1 /* Header for use in defining a given protocol for connection tracking. */
2 #ifndef _IP_CONNTRACK_PROTOCOL_H
3 #define _IP_CONNTRACK_PROTOCOL_H
4 #include <linux/netfilter_ipv4/ip_conntrack.h>
5
6 struct ip_conntrack_protocol
7 {
8 /* Next pointer. */
9 struct list_head list;
10
11 /* Protocol number. */
12 u_int8_t proto;
13
14 /* Protocol name */
15 const char *name;
16
17 /* Try to fill in the third arg; return true if possible. */
18 int (*pkt_to_tuple)(const void *datah, size_t datalen,
19 struct ip_conntrack_tuple *tuple);
20
21 /* Invert the per-proto part of the tuple: ie. turn xmit into reply.
22 * Some packets can't be inverted: return 0 in that case.
23 */
24 int (*invert_tuple)(struct ip_conntrack_tuple *inverse,
25 const struct ip_conntrack_tuple *orig);
26
27 /* Print out the per-protocol part of the tuple. */
28 unsigned int (*print_tuple)(char *buffer,
29 const struct ip_conntrack_tuple *);
30
31 /* Print out the private part of the conntrack. */
32 unsigned int (*print_conntrack)(char *buffer,
33 const struct ip_conntrack *);
34
35 /* Returns verdict for packet, or -1 for invalid. */
36 int (*packet)(struct ip_conntrack *conntrack,
37 struct iphdr *iph, size_t len,
38 enum ip_conntrack_info ctinfo);
39
40 /* Called when a new connection for this protocol found;
41 * returns timeout. If so, packet() called next. */
42 unsigned long (*new)(struct ip_conntrack *conntrack,
43 struct iphdr *iph, size_t len);
44
45 /* Module (if any) which this is connected to. */
46 struct module *me;
47 };
48
49 /* Protocol registration. */
50 extern int ip_conntrack_protocol_register(struct ip_conntrack_protocol *proto);
51 extern void ip_conntrack_protocol_unregister(struct ip_conntrack_protocol *proto);
52
53 /* Existing built-in protocols */
54 extern struct ip_conntrack_protocol ip_conntrack_protocol_tcp;
55 extern struct ip_conntrack_protocol ip_conntrack_protocol_udp;
56 extern struct ip_conntrack_protocol ip_conntrack_protocol_icmp;
57 extern int ip_conntrack_protocol_tcp_init(void);
58 #endif /*_IP_CONNTRACK_PROTOCOL_H*/
59
This page was automatically generated by the
LXR engine.
Visit the LXR main site for more
information.