diff options
author | Jan Engelhardt <jengelh@computergmbh.de> | 2008-01-31 06:58:24 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-01-31 22:27:31 -0500 |
commit | b41649989c9640e54e47001994b7ecb927ea1822 (patch) | |
tree | 4c733dd12a1d8f95ac05c431fb64a1eb7cd7e59e /include | |
parent | 41d0cdedd5d0a067069a1559315aa9bfdf00794a (diff) |
[NETFILTER]: xt_conntrack: add port and direction matching
Extend the xt_conntrack match revision 1 by port matching (all four
{orig,repl}{src,dst}) and by packet direction matching.
Signed-off-by: Jan Engelhardt <jengelh@computergmbh.de>
Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/netfilter/xt_conntrack.h | 30 |
1 files changed, 18 insertions, 12 deletions
diff --git a/include/linux/netfilter/xt_conntrack.h b/include/linux/netfilter/xt_conntrack.h index d2492a3329be..f3fd83e46bab 100644 --- a/include/linux/netfilter/xt_conntrack.h +++ b/include/linux/netfilter/xt_conntrack.h | |||
@@ -6,9 +6,6 @@ | |||
6 | #define _XT_CONNTRACK_H | 6 | #define _XT_CONNTRACK_H |
7 | 7 | ||
8 | #include <linux/netfilter/nf_conntrack_tuple_common.h> | 8 | #include <linux/netfilter/nf_conntrack_tuple_common.h> |
9 | #ifdef __KERNEL__ | ||
10 | # include <linux/in.h> | ||
11 | #endif | ||
12 | 9 | ||
13 | #define XT_CONNTRACK_STATE_BIT(ctinfo) (1 << ((ctinfo)%IP_CT_IS_REPLY+1)) | 10 | #define XT_CONNTRACK_STATE_BIT(ctinfo) (1 << ((ctinfo)%IP_CT_IS_REPLY+1)) |
14 | #define XT_CONNTRACK_STATE_INVALID (1 << 0) | 11 | #define XT_CONNTRACK_STATE_INVALID (1 << 0) |
@@ -18,14 +15,21 @@ | |||
18 | #define XT_CONNTRACK_STATE_UNTRACKED (1 << (IP_CT_NUMBER + 3)) | 15 | #define XT_CONNTRACK_STATE_UNTRACKED (1 << (IP_CT_NUMBER + 3)) |
19 | 16 | ||
20 | /* flags, invflags: */ | 17 | /* flags, invflags: */ |
21 | #define XT_CONNTRACK_STATE 0x01 | 18 | enum { |
22 | #define XT_CONNTRACK_PROTO 0x02 | 19 | XT_CONNTRACK_STATE = 1 << 0, |
23 | #define XT_CONNTRACK_ORIGSRC 0x04 | 20 | XT_CONNTRACK_PROTO = 1 << 1, |
24 | #define XT_CONNTRACK_ORIGDST 0x08 | 21 | XT_CONNTRACK_ORIGSRC = 1 << 2, |
25 | #define XT_CONNTRACK_REPLSRC 0x10 | 22 | XT_CONNTRACK_ORIGDST = 1 << 3, |
26 | #define XT_CONNTRACK_REPLDST 0x20 | 23 | XT_CONNTRACK_REPLSRC = 1 << 4, |
27 | #define XT_CONNTRACK_STATUS 0x40 | 24 | XT_CONNTRACK_REPLDST = 1 << 5, |
28 | #define XT_CONNTRACK_EXPIRES 0x80 | 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, | ||
32 | }; | ||
29 | 33 | ||
30 | /* This is exposed to userspace, so remains frozen in time. */ | 34 | /* This is exposed to userspace, so remains frozen in time. */ |
31 | struct ip_conntrack_old_tuple | 35 | struct ip_conntrack_old_tuple |
@@ -70,8 +74,10 @@ struct xt_conntrack_mtinfo1 { | |||
70 | union nf_inet_addr repldst_addr, repldst_mask; | 74 | union nf_inet_addr repldst_addr, repldst_mask; |
71 | u_int32_t expires_min, expires_max; | 75 | u_int32_t expires_min, expires_max; |
72 | u_int16_t l4proto; | 76 | u_int16_t l4proto; |
77 | __be16 origsrc_port, origdst_port; | ||
78 | __be16 replsrc_port, repldst_port; | ||
79 | u_int16_t match_flags, invert_flags; | ||
73 | u_int8_t state_mask, status_mask; | 80 | u_int8_t state_mask, status_mask; |
74 | u_int8_t match_flags, invert_flags; | ||
75 | }; | 81 | }; |
76 | 82 | ||
77 | #endif /*_XT_CONNTRACK_H*/ | 83 | #endif /*_XT_CONNTRACK_H*/ |