diff options
author | davem <davem> | 2001-12-24 01:45:18 +0000 |
---|---|---|
committer | davem <davem> | 2001-12-24 01:45:18 +0000 |
commit | 40f2773d5410f84339a72fb39b8b1cf540df94e7 (patch) | |
tree | c7ddcff606a64913172c74d8e62c26ce5e3f981c | |
parent | 22df8bf00703e1bb35ebf2f05c6234fdbab13b0e (diff) | |
download | netdev-vger-cvs-40f2773d5410f84339a72fb39b8b1cf540df94e7.tar.gz |
Correct printk message in conntrack handling.
Move some conntrack enums to header visible to userspace.
From netfilter maintainers.
-rw-r--r-- | include/linux/netfilter_ipv4/ip_conntrack.h | 30 | ||||
-rw-r--r-- | include/linux/netfilter_ipv4/ip_conntrack_tuple.h | 33 | ||||
-rw-r--r-- | net/ipv4/netfilter/ip_conntrack_standalone.c | 2 |
3 files changed, 33 insertions, 32 deletions
diff --git a/include/linux/netfilter_ipv4/ip_conntrack.h b/include/linux/netfilter_ipv4/ip_conntrack.h index 8ce25aae4..f0e8b9927 100644 --- a/include/linux/netfilter_ipv4/ip_conntrack.h +++ b/include/linux/netfilter_ipv4/ip_conntrack.h @@ -27,6 +27,21 @@ enum ip_conntrack_info IP_CT_NUMBER = IP_CT_IS_REPLY * 2 - 1 }; +/* Bitset representing status of connection. */ +enum ip_conntrack_status { + /* It's an expected connection: bit 0 set. This bit never changed */ + IPS_EXPECTED_BIT = 0, + IPS_EXPECTED = (1 << IPS_EXPECTED_BIT), + + /* We've seen packets both ways: bit 1 set. Can be set, not unset. */ + IPS_SEEN_REPLY_BIT = 1, + IPS_SEEN_REPLY = (1 << IPS_SEEN_REPLY_BIT), + + /* Conntrack should never be early-expired. */ + IPS_ASSURED_BIT = 2, + IPS_ASSURED = (1 << IPS_ASSURED_BIT), +}; + #ifdef __KERNEL__ #include <linux/types.h> @@ -47,21 +62,6 @@ do { \ #define IP_NF_ASSERT(x) #endif -/* Bitset representing status of connection. */ -enum ip_conntrack_status { - /* It's an expected connection: bit 0 set. This bit never changed */ - IPS_EXPECTED_BIT = 0, - IPS_EXPECTED = (1 << IPS_EXPECTED_BIT), - - /* We've seen packets both ways: bit 1 set. Can be set, not unset. */ - IPS_SEEN_REPLY_BIT = 1, - IPS_SEEN_REPLY = (1 << IPS_SEEN_REPLY_BIT), - - /* Conntrack should never be early-expired. */ - IPS_ASSURED_BIT = 2, - IPS_ASSURED = (1 << IPS_ASSURED_BIT), -}; - struct ip_conntrack_expect { /* Internal linked list */ diff --git a/include/linux/netfilter_ipv4/ip_conntrack_tuple.h b/include/linux/netfilter_ipv4/ip_conntrack_tuple.h index 8b6dc4a8b..9f6ec0a6b 100644 --- a/include/linux/netfilter_ipv4/ip_conntrack_tuple.h +++ b/include/linux/netfilter_ipv4/ip_conntrack_tuple.h @@ -62,6 +62,13 @@ struct ip_conntrack_tuple } dst; }; +enum ip_conntrack_dir +{ + IP_CT_DIR_ORIGINAL, + IP_CT_DIR_REPLY, + IP_CT_DIR_MAX +}; + #ifdef __KERNEL__ #define DUMP_TUPLE(tp) \ @@ -75,13 +82,19 @@ DEBUGP("tuple %p: %u %u.%u.%u.%u:%hu -> %u.%u.%u.%u:%hu\n", \ /* If we're the first tuple, it's the original dir. */ #define DIRECTION(h) ((enum ip_conntrack_dir)(&(h)->ctrack->tuplehash[1] == (h))) -enum ip_conntrack_dir +/* Connections have two entries in the hash table: one for each way */ +struct ip_conntrack_tuple_hash { - IP_CT_DIR_ORIGINAL, - IP_CT_DIR_REPLY, - IP_CT_DIR_MAX + struct list_head list; + + struct ip_conntrack_tuple tuple; + + /* this == &ctrack->tuplehash[DIRECTION(this)]. */ + struct ip_conntrack *ctrack; }; +#endif /* __KERNEL__ */ + static inline int ip_ct_tuple_src_equal(const struct ip_conntrack_tuple *t1, const struct ip_conntrack_tuple *t2) { @@ -115,16 +128,4 @@ static inline int ip_ct_tuple_mask_cmp(const struct ip_conntrack_tuple *t, & mask->dst.protonum)); } -/* Connections have two entries in the hash table: one for each way */ -struct ip_conntrack_tuple_hash -{ - struct list_head list; - - struct ip_conntrack_tuple tuple; - - /* this == &ctrack->tuplehash[DIRECTION(this)]. */ - struct ip_conntrack *ctrack; -}; - -#endif /* __KERNEL__ */ #endif /* _IP_CONNTRACK_TUPLE_H */ diff --git a/net/ipv4/netfilter/ip_conntrack_standalone.c b/net/ipv4/netfilter/ip_conntrack_standalone.c index 3c60c0d78..1846640d2 100644 --- a/net/ipv4/netfilter/ip_conntrack_standalone.c +++ b/net/ipv4/netfilter/ip_conntrack_standalone.c @@ -243,7 +243,7 @@ static int init_or_cleanup(int init) ret = nf_register_hook(&ip_conntrack_in_ops); if (ret < 0) { - printk("ip_conntrack: can't register in hook.\n"); + printk("ip_conntrack: can't register pre-routing hook.\n"); goto cleanup_proc; } ret = nf_register_hook(&ip_conntrack_local_out_ops); |