aboutsummaryrefslogtreecommitdiffstats
path: root/include/net
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2009-03-27 01:45:23 -0400
committerDavid S. Miller <davem@davemloft.net>2009-03-27 01:45:23 -0400
commit01e6de64d9c8d0e75dca3bb4cf898db73abe00d4 (patch)
tree925982e6241e5ac47f268bc2c2942ab0f06775cd /include/net
parent8f1ead2d1a626ed0c85b3d2c2046a49081d5933f (diff)
parentd271e8bd8c60ce059ee36d836ba063cfc61c3e21 (diff)
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/kaber/nf-next-2.6
Diffstat (limited to 'include/net')
-rw-r--r--include/net/netfilter/nf_conntrack.h14
-rw-r--r--include/net/netfilter/nf_conntrack_helper.h2
-rw-r--r--include/net/netfilter/nf_conntrack_l3proto.h7
-rw-r--r--include/net/netfilter/nf_conntrack_l4proto.h7
-rw-r--r--include/net/netfilter/nf_conntrack_tuple.h6
-rw-r--r--include/net/netlink.h1
-rw-r--r--include/net/netns/conntrack.h5
7 files changed, 31 insertions, 11 deletions
diff --git a/include/net/netfilter/nf_conntrack.h b/include/net/netfilter/nf_conntrack.h
index 4dfb793c3f15..6c3f964de9e1 100644
--- a/include/net/netfilter/nf_conntrack.h
+++ b/include/net/netfilter/nf_conntrack.h
@@ -91,8 +91,7 @@ struct nf_conn_help {
91#include <net/netfilter/ipv4/nf_conntrack_ipv4.h> 91#include <net/netfilter/ipv4/nf_conntrack_ipv4.h>
92#include <net/netfilter/ipv6/nf_conntrack_ipv6.h> 92#include <net/netfilter/ipv6/nf_conntrack_ipv6.h>
93 93
94struct nf_conn 94struct nf_conn {
95{
96 /* Usage count in here is 1 for hash table/destruct timer, 1 per skb, 95 /* Usage count in here is 1 for hash table/destruct timer, 1 per skb,
97 plus 1 for any connection(s) we are `master' for */ 96 plus 1 for any connection(s) we are `master' for */
98 struct nf_conntrack ct_general; 97 struct nf_conntrack ct_general;
@@ -126,7 +125,6 @@ struct nf_conn
126#ifdef CONFIG_NET_NS 125#ifdef CONFIG_NET_NS
127 struct net *ct_net; 126 struct net *ct_net;
128#endif 127#endif
129 struct rcu_head rcu;
130}; 128};
131 129
132static inline struct nf_conn * 130static inline struct nf_conn *
@@ -190,9 +188,13 @@ static inline void nf_ct_put(struct nf_conn *ct)
190extern int nf_ct_l3proto_try_module_get(unsigned short l3proto); 188extern int nf_ct_l3proto_try_module_get(unsigned short l3proto);
191extern void nf_ct_l3proto_module_put(unsigned short l3proto); 189extern void nf_ct_l3proto_module_put(unsigned short l3proto);
192 190
193extern struct hlist_head *nf_ct_alloc_hashtable(unsigned int *sizep, int *vmalloced); 191/*
194extern void nf_ct_free_hashtable(struct hlist_head *hash, int vmalloced, 192 * Allocate a hashtable of hlist_head (if nulls == 0),
195 unsigned int size); 193 * or hlist_nulls_head (if nulls == 1)
194 */
195extern void *nf_ct_alloc_hashtable(unsigned int *sizep, int *vmalloced, int nulls);
196
197extern void nf_ct_free_hashtable(void *hash, int vmalloced, unsigned int size);
196 198
197extern struct nf_conntrack_tuple_hash * 199extern struct nf_conntrack_tuple_hash *
198__nf_conntrack_find(struct net *net, const struct nf_conntrack_tuple *tuple); 200__nf_conntrack_find(struct net *net, const struct nf_conntrack_tuple *tuple);
diff --git a/include/net/netfilter/nf_conntrack_helper.h b/include/net/netfilter/nf_conntrack_helper.h
index 66d65a7caa39..ee2a4b369a04 100644
--- a/include/net/netfilter/nf_conntrack_helper.h
+++ b/include/net/netfilter/nf_conntrack_helper.h
@@ -14,6 +14,8 @@
14 14
15struct module; 15struct module;
16 16
17#define NF_CT_HELPER_NAME_LEN 16
18
17struct nf_conntrack_helper 19struct nf_conntrack_helper
18{ 20{
19 struct hlist_node hnode; /* Internal use. */ 21 struct hlist_node hnode; /* Internal use. */
diff --git a/include/net/netfilter/nf_conntrack_l3proto.h b/include/net/netfilter/nf_conntrack_l3proto.h
index 0378676c3dd8..9f99d36d5de9 100644
--- a/include/net/netfilter/nf_conntrack_l3proto.h
+++ b/include/net/netfilter/nf_conntrack_l3proto.h
@@ -53,10 +53,17 @@ struct nf_conntrack_l3proto
53 int (*tuple_to_nlattr)(struct sk_buff *skb, 53 int (*tuple_to_nlattr)(struct sk_buff *skb,
54 const struct nf_conntrack_tuple *t); 54 const struct nf_conntrack_tuple *t);
55 55
56 /*
57 * Calculate size of tuple nlattr
58 */
59 int (*nlattr_tuple_size)(void);
60
56 int (*nlattr_to_tuple)(struct nlattr *tb[], 61 int (*nlattr_to_tuple)(struct nlattr *tb[],
57 struct nf_conntrack_tuple *t); 62 struct nf_conntrack_tuple *t);
58 const struct nla_policy *nla_policy; 63 const struct nla_policy *nla_policy;
59 64
65 size_t nla_size;
66
60#ifdef CONFIG_SYSCTL 67#ifdef CONFIG_SYSCTL
61 struct ctl_table_header *ctl_table_header; 68 struct ctl_table_header *ctl_table_header;
62 struct ctl_path *ctl_table_path; 69 struct ctl_path *ctl_table_path;
diff --git a/include/net/netfilter/nf_conntrack_l4proto.h b/include/net/netfilter/nf_conntrack_l4proto.h
index b01070bf2f84..ba32ed7bdabe 100644
--- a/include/net/netfilter/nf_conntrack_l4proto.h
+++ b/include/net/netfilter/nf_conntrack_l4proto.h
@@ -64,16 +64,22 @@ struct nf_conntrack_l4proto
64 /* convert protoinfo to nfnetink attributes */ 64 /* convert protoinfo to nfnetink attributes */
65 int (*to_nlattr)(struct sk_buff *skb, struct nlattr *nla, 65 int (*to_nlattr)(struct sk_buff *skb, struct nlattr *nla,
66 const struct nf_conn *ct); 66 const struct nf_conn *ct);
67 /* Calculate protoinfo nlattr size */
68 int (*nlattr_size)(void);
67 69
68 /* convert nfnetlink attributes to protoinfo */ 70 /* convert nfnetlink attributes to protoinfo */
69 int (*from_nlattr)(struct nlattr *tb[], struct nf_conn *ct); 71 int (*from_nlattr)(struct nlattr *tb[], struct nf_conn *ct);
70 72
71 int (*tuple_to_nlattr)(struct sk_buff *skb, 73 int (*tuple_to_nlattr)(struct sk_buff *skb,
72 const struct nf_conntrack_tuple *t); 74 const struct nf_conntrack_tuple *t);
75 /* Calculate tuple nlattr size */
76 int (*nlattr_tuple_size)(void);
73 int (*nlattr_to_tuple)(struct nlattr *tb[], 77 int (*nlattr_to_tuple)(struct nlattr *tb[],
74 struct nf_conntrack_tuple *t); 78 struct nf_conntrack_tuple *t);
75 const struct nla_policy *nla_policy; 79 const struct nla_policy *nla_policy;
76 80
81 size_t nla_size;
82
77#ifdef CONFIG_SYSCTL 83#ifdef CONFIG_SYSCTL
78 struct ctl_table_header **ctl_table_header; 84 struct ctl_table_header **ctl_table_header;
79 struct ctl_table *ctl_table; 85 struct ctl_table *ctl_table;
@@ -107,6 +113,7 @@ extern int nf_ct_port_tuple_to_nlattr(struct sk_buff *skb,
107 const struct nf_conntrack_tuple *tuple); 113 const struct nf_conntrack_tuple *tuple);
108extern int nf_ct_port_nlattr_to_tuple(struct nlattr *tb[], 114extern int nf_ct_port_nlattr_to_tuple(struct nlattr *tb[],
109 struct nf_conntrack_tuple *t); 115 struct nf_conntrack_tuple *t);
116extern int nf_ct_port_nlattr_tuple_size(void);
110extern const struct nla_policy nf_ct_port_nla_policy[]; 117extern const struct nla_policy nf_ct_port_nla_policy[];
111 118
112#ifdef CONFIG_SYSCTL 119#ifdef CONFIG_SYSCTL
diff --git a/include/net/netfilter/nf_conntrack_tuple.h b/include/net/netfilter/nf_conntrack_tuple.h
index f2f6aa73dc10..2628c154d40e 100644
--- a/include/net/netfilter/nf_conntrack_tuple.h
+++ b/include/net/netfilter/nf_conntrack_tuple.h
@@ -12,6 +12,7 @@
12 12
13#include <linux/netfilter/x_tables.h> 13#include <linux/netfilter/x_tables.h>
14#include <linux/netfilter/nf_conntrack_tuple_common.h> 14#include <linux/netfilter/nf_conntrack_tuple_common.h>
15#include <linux/list_nulls.h>
15 16
16/* A `tuple' is a structure containing the information to uniquely 17/* A `tuple' is a structure containing the information to uniquely
17 identify a connection. ie. if two packets have the same tuple, they 18 identify a connection. ie. if two packets have the same tuple, they
@@ -146,9 +147,8 @@ static inline void nf_ct_dump_tuple(const struct nf_conntrack_tuple *t)
146 ((enum ip_conntrack_dir)(h)->tuple.dst.dir) 147 ((enum ip_conntrack_dir)(h)->tuple.dst.dir)
147 148
148/* Connections have two entries in the hash table: one for each way */ 149/* Connections have two entries in the hash table: one for each way */
149struct nf_conntrack_tuple_hash 150struct nf_conntrack_tuple_hash {
150{ 151 struct hlist_nulls_node hnnode;
151 struct hlist_node hnode;
152 struct nf_conntrack_tuple tuple; 152 struct nf_conntrack_tuple tuple;
153}; 153};
154 154
diff --git a/include/net/netlink.h b/include/net/netlink.h
index 8a6150a3f4c7..eddb50289d6d 100644
--- a/include/net/netlink.h
+++ b/include/net/netlink.h
@@ -230,6 +230,7 @@ extern int nla_validate(struct nlattr *head, int len, int maxtype,
230extern int nla_parse(struct nlattr *tb[], int maxtype, 230extern int nla_parse(struct nlattr *tb[], int maxtype,
231 struct nlattr *head, int len, 231 struct nlattr *head, int len,
232 const struct nla_policy *policy); 232 const struct nla_policy *policy);
233extern int nla_policy_len(const struct nla_policy *, int);
233extern struct nlattr * nla_find(struct nlattr *head, int len, int attrtype); 234extern struct nlattr * nla_find(struct nlattr *head, int len, int attrtype);
234extern size_t nla_strlcpy(char *dst, const struct nlattr *nla, 235extern size_t nla_strlcpy(char *dst, const struct nlattr *nla,
235 size_t dstsize); 236 size_t dstsize);
diff --git a/include/net/netns/conntrack.h b/include/net/netns/conntrack.h
index f4498a62881b..9dc58402bc09 100644
--- a/include/net/netns/conntrack.h
+++ b/include/net/netns/conntrack.h
@@ -2,6 +2,7 @@
2#define __NETNS_CONNTRACK_H 2#define __NETNS_CONNTRACK_H
3 3
4#include <linux/list.h> 4#include <linux/list.h>
5#include <linux/list_nulls.h>
5#include <asm/atomic.h> 6#include <asm/atomic.h>
6 7
7struct ctl_table_header; 8struct ctl_table_header;
@@ -10,9 +11,9 @@ struct nf_conntrack_ecache;
10struct netns_ct { 11struct netns_ct {
11 atomic_t count; 12 atomic_t count;
12 unsigned int expect_count; 13 unsigned int expect_count;
13 struct hlist_head *hash; 14 struct hlist_nulls_head *hash;
14 struct hlist_head *expect_hash; 15 struct hlist_head *expect_hash;
15 struct hlist_head unconfirmed; 16 struct hlist_nulls_head unconfirmed;
16 struct ip_conntrack_stat *stat; 17 struct ip_conntrack_stat *stat;
17#ifdef CONFIG_NF_CONNTRACK_EVENTS 18#ifdef CONFIG_NF_CONNTRACK_EVENTS
18 struct nf_conntrack_ecache *ecache; 19 struct nf_conntrack_ecache *ecache;