aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorAlexey Dobriyan <adobriyan@gmail.com>2008-10-08 05:35:09 -0400
committerPatrick McHardy <kaber@trash.net>2008-10-08 05:35:09 -0400
commitd716a4dfbbdf0d4731d596a96e5f4b0d892ac168 (patch)
tree6131d86efdcebf7da50ded77e437223df9f41f7c /include
parentc2a2c7e0cc39e7f9336cd67e8307a110bdba82f3 (diff)
netfilter: netns nf_conntrack: per-netns conntrack accounting
Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com> Signed-off-by: Patrick McHardy <kaber@trash.net>
Diffstat (limited to 'include')
-rw-r--r--include/net/netfilter/nf_conntrack_acct.h10
-rw-r--r--include/net/netns/conntrack.h2
2 files changed, 7 insertions, 5 deletions
diff --git a/include/net/netfilter/nf_conntrack_acct.h b/include/net/netfilter/nf_conntrack_acct.h
index 5d5ae55d54c4..03e218f0be43 100644
--- a/include/net/netfilter/nf_conntrack_acct.h
+++ b/include/net/netfilter/nf_conntrack_acct.h
@@ -8,6 +8,7 @@
8 8
9#ifndef _NF_CONNTRACK_ACCT_H 9#ifndef _NF_CONNTRACK_ACCT_H
10#define _NF_CONNTRACK_ACCT_H 10#define _NF_CONNTRACK_ACCT_H
11#include <net/net_namespace.h>
11#include <linux/netfilter/nf_conntrack_common.h> 12#include <linux/netfilter/nf_conntrack_common.h>
12#include <linux/netfilter/nf_conntrack_tuple_common.h> 13#include <linux/netfilter/nf_conntrack_tuple_common.h>
13#include <net/netfilter/nf_conntrack.h> 14#include <net/netfilter/nf_conntrack.h>
@@ -18,8 +19,6 @@ struct nf_conn_counter {
18 u_int64_t bytes; 19 u_int64_t bytes;
19}; 20};
20 21
21extern int nf_ct_acct;
22
23static inline 22static inline
24struct nf_conn_counter *nf_conn_acct_find(const struct nf_conn *ct) 23struct nf_conn_counter *nf_conn_acct_find(const struct nf_conn *ct)
25{ 24{
@@ -29,9 +28,10 @@ struct nf_conn_counter *nf_conn_acct_find(const struct nf_conn *ct)
29static inline 28static inline
30struct nf_conn_counter *nf_ct_acct_ext_add(struct nf_conn *ct, gfp_t gfp) 29struct nf_conn_counter *nf_ct_acct_ext_add(struct nf_conn *ct, gfp_t gfp)
31{ 30{
31 struct net *net = nf_ct_net(ct);
32 struct nf_conn_counter *acct; 32 struct nf_conn_counter *acct;
33 33
34 if (!nf_ct_acct) 34 if (!net->ct.sysctl_acct)
35 return NULL; 35 return NULL;
36 36
37 acct = nf_ct_ext_add(ct, NF_CT_EXT_ACCT, gfp); 37 acct = nf_ct_ext_add(ct, NF_CT_EXT_ACCT, gfp);
@@ -45,7 +45,7 @@ struct nf_conn_counter *nf_ct_acct_ext_add(struct nf_conn *ct, gfp_t gfp)
45extern unsigned int 45extern unsigned int
46seq_print_acct(struct seq_file *s, const struct nf_conn *ct, int dir); 46seq_print_acct(struct seq_file *s, const struct nf_conn *ct, int dir);
47 47
48extern int nf_conntrack_acct_init(void); 48extern int nf_conntrack_acct_init(struct net *net);
49extern void nf_conntrack_acct_fini(void); 49extern void nf_conntrack_acct_fini(struct net *net);
50 50
51#endif /* _NF_CONNTRACK_ACCT_H */ 51#endif /* _NF_CONNTRACK_ACCT_H */
diff --git a/include/net/netns/conntrack.h b/include/net/netns/conntrack.h
index 503e37551b17..f4498a62881b 100644
--- a/include/net/netns/conntrack.h
+++ b/include/net/netns/conntrack.h
@@ -17,10 +17,12 @@ struct netns_ct {
17#ifdef CONFIG_NF_CONNTRACK_EVENTS 17#ifdef CONFIG_NF_CONNTRACK_EVENTS
18 struct nf_conntrack_ecache *ecache; 18 struct nf_conntrack_ecache *ecache;
19#endif 19#endif
20 int sysctl_acct;
20 int sysctl_checksum; 21 int sysctl_checksum;
21 unsigned int sysctl_log_invalid; /* Log invalid packets */ 22 unsigned int sysctl_log_invalid; /* Log invalid packets */
22#ifdef CONFIG_SYSCTL 23#ifdef CONFIG_SYSCTL
23 struct ctl_table_header *sysctl_header; 24 struct ctl_table_header *sysctl_header;
25 struct ctl_table_header *acct_sysctl_header;
24#endif 26#endif
25 int hash_vmalloc; 27 int hash_vmalloc;
26 int expect_vmalloc; 28 int expect_vmalloc;