Files: 2781c75ff99cd5da7b25f6b883d78ff3de987308 / probe.h
1820 bytesRaw
1 | /* API for probe.c */ |
2 | |
3 | |
4 | |
5 | |
6 | |
7 | |
8 | struct proto; |
9 | typedef int T_PROBE(const char*, int, struct proto*); |
10 | |
11 | /* For each protocol we need: */ |
12 | struct 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 */ |
25 | struct proto * get_builtins(void); |
26 | |
27 | /* Returns the number of builtin protocols */ |
28 | int get_num_builtins(void); |
29 | |
30 | /* Returns the probe for specified protocol */ |
31 | T_PROBE* get_probe(const char* description); |
32 | |
33 | /* Returns the head of the configured protocols */ |
34 | struct proto* get_first_protocol(void); |
35 | |
36 | /* Set the list of configured protocols */ |
37 | void 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 | */ |
46 | struct proto* probe_client_protocol(struct connection *cnx); |
47 | |
48 | /* set the protocol to connect to in case of timeout */ |
49 | void set_ontimeout(const char* name); |
50 | |
51 | /* timeout_protocol |
52 | * |
53 | * Returns the protocol to connect to in case of timeout |
54 | */ |
55 | struct proto* timeout_protocol(void); |
56 | |
57 | void hexdump(const char*, unsigned int); |
58 | |
59 | |
60 |
Built with git-ssb-web