2 * sysctl_net_core.c: sysctl interface to net core subsystem.
4 * Begun April 1, 1996, Mike Shaver.
5 * Added /proc/sys/net/core directory entry (empty =) ). [MS]
9 #include <linux/sysctl.h>
10 #include <linux/config.h>
11 #include <linux/module.h>
15 extern int netdev_max_backlog;
17 extern int no_cong_thresh;
21 extern int netdev_fastroute;
22 extern int net_msg_cost;
23 extern int net_msg_burst;
25 extern __u32 sysctl_wmem_max;
26 extern __u32 sysctl_rmem_max;
27 extern __u32 sysctl_wmem_default;
28 extern __u32 sysctl_rmem_default;
30 extern int sysctl_core_destroy_delay;
31 extern int sysctl_optmem_max;
32 extern int sysctl_somaxconn;
34 #ifdef CONFIG_NET_DIVERT
35 extern char sysctl_divert_version[];
36 #endif /* CONFIG_NET_DIVERT */
39 * This strdup() is used for creating copies of network
40 * device names to be handed over to sysctl.
43 char *net_sysctl_strdup(const char *s)
45 char *rv = kmalloc(strlen(s)+1, GFP_KERNEL);
51 ctl_table core_table[] = {
54 .ctl_name = NET_CORE_WMEM_MAX,
55 .procname = "wmem_max",
56 .data = &sysctl_wmem_max,
57 .maxlen = sizeof(int),
59 .proc_handler = &proc_dointvec
62 .ctl_name = NET_CORE_RMEM_MAX,
63 .procname = "rmem_max",
64 .data = &sysctl_rmem_max,
65 .maxlen = sizeof(int),
67 .proc_handler = &proc_dointvec
70 .ctl_name = NET_CORE_WMEM_DEFAULT,
71 .procname = "wmem_default",
72 .data = &sysctl_wmem_default,
73 .maxlen = sizeof(int),
75 .proc_handler = &proc_dointvec
78 .ctl_name = NET_CORE_RMEM_DEFAULT,
79 .procname = "rmem_default",
80 .data = &sysctl_rmem_default,
81 .maxlen = sizeof(int),
83 .proc_handler = &proc_dointvec
86 .ctl_name = NET_CORE_DEV_WEIGHT,
87 .procname = "dev_weight",
89 .maxlen = sizeof(int),
91 .proc_handler = &proc_dointvec
94 .ctl_name = NET_CORE_MAX_BACKLOG,
95 .procname = "netdev_max_backlog",
96 .data = &netdev_max_backlog,
97 .maxlen = sizeof(int),
99 .proc_handler = &proc_dointvec
102 .ctl_name = NET_CORE_NO_CONG_THRESH,
103 .procname = "no_cong_thresh",
104 .data = &no_cong_thresh,
105 .maxlen = sizeof(int),
107 .proc_handler = &proc_dointvec
110 .ctl_name = NET_CORE_NO_CONG,
111 .procname = "no_cong",
113 .maxlen = sizeof(int),
115 .proc_handler = &proc_dointvec
118 .ctl_name = NET_CORE_LO_CONG,
119 .procname = "lo_cong",
121 .maxlen = sizeof(int),
123 .proc_handler = &proc_dointvec
126 .ctl_name = NET_CORE_MOD_CONG,
127 .procname = "mod_cong",
129 .maxlen = sizeof(int),
131 .proc_handler = &proc_dointvec
134 .ctl_name = NET_CORE_MSG_COST,
135 .procname = "message_cost",
136 .data = &net_msg_cost,
137 .maxlen = sizeof(int),
139 .proc_handler = &proc_dointvec_jiffies,
140 .strategy = &sysctl_jiffies,
143 .ctl_name = NET_CORE_MSG_BURST,
144 .procname = "message_burst",
145 .data = &net_msg_burst,
146 .maxlen = sizeof(int),
148 .proc_handler = &proc_dointvec,
151 .ctl_name = NET_CORE_OPTMEM_MAX,
152 .procname = "optmem_max",
153 .data = &sysctl_optmem_max,
154 .maxlen = sizeof(int),
156 .proc_handler = &proc_dointvec
158 #ifdef CONFIG_NET_DIVERT
160 .ctl_name = NET_CORE_DIVERT_VERSION,
161 .procname = "divert_version",
162 .data = (void *)sysctl_divert_version,
165 .proc_handler = &proc_dostring
167 #endif /* CONFIG_NET_DIVERT */
168 #endif /* CONFIG_NET */
170 .ctl_name = NET_CORE_SOMAXCONN,
171 .procname = "somaxconn",
172 .data = &sysctl_somaxconn,
173 .maxlen = sizeof(int),
175 .proc_handler = &proc_dointvec
180 EXPORT_SYMBOL(net_sysctl_strdup);