]> pilppa.org Git - linux-2.6-omap-h63xx.git/blob - include/linux/netfilter/xt_conntrack.h
Merge branch 'linux-2.6'
[linux-2.6-omap-h63xx.git] / include / linux / netfilter / xt_conntrack.h
1 /* Header file for kernel module to match connection tracking information.
2  * GPL (C) 2001  Marc Boucher (marc@mbsi.ca).
3  */
4
5 #ifndef _XT_CONNTRACK_H
6 #define _XT_CONNTRACK_H
7
8 #include <linux/netfilter/nf_conntrack_tuple_common.h>
9 #ifdef __KERNEL__
10 #       include <linux/in.h>
11 #endif
12
13 #define XT_CONNTRACK_STATE_BIT(ctinfo) (1 << ((ctinfo)%IP_CT_IS_REPLY+1))
14 #define XT_CONNTRACK_STATE_INVALID (1 << 0)
15
16 #define XT_CONNTRACK_STATE_SNAT (1 << (IP_CT_NUMBER + 1))
17 #define XT_CONNTRACK_STATE_DNAT (1 << (IP_CT_NUMBER + 2))
18 #define XT_CONNTRACK_STATE_UNTRACKED (1 << (IP_CT_NUMBER + 3))
19
20 /* flags, invflags: */
21 #define XT_CONNTRACK_STATE      0x01
22 #define XT_CONNTRACK_PROTO      0x02
23 #define XT_CONNTRACK_ORIGSRC    0x04
24 #define XT_CONNTRACK_ORIGDST    0x08
25 #define XT_CONNTRACK_REPLSRC    0x10
26 #define XT_CONNTRACK_REPLDST    0x20
27 #define XT_CONNTRACK_STATUS     0x40
28 #define XT_CONNTRACK_EXPIRES    0x80
29
30 /* This is exposed to userspace, so remains frozen in time. */
31 struct ip_conntrack_old_tuple
32 {
33         struct {
34                 __be32 ip;
35                 union {
36                         __u16 all;
37                 } u;
38         } src;
39
40         struct {
41                 __be32 ip;
42                 union {
43                         __u16 all;
44                 } u;
45
46                 /* The protocol. */
47                 __u16 protonum;
48         } dst;
49 };
50
51 struct xt_conntrack_info
52 {
53         unsigned int statemask, statusmask;
54
55         struct ip_conntrack_old_tuple tuple[IP_CT_DIR_MAX];
56         struct in_addr sipmsk[IP_CT_DIR_MAX], dipmsk[IP_CT_DIR_MAX];
57
58         unsigned long expires_min, expires_max;
59
60         /* Flags word */
61         u_int8_t flags;
62         /* Inverse flags */
63         u_int8_t invflags;
64 };
65
66 struct xt_conntrack_mtinfo1 {
67         union nf_inet_addr origsrc_addr, origsrc_mask;
68         union nf_inet_addr origdst_addr, origdst_mask;
69         union nf_inet_addr replsrc_addr, replsrc_mask;
70         union nf_inet_addr repldst_addr, repldst_mask;
71         u_int32_t expires_min, expires_max;
72         u_int16_t l4proto;
73         u_int8_t state_mask, status_mask;
74         u_int8_t match_flags, invert_flags;
75 };
76
77 #endif /*_XT_CONNTRACK_H*/