git ssb

0+

cel / sslh



Tree: 9bcb2cdd7a920ebc78b59d0b5797d678424aa93a

Files: 9bcb2cdd7a920ebc78b59d0b5797d678424aa93a / probe.h

1683 bytesRaw
1/* API for probe.c */
2
3#ifndef __PROBE_H_
4#define __PROBE_H_
5
6#include "common.h"
7
8struct proto;
9typedef int T_PROBE(const char*, int, struct proto*);
10
11/* For each protocol we need: */
12struct proto {
13 const char* description; /* a string that says what it is (for logging and command-line parsing) */
14 const char* service; /* service name to do libwrap checks */
15 struct addrinfo *saddr; /* list of addresses to try and switch that protocol */
16
17 /* function to probe that protocol; parameters are buffer and length
18 * containing the data to probe, and a pointer to the protocol structure */
19 T_PROBE* probe;
20 void* data; /* opaque pointer ; used to pass list of regex to regex probe */
21 struct proto *next; /* pointer to next protocol in list, NULL if last */
22};
23
24/* Returns a pointer to the array of builtin protocols */
25struct proto * get_builtins(void);
26
27/* Returns the number of builtin protocols */
28int get_num_builtins(void);
29
30/* Returns the probe for specified protocol */
31T_PROBE* get_probe(const char* description);
32
33/* Returns the head of the configured protocols */
34struct proto* get_first_protocol(void);
35
36/* Set the list of configured protocols */
37void set_protocol_list(struct proto*);
38
39/* probe_client_protocol
40 *
41 * Read the beginning of data coming from the client connection and check if
42 * it's a known protocol. Then leave the data on the defered
43 * write buffer of the connection and returns a pointer to the protocol
44 * structure
45 */
46struct proto* probe_client_protocol(struct connection *cnx);
47
48/* timeout_protocol
49 *
50 * Returns the protocol to connect to in case of timeout
51 */
52struct proto* timeout_protocol(void);
53
54#endif
55

Built with git-ssb-web