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