backlight: Add Epson L4F00242T03 LCD driver
[linux-2.6/linux-acpi-2.6/ibm-acpi-2.6.git] / net / xfrm / xfrm_sysctl.c
blob2c4d6cdcba492cd2f70ac32a3e71b5b0abd17691
1 #include <linux/sysctl.h>
2 #include <net/net_namespace.h>
3 #include <net/xfrm.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;
13 #ifdef CONFIG_SYSCTL
14 static struct ctl_table xfrm_table[] = {
16 .procname = "xfrm_aevent_etime",
17 .maxlen = sizeof(u32),
18 .mode = 0644,
19 .proc_handler = proc_dointvec
22 .procname = "xfrm_aevent_rseqth",
23 .maxlen = sizeof(u32),
24 .mode = 0644,
25 .proc_handler = proc_dointvec
28 .procname = "xfrm_larval_drop",
29 .maxlen = sizeof(int),
30 .mode = 0644,
31 .proc_handler = proc_dointvec
34 .procname = "xfrm_acq_expires",
35 .maxlen = sizeof(int),
36 .mode = 0644,
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);
49 if (!table)
50 goto out_kmemdup;
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)
58 goto out_register;
59 return 0;
61 out_register:
62 kfree(table);
63 out_kmemdup:
64 return -ENOMEM;
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);
73 kfree(table);
75 #else
76 int __net_init xfrm_sysctl_init(struct net *net)
78 __xfrm_sysctl_init(net);
79 return 0;
81 #endif