netfilter: netns nf_conntrack: per-netns conntrack accounting
Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com> Signed-off-by: Patrick McHardy <kaber@trash.net>
This commit is contained in:
committed by
Patrick McHardy
parent
c2a2c7e0cc
commit
d716a4dfbb
@@ -8,6 +8,7 @@
|
||||
|
||||
#ifndef _NF_CONNTRACK_ACCT_H
|
||||
#define _NF_CONNTRACK_ACCT_H
|
||||
#include <net/net_namespace.h>
|
||||
#include <linux/netfilter/nf_conntrack_common.h>
|
||||
#include <linux/netfilter/nf_conntrack_tuple_common.h>
|
||||
#include <net/netfilter/nf_conntrack.h>
|
||||
@@ -18,8 +19,6 @@ struct nf_conn_counter {
|
||||
u_int64_t bytes;
|
||||
};
|
||||
|
||||
extern int nf_ct_acct;
|
||||
|
||||
static inline
|
||||
struct nf_conn_counter *nf_conn_acct_find(const struct nf_conn *ct)
|
||||
{
|
||||
@@ -29,9 +28,10 @@ struct nf_conn_counter *nf_conn_acct_find(const struct nf_conn *ct)
|
||||
static inline
|
||||
struct nf_conn_counter *nf_ct_acct_ext_add(struct nf_conn *ct, gfp_t gfp)
|
||||
{
|
||||
struct net *net = nf_ct_net(ct);
|
||||
struct nf_conn_counter *acct;
|
||||
|
||||
if (!nf_ct_acct)
|
||||
if (!net->ct.sysctl_acct)
|
||||
return NULL;
|
||||
|
||||
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)
|
||||
extern unsigned int
|
||||
seq_print_acct(struct seq_file *s, const struct nf_conn *ct, int dir);
|
||||
|
||||
extern int nf_conntrack_acct_init(void);
|
||||
extern void nf_conntrack_acct_fini(void);
|
||||
extern int nf_conntrack_acct_init(struct net *net);
|
||||
extern void nf_conntrack_acct_fini(struct net *net);
|
||||
|
||||
#endif /* _NF_CONNTRACK_ACCT_H */
|
||||
|
Reference in New Issue
Block a user