Harald Welte | 2e4e6a1 | 2006-01-12 13:30:04 -0800 | [diff] [blame] | 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 | |
Jaswinder Singh Rajput | 9df27ba | 2009-01-30 20:00:47 +0530 | [diff] [blame] | 8 | #include <linux/types.h> |
Ben Hutchings | 5740bb5 | 2011-08-24 18:45:42 +0000 | [diff] [blame] | 9 | #include <linux/netfilter.h> |
Harald Welte | 2e4e6a1 | 2006-01-12 13:30:04 -0800 | [diff] [blame] | 10 | #include <linux/netfilter/nf_conntrack_tuple_common.h> |
Harald Welte | 2e4e6a1 | 2006-01-12 13:30:04 -0800 | [diff] [blame] | 11 | |
| 12 | #define XT_CONNTRACK_STATE_BIT(ctinfo) (1 << ((ctinfo)%IP_CT_IS_REPLY+1)) |
| 13 | #define XT_CONNTRACK_STATE_INVALID (1 << 0) |
| 14 | |
| 15 | #define XT_CONNTRACK_STATE_SNAT (1 << (IP_CT_NUMBER + 1)) |
| 16 | #define XT_CONNTRACK_STATE_DNAT (1 << (IP_CT_NUMBER + 2)) |
| 17 | #define XT_CONNTRACK_STATE_UNTRACKED (1 << (IP_CT_NUMBER + 3)) |
| 18 | |
| 19 | /* flags, invflags: */ |
Jan Engelhardt | b416499 | 2008-01-31 03:58:24 -0800 | [diff] [blame] | 20 | enum { |
| 21 | XT_CONNTRACK_STATE = 1 << 0, |
| 22 | XT_CONNTRACK_PROTO = 1 << 1, |
| 23 | XT_CONNTRACK_ORIGSRC = 1 << 2, |
| 24 | XT_CONNTRACK_ORIGDST = 1 << 3, |
| 25 | XT_CONNTRACK_REPLSRC = 1 << 4, |
| 26 | XT_CONNTRACK_REPLDST = 1 << 5, |
| 27 | XT_CONNTRACK_STATUS = 1 << 6, |
| 28 | XT_CONNTRACK_EXPIRES = 1 << 7, |
| 29 | XT_CONNTRACK_ORIGSRC_PORT = 1 << 8, |
| 30 | XT_CONNTRACK_ORIGDST_PORT = 1 << 9, |
| 31 | XT_CONNTRACK_REPLSRC_PORT = 1 << 10, |
| 32 | XT_CONNTRACK_REPLDST_PORT = 1 << 11, |
| 33 | XT_CONNTRACK_DIRECTION = 1 << 12, |
| 34 | }; |
Harald Welte | 2e4e6a1 | 2006-01-12 13:30:04 -0800 | [diff] [blame] | 35 | |
Jan Engelhardt | 64eb12f | 2008-01-14 23:40:53 -0800 | [diff] [blame] | 36 | struct xt_conntrack_mtinfo1 { |
| 37 | union nf_inet_addr origsrc_addr, origsrc_mask; |
| 38 | union nf_inet_addr origdst_addr, origdst_mask; |
| 39 | union nf_inet_addr replsrc_addr, replsrc_mask; |
| 40 | union nf_inet_addr repldst_addr, repldst_mask; |
Arnd Bergmann | 60c195c | 2009-02-26 00:51:43 +0100 | [diff] [blame] | 41 | __u32 expires_min, expires_max; |
| 42 | __u16 l4proto; |
Jan Engelhardt | b416499 | 2008-01-31 03:58:24 -0800 | [diff] [blame] | 43 | __be16 origsrc_port, origdst_port; |
| 44 | __be16 replsrc_port, repldst_port; |
Arnd Bergmann | 60c195c | 2009-02-26 00:51:43 +0100 | [diff] [blame] | 45 | __u16 match_flags, invert_flags; |
| 46 | __u8 state_mask, status_mask; |
Jan Engelhardt | 64eb12f | 2008-01-14 23:40:53 -0800 | [diff] [blame] | 47 | }; |
| 48 | |
Jan Engelhardt | d6d3f08 | 2009-06-29 14:31:46 +0200 | [diff] [blame] | 49 | struct xt_conntrack_mtinfo2 { |
| 50 | union nf_inet_addr origsrc_addr, origsrc_mask; |
| 51 | union nf_inet_addr origdst_addr, origdst_mask; |
| 52 | union nf_inet_addr replsrc_addr, replsrc_mask; |
| 53 | union nf_inet_addr repldst_addr, repldst_mask; |
| 54 | __u32 expires_min, expires_max; |
| 55 | __u16 l4proto; |
| 56 | __be16 origsrc_port, origdst_port; |
| 57 | __be16 replsrc_port, repldst_port; |
| 58 | __u16 match_flags, invert_flags; |
| 59 | __u16 state_mask, status_mask; |
| 60 | }; |
| 61 | |
Patrick McHardy | b017900 | 2010-12-15 09:46:26 +0100 | [diff] [blame] | 62 | struct xt_conntrack_mtinfo3 { |
| 63 | union nf_inet_addr origsrc_addr, origsrc_mask; |
| 64 | union nf_inet_addr origdst_addr, origdst_mask; |
| 65 | union nf_inet_addr replsrc_addr, replsrc_mask; |
| 66 | union nf_inet_addr repldst_addr, repldst_mask; |
| 67 | __u32 expires_min, expires_max; |
| 68 | __u16 l4proto; |
| 69 | __u16 origsrc_port, origdst_port; |
| 70 | __u16 replsrc_port, repldst_port; |
| 71 | __u16 match_flags, invert_flags; |
| 72 | __u16 state_mask, status_mask; |
| 73 | __u16 origsrc_port_high, origdst_port_high; |
| 74 | __u16 replsrc_port_high, repldst_port_high; |
| 75 | }; |
| 76 | |
Harald Welte | 2e4e6a1 | 2006-01-12 13:30:04 -0800 | [diff] [blame] | 77 | #endif /*_XT_CONNTRACK_H*/ |