[NETNS]: init dev_base_lock only once
[linux-2.6] / net / core / sysctl_net_core.c
1 /* -*- linux-c -*-
2  * sysctl_net_core.c: sysctl interface to net core subsystem.
3  *
4  * Begun April 1, 1996, Mike Shaver.
5  * Added /proc/sys/net/core directory entry (empty =) ). [MS]
6  */
7
8 #include <linux/mm.h>
9 #include <linux/sysctl.h>
10 #include <linux/module.h>
11 #include <linux/socket.h>
12 #include <linux/netdevice.h>
13 #include <net/sock.h>
14 #include <net/xfrm.h>
15
16 #ifdef CONFIG_SYSCTL
17
18 ctl_table core_table[] = {
19 #ifdef CONFIG_NET
20         {
21                 .ctl_name       = NET_CORE_WMEM_MAX,
22                 .procname       = "wmem_max",
23                 .data           = &sysctl_wmem_max,
24                 .maxlen         = sizeof(int),
25                 .mode           = 0644,
26                 .proc_handler   = &proc_dointvec
27         },
28         {
29                 .ctl_name       = NET_CORE_RMEM_MAX,
30                 .procname       = "rmem_max",
31                 .data           = &sysctl_rmem_max,
32                 .maxlen         = sizeof(int),
33                 .mode           = 0644,
34                 .proc_handler   = &proc_dointvec
35         },
36         {
37                 .ctl_name       = NET_CORE_WMEM_DEFAULT,
38                 .procname       = "wmem_default",
39                 .data           = &sysctl_wmem_default,
40                 .maxlen         = sizeof(int),
41                 .mode           = 0644,
42                 .proc_handler   = &proc_dointvec
43         },
44         {
45                 .ctl_name       = NET_CORE_RMEM_DEFAULT,
46                 .procname       = "rmem_default",
47                 .data           = &sysctl_rmem_default,
48                 .maxlen         = sizeof(int),
49                 .mode           = 0644,
50                 .proc_handler   = &proc_dointvec
51         },
52         {
53                 .ctl_name       = NET_CORE_DEV_WEIGHT,
54                 .procname       = "dev_weight",
55                 .data           = &weight_p,
56                 .maxlen         = sizeof(int),
57                 .mode           = 0644,
58                 .proc_handler   = &proc_dointvec
59         },
60         {
61                 .ctl_name       = NET_CORE_MAX_BACKLOG,
62                 .procname       = "netdev_max_backlog",
63                 .data           = &netdev_max_backlog,
64                 .maxlen         = sizeof(int),
65                 .mode           = 0644,
66                 .proc_handler   = &proc_dointvec
67         },
68         {
69                 .ctl_name       = NET_CORE_MSG_COST,
70                 .procname       = "message_cost",
71                 .data           = &net_msg_cost,
72                 .maxlen         = sizeof(int),
73                 .mode           = 0644,
74                 .proc_handler   = &proc_dointvec_jiffies,
75                 .strategy       = &sysctl_jiffies,
76         },
77         {
78                 .ctl_name       = NET_CORE_MSG_BURST,
79                 .procname       = "message_burst",
80                 .data           = &net_msg_burst,
81                 .maxlen         = sizeof(int),
82                 .mode           = 0644,
83                 .proc_handler   = &proc_dointvec,
84         },
85         {
86                 .ctl_name       = NET_CORE_OPTMEM_MAX,
87                 .procname       = "optmem_max",
88                 .data           = &sysctl_optmem_max,
89                 .maxlen         = sizeof(int),
90                 .mode           = 0644,
91                 .proc_handler   = &proc_dointvec
92         },
93 #ifdef CONFIG_XFRM
94         {
95                 .ctl_name       = NET_CORE_AEVENT_ETIME,
96                 .procname       = "xfrm_aevent_etime",
97                 .data           = &sysctl_xfrm_aevent_etime,
98                 .maxlen         = sizeof(u32),
99                 .mode           = 0644,
100                 .proc_handler   = &proc_dointvec
101         },
102         {
103                 .ctl_name       = NET_CORE_AEVENT_RSEQTH,
104                 .procname       = "xfrm_aevent_rseqth",
105                 .data           = &sysctl_xfrm_aevent_rseqth,
106                 .maxlen         = sizeof(u32),
107                 .mode           = 0644,
108                 .proc_handler   = &proc_dointvec
109         },
110         {
111                 .ctl_name       = CTL_UNNUMBERED,
112                 .procname       = "xfrm_larval_drop",
113                 .data           = &sysctl_xfrm_larval_drop,
114                 .maxlen         = sizeof(int),
115                 .mode           = 0644,
116                 .proc_handler   = &proc_dointvec
117         },
118         {
119                 .ctl_name       = CTL_UNNUMBERED,
120                 .procname       = "xfrm_acq_expires",
121                 .data           = &sysctl_xfrm_acq_expires,
122                 .maxlen         = sizeof(int),
123                 .mode           = 0644,
124                 .proc_handler   = &proc_dointvec
125         },
126 #endif /* CONFIG_XFRM */
127 #endif /* CONFIG_NET */
128         {
129                 .ctl_name       = NET_CORE_SOMAXCONN,
130                 .procname       = "somaxconn",
131                 .data           = &sysctl_somaxconn,
132                 .maxlen         = sizeof(int),
133                 .mode           = 0644,
134                 .proc_handler   = &proc_dointvec
135         },
136         {
137                 .ctl_name       = NET_CORE_BUDGET,
138                 .procname       = "netdev_budget",
139                 .data           = &netdev_budget,
140                 .maxlen         = sizeof(int),
141                 .mode           = 0644,
142                 .proc_handler   = &proc_dointvec
143         },
144         {
145                 .ctl_name       = NET_CORE_WARNINGS,
146                 .procname       = "warnings",
147                 .data           = &net_msg_warn,
148                 .maxlen         = sizeof(int),
149                 .mode           = 0644,
150                 .proc_handler   = &proc_dointvec
151         },
152         { .ctl_name = 0 }
153 };
154
155 #endif