1 #include <linux/sysctl.h>
2 #include <net/net_namespace.h>
5 static void __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 .ctl_name
= NET_CORE_AEVENT_ETIME
,
17 .procname
= "xfrm_aevent_etime",
18 .maxlen
= sizeof(u32
),
20 .proc_handler
= proc_dointvec
23 .ctl_name
= NET_CORE_AEVENT_RSEQTH
,
24 .procname
= "xfrm_aevent_rseqth",
25 .maxlen
= sizeof(u32
),
27 .proc_handler
= proc_dointvec
30 .ctl_name
= CTL_UNNUMBERED
,
31 .procname
= "xfrm_larval_drop",
32 .maxlen
= sizeof(int),
34 .proc_handler
= proc_dointvec
37 .ctl_name
= CTL_UNNUMBERED
,
38 .procname
= "xfrm_acq_expires",
39 .maxlen
= sizeof(int),
41 .proc_handler
= proc_dointvec
46 int __net_init
xfrm_sysctl_init(struct net
*net
)
48 struct ctl_table
*table
;
50 __xfrm_sysctl_init(net
);
52 table
= kmemdup(xfrm_table
, sizeof(xfrm_table
), GFP_KERNEL
);
55 table
[0].data
= &net
->xfrm
.sysctl_aevent_etime
;
56 table
[1].data
= &net
->xfrm
.sysctl_aevent_rseqth
;
57 table
[2].data
= &net
->xfrm
.sysctl_larval_drop
;
58 table
[3].data
= &net
->xfrm
.sysctl_acq_expires
;
60 net
->xfrm
.sysctl_hdr
= register_net_sysctl_table(net
, net_core_path
, table
);
61 if (!net
->xfrm
.sysctl_hdr
)
71 void xfrm_sysctl_fini(struct net
*net
)
73 struct ctl_table
*table
;
75 table
= net
->xfrm
.sysctl_hdr
->ctl_table_arg
;
76 unregister_net_sysctl_table(net
->xfrm
.sysctl_hdr
);
80 int __net_init
xfrm_sysctl_init(struct net
*net
)
82 __xfrm_sysctl_init(net
);
This page took 0.031562 seconds and 5 git commands to generate.