diff options
author | Jan Engelhardt <jengelh@medozas.de> | 2009-02-21 04:42:32 +0100 |
---|---|---|
committer | Jan Engelhardt <jengelh@medozas.de> | 2009-02-21 04:42:32 +0100 |
commit | 978e27e8f8c2e49d0528c6c4ae3a56627fbe8492 (patch) | |
tree | b0de4c35b0d209b450cb86e022ce7552c3e778e8 /include/net/netfilter/nf_conntrack_tuple.h | |
parent | da68957303dea58632466d79d52f83bcbbca8925 (diff) |
include: resynchronize headers with 2.6.29-rc5
Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
Diffstat (limited to 'include/net/netfilter/nf_conntrack_tuple.h')
-rw-r--r-- | include/net/netfilter/nf_conntrack_tuple.h | 114 |
1 files changed, 114 insertions, 0 deletions
diff --git a/include/net/netfilter/nf_conntrack_tuple.h b/include/net/netfilter/nf_conntrack_tuple.h new file mode 100644 index 00000000..c40e0b40 --- /dev/null +++ b/include/net/netfilter/nf_conntrack_tuple.h @@ -0,0 +1,114 @@ +/* This file was manually copied from the Linux kernel source + * and manually stripped from __KERNEL__ sections and unused functions. + */ + +/* + * Definitions and Declarations for tuple. + * + * 16 Dec 2003: Yasuyuki Kozakai @USAGI <yasuyuki.kozakai@toshiba.co.jp> + * - generalize L3 protocol dependent part. + * + * Derived from include/linux/netfiter_ipv4/ip_conntrack_tuple.h + */ + +#ifndef _NF_CONNTRACK_TUPLE_H +#define _NF_CONNTRACK_TUPLE_H + +#include <linux/netfilter/x_tables.h> +#include <linux/netfilter/nf_conntrack_tuple_common.h> + +/* A `tuple' is a structure containing the information to uniquely + identify a connection. ie. if two packets have the same tuple, they + are in the same connection; if not, they are not. + + We divide the structure along "manipulatable" and + "non-manipulatable" lines, for the benefit of the NAT code. +*/ + +#define NF_CT_TUPLE_L3SIZE ARRAY_SIZE(((union nf_inet_addr *)NULL)->all) + +/* The protocol-specific manipulable parts of the tuple: always in + network order! */ +union nf_conntrack_man_proto +{ + /* Add other protocols here. */ + __be16 all; + + struct { + __be16 port; + } tcp; + struct { + __be16 port; + } udp; + struct { + __be16 id; + } icmp; + struct { + __be16 port; + } dccp; + struct { + __be16 port; + } sctp; + struct { + __be16 key; /* GRE key is 32bit, PPtP only uses 16bit */ + } gre; +}; + +/* The manipulable part of the tuple. */ +struct nf_conntrack_man +{ + union nf_inet_addr u3; + union nf_conntrack_man_proto u; + /* Layer 3 protocol */ + u_int16_t l3num; +}; + +/* This contains the information to distinguish a connection. */ +struct nf_conntrack_tuple +{ + struct nf_conntrack_man src; + + /* These are the parts of the tuple which are fixed. */ + struct { + union nf_inet_addr u3; + union { + /* Add other protocols here. */ + __be16 all; + + struct { + __be16 port; + } tcp; + struct { + __be16 port; + } udp; + struct { + u_int8_t type, code; + } icmp; + struct { + __be16 port; + } dccp; + struct { + __be16 port; + } sctp; + struct { + __be16 key; + } gre; + } u; + + /* The protocol. */ + u_int8_t protonum; + + /* The direction (for tuplehash) */ + u_int8_t dir; + } dst; +}; + +struct nf_conntrack_tuple_mask +{ + struct { + union nf_inet_addr u3; + union nf_conntrack_man_proto u; + } src; +}; + +#endif /* _NF_CONNTRACK_TUPLE_H */ |