1 #include <linux/sysctl.h>
2 #include <net/net_namespace.h>
5 static void __net_init
__xfrm_sysctl_init(struct net
*net
)
7 net
->xfrm
.sysctl_aevent_etime
= XFRM_AE_ETIME
;
8 net
->xfrm
.sysctl_aevent_rseqth
= XFRM_AE_SEQT_SIZE
;
9 net
->xfrm
.sysctl_larval_drop
= 1;
10 net
->xfrm
.sysctl_acq_expires
= 30;
14 static struct ctl_table xfrm_table
[] = {
16 .procname
= "xfrm_aevent_etime",
17 .maxlen
= sizeof(u32
),
19 .proc_handler
= proc_dointvec
22 .procname
= "xfrm_aevent_rseqth",
23 .maxlen
= sizeof(u32
),
25 .proc_handler
= proc_dointvec
28 .procname
= "xfrm_larval_drop",
29 .maxlen
= sizeof(int),
31 .proc_handler
= proc_dointvec
34 .procname
= "xfrm_acq_expires",
35 .maxlen
= sizeof(int),
37 .proc_handler
= proc_dointvec
42 int __net_init
xfrm_sysctl_init(struct net
*net
)
44 struct ctl_table
*table
;
46 __xfrm_sysctl_init(net
);
48 table
= kmemdup(xfrm_table
, sizeof(xfrm_table
), GFP_KERNEL
);
51 table
[0].data
= &net
->xfrm
.sysctl_aevent_etime
;
52 table
[1].data
= &net
->xfrm
.sysctl_aevent_rseqth
;
53 table
[2].data
= &net
->xfrm
.sysctl_larval_drop
;
54 table
[3].data
= &net
->xfrm
.sysctl_acq_expires
;
56 net
->xfrm
.sysctl_hdr
= register_net_sysctl_table(net
, net_core_path
, table
);
57 if (!net
->xfrm
.sysctl_hdr
)
67 void __net_exit
xfrm_sysctl_fini(struct net
*net
)
69 struct ctl_table
*table
;
71 table
= net
->xfrm
.sysctl_hdr
->ctl_table_arg
;
72 unregister_net_sysctl_table(net
->xfrm
.sysctl_hdr
);
76 int __net_init
xfrm_sysctl_init(struct net
*net
)
78 __xfrm_sysctl_init(net
);