11 #include <linux/netfilter.h>
12 #include <linux/slab.h>
13 #include <linux/kernel.h>
15 #include <linux/export.h>
27 static struct ctl_table acct_sysctl_table[] = {
31 .maxlen =
sizeof(
unsigned int),
44 acct = nf_conn_acct_find(ct);
48 return seq_printf(s,
"packets=%llu bytes=%llu ",
61 static int nf_conntrack_acct_init_sysctl(
struct net *
net)
65 table =
kmemdup(acct_sysctl_table,
sizeof(acct_sysctl_table),
70 table[0].
data = &net->ct.sysctl_acct;
74 if (!net->ct.acct_sysctl_header) {
86 static void nf_conntrack_acct_fini_sysctl(
struct net *net)
90 table = net->ct.acct_sysctl_header->ctl_table_arg;
95 static int nf_conntrack_acct_init_sysctl(
struct net *net)
100 static void nf_conntrack_acct_fini_sysctl(
struct net *net)
109 net->ct.sysctl_acct = nf_ct_acct;
114 printk(
KERN_ERR "nf_conntrack_acct: Unable to register extension\n");
115 goto out_extend_register;
119 ret = nf_conntrack_acct_init_sysctl(net);
134 nf_conntrack_acct_fini_sysctl(net);