Merge master.kernel.org:/pub/scm/linux/kernel/git/davej/cpufreq
[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 <net/sock.h>
13
14 #ifdef CONFIG_SYSCTL
15
16 extern int netdev_max_backlog;
17 extern int weight_p;
18
19 extern __u32 sysctl_wmem_max;
20 extern __u32 sysctl_rmem_max;
21
22 extern int sysctl_core_destroy_delay;
23
24 #ifdef CONFIG_NET_DIVERT
25 extern char sysctl_divert_version[];
26 #endif /* CONFIG_NET_DIVERT */
27
28 #ifdef CONFIG_XFRM
29 extern u32 sysctl_xfrm_aevent_etime;
30 extern u32 sysctl_xfrm_aevent_rseqth;
31 #endif
32
33 ctl_table core_table[] = {
34 #ifdef CONFIG_NET
35         {
36                 .ctl_name       = NET_CORE_WMEM_MAX,
37                 .procname       = "wmem_max",
38                 .data           = &sysctl_wmem_max,
39                 .maxlen         = sizeof(int),
40                 .mode           = 0644,
41                 .proc_handler   = &proc_dointvec
42         },
43         {
44                 .ctl_name       = NET_CORE_RMEM_MAX,
45                 .procname       = "rmem_max",
46                 .data           = &sysctl_rmem_max,
47                 .maxlen         = sizeof(int),
48                 .mode           = 0644,
49                 .proc_handler   = &proc_dointvec
50         },
51         {
52                 .ctl_name       = NET_CORE_WMEM_DEFAULT,
53                 .procname       = "wmem_default",
54                 .data           = &sysctl_wmem_default,
55                 .maxlen         = sizeof(int),
56                 .mode           = 0644,
57                 .proc_handler   = &proc_dointvec
58         },
59         {
60                 .ctl_name       = NET_CORE_RMEM_DEFAULT,
61                 .procname       = "rmem_default",
62                 .data           = &sysctl_rmem_default,
63                 .maxlen         = sizeof(int),
64                 .mode           = 0644,
65                 .proc_handler   = &proc_dointvec
66         },
67         {
68                 .ctl_name       = NET_CORE_DEV_WEIGHT,
69                 .procname       = "dev_weight",
70                 .data           = &weight_p,
71                 .maxlen         = sizeof(int),
72                 .mode           = 0644,
73                 .proc_handler   = &proc_dointvec
74         },
75         {
76                 .ctl_name       = NET_CORE_MAX_BACKLOG,
77                 .procname       = "netdev_max_backlog",
78                 .data           = &netdev_max_backlog,
79                 .maxlen         = sizeof(int),
80                 .mode           = 0644,
81                 .proc_handler   = &proc_dointvec
82         },
83         {
84                 .ctl_name       = NET_CORE_MSG_COST,
85                 .procname       = "message_cost",
86                 .data           = &net_msg_cost,
87                 .maxlen         = sizeof(int),
88                 .mode           = 0644,
89                 .proc_handler   = &proc_dointvec_jiffies,
90                 .strategy       = &sysctl_jiffies,
91         },
92         {
93                 .ctl_name       = NET_CORE_MSG_BURST,
94                 .procname       = "message_burst",
95                 .data           = &net_msg_burst,
96                 .maxlen         = sizeof(int),
97                 .mode           = 0644,
98                 .proc_handler   = &proc_dointvec,
99         },
100         {
101                 .ctl_name       = NET_CORE_OPTMEM_MAX,
102                 .procname       = "optmem_max",
103                 .data           = &sysctl_optmem_max,
104                 .maxlen         = sizeof(int),
105                 .mode           = 0644,
106                 .proc_handler   = &proc_dointvec
107         },
108 #ifdef CONFIG_NET_DIVERT
109         {
110                 .ctl_name       = NET_CORE_DIVERT_VERSION,
111                 .procname       = "divert_version",
112                 .data           = (void *)sysctl_divert_version,
113                 .maxlen         = 32,
114                 .mode           = 0444,
115                 .proc_handler   = &proc_dostring
116         },
117 #endif /* CONFIG_NET_DIVERT */
118 #ifdef CONFIG_XFRM
119         {
120                 .ctl_name       = NET_CORE_AEVENT_ETIME,
121                 .procname       = "xfrm_aevent_etime",
122                 .data           = &sysctl_xfrm_aevent_etime,
123                 .maxlen         = sizeof(u32),
124                 .mode           = 0644,
125                 .proc_handler   = &proc_dointvec
126         },
127         {
128                 .ctl_name       = NET_CORE_AEVENT_RSEQTH,
129                 .procname       = "xfrm_aevent_rseqth",
130                 .data           = &sysctl_xfrm_aevent_rseqth,
131                 .maxlen         = sizeof(u32),
132                 .mode           = 0644,
133                 .proc_handler   = &proc_dointvec
134         },
135 #endif /* CONFIG_XFRM */
136 #endif /* CONFIG_NET */
137         {
138                 .ctl_name       = NET_CORE_SOMAXCONN,
139                 .procname       = "somaxconn",
140                 .data           = &sysctl_somaxconn,
141                 .maxlen         = sizeof(int),
142                 .mode           = 0644,
143                 .proc_handler   = &proc_dointvec
144         },
145         {
146                 .ctl_name       = NET_CORE_BUDGET,
147                 .procname       = "netdev_budget",
148                 .data           = &netdev_budget,
149                 .maxlen         = sizeof(int),
150                 .mode           = 0644,
151                 .proc_handler   = &proc_dointvec
152         },
153         { .ctl_name = 0 }
154 };
155
156 #endif