1 /* Header file for kernel module to match connection tracking information.
2 * GPL (C) 2001 Marc Boucher (marc@mbsi.ca).
5 #ifndef _XT_CONNTRACK_H
6 #define _XT_CONNTRACK_H
8 #include <linux/netfilter/nf_conntrack_tuple_common.h>
10 #define XT_CONNTRACK_STATE_BIT(ctinfo) (1 << ((ctinfo)%IP_CT_IS_REPLY+1))
11 #define XT_CONNTRACK_STATE_INVALID (1 << 0)
13 #define XT_CONNTRACK_STATE_SNAT (1 << (IP_CT_NUMBER + 1))
14 #define XT_CONNTRACK_STATE_DNAT (1 << (IP_CT_NUMBER + 2))
15 #define XT_CONNTRACK_STATE_UNTRACKED (1 << (IP_CT_NUMBER + 3))
17 /* flags, invflags: */
19 XT_CONNTRACK_STATE
= 1 << 0,
20 XT_CONNTRACK_PROTO
= 1 << 1,
21 XT_CONNTRACK_ORIGSRC
= 1 << 2,
22 XT_CONNTRACK_ORIGDST
= 1 << 3,
23 XT_CONNTRACK_REPLSRC
= 1 << 4,
24 XT_CONNTRACK_REPLDST
= 1 << 5,
25 XT_CONNTRACK_STATUS
= 1 << 6,
26 XT_CONNTRACK_EXPIRES
= 1 << 7,
27 XT_CONNTRACK_ORIGSRC_PORT
= 1 << 8,
28 XT_CONNTRACK_ORIGDST_PORT
= 1 << 9,
29 XT_CONNTRACK_REPLSRC_PORT
= 1 << 10,
30 XT_CONNTRACK_REPLDST_PORT
= 1 << 11,
31 XT_CONNTRACK_DIRECTION
= 1 << 12,
34 /* This is exposed to userspace, so remains frozen in time. */
35 struct ip_conntrack_old_tuple
55 struct xt_conntrack_info
57 unsigned int statemask
, statusmask
;
59 struct ip_conntrack_old_tuple tuple
[IP_CT_DIR_MAX
];
60 struct in_addr sipmsk
[IP_CT_DIR_MAX
], dipmsk
[IP_CT_DIR_MAX
];
62 unsigned long expires_min
, expires_max
;
70 struct xt_conntrack_mtinfo1
{
71 union nf_inet_addr origsrc_addr
, origsrc_mask
;
72 union nf_inet_addr origdst_addr
, origdst_mask
;
73 union nf_inet_addr replsrc_addr
, replsrc_mask
;
74 union nf_inet_addr repldst_addr
, repldst_mask
;
75 u_int32_t expires_min
, expires_max
;
77 __be16 origsrc_port
, origdst_port
;
78 __be16 replsrc_port
, repldst_port
;
79 u_int16_t match_flags
, invert_flags
;
80 u_int8_t state_mask
, status_mask
;
83 #endif /*_XT_CONNTRACK_H*/