Merge master.kernel.org:/pub/scm/linux/kernel/git/gregkh/driver-2.6
[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 ctl_table core_table[] = {
30 #ifdef CONFIG_NET
31         {
32                 .ctl_name       = NET_CORE_WMEM_MAX,
33                 .procname       = "wmem_max",
34                 .data           = &sysctl_wmem_max,
35                 .maxlen         = sizeof(int),
36                 .mode           = 0644,
37                 .proc_handler   = &proc_dointvec
38         },
39         {
40                 .ctl_name       = NET_CORE_RMEM_MAX,
41                 .procname       = "rmem_max",
42                 .data           = &sysctl_rmem_max,
43                 .maxlen         = sizeof(int),
44                 .mode           = 0644,
45                 .proc_handler   = &proc_dointvec
46         },
47         {
48                 .ctl_name       = NET_CORE_WMEM_DEFAULT,
49                 .procname       = "wmem_default",
50                 .data           = &sysctl_wmem_default,
51                 .maxlen         = sizeof(int),
52                 .mode           = 0644,
53                 .proc_handler   = &proc_dointvec
54         },
55         {
56                 .ctl_name       = NET_CORE_RMEM_DEFAULT,
57                 .procname       = "rmem_default",
58                 .data           = &sysctl_rmem_default,
59                 .maxlen         = sizeof(int),
60                 .mode           = 0644,
61                 .proc_handler   = &proc_dointvec
62         },
63         {
64                 .ctl_name       = NET_CORE_DEV_WEIGHT,
65                 .procname       = "dev_weight",
66                 .data           = &weight_p,
67                 .maxlen         = sizeof(int),
68                 .mode           = 0644,
69                 .proc_handler   = &proc_dointvec
70         },
71         {
72                 .ctl_name       = NET_CORE_MAX_BACKLOG,
73                 .procname       = "netdev_max_backlog",
74                 .data           = &netdev_max_backlog,
75                 .maxlen         = sizeof(int),
76                 .mode           = 0644,
77                 .proc_handler   = &proc_dointvec
78         },
79         {
80                 .ctl_name       = NET_CORE_MSG_COST,
81                 .procname       = "message_cost",
82                 .data           = &net_msg_cost,
83                 .maxlen         = sizeof(int),
84                 .mode           = 0644,
85                 .proc_handler   = &proc_dointvec_jiffies,
86                 .strategy       = &sysctl_jiffies,
87         },
88         {
89                 .ctl_name       = NET_CORE_MSG_BURST,
90                 .procname       = "message_burst",
91                 .data           = &net_msg_burst,
92                 .maxlen         = sizeof(int),
93                 .mode           = 0644,
94                 .proc_handler   = &proc_dointvec,
95         },
96         {
97                 .ctl_name       = NET_CORE_OPTMEM_MAX,
98                 .procname       = "optmem_max",
99                 .data           = &sysctl_optmem_max,
100                 .maxlen         = sizeof(int),
101                 .mode           = 0644,
102                 .proc_handler   = &proc_dointvec
103         },
104 #ifdef CONFIG_NET_DIVERT
105         {
106                 .ctl_name       = NET_CORE_DIVERT_VERSION,
107                 .procname       = "divert_version",
108                 .data           = (void *)sysctl_divert_version,
109                 .maxlen         = 32,
110                 .mode           = 0444,
111                 .proc_handler   = &proc_dostring
112         },
113 #endif /* CONFIG_NET_DIVERT */
114 #endif /* CONFIG_NET */
115         {
116                 .ctl_name       = NET_CORE_SOMAXCONN,
117                 .procname       = "somaxconn",
118                 .data           = &sysctl_somaxconn,
119                 .maxlen         = sizeof(int),
120                 .mode           = 0644,
121                 .proc_handler   = &proc_dointvec
122         },
123         {
124                 .ctl_name       = NET_CORE_BUDGET,
125                 .procname       = "netdev_budget",
126                 .data           = &netdev_budget,
127                 .maxlen         = sizeof(int),
128                 .mode           = 0644,
129                 .proc_handler   = &proc_dointvec
130         },
131         { .ctl_name = 0 }
132 };
133
134 #endif