[IPVS]: Fix sysctl warnings about missing strategy in schedulers
[safe/jmp/linux-2.6] / kernel / sysctl_check.c
1 #include <linux/stat.h>
2 #include <linux/sysctl.h>
3 #include "../arch/s390/appldata/appldata.h"
4 #include "../fs/xfs/linux-2.6/xfs_sysctl.h"
5 #include <linux/sunrpc/debug.h>
6 #include <linux/string.h>
7 #include <net/ip_vs.h>
8
9 struct trans_ctl_table {
10         int                     ctl_name;
11         const char              *procname;
12         struct trans_ctl_table  *child;
13 };
14
15 static struct trans_ctl_table trans_random_table[] = {
16         { RANDOM_POOLSIZE,      "poolsize" },
17         { RANDOM_ENTROPY_COUNT, "entropy_avail" },
18         { RANDOM_READ_THRESH,   "read_wakeup_threshold" },
19         { RANDOM_WRITE_THRESH,  "write_wakeup_threshold" },
20         { RANDOM_BOOT_ID,       "boot_id" },
21         { RANDOM_UUID,          "uuid" },
22         {}
23 };
24
25 static struct trans_ctl_table trans_pty_table[] = {
26         { PTY_MAX,              "max" },
27         { PTY_NR,               "nr" },
28         {}
29 };
30
31 static struct trans_ctl_table trans_kern_table[] = {
32         { KERN_OSTYPE,                  "ostype" },
33         { KERN_OSRELEASE,               "osrelease" },
34         /* KERN_OSREV not used */
35         { KERN_VERSION,                 "version" },
36         /* KERN_SECUREMASK not used */
37         /* KERN_PROF not used */
38         { KERN_NODENAME,                "hostname" },
39         { KERN_DOMAINNAME,              "domainname" },
40
41 #ifdef CONFIG_SECURITY_CAPABILITIES
42         { KERN_CAP_BSET,                "cap-bound" },
43 #endif /* def CONFIG_SECURITY_CAPABILITIES */
44
45         { KERN_PANIC,                   "panic" },
46         { KERN_REALROOTDEV,             "real-root-dev" },
47
48         { KERN_SPARC_REBOOT,            "reboot-cmd" },
49         { KERN_CTLALTDEL,               "ctrl-alt-del" },
50         { KERN_PRINTK,                  "printk" },
51
52         /* KERN_NAMETRANS not used */
53         /* KERN_PPC_HTABRECLAIM not used */
54         /* KERN_PPC_ZEROPAGED not used */
55         { KERN_PPC_POWERSAVE_NAP,       "powersave-nap" },
56
57         { KERN_MODPROBE,                "modprobe" },
58         { KERN_SG_BIG_BUFF,             "sg-big-buff" },
59         { KERN_ACCT,                    "acct" },
60         { KERN_PPC_L2CR,                "l2cr" },
61
62         /* KERN_RTSIGNR not used */
63         /* KERN_RTSIGMAX not used */
64
65         { KERN_SHMMAX,                  "shmmax" },
66         { KERN_MSGMAX,                  "msgmax" },
67         { KERN_MSGMNB,                  "msgmnb" },
68         /* KERN_MSGPOOL not used*/
69         { KERN_SYSRQ,                   "sysrq" },
70         { KERN_MAX_THREADS,             "threads-max" },
71         { KERN_RANDOM,                  "random",       trans_random_table },
72         { KERN_SHMALL,                  "shmall" },
73         { KERN_MSGMNI,                  "msgmni" },
74         { KERN_SEM,                     "sem" },
75         { KERN_SPARC_STOP_A,            "stop-a" },
76         { KERN_SHMMNI,                  "shmmni" },
77
78         { KERN_OVERFLOWUID,             "overflowuid" },
79         { KERN_OVERFLOWGID,             "overflowgid" },
80
81         { KERN_HOTPLUG,                 "hotplug", },
82         { KERN_IEEE_EMULATION_WARNINGS, "ieee_emulation_warnings" },
83
84         { KERN_S390_USER_DEBUG_LOGGING, "userprocess_debug" },
85         { KERN_CORE_USES_PID,           "core_uses_pid" },
86         { KERN_TAINTED,                 "tainted" },
87         { KERN_CADPID,                  "cad_pid" },
88         { KERN_PIDMAX,                  "pid_max" },
89         { KERN_CORE_PATTERN,            "core_pattern" },
90         { KERN_PANIC_ON_OOPS,           "panic_on_oops" },
91         { KERN_HPPA_PWRSW,              "soft-power" },
92         { KERN_HPPA_UNALIGNED,          "unaligned-trap" },
93
94         { KERN_PRINTK_RATELIMIT,        "printk_ratelimit" },
95         { KERN_PRINTK_RATELIMIT_BURST,  "printk_ratelimit_burst" },
96
97         { KERN_PTY,                     "pty",          trans_pty_table },
98         { KERN_NGROUPS_MAX,             "ngroups_max" },
99         { KERN_SPARC_SCONS_PWROFF,      "scons_poweroff" },
100         { KERN_HZ_TIMER,                "hz_timer" },
101         { KERN_UNKNOWN_NMI_PANIC,       "unknown_nmi_panic" },
102         { KERN_BOOTLOADER_TYPE,         "bootloader_type" },
103         { KERN_RANDOMIZE,               "randomize_va_space" },
104
105         { KERN_SPIN_RETRY,              "spin_retry" },
106         { KERN_ACPI_VIDEO_FLAGS,        "acpi_video_flags" },
107         { KERN_IA64_UNALIGNED,          "ignore-unaligned-usertrap" },
108         { KERN_COMPAT_LOG,              "compat-log" },
109         { KERN_MAX_LOCK_DEPTH,          "max_lock_depth" },
110         { KERN_NMI_WATCHDOG,            "nmi_watchdog" },
111         { KERN_PANIC_ON_NMI,            "panic_on_unrecovered_nmi" },
112         {}
113 };
114
115 static struct trans_ctl_table trans_vm_table[] = {
116         { VM_OVERCOMMIT_MEMORY,         "overcommit_memory" },
117         { VM_PAGE_CLUSTER,              "page-cluster" },
118         { VM_DIRTY_BACKGROUND,          "dirty_background_ratio" },
119         { VM_DIRTY_RATIO,               "dirty_ratio" },
120         { VM_DIRTY_WB_CS,               "dirty_writeback_centisecs" },
121         { VM_DIRTY_EXPIRE_CS,           "dirty_expire_centisecs" },
122         { VM_NR_PDFLUSH_THREADS,        "nr_pdflush_threads" },
123         { VM_OVERCOMMIT_RATIO,          "overcommit_ratio" },
124         /* VM_PAGEBUF unused */
125         { VM_HUGETLB_PAGES,             "nr_hugepages" },
126         { VM_SWAPPINESS,                "swappiness" },
127         { VM_LOWMEM_RESERVE_RATIO,      "lowmem_reserve_ratio" },
128         { VM_MIN_FREE_KBYTES,           "min_free_kbytes" },
129         { VM_MAX_MAP_COUNT,             "max_map_count" },
130         { VM_LAPTOP_MODE,               "laptop_mode" },
131         { VM_BLOCK_DUMP,                "block_dump" },
132         { VM_HUGETLB_GROUP,             "hugetlb_shm_group" },
133         { VM_VFS_CACHE_PRESSURE,        "vfs_cache_pressure" },
134         { VM_LEGACY_VA_LAYOUT,          "legacy_va_layout" },
135         /* VM_SWAP_TOKEN_TIMEOUT unused */
136         { VM_DROP_PAGECACHE,            "drop_caches" },
137         { VM_PERCPU_PAGELIST_FRACTION,  "percpu_pagelist_fraction" },
138         { VM_ZONE_RECLAIM_MODE,         "zone_reclaim_mode" },
139         { VM_MIN_UNMAPPED,              "min_unmapped_ratio" },
140         { VM_PANIC_ON_OOM,              "panic_on_oom" },
141         { VM_VDSO_ENABLED,              "vdso_enabled" },
142         { VM_MIN_SLAB,                  "min_slab_ratio" },
143         { VM_CMM_PAGES,                 "cmm_pages" },
144         { VM_CMM_TIMED_PAGES,           "cmm_timed_pages" },
145         { VM_CMM_TIMEOUT,               "cmm_timeout" },
146
147         {}
148 };
149
150 static struct trans_ctl_table trans_net_core_table[] = {
151         { NET_CORE_WMEM_MAX,            "wmem_max" },
152         { NET_CORE_RMEM_MAX,            "rmem_max" },
153         { NET_CORE_WMEM_DEFAULT,        "wmem_default" },
154         { NET_CORE_RMEM_DEFAULT,        "rmem_default" },
155         /* NET_CORE_DESTROY_DELAY unused */
156         { NET_CORE_MAX_BACKLOG,         "netdev_max_backlog" },
157         /* NET_CORE_FASTROUTE unused */
158         { NET_CORE_MSG_COST,            "message_cost" },
159         { NET_CORE_MSG_BURST,           "message_burst" },
160         { NET_CORE_OPTMEM_MAX,          "optmem_max" },
161         /* NET_CORE_HOT_LIST_LENGTH unused */
162         /* NET_CORE_DIVERT_VERSION unused */
163         /* NET_CORE_NO_CONG_THRESH unused */
164         /* NET_CORE_NO_CONG unused */
165         /* NET_CORE_LO_CONG unused */
166         /* NET_CORE_MOD_CONG unused */
167         { NET_CORE_DEV_WEIGHT,          "dev_weight" },
168         { NET_CORE_SOMAXCONN,           "somaxconn" },
169         { NET_CORE_BUDGET,              "netdev_budget" },
170         { NET_CORE_AEVENT_ETIME,        "xfrm_aevent_etime" },
171         { NET_CORE_AEVENT_RSEQTH,       "xfrm_aevent_rseqth" },
172         { NET_CORE_WARNINGS,            "warnings" },
173         {},
174 };
175
176 static struct trans_ctl_table trans_net_unix_table[] = {
177         /* NET_UNIX_DESTROY_DELAY unused */
178         /* NET_UNIX_DELETE_DELAY unused */
179         { NET_UNIX_MAX_DGRAM_QLEN,      "max_dgram_qlen" },
180         {}
181 };
182
183 static struct trans_ctl_table trans_net_ipv4_route_table[] = {
184         { NET_IPV4_ROUTE_FLUSH,                 "flush" },
185         { NET_IPV4_ROUTE_MIN_DELAY,             "min_delay" },
186         { NET_IPV4_ROUTE_MAX_DELAY,             "max_delay" },
187         { NET_IPV4_ROUTE_GC_THRESH,             "gc_thresh" },
188         { NET_IPV4_ROUTE_MAX_SIZE,              "max_size" },
189         { NET_IPV4_ROUTE_GC_MIN_INTERVAL,       "gc_min_interval" },
190         { NET_IPV4_ROUTE_GC_TIMEOUT,            "gc_timeout" },
191         { NET_IPV4_ROUTE_GC_INTERVAL,           "gc_interval" },
192         { NET_IPV4_ROUTE_REDIRECT_LOAD,         "redirect_load" },
193         { NET_IPV4_ROUTE_REDIRECT_NUMBER,       "redirect_number" },
194         { NET_IPV4_ROUTE_REDIRECT_SILENCE,      "redirect_silence" },
195         { NET_IPV4_ROUTE_ERROR_COST,            "error_cost" },
196         { NET_IPV4_ROUTE_ERROR_BURST,           "error_burst" },
197         { NET_IPV4_ROUTE_GC_ELASTICITY,         "gc_elasticity" },
198         { NET_IPV4_ROUTE_MTU_EXPIRES,           "mtu_expires" },
199         { NET_IPV4_ROUTE_MIN_PMTU,              "min_pmtu" },
200         { NET_IPV4_ROUTE_MIN_ADVMSS,            "min_adv_mss" },
201         { NET_IPV4_ROUTE_SECRET_INTERVAL,       "secret_interval" },
202         { NET_IPV4_ROUTE_GC_MIN_INTERVAL_MS,    "gc_min_interval_ms" },
203         {}
204 };
205
206 static struct trans_ctl_table trans_net_ipv4_conf_vars_table[] = {
207         { NET_IPV4_CONF_FORWARDING,             "forwarding" },
208         { NET_IPV4_CONF_MC_FORWARDING,          "mc_forwarding" },
209
210         { NET_IPV4_CONF_PROXY_ARP,              "proxy_arp" },
211         { NET_IPV4_CONF_ACCEPT_REDIRECTS,       "accept_redirects" },
212         { NET_IPV4_CONF_SECURE_REDIRECTS,       "secure_redirects" },
213         { NET_IPV4_CONF_SEND_REDIRECTS,         "send_redirects" },
214         { NET_IPV4_CONF_SHARED_MEDIA,           "shared_media" },
215         { NET_IPV4_CONF_RP_FILTER,              "rp_filter" },
216         { NET_IPV4_CONF_ACCEPT_SOURCE_ROUTE,    "accept_source_route" },
217         { NET_IPV4_CONF_BOOTP_RELAY,            "bootp_relay" },
218         { NET_IPV4_CONF_LOG_MARTIANS,           "log_martians" },
219         { NET_IPV4_CONF_TAG,                    "tag" },
220         { NET_IPV4_CONF_ARPFILTER,              "arp_filter" },
221         { NET_IPV4_CONF_MEDIUM_ID,              "medium_id" },
222         { NET_IPV4_CONF_NOXFRM,                 "disable_xfrm" },
223         { NET_IPV4_CONF_NOPOLICY,               "disable_policy" },
224         { NET_IPV4_CONF_FORCE_IGMP_VERSION,     "force_igmp_version" },
225
226         { NET_IPV4_CONF_ARP_ANNOUNCE,           "arp_announce" },
227         { NET_IPV4_CONF_ARP_IGNORE,             "arp_ignore" },
228         { NET_IPV4_CONF_PROMOTE_SECONDARIES,    "promote_secondaries" },
229         { NET_IPV4_CONF_ARP_ACCEPT,             "arp_accept" },
230         {}
231 };
232
233 static struct trans_ctl_table trans_net_ipv4_conf_table[] = {
234         { NET_PROTO_CONF_ALL,           "all",          trans_net_ipv4_conf_vars_table },
235         { NET_PROTO_CONF_DEFAULT,       "default",      trans_net_ipv4_conf_vars_table },
236         { 0, NULL, trans_net_ipv4_conf_vars_table },
237         {}
238 };
239
240
241 static struct trans_ctl_table trans_net_ipv4_vs_table[] = {
242         { NET_IPV4_VS_AMEMTHRESH,       "amemthresh" },
243         { NET_IPV4_VS_DEBUG_LEVEL,      "debug_level" },
244         { NET_IPV4_VS_AMDROPRATE,       "am_droprate" },
245         { NET_IPV4_VS_TO_ES,            "timeout_established" },
246         { NET_IPV4_VS_TO_SS,            "timeout_synsent" },
247         { NET_IPV4_VS_TO_SR,            "timeout_synrecv" },
248         { NET_IPV4_VS_TO_FW,            "timeout_finwait" },
249         { NET_IPV4_VS_TO_TW,            "timeout_timewait" },
250         { NET_IPV4_VS_TO_CL,            "timeout_close" },
251         { NET_IPV4_VS_TO_CW,            "timeout_closewait" },
252         { NET_IPV4_VS_TO_LA,            "timeout_lastack" },
253         { NET_IPV4_VS_TO_LI,            "timeout_listen" },
254         { NET_IPV4_VS_TO_SA,            "timeout_synack" },
255         { NET_IPV4_VS_TO_UDP,           "timeout_udp" },
256         { NET_IPV4_VS_TO_ICMP,          "timeout_icmp" },
257         { NET_IPV4_VS_CACHE_BYPASS,     "cache_bypass" },
258         { NET_IPV4_VS_EXPIRE_NODEST_CONN,       "expire_nodest_conn" },
259         { NET_IPV4_VS_EXPIRE_QUIESCENT_TEMPLATE,        "expire_quiescent_template" },
260         { NET_IPV4_VS_NAT_ICMP_SEND,    "nat_icmp_send" },
261         {}
262 };
263
264 static struct trans_ctl_table trans_net_neigh_vars_table[] = {
265         { NET_NEIGH_MCAST_SOLICIT,      "mcast_solicit" },
266         { NET_NEIGH_UCAST_SOLICIT,      "ucast_solicit" },
267         { NET_NEIGH_APP_SOLICIT,        "app_solicit" },
268         { NET_NEIGH_RETRANS_TIME,       "retrans_time" },
269         { NET_NEIGH_REACHABLE_TIME,     "base_reachable_time" },
270         { NET_NEIGH_DELAY_PROBE_TIME,   "delay_first_probe_time" },
271         { NET_NEIGH_GC_STALE_TIME,      "gc_stale_time" },
272         { NET_NEIGH_UNRES_QLEN,         "unres_qlen" },
273         { NET_NEIGH_PROXY_QLEN,         "proxy_qlen" },
274         { NET_NEIGH_ANYCAST_DELAY,      "anycast_delay" },
275         { NET_NEIGH_PROXY_DELAY,        "proxy_delay" },
276         { NET_NEIGH_LOCKTIME,           "locktime" },
277         { NET_NEIGH_GC_INTERVAL,        "gc_interval" },
278         { NET_NEIGH_GC_THRESH1,         "gc_thresh1" },
279         { NET_NEIGH_GC_THRESH2,         "gc_thresh2" },
280         { NET_NEIGH_GC_THRESH3,         "gc_thresh3" },
281         { NET_NEIGH_RETRANS_TIME_MS,    "retrans_time_ms" },
282         { NET_NEIGH_REACHABLE_TIME_MS,  "base_reachable_time_ms" },
283         {}
284 };
285
286 static struct trans_ctl_table trans_net_neigh_table[] = {
287         { NET_PROTO_CONF_DEFAULT, "default", trans_net_neigh_vars_table },
288         { 0, NULL, trans_net_neigh_vars_table },
289         {}
290 };
291
292 static struct trans_ctl_table trans_net_ipv4_netfilter_table[] = {
293         { NET_IPV4_NF_CONNTRACK_MAX,                            "ip_conntrack_max" },
294
295         { NET_IPV4_NF_CONNTRACK_TCP_TIMEOUT_SYN_SENT,           "ip_conntrack_tcp_timeout_syn_sent" },
296         { NET_IPV4_NF_CONNTRACK_TCP_TIMEOUT_SYN_RECV,           "ip_conntrack_tcp_timeout_syn_recv" },
297         { NET_IPV4_NF_CONNTRACK_TCP_TIMEOUT_ESTABLISHED,        "ip_conntrack_tcp_timeout_established" },
298         { NET_IPV4_NF_CONNTRACK_TCP_TIMEOUT_FIN_WAIT,           "ip_conntrack_tcp_timeout_fin_wait" },
299         { NET_IPV4_NF_CONNTRACK_TCP_TIMEOUT_CLOSE_WAIT,         "ip_conntrack_tcp_timeout_close_wait" },
300         { NET_IPV4_NF_CONNTRACK_TCP_TIMEOUT_LAST_ACK,           "ip_conntrack_tcp_timeout_last_ack" },
301         { NET_IPV4_NF_CONNTRACK_TCP_TIMEOUT_TIME_WAIT,          "ip_conntrack_tcp_timeout_time_wait" },
302         { NET_IPV4_NF_CONNTRACK_TCP_TIMEOUT_CLOSE,              "ip_conntrack_tcp_timeout_close" },
303
304         { NET_IPV4_NF_CONNTRACK_UDP_TIMEOUT,                    "ip_conntrack_udp_timeout" },
305         { NET_IPV4_NF_CONNTRACK_UDP_TIMEOUT_STREAM,             "ip_conntrack_udp_timeout_stream" },
306         { NET_IPV4_NF_CONNTRACK_ICMP_TIMEOUT,                   "ip_conntrack_icmp_timeout" },
307         { NET_IPV4_NF_CONNTRACK_GENERIC_TIMEOUT,                "ip_conntrack_generic_timeout" },
308
309         { NET_IPV4_NF_CONNTRACK_BUCKETS,                        "ip_conntrack_buckets" },
310         { NET_IPV4_NF_CONNTRACK_LOG_INVALID,                    "ip_conntrack_log_invalid" },
311         { NET_IPV4_NF_CONNTRACK_TCP_TIMEOUT_MAX_RETRANS,        "ip_conntrack_tcp_timeout_max_retrans" },
312         { NET_IPV4_NF_CONNTRACK_TCP_LOOSE,                      "ip_conntrack_tcp_loose" },
313         { NET_IPV4_NF_CONNTRACK_TCP_BE_LIBERAL,                 "ip_conntrack_tcp_be_liberal" },
314         { NET_IPV4_NF_CONNTRACK_TCP_MAX_RETRANS,                "ip_conntrack_tcp_max_retrans" },
315
316         { NET_IPV4_NF_CONNTRACK_SCTP_TIMEOUT_CLOSED,            "ip_conntrack_sctp_timeout_closed" },
317         { NET_IPV4_NF_CONNTRACK_SCTP_TIMEOUT_COOKIE_WAIT,       "ip_conntrack_sctp_timeout_cookie_wait" },
318         { NET_IPV4_NF_CONNTRACK_SCTP_TIMEOUT_COOKIE_ECHOED,     "ip_conntrack_sctp_timeout_cookie_echoed" },
319         { NET_IPV4_NF_CONNTRACK_SCTP_TIMEOUT_ESTABLISHED,       "ip_conntrack_sctp_timeout_established" },
320         { NET_IPV4_NF_CONNTRACK_SCTP_TIMEOUT_SHUTDOWN_SENT,     "ip_conntrack_sctp_timeout_shutdown_sent" },
321         { NET_IPV4_NF_CONNTRACK_SCTP_TIMEOUT_SHUTDOWN_RECD,     "ip_conntrack_sctp_timeout_shutdown_recd" },
322         { NET_IPV4_NF_CONNTRACK_SCTP_TIMEOUT_SHUTDOWN_ACK_SENT, "ip_conntrack_sctp_timeout_shutdown_ack_sent" },
323
324         { NET_IPV4_NF_CONNTRACK_COUNT,          "ip_conntrack_count" },
325         { NET_IPV4_NF_CONNTRACK_CHECKSUM,       "ip_conntrack_checksum" },
326         {}
327 };
328
329 static struct trans_ctl_table trans_net_ipv4_table[] = {
330         { NET_IPV4_FORWARD,                     "ip_forward" },
331         { NET_IPV4_DYNADDR,                     "ip_dynaddr" },
332
333         { NET_IPV4_CONF,                "conf",         trans_net_ipv4_conf_table },
334         { NET_IPV4_NEIGH,               "neigh",        trans_net_neigh_table },
335         { NET_IPV4_ROUTE,               "route",        trans_net_ipv4_route_table },
336         /* NET_IPV4_FIB_HASH unused */
337         { NET_IPV4_NETFILTER,           "netfilter",    trans_net_ipv4_netfilter_table },
338         { NET_IPV4_VS,                  "vs",           trans_net_ipv4_vs_table },
339
340         { NET_IPV4_TCP_TIMESTAMPS,              "tcp_timestamps" },
341         { NET_IPV4_TCP_WINDOW_SCALING,          "tcp_window_scaling" },
342         { NET_IPV4_TCP_SACK,                    "tcp_sack" },
343         { NET_IPV4_TCP_RETRANS_COLLAPSE,        "tcp_retrans_collapse" },
344         { NET_IPV4_DEFAULT_TTL,                 "ip_default_ttl" },
345         /* NET_IPV4_AUTOCONFIG unused */
346         { NET_IPV4_NO_PMTU_DISC,                "ip_no_pmtu_disc" },
347         { NET_IPV4_TCP_SYN_RETRIES,             "tcp_syn_retries" },
348         { NET_IPV4_IPFRAG_HIGH_THRESH,          "ipfrag_high_thresh" },
349         { NET_IPV4_IPFRAG_LOW_THRESH,           "ipfrag_low_thresh" },
350         { NET_IPV4_IPFRAG_TIME,                 "ipfrag_time" },
351         /* NET_IPV4_TCP_MAX_KA_PROBES unused */
352         { NET_IPV4_TCP_KEEPALIVE_TIME,          "tcp_keepalive_time" },
353         { NET_IPV4_TCP_KEEPALIVE_PROBES,        "tcp_keepalive_probes" },
354         { NET_IPV4_TCP_RETRIES1,                "tcp_retries1" },
355         { NET_IPV4_TCP_RETRIES2,                "tcp_retries2" },
356         { NET_IPV4_TCP_FIN_TIMEOUT,             "tcp_fin_timeout" },
357         /* NET_IPV4_IP_MASQ_DEBUG unused */
358         { NET_TCP_SYNCOOKIES,                   "tcp_syncookies" },
359         { NET_TCP_STDURG,                       "tcp_stdurg" },
360         { NET_TCP_RFC1337,                      "tcp_rfc1337" },
361         /* NET_TCP_SYN_TAILDROP unused */
362         { NET_TCP_MAX_SYN_BACKLOG,              "tcp_max_syn_backlog" },
363         { NET_IPV4_LOCAL_PORT_RANGE,            "ip_local_port_range" },
364         { NET_IPV4_ICMP_ECHO_IGNORE_ALL,        "icmp_echo_ignore_all" },
365         { NET_IPV4_ICMP_ECHO_IGNORE_BROADCASTS, "icmp_echo_ignore_broadcasts" },
366         /* NET_IPV4_ICMP_SOURCEQUENCH_RATE unused */
367         /* NET_IPV4_ICMP_DESTUNREACH_RATE unused */
368         /* NET_IPV4_ICMP_TIMEEXCEED_RATE unused */
369         /* NET_IPV4_ICMP_PARAMPROB_RATE unused */
370         /* NET_IPV4_ICMP_ECHOREPLY_RATE unused */
371         { NET_IPV4_ICMP_IGNORE_BOGUS_ERROR_RESPONSES,   "icmp_ignore_bogus_error_responses" },
372         { NET_IPV4_IGMP_MAX_MEMBERSHIPS,        "igmp_max_memberships" },
373         { NET_TCP_TW_RECYCLE,                   "tcp_tw_recycle" },
374         /* NET_IPV4_ALWAYS_DEFRAG unused */
375         { NET_IPV4_TCP_KEEPALIVE_INTVL,         "tcp_keepalive_intvl" },
376         { NET_IPV4_INET_PEER_THRESHOLD,         "inet_peer_threshold" },
377         { NET_IPV4_INET_PEER_MINTTL,            "inet_peer_minttl" },
378         { NET_IPV4_INET_PEER_MAXTTL,            "inet_peer_maxttl" },
379         { NET_IPV4_INET_PEER_GC_MINTIME,        "inet_peer_gc_mintime" },
380         { NET_IPV4_INET_PEER_GC_MAXTIME,        "inet_peer_gc_maxtime" },
381         { NET_TCP_ORPHAN_RETRIES,               "tcp_orphan_retries" },
382         { NET_TCP_ABORT_ON_OVERFLOW,            "tcp_abort_on_overflow" },
383         { NET_TCP_SYNACK_RETRIES,               "tcp_synack_retries" },
384         { NET_TCP_MAX_ORPHANS,                  "tcp_max_orphans" },
385         { NET_TCP_MAX_TW_BUCKETS,               "tcp_max_tw_buckets" },
386         { NET_TCP_FACK,                         "tcp_fack" },
387         { NET_TCP_REORDERING,                   "tcp_reordering" },
388         { NET_TCP_ECN,                          "tcp_ecn" },
389         { NET_TCP_DSACK,                        "tcp_dsack" },
390         { NET_TCP_MEM,                          "tcp_mem" },
391         { NET_TCP_WMEM,                         "tcp_wmem" },
392         { NET_TCP_RMEM,                         "tcp_rmem" },
393         { NET_TCP_APP_WIN,                      "tcp_app_win" },
394         { NET_TCP_ADV_WIN_SCALE,                "tcp_adv_win_scale" },
395         { NET_IPV4_NONLOCAL_BIND,               "ip_nonlocal_bind" },
396         { NET_IPV4_ICMP_RATELIMIT,              "icmp_ratelimit" },
397         { NET_IPV4_ICMP_RATEMASK,               "icmp_ratemask" },
398         { NET_TCP_TW_REUSE,                     "tcp_tw_reuse" },
399         { NET_TCP_FRTO,                         "tcp_frto" },
400         { NET_TCP_LOW_LATENCY,                  "tcp_low_latency" },
401         { NET_IPV4_IPFRAG_SECRET_INTERVAL,      "ipfrag_secret_interval" },
402         { NET_IPV4_IGMP_MAX_MSF,                "igmp_max_msf" },
403         { NET_TCP_NO_METRICS_SAVE,              "tcp_no_metrics_save" },
404         /* NET_TCP_DEFAULT_WIN_SCALE unused */
405         { NET_TCP_MODERATE_RCVBUF,              "tcp_moderate_rcvbuf" },
406         { NET_TCP_TSO_WIN_DIVISOR,              "tcp_tso_win_divisor" },
407         /* NET_TCP_BIC_BETA unused */
408         { NET_IPV4_ICMP_ERRORS_USE_INBOUND_IFADDR,      "icmp_errors_use_inbound_ifaddr" },
409         { NET_TCP_CONG_CONTROL,                 "tcp_congestion_control" },
410         { NET_TCP_ABC,                          "tcp_abc" },
411         { NET_IPV4_IPFRAG_MAX_DIST,             "ipfrag_max_dist" },
412         { NET_TCP_MTU_PROBING,                  "tcp_mtu_probing" },
413         { NET_TCP_BASE_MSS,                     "tcp_base_mss" },
414         { NET_IPV4_TCP_WORKAROUND_SIGNED_WINDOWS,       "tcp_workaround_signed_windows" },
415         { NET_TCP_DMA_COPYBREAK,                "tcp_dma_copybreak" },
416         { NET_TCP_SLOW_START_AFTER_IDLE,        "tcp_slow_start_after_idle" },
417         { NET_CIPSOV4_CACHE_ENABLE,             "cipso_cache_enable" },
418         { NET_CIPSOV4_CACHE_BUCKET_SIZE,        "cipso_cache_bucket_size" },
419         { NET_CIPSOV4_RBM_OPTFMT,               "cipso_rbm_optfmt" },
420         { NET_CIPSOV4_RBM_STRICTVALID,          "cipso_rbm_strictvalid" },
421         { NET_TCP_AVAIL_CONG_CONTROL,           "tcp_available_congestion_control" },
422         { NET_TCP_ALLOWED_CONG_CONTROL,         "tcp_allowed_congestion_control" },
423         { NET_TCP_MAX_SSTHRESH,                 "tcp_max_ssthresh" },
424         { NET_TCP_FRTO_RESPONSE,                "tcp_frto_response" },
425         { 2088 /* NET_IPQ_QMAX */,              "ip_queue_maxlen" },
426         {}
427 };
428
429 static struct trans_ctl_table trans_net_ipx_table[] = {
430         { NET_IPX_PPROP_BROADCASTING,   "ipx_pprop_broadcasting" },
431         /* NET_IPX_FORWARDING unused */
432         {}
433 };
434
435 static struct trans_ctl_table trans_net_atalk_table[] = {
436         { NET_ATALK_AARP_EXPIRY_TIME,           "aarp-expiry-time" },
437         { NET_ATALK_AARP_TICK_TIME,             "aarp-tick-time" },
438         { NET_ATALK_AARP_RETRANSMIT_LIMIT,      "aarp-retransmit-limit" },
439         { NET_ATALK_AARP_RESOLVE_TIME,          "aarp-resolve-time" },
440         {},
441 };
442
443 static struct trans_ctl_table trans_net_netrom_table[] = {
444         { NET_NETROM_DEFAULT_PATH_QUALITY,              "default_path_quality" },
445         { NET_NETROM_OBSOLESCENCE_COUNT_INITIALISER,    "obsolescence_count_initialiser" },
446         { NET_NETROM_NETWORK_TTL_INITIALISER,           "network_ttl_initialiser" },
447         { NET_NETROM_TRANSPORT_TIMEOUT,                 "transport_timeout" },
448         { NET_NETROM_TRANSPORT_MAXIMUM_TRIES,           "transport_maximum_tries" },
449         { NET_NETROM_TRANSPORT_ACKNOWLEDGE_DELAY,       "transport_acknowledge_delay" },
450         { NET_NETROM_TRANSPORT_BUSY_DELAY,              "transport_busy_delay" },
451         { NET_NETROM_TRANSPORT_REQUESTED_WINDOW_SIZE,   "transport_requested_window_size" },
452         { NET_NETROM_TRANSPORT_NO_ACTIVITY_TIMEOUT,     "transport_no_activity_timeout" },
453         { NET_NETROM_ROUTING_CONTROL,                   "routing_control" },
454         { NET_NETROM_LINK_FAILS_COUNT,                  "link_fails_count" },
455         { NET_NETROM_RESET,                             "reset" },
456         {}
457 };
458
459 static struct trans_ctl_table trans_net_ax25_table[] = {
460         { NET_AX25_IP_DEFAULT_MODE,     "ip_default_mode" },
461         { NET_AX25_DEFAULT_MODE,        "ax25_default_mode" },
462         { NET_AX25_BACKOFF_TYPE,        "backoff_type" },
463         { NET_AX25_CONNECT_MODE,        "connect_mode" },
464         { NET_AX25_STANDARD_WINDOW,     "standard_window_size" },
465         { NET_AX25_EXTENDED_WINDOW,     "extended_window_size" },
466         { NET_AX25_T1_TIMEOUT,          "t1_timeout" },
467         { NET_AX25_T2_TIMEOUT,          "t2_timeout" },
468         { NET_AX25_T3_TIMEOUT,          "t3_timeout" },
469         { NET_AX25_IDLE_TIMEOUT,        "idle_timeout" },
470         { NET_AX25_N2,                  "maximum_retry_count" },
471         { NET_AX25_PACLEN,              "maximum_packet_length" },
472         { NET_AX25_PROTOCOL,            "protocol" },
473         { NET_AX25_DAMA_SLAVE_TIMEOUT,  "dama_slave_timeout" },
474         {}
475 };
476
477 static struct trans_ctl_table trans_net_bridge_table[] = {
478         { NET_BRIDGE_NF_CALL_ARPTABLES,         "bridge-nf-call-arptables" },
479         { NET_BRIDGE_NF_CALL_IPTABLES,          "bridge-nf-call-iptables" },
480         { NET_BRIDGE_NF_CALL_IP6TABLES,         "bridge-nf-call-ip6tables" },
481         { NET_BRIDGE_NF_FILTER_VLAN_TAGGED,     "bridge-nf-filter-vlan-tagged" },
482         { NET_BRIDGE_NF_FILTER_PPPOE_TAGGED,    "bridge-nf-filter-pppoe-tagged" },
483         {}
484 };
485
486 static struct trans_ctl_table trans_net_rose_table[] = {
487         { NET_ROSE_RESTART_REQUEST_TIMEOUT,     "restart_request_timeout" },
488         { NET_ROSE_CALL_REQUEST_TIMEOUT,        "call_request_timeout" },
489         { NET_ROSE_RESET_REQUEST_TIMEOUT,       "reset_request_timeout" },
490         { NET_ROSE_CLEAR_REQUEST_TIMEOUT,       "clear_request_timeout" },
491         { NET_ROSE_ACK_HOLD_BACK_TIMEOUT,       "acknowledge_hold_back_timeout" },
492         { NET_ROSE_ROUTING_CONTROL,             "routing_control" },
493         { NET_ROSE_LINK_FAIL_TIMEOUT,           "link_fail_timeout" },
494         { NET_ROSE_MAX_VCS,                     "maximum_virtual_circuits" },
495         { NET_ROSE_WINDOW_SIZE,                 "window_size" },
496         { NET_ROSE_NO_ACTIVITY_TIMEOUT,         "no_activity_timeout" },
497         {}
498 };
499
500 static struct trans_ctl_table trans_net_ipv6_conf_var_table[] = {
501         { NET_IPV6_FORWARDING,                  "forwarding" },
502         { NET_IPV6_HOP_LIMIT,                   "hop_limit" },
503         { NET_IPV6_MTU,                         "mtu" },
504         { NET_IPV6_ACCEPT_RA,                   "accept_ra" },
505         { NET_IPV6_ACCEPT_REDIRECTS,            "accept_redirects" },
506         { NET_IPV6_AUTOCONF,                    "autoconf" },
507         { NET_IPV6_DAD_TRANSMITS,               "dad_transmits" },
508         { NET_IPV6_RTR_SOLICITS,                "router_solicitations" },
509         { NET_IPV6_RTR_SOLICIT_INTERVAL,        "router_solicitation_interval" },
510         { NET_IPV6_RTR_SOLICIT_DELAY,           "router_solicitation_delay" },
511         { NET_IPV6_USE_TEMPADDR,                "use_tempaddr" },
512         { NET_IPV6_TEMP_VALID_LFT,              "temp_valid_lft" },
513         { NET_IPV6_TEMP_PREFERED_LFT,           "temp_prefered_lft" },
514         { NET_IPV6_REGEN_MAX_RETRY,             "regen_max_retry" },
515         { NET_IPV6_MAX_DESYNC_FACTOR,           "max_desync_factor" },
516         { NET_IPV6_MAX_ADDRESSES,               "max_addresses" },
517         { NET_IPV6_FORCE_MLD_VERSION,           "force_mld_version" },
518         { NET_IPV6_ACCEPT_RA_DEFRTR,            "accept_ra_defrtr" },
519         { NET_IPV6_ACCEPT_RA_PINFO,             "accept_ra_pinfo" },
520         { NET_IPV6_ACCEPT_RA_RTR_PREF,          "accept_ra_rtr_pref" },
521         { NET_IPV6_RTR_PROBE_INTERVAL,          "router_probe_interval" },
522         { NET_IPV6_ACCEPT_RA_RT_INFO_MAX_PLEN,  "accept_ra_rt_info_max_plen" },
523         { NET_IPV6_PROXY_NDP,                   "proxy_ndp" },
524         { NET_IPV6_ACCEPT_SOURCE_ROUTE,         "accept_source_route" },
525         {}
526 };
527
528 static struct trans_ctl_table trans_net_ipv6_conf_table[] = {
529         { NET_PROTO_CONF_ALL,           "all",  trans_net_ipv6_conf_var_table },
530         { NET_PROTO_CONF_DEFAULT,       "default", trans_net_ipv6_conf_var_table },
531         { 0, NULL, trans_net_ipv6_conf_var_table },
532         {}
533 };
534
535 static struct trans_ctl_table trans_net_ipv6_route_table[] = {
536         { NET_IPV6_ROUTE_FLUSH,                 "flush" },
537         { NET_IPV6_ROUTE_GC_THRESH,             "gc_thresh" },
538         { NET_IPV6_ROUTE_MAX_SIZE,              "max_size" },
539         { NET_IPV6_ROUTE_GC_MIN_INTERVAL,       "gc_min_interval" },
540         { NET_IPV6_ROUTE_GC_TIMEOUT,            "gc_timeout" },
541         { NET_IPV6_ROUTE_GC_INTERVAL,           "gc_interval" },
542         { NET_IPV6_ROUTE_GC_ELASTICITY,         "gc_elasticity" },
543         { NET_IPV6_ROUTE_MTU_EXPIRES,           "mtu_expires" },
544         { NET_IPV6_ROUTE_MIN_ADVMSS,            "min_adv_mss" },
545         { NET_IPV6_ROUTE_GC_MIN_INTERVAL_MS,    "gc_min_interval_ms" },
546         {}
547 };
548
549 static struct trans_ctl_table trans_net_ipv6_icmp_table[] = {
550         { NET_IPV6_ICMP_RATELIMIT,      "ratelimit" },
551         {}
552 };
553
554 static struct trans_ctl_table trans_net_ipv6_table[] = {
555         { NET_IPV6_CONF,                "conf",         trans_net_ipv6_conf_table },
556         { NET_IPV6_NEIGH,               "neigh",        trans_net_neigh_table },
557         { NET_IPV6_ROUTE,               "route",        trans_net_ipv6_route_table },
558         { NET_IPV6_ICMP,                "icmp",         trans_net_ipv6_icmp_table },
559         { NET_IPV6_BINDV6ONLY,          "bindv6only" },
560         { NET_IPV6_IP6FRAG_HIGH_THRESH, "ip6frag_high_thresh" },
561         { NET_IPV6_IP6FRAG_LOW_THRESH,  "ip6frag_low_thresh" },
562         { NET_IPV6_IP6FRAG_TIME,        "ip6frag_time" },
563         { NET_IPV6_IP6FRAG_SECRET_INTERVAL,     "ip6frag_secret_interval" },
564         { NET_IPV6_MLD_MAX_MSF,         "mld_max_msf" },
565         { 2088 /* IPQ_QMAX */,          "ip6_queue_maxlen" },
566         {}
567 };
568
569 static struct trans_ctl_table trans_net_x25_table[] = {
570         { NET_X25_RESTART_REQUEST_TIMEOUT,      "restart_request_timeout" },
571         { NET_X25_CALL_REQUEST_TIMEOUT,         "call_request_timeout" },
572         { NET_X25_RESET_REQUEST_TIMEOUT,        "reset_request_timeout" },
573         { NET_X25_CLEAR_REQUEST_TIMEOUT,        "clear_request_timeout" },
574         { NET_X25_ACK_HOLD_BACK_TIMEOUT,        "acknowledgement_hold_back_timeout" },
575         { NET_X25_FORWARD,                      "x25_forward" },
576         {}
577 };
578
579 static struct trans_ctl_table trans_net_tr_table[] = {
580         { NET_TR_RIF_TIMEOUT,   "rif_timeout" },
581         {}
582 };
583
584
585 static struct trans_ctl_table trans_net_decnet_conf_vars[] = {
586         { NET_DECNET_CONF_DEV_FORWARDING,       "forwarding" },
587         { NET_DECNET_CONF_DEV_PRIORITY,         "priority" },
588         { NET_DECNET_CONF_DEV_T2,               "t2" },
589         { NET_DECNET_CONF_DEV_T3,               "t3" },
590         {}
591 };
592
593 static struct trans_ctl_table trans_net_decnet_conf[] = {
594         { 0, NULL, trans_net_decnet_conf_vars },
595         {}
596 };
597
598 static struct trans_ctl_table trans_net_decnet_table[] = {
599         { NET_DECNET_CONF,              "conf", trans_net_decnet_conf },
600         { NET_DECNET_NODE_ADDRESS,      "node_address" },
601         { NET_DECNET_NODE_NAME,         "node_name" },
602         { NET_DECNET_DEFAULT_DEVICE,    "default_device" },
603         { NET_DECNET_TIME_WAIT,         "time_wait" },
604         { NET_DECNET_DN_COUNT,          "dn_count" },
605         { NET_DECNET_DI_COUNT,          "di_count" },
606         { NET_DECNET_DR_COUNT,          "dr_count" },
607         { NET_DECNET_DST_GC_INTERVAL,   "dst_gc_interval" },
608         { NET_DECNET_NO_FC_MAX_CWND,    "no_fc_max_cwnd" },
609         { NET_DECNET_MEM,               "decnet_mem" },
610         { NET_DECNET_RMEM,              "decnet_rmem" },
611         { NET_DECNET_WMEM,              "decnet_wmem" },
612         { NET_DECNET_DEBUG_LEVEL,       "debug" },
613         {}
614 };
615
616 static struct trans_ctl_table trans_net_sctp_table[] = {
617         { NET_SCTP_RTO_INITIAL,         "rto_initial" },
618         { NET_SCTP_RTO_MIN,             "rto_min" },
619         { NET_SCTP_RTO_MAX,             "rto_max" },
620         { NET_SCTP_RTO_ALPHA,           "rto_alpha_exp_divisor" },
621         { NET_SCTP_RTO_BETA,            "rto_beta_exp_divisor" },
622         { NET_SCTP_VALID_COOKIE_LIFE,   "valid_cookie_life" },
623         { NET_SCTP_ASSOCIATION_MAX_RETRANS,     "association_max_retrans" },
624         { NET_SCTP_PATH_MAX_RETRANS,    "path_max_retrans" },
625         { NET_SCTP_MAX_INIT_RETRANSMITS,        "max_init_retransmits" },
626         { NET_SCTP_HB_INTERVAL,         "hb_interval" },
627         { NET_SCTP_PRESERVE_ENABLE,     "cookie_preserve_enable" },
628         { NET_SCTP_MAX_BURST,           "max_burst" },
629         { NET_SCTP_ADDIP_ENABLE,        "addip_enable" },
630         { NET_SCTP_PRSCTP_ENABLE,       "prsctp_enable" },
631         { NET_SCTP_SNDBUF_POLICY,       "sndbuf_policy" },
632         { NET_SCTP_SACK_TIMEOUT,        "sack_timeout" },
633         { NET_SCTP_RCVBUF_POLICY,       "rcvbuf_policy" },
634         {}
635 };
636
637 static struct trans_ctl_table trans_net_llc_llc2_timeout_table[] = {
638         { NET_LLC2_ACK_TIMEOUT,         "ack" },
639         { NET_LLC2_P_TIMEOUT,           "p" },
640         { NET_LLC2_REJ_TIMEOUT,         "rej" },
641         { NET_LLC2_BUSY_TIMEOUT,        "busy" },
642         {}
643 };
644
645 static struct trans_ctl_table trans_net_llc_station_table[] = {
646         { NET_LLC_STATION_ACK_TIMEOUT,  "ack_timeout" },
647         {}
648 };
649
650 static struct trans_ctl_table trans_net_llc_llc2_table[] = {
651         { NET_LLC2,             "timeout",      trans_net_llc_llc2_timeout_table },
652         {}
653 };
654
655 static struct trans_ctl_table trans_net_llc_table[] = {
656         { NET_LLC2,             "llc2",         trans_net_llc_llc2_table },
657         { NET_LLC_STATION,      "station",      trans_net_llc_station_table },
658         {}
659 };
660
661 static struct trans_ctl_table trans_net_netfilter_table[] = {
662         { NET_NF_CONNTRACK_MAX,                         "nf_conntrack_max" },
663         { NET_NF_CONNTRACK_TCP_TIMEOUT_SYN_SENT,        "nf_conntrack_tcp_timeout_syn_sent" },
664         { NET_NF_CONNTRACK_TCP_TIMEOUT_SYN_RECV,        "nf_conntrack_tcp_timeout_syn_recv" },
665         { NET_NF_CONNTRACK_TCP_TIMEOUT_ESTABLISHED,     "nf_conntrack_tcp_timeout_established" },
666         { NET_NF_CONNTRACK_TCP_TIMEOUT_FIN_WAIT,        "nf_conntrack_tcp_timeout_fin_wait" },
667         { NET_NF_CONNTRACK_TCP_TIMEOUT_CLOSE_WAIT,      "nf_conntrack_tcp_timeout_close_wait" },
668         { NET_NF_CONNTRACK_TCP_TIMEOUT_LAST_ACK,        "nf_conntrack_tcp_timeout_last_ack" },
669         { NET_NF_CONNTRACK_TCP_TIMEOUT_TIME_WAIT,       "nf_conntrack_tcp_timeout_time_wait" },
670         { NET_NF_CONNTRACK_TCP_TIMEOUT_CLOSE,           "nf_conntrack_tcp_timeout_close" },
671         { NET_NF_CONNTRACK_UDP_TIMEOUT,                 "nf_conntrack_udp_timeout" },
672         { NET_NF_CONNTRACK_UDP_TIMEOUT_STREAM,          "nf_conntrack_udp_timeout_stream" },
673         { NET_NF_CONNTRACK_ICMP_TIMEOUT,        "nf_conntrack_icmp_timeout" },
674         { NET_NF_CONNTRACK_GENERIC_TIMEOUT,             "nf_conntrack_generic_timeout" },
675         { NET_NF_CONNTRACK_BUCKETS,                     "nf_conntrack_buckets" },
676         { NET_NF_CONNTRACK_LOG_INVALID,                 "nf_conntrack_log_invalid" },
677         { NET_NF_CONNTRACK_TCP_TIMEOUT_MAX_RETRANS,     "nf_conntrack_tcp_timeout_max_retrans" },
678         { NET_NF_CONNTRACK_TCP_LOOSE,                   "nf_conntrack_tcp_loose" },
679         { NET_NF_CONNTRACK_TCP_BE_LIBERAL,              "nf_conntrack_tcp_be_liberal" },
680         { NET_NF_CONNTRACK_TCP_MAX_RETRANS,             "nf_conntrack_tcp_max_retrans" },
681         { NET_NF_CONNTRACK_SCTP_TIMEOUT_CLOSED,         "nf_conntrack_sctp_timeout_closed" },
682         { NET_NF_CONNTRACK_SCTP_TIMEOUT_COOKIE_WAIT,    "nf_conntrack_sctp_timeout_cookie_wait" },
683         { NET_NF_CONNTRACK_SCTP_TIMEOUT_COOKIE_ECHOED,  "nf_conntrack_sctp_timeout_cookie_echoed" },
684         { NET_NF_CONNTRACK_SCTP_TIMEOUT_ESTABLISHED,    "nf_conntrack_sctp_timeout_established" },
685         { NET_NF_CONNTRACK_SCTP_TIMEOUT_SHUTDOWN_SENT,  "nf_conntrack_sctp_timeout_shutdown_sent" },
686         { NET_NF_CONNTRACK_SCTP_TIMEOUT_SHUTDOWN_RECD,  "nf_conntrack_sctp_timeout_shutdown_recd" },
687         { NET_NF_CONNTRACK_SCTP_TIMEOUT_SHUTDOWN_ACK_SENT,      "nf_conntrack_sctp_timeout_shutdown_ack_sent" },
688         { NET_NF_CONNTRACK_COUNT,                       "nf_conntrack_count" },
689         { NET_NF_CONNTRACK_ICMPV6_TIMEOUT,      "nf_conntrack_icmpv6_timeout" },
690         { NET_NF_CONNTRACK_FRAG6_TIMEOUT,               "nf_conntrack_frag6_timeout" },
691         { NET_NF_CONNTRACK_FRAG6_LOW_THRESH,            "nf_conntrack_frag6_low_thresh" },
692         { NET_NF_CONNTRACK_FRAG6_HIGH_THRESH,           "nf_conntrack_frag6_high_thresh" },
693         { NET_NF_CONNTRACK_CHECKSUM,                    "nf_conntrack_checksum" },
694
695         {}
696 };
697
698 static struct trans_ctl_table trans_net_dccp_table[] = {
699         { NET_DCCP_DEFAULT,     "default" },
700         {}
701 };
702
703 static struct trans_ctl_table trans_net_irda_table[] = {
704         { NET_IRDA_DISCOVERY,           "discovery" },
705         { NET_IRDA_DEVNAME,             "devname" },
706         { NET_IRDA_DEBUG,               "debug" },
707         { NET_IRDA_FAST_POLL,           "fast_poll_increase" },
708         { NET_IRDA_DISCOVERY_SLOTS,     "discovery_slots" },
709         { NET_IRDA_DISCOVERY_TIMEOUT,   "discovery_timeout" },
710         { NET_IRDA_SLOT_TIMEOUT,        "slot_timeout" },
711         { NET_IRDA_MAX_BAUD_RATE,       "max_baud_rate" },
712         { NET_IRDA_MIN_TX_TURN_TIME,    "min_tx_turn_time" },
713         { NET_IRDA_MAX_TX_DATA_SIZE,    "max_tx_data_size" },
714         { NET_IRDA_MAX_TX_WINDOW,       "max_tx_window" },
715         { NET_IRDA_MAX_NOREPLY_TIME,    "max_noreply_time" },
716         { NET_IRDA_WARN_NOREPLY_TIME,   "warn_noreply_time" },
717         { NET_IRDA_LAP_KEEPALIVE_TIME,  "lap_keepalive_time" },
718         {}
719 };
720
721 static struct trans_ctl_table trans_net_table[] = {
722         { NET_CORE,             "core",         trans_net_core_table },
723         /* NET_ETHER not used */
724         /* NET_802 not used */
725         { NET_UNIX,             "unix",         trans_net_unix_table },
726         { NET_IPV4,             "ipv4",         trans_net_ipv4_table },
727         { NET_IPX,              "ipx",          trans_net_ipx_table },
728         { NET_ATALK,            "appletalk",    trans_net_atalk_table },
729         { NET_NETROM,           "netrom",       trans_net_netrom_table },
730         { NET_AX25,             "ax25",         trans_net_ax25_table },
731         { NET_BRIDGE,           "bridge",       trans_net_bridge_table },
732         { NET_ROSE,             "rose",         trans_net_rose_table },
733         { NET_IPV6,             "ipv6",         trans_net_ipv6_table },
734         { NET_X25,              "x25",          trans_net_x25_table },
735         { NET_TR,               "token-ring",   trans_net_tr_table },
736         { NET_DECNET,           "decnet",       trans_net_decnet_table },
737         /*  NET_ECONET not used */
738         { NET_SCTP,             "sctp",         trans_net_sctp_table },
739         { NET_LLC,              "llc",          trans_net_llc_table },
740         { NET_NETFILTER,        "netfilter",    trans_net_netfilter_table },
741         { NET_DCCP,             "dccp",         trans_net_dccp_table },
742         { NET_IRDA,             "irda",         trans_net_irda_table },
743         { 2089,                 "nf_conntrack_max" },
744         {}
745 };
746
747 static struct trans_ctl_table trans_fs_quota_table[] = {
748         { FS_DQ_LOOKUPS,        "lookups" },
749         { FS_DQ_DROPS,          "drops" },
750         { FS_DQ_READS,          "reads" },
751         { FS_DQ_WRITES,         "writes" },
752         { FS_DQ_CACHE_HITS,     "cache_hits" },
753         { FS_DQ_ALLOCATED,      "allocated_dquots" },
754         { FS_DQ_FREE,           "free_dquots" },
755         { FS_DQ_SYNCS,          "syncs" },
756         { FS_DQ_WARNINGS,       "warnings" },
757         {}
758 };
759
760 static struct trans_ctl_table trans_fs_xfs_table[] = {
761         { XFS_RESTRICT_CHOWN,   "restrict_chown" },
762         { XFS_SGID_INHERIT,     "irix_sgid_inherit" },
763         { XFS_SYMLINK_MODE,     "irix_symlink_mode" },
764         { XFS_PANIC_MASK,       "panic_mask" },
765
766         { XFS_ERRLEVEL,         "error_level" },
767         { XFS_SYNCD_TIMER,      "xfssyncd_centisecs" },
768         { XFS_INHERIT_SYNC,     "inherit_sync" },
769         { XFS_INHERIT_NODUMP,   "inherit_nodump" },
770         { XFS_INHERIT_NOATIME,  "inherit_noatime" },
771         { XFS_BUF_TIMER,        "xfsbufd_centisecs" },
772         { XFS_BUF_AGE,          "age_buffer_centisecs" },
773         { XFS_INHERIT_NOSYM,    "inherit_nosymlinks" },
774         { XFS_ROTORSTEP,        "rotorstep" },
775         { XFS_INHERIT_NODFRG,   "inherit_nodefrag" },
776         { XFS_FILESTREAM_TIMER, "filestream_centisecs" },
777         { XFS_STATS_CLEAR,      "stats_clear" },
778         {}
779 };
780
781 static struct trans_ctl_table trans_fs_ocfs2_nm_table[] = {
782         { 1, "hb_ctl_path" },
783         {}
784 };
785
786 static struct trans_ctl_table trans_fs_ocfs2_table[] = {
787         { 1,    "nm",   trans_fs_ocfs2_nm_table },
788         {}
789 };
790
791 static struct trans_ctl_table trans_inotify_table[] = {
792         { INOTIFY_MAX_USER_INSTANCES,   "max_user_instances" },
793         { INOTIFY_MAX_USER_WATCHES,     "max_user_watches" },
794         { INOTIFY_MAX_QUEUED_EVENTS,    "max_queued_events" },
795         {}
796 };
797
798 static struct trans_ctl_table trans_fs_table[] = {
799         { FS_NRINODE,           "inode-nr" },
800         { FS_STATINODE,         "inode-state" },
801         /* FS_MAXINODE unused */
802         /* FS_NRDQUOT unused */
803         /* FS_MAXDQUOT unused */
804         { FS_NRFILE,            "file-nr" },
805         { FS_MAXFILE,           "file-max" },
806         { FS_DENTRY,            "dentry-state" },
807         /* FS_NRSUPER unused */
808         /* FS_MAXUPSER unused */
809         { FS_OVERFLOWUID,       "overflowuid" },
810         { FS_OVERFLOWGID,       "overflowgid" },
811         { FS_LEASES,            "leases-enable" },
812         { FS_DIR_NOTIFY,        "dir-notify-enable" },
813         { FS_LEASE_TIME,        "lease-break-time" },
814         { FS_DQSTATS,           "quota",                trans_fs_quota_table },
815         { FS_XFS,               "xfs",                  trans_fs_xfs_table },
816         { FS_AIO_NR,            "aio-nr" },
817         { FS_AIO_MAX_NR,        "aio-max-nr" },
818         { FS_INOTIFY,           "inotify",              trans_inotify_table },
819         { FS_OCFS2,             "ocfs2",                trans_fs_ocfs2_table },
820         { KERN_SETUID_DUMPABLE, "suid_dumpable" },
821         {}
822 };
823
824 static struct trans_ctl_table trans_debug_table[] = {
825         {}
826 };
827
828 static struct trans_ctl_table trans_cdrom_table[] = {
829         { DEV_CDROM_INFO,               "info" },
830         { DEV_CDROM_AUTOCLOSE,          "autoclose" },
831         { DEV_CDROM_AUTOEJECT,          "autoeject" },
832         { DEV_CDROM_DEBUG,              "debug" },
833         { DEV_CDROM_LOCK,               "lock" },
834         { DEV_CDROM_CHECK_MEDIA,        "check_media" },
835         {}
836 };
837
838 static struct trans_ctl_table trans_ipmi_table[] = {
839         { DEV_IPMI_POWEROFF_POWERCYCLE, "poweroff_powercycle" },
840         {}
841 };
842
843 static struct trans_ctl_table trans_mac_hid_files[] = {
844         /* DEV_MAC_HID_KEYBOARD_SENDS_LINUX_KEYCODES unused */
845         /* DEV_MAC_HID_KEYBOARD_LOCK_KEYCODES unused */
846         { DEV_MAC_HID_MOUSE_BUTTON_EMULATION,   "mouse_button_emulation" },
847         { DEV_MAC_HID_MOUSE_BUTTON2_KEYCODE,    "mouse_button2_keycode" },
848         { DEV_MAC_HID_MOUSE_BUTTON3_KEYCODE,    "mouse_button3_keycode" },
849         /* DEV_MAC_HID_ADB_MOUSE_SENDS_KEYCODES unused */
850         {}
851 };
852
853 static struct trans_ctl_table trans_raid_table[] = {
854         { DEV_RAID_SPEED_LIMIT_MIN,     "speed_limit_min" },
855         { DEV_RAID_SPEED_LIMIT_MAX,     "speed_limit_max" },
856         {}
857 };
858
859 static struct trans_ctl_table trans_scsi_table[] = {
860         { DEV_SCSI_LOGGING_LEVEL, "logging_level" },
861         {}
862 };
863
864 static struct trans_ctl_table trans_parport_default_table[] = {
865         { DEV_PARPORT_DEFAULT_TIMESLICE,        "timeslice" },
866         { DEV_PARPORT_DEFAULT_SPINTIME,         "spintime" },
867         {}
868 };
869
870 static struct trans_ctl_table trans_parport_device_table[] = {
871         { DEV_PARPORT_DEVICE_TIMESLICE,         "timeslice" },
872         {}
873 };
874
875 static struct trans_ctl_table trans_parport_devices_table[] = {
876         { DEV_PARPORT_DEVICES_ACTIVE,           "active" },
877         { 0, NULL, trans_parport_device_table },
878         {}
879 };
880
881 static struct trans_ctl_table trans_parport_parport_table[] = {
882         { DEV_PARPORT_SPINTIME,         "spintime" },
883         { DEV_PARPORT_BASE_ADDR,        "base-addr" },
884         { DEV_PARPORT_IRQ,              "irq" },
885         { DEV_PARPORT_DMA,              "dma" },
886         { DEV_PARPORT_MODES,            "modes" },
887         { DEV_PARPORT_DEVICES,          "devices",      trans_parport_devices_table },
888         { DEV_PARPORT_AUTOPROBE,        "autoprobe" },
889         { DEV_PARPORT_AUTOPROBE + 1,    "autoprobe0" },
890         { DEV_PARPORT_AUTOPROBE + 2,    "autoprobe1" },
891         { DEV_PARPORT_AUTOPROBE + 3,    "autoprobe2" },
892         { DEV_PARPORT_AUTOPROBE + 4,    "autoprobe3" },
893         {}
894 };
895 static struct trans_ctl_table trans_parport_table[] = {
896         { DEV_PARPORT_DEFAULT,  "default",      trans_parport_default_table },
897         { 0, NULL, trans_parport_parport_table },
898         {}
899 };
900
901 static struct trans_ctl_table trans_dev_table[] = {
902         { DEV_CDROM,    "cdrom",        trans_cdrom_table },
903         /* DEV_HWMON unused */
904         { DEV_PARPORT,  "parport",      trans_parport_table },
905         { DEV_RAID,     "raid",         trans_raid_table },
906         { DEV_MAC_HID,  "mac_hid",      trans_mac_hid_files },
907         { DEV_SCSI,     "scsi",         trans_scsi_table },
908         { DEV_IPMI,     "ipmi",         trans_ipmi_table },
909         {}
910 };
911
912 static struct trans_ctl_table trans_bus_isa_table[] = {
913         { BUS_ISA_MEM_BASE,     "membase" },
914         { BUS_ISA_PORT_BASE,    "portbase" },
915         { BUS_ISA_PORT_SHIFT,   "portshift" },
916         {}
917 };
918
919 static struct trans_ctl_table trans_bus_table[] = {
920         { CTL_BUS_ISA,  "isa",  trans_bus_isa_table },
921         {}
922 };
923
924 static struct trans_ctl_table trans_arlan_conf_table0[] = {
925         { 1,    "spreadingCode" },
926         { 2,    "channelNumber" },
927         { 3,    "scramblingDisable" },
928         { 4,    "txAttenuation" },
929         { 5,    "systemId" },
930         { 6,    "maxDatagramSize" },
931         { 7,    "maxFrameSize" },
932         { 8,    "maxRetries" },
933         { 9,    "receiveMode" },
934         { 10,   "priority" },
935         { 11,   "rootOrRepeater" },
936         { 12,   "SID" },
937         { 13,   "registrationMode" },
938         { 14,   "registrationFill" },
939         { 15,   "localTalkAddress" },
940         { 16,   "codeFormat" },
941         { 17,   "numChannels" },
942         { 18,   "channel1" },
943         { 19,   "channel2" },
944         { 20,   "channel3" },
945         { 21,   "channel4" },
946         { 22,   "txClear" },
947         { 23,   "txRetries" },
948         { 24,   "txRouting" },
949         { 25,   "txScrambled" },
950         { 26,   "rxParameter" },
951         { 27,   "txTimeoutMs" },
952         { 28,   "waitCardTimeout" },
953         { 29,   "channelSet" },
954         { 30,   "name" },
955         { 31,   "waitTime" },
956         { 32,   "lParameter" },
957         { 33,   "_15" },
958         { 34,   "headerSize" },
959         { 36,   "tx_delay_ms" },
960         { 37,   "retries" },
961         { 38,   "ReTransmitPacketMaxSize" },
962         { 39,   "waitReTransmitPacketMaxSize" },
963         { 40,   "fastReTransCount" },
964         { 41,   "driverRetransmissions" },
965         { 42,   "txAckTimeoutMs" },
966         { 43,   "registrationInterrupts" },
967         { 44,   "hardwareType" },
968         { 45,   "radioType" },
969         { 46,   "writeEEPROM" },
970         { 47,   "writeRadioType" },
971         { 48,   "entry_exit_debug" },
972         { 49,   "debug" },
973         { 50,   "in_speed" },
974         { 51,   "out_speed" },
975         { 52,   "in_speed10" },
976         { 53,   "out_speed10" },
977         { 54,   "in_speed_max" },
978         { 55,   "out_speed_max" },
979         { 56,   "measure_rate" },
980         { 57,   "pre_Command_Wait" },
981         { 58,   "rx_tweak1" },
982         { 59,   "rx_tweak2" },
983         { 60,   "tx_queue_len" },
984
985         { 150,  "arlan0-txRing" },
986         { 151,  "arlan0-rxRing" },
987         { 152,  "arlan0-18" },
988         { 153,  "arlan0-ring" },
989         { 154,  "arlan0-shm-cpy" },
990         { 155,  "config0" },
991         { 156,  "reset0" },
992         {}
993 };
994
995 static struct trans_ctl_table trans_arlan_conf_table1[] = {
996         { 1,    "spreadingCode" },
997         { 2,    "channelNumber" },
998         { 3,    "scramblingDisable" },
999         { 4,    "txAttenuation" },
1000         { 5,    "systemId" },
1001         { 6,    "maxDatagramSize" },
1002         { 7,    "maxFrameSize" },
1003         { 8,    "maxRetries" },
1004         { 9,    "receiveMode" },
1005         { 10,   "priority" },
1006         { 11,   "rootOrRepeater" },
1007         { 12,   "SID" },
1008         { 13,   "registrationMode" },
1009         { 14,   "registrationFill" },
1010         { 15,   "localTalkAddress" },
1011         { 16,   "codeFormat" },
1012         { 17,   "numChannels" },
1013         { 18,   "channel1" },
1014         { 19,   "channel2" },
1015         { 20,   "channel3" },
1016         { 21,   "channel4" },
1017         { 22,   "txClear" },
1018         { 23,   "txRetries" },
1019         { 24,   "txRouting" },
1020         { 25,   "txScrambled" },
1021         { 26,   "rxParameter" },
1022         { 27,   "txTimeoutMs" },
1023         { 28,   "waitCardTimeout" },
1024         { 29,   "channelSet" },
1025         { 30,   "name" },
1026         { 31,   "waitTime" },
1027         { 32,   "lParameter" },
1028         { 33,   "_15" },
1029         { 34,   "headerSize" },
1030         { 36,   "tx_delay_ms" },
1031         { 37,   "retries" },
1032         { 38,   "ReTransmitPacketMaxSize" },
1033         { 39,   "waitReTransmitPacketMaxSize" },
1034         { 40,   "fastReTransCount" },
1035         { 41,   "driverRetransmissions" },
1036         { 42,   "txAckTimeoutMs" },
1037         { 43,   "registrationInterrupts" },
1038         { 44,   "hardwareType" },
1039         { 45,   "radioType" },
1040         { 46,   "writeEEPROM" },
1041         { 47,   "writeRadioType" },
1042         { 48,   "entry_exit_debug" },
1043         { 49,   "debug" },
1044         { 50,   "in_speed" },
1045         { 51,   "out_speed" },
1046         { 52,   "in_speed10" },
1047         { 53,   "out_speed10" },
1048         { 54,   "in_speed_max" },
1049         { 55,   "out_speed_max" },
1050         { 56,   "measure_rate" },
1051         { 57,   "pre_Command_Wait" },
1052         { 58,   "rx_tweak1" },
1053         { 59,   "rx_tweak2" },
1054         { 60,   "tx_queue_len" },
1055
1056         { 150,  "arlan1-txRing" },
1057         { 151,  "arlan1-rxRing" },
1058         { 152,  "arlan1-18" },
1059         { 153,  "arlan1-ring" },
1060         { 154,  "arlan1-shm-cpy" },
1061         { 155,  "config1" },
1062         { 156,  "reset1" },
1063         {}
1064 };
1065
1066 static struct trans_ctl_table trans_arlan_conf_table2[] = {
1067         { 1,    "spreadingCode" },
1068         { 2,    "channelNumber" },
1069         { 3,    "scramblingDisable" },
1070         { 4,    "txAttenuation" },
1071         { 5,    "systemId" },
1072         { 6,    "maxDatagramSize" },
1073         { 7,    "maxFrameSize" },
1074         { 8,    "maxRetries" },
1075         { 9,    "receiveMode" },
1076         { 10,   "priority" },
1077         { 11,   "rootOrRepeater" },
1078         { 12,   "SID" },
1079         { 13,   "registrationMode" },
1080         { 14,   "registrationFill" },
1081         { 15,   "localTalkAddress" },
1082         { 16,   "codeFormat" },
1083         { 17,   "numChannels" },
1084         { 18,   "channel1" },
1085         { 19,   "channel2" },
1086         { 20,   "channel3" },
1087         { 21,   "channel4" },
1088         { 22,   "txClear" },
1089         { 23,   "txRetries" },
1090         { 24,   "txRouting" },
1091         { 25,   "txScrambled" },
1092         { 26,   "rxParameter" },
1093         { 27,   "txTimeoutMs" },
1094         { 28,   "waitCardTimeout" },
1095         { 29,   "channelSet" },
1096         { 30,   "name" },
1097         { 31,   "waitTime" },
1098         { 32,   "lParameter" },
1099         { 33,   "_15" },
1100         { 34,   "headerSize" },
1101         { 36,   "tx_delay_ms" },
1102         { 37,   "retries" },
1103         { 38,   "ReTransmitPacketMaxSize" },
1104         { 39,   "waitReTransmitPacketMaxSize" },
1105         { 40,   "fastReTransCount" },
1106         { 41,   "driverRetransmissions" },
1107         { 42,   "txAckTimeoutMs" },
1108         { 43,   "registrationInterrupts" },
1109         { 44,   "hardwareType" },
1110         { 45,   "radioType" },
1111         { 46,   "writeEEPROM" },
1112         { 47,   "writeRadioType" },
1113         { 48,   "entry_exit_debug" },
1114         { 49,   "debug" },
1115         { 50,   "in_speed" },
1116         { 51,   "out_speed" },
1117         { 52,   "in_speed10" },
1118         { 53,   "out_speed10" },
1119         { 54,   "in_speed_max" },
1120         { 55,   "out_speed_max" },
1121         { 56,   "measure_rate" },
1122         { 57,   "pre_Command_Wait" },
1123         { 58,   "rx_tweak1" },
1124         { 59,   "rx_tweak2" },
1125         { 60,   "tx_queue_len" },
1126
1127         { 150,  "arlan2-txRing" },
1128         { 151,  "arlan2-rxRing" },
1129         { 152,  "arlan2-18" },
1130         { 153,  "arlan2-ring" },
1131         { 154,  "arlan2-shm-cpy" },
1132         { 155,  "config2" },
1133         { 156,  "reset2" },
1134         {}
1135 };
1136
1137 static struct trans_ctl_table trans_arlan_conf_table3[] = {
1138         { 1,    "spreadingCode" },
1139         { 2,    "channelNumber" },
1140         { 3,    "scramblingDisable" },
1141         { 4,    "txAttenuation" },
1142         { 5,    "systemId" },
1143         { 6,    "maxDatagramSize" },
1144         { 7,    "maxFrameSize" },
1145         { 8,    "maxRetries" },
1146         { 9,    "receiveMode" },
1147         { 10,   "priority" },
1148         { 11,   "rootOrRepeater" },
1149         { 12,   "SID" },
1150         { 13,   "registrationMode" },
1151         { 14,   "registrationFill" },
1152         { 15,   "localTalkAddress" },
1153         { 16,   "codeFormat" },
1154         { 17,   "numChannels" },
1155         { 18,   "channel1" },
1156         { 19,   "channel2" },
1157         { 20,   "channel3" },
1158         { 21,   "channel4" },
1159         { 22,   "txClear" },
1160         { 23,   "txRetries" },
1161         { 24,   "txRouting" },
1162         { 25,   "txScrambled" },
1163         { 26,   "rxParameter" },
1164         { 27,   "txTimeoutMs" },
1165         { 28,   "waitCardTimeout" },
1166         { 29,   "channelSet" },
1167         { 30,   "name" },
1168         { 31,   "waitTime" },
1169         { 32,   "lParameter" },
1170         { 33,   "_15" },
1171         { 34,   "headerSize" },
1172         { 36,   "tx_delay_ms" },
1173         { 37,   "retries" },
1174         { 38,   "ReTransmitPacketMaxSize" },
1175         { 39,   "waitReTransmitPacketMaxSize" },
1176         { 40,   "fastReTransCount" },
1177         { 41,   "driverRetransmissions" },
1178         { 42,   "txAckTimeoutMs" },
1179         { 43,   "registrationInterrupts" },
1180         { 44,   "hardwareType" },
1181         { 45,   "radioType" },
1182         { 46,   "writeEEPROM" },
1183         { 47,   "writeRadioType" },
1184         { 48,   "entry_exit_debug" },
1185         { 49,   "debug" },
1186         { 50,   "in_speed" },
1187         { 51,   "out_speed" },
1188         { 52,   "in_speed10" },
1189         { 53,   "out_speed10" },
1190         { 54,   "in_speed_max" },
1191         { 55,   "out_speed_max" },
1192         { 56,   "measure_rate" },
1193         { 57,   "pre_Command_Wait" },
1194         { 58,   "rx_tweak1" },
1195         { 59,   "rx_tweak2" },
1196         { 60,   "tx_queue_len" },
1197
1198         { 150,  "arlan3-txRing" },
1199         { 151,  "arlan3-rxRing" },
1200         { 152,  "arlan3-18" },
1201         { 153,  "arlan3-ring" },
1202         { 154,  "arlan3-shm-cpy" },
1203         { 155,  "config3" },
1204         { 156,  "reset3" },
1205         {}
1206 };
1207
1208 static struct trans_ctl_table trans_arlan_table[] = {
1209         { 1,            "arlan0",       trans_arlan_conf_table0 },
1210         { 2,            "arlan1",       trans_arlan_conf_table1 },
1211         { 3,            "arlan2",       trans_arlan_conf_table2 },
1212         { 4,            "arlan3",       trans_arlan_conf_table3 },
1213         {}
1214 };
1215
1216 static struct trans_ctl_table trans_appldata_table[] = {
1217         { CTL_APPLDATA_TIMER,           "timer" },
1218         { CTL_APPLDATA_INTERVAL,        "interval" },
1219         { CTL_APPLDATA_OS,              "os" },
1220         { CTL_APPLDATA_NET_SUM,         "net_sum" },
1221         { CTL_APPLDATA_MEM,             "mem" },
1222         {}
1223
1224 };
1225
1226 static struct trans_ctl_table trans_s390dbf_table[] = {
1227         { 5678 /* CTL_S390DBF_STOPPABLE */,     "debug_stoppable" },
1228         { 5679 /* CTL_S390DBF_ACTIVE */,        "debug_active" },
1229         {}
1230 };
1231
1232 static struct trans_ctl_table trans_sunrpc_table[] = {
1233         { CTL_RPCDEBUG,         "rpc_debug" },
1234         { CTL_NFSDEBUG,         "nfs_debug" },
1235         { CTL_NFSDDEBUG,        "nfsd_debug" },
1236         { CTL_NLMDEBUG,         "nlm_debug" },
1237         { CTL_SLOTTABLE_UDP,    "udp_slot_table_entries" },
1238         { CTL_SLOTTABLE_TCP,    "tcp_slot_table_entries" },
1239         { CTL_MIN_RESVPORT,     "min_resvport" },
1240         { CTL_MAX_RESVPORT,     "max_resvport" },
1241         {}
1242 };
1243
1244 static struct trans_ctl_table trans_pm_table[] = {
1245         { 1 /* CTL_PM_SUSPEND */,       "suspend" },
1246         { 2 /* CTL_PM_CMODE */,         "cmode" },
1247         { 3 /* CTL_PM_P0 */,            "p0" },
1248         { 4 /* CTL_PM_CM */,            "cm" },
1249         {}
1250 };
1251
1252 static struct trans_ctl_table trans_frv_table[] = {
1253         { 1,    "cache-mode" },
1254         { 2,    "pin-cxnr" },
1255         {}
1256 };
1257
1258 static struct trans_ctl_table trans_root_table[] = {
1259         { CTL_KERN,     "kernel",       trans_kern_table },
1260         { CTL_VM,       "vm",           trans_vm_table },
1261         { CTL_NET,      "net",          trans_net_table },
1262         /* CTL_PROC not used */
1263         { CTL_FS,       "fs",           trans_fs_table },
1264         { CTL_DEBUG,    "debug",        trans_debug_table },
1265         { CTL_DEV,      "dev",          trans_dev_table },
1266         { CTL_BUS,      "bus",          trans_bus_table },
1267         { CTL_ABI,      "abi" },
1268         /* CTL_CPU not used */
1269         { CTL_ARLAN,    "arlan",        trans_arlan_table },
1270         { CTL_APPLDATA, "appldata",     trans_appldata_table },
1271         { CTL_S390DBF,  "s390dbf",      trans_s390dbf_table },
1272         { CTL_SUNRPC,   "sunrpc",       trans_sunrpc_table },
1273         { CTL_PM,       "pm",           trans_pm_table },
1274         { CTL_FRV,      "frv",          trans_frv_table },
1275         {}
1276 };
1277
1278
1279
1280
1281 static int sysctl_depth(struct ctl_table *table)
1282 {
1283         struct ctl_table *tmp;
1284         int depth;
1285
1286         depth = 0;
1287         for (tmp = table; tmp->parent; tmp = tmp->parent)
1288                 depth++;
1289
1290         return depth;
1291 }
1292
1293 static struct ctl_table *sysctl_parent(struct ctl_table *table, int n)
1294 {
1295         int i;
1296
1297         for (i = 0; table && i < n; i++)
1298                 table = table->parent;
1299
1300         return table;
1301 }
1302
1303 static struct trans_ctl_table *sysctl_binary_lookup(struct ctl_table *table)
1304 {
1305         struct ctl_table *test;
1306         struct trans_ctl_table *ref;
1307         int depth, cur_depth;
1308
1309         depth = sysctl_depth(table);
1310
1311         cur_depth = depth;
1312         ref = trans_root_table;
1313 repeat:
1314         test = sysctl_parent(table, cur_depth);
1315         for (; ref->ctl_name || ref->procname || ref->child; ref++) {
1316                 int match = 0;
1317
1318                 if (cur_depth && !ref->child)
1319                         continue;
1320
1321                 if (test->procname && ref->procname &&
1322                         (strcmp(test->procname, ref->procname) == 0))
1323                         match++;
1324
1325                 if (test->ctl_name && ref->ctl_name &&
1326                         (test->ctl_name == ref->ctl_name))
1327                         match++;
1328
1329                 if (!ref->ctl_name && !ref->procname)
1330                         match++;
1331
1332                 if (match) {
1333                         if (cur_depth != 0) {
1334                                 cur_depth--;
1335                                 ref = ref->child;
1336                                 goto repeat;
1337                         }
1338                         goto out;
1339                 }
1340         }
1341         ref = NULL;
1342 out:
1343         return ref;
1344 }
1345
1346 static void sysctl_print_path(struct ctl_table *table)
1347 {
1348         struct ctl_table *tmp;
1349         int depth, i;
1350         depth = sysctl_depth(table);
1351         if (table->procname) {
1352                 for (i = depth; i >= 0; i--) {
1353                         tmp = sysctl_parent(table, i);
1354                         printk("/%s", tmp->procname?tmp->procname:"");
1355                 }
1356         }
1357         printk(" ");
1358         if (table->ctl_name) {
1359                 for (i = depth; i >= 0; i--) {
1360                         tmp = sysctl_parent(table, i);
1361                         printk(".%d", tmp->ctl_name);
1362                 }
1363         }
1364 }
1365
1366 static void sysctl_repair_table(struct ctl_table *table)
1367 {
1368         /* Don't complain about the classic default
1369          * sysctl strategy routine.  Maybe later we
1370          * can get the tables fixed and complain about
1371          * this.
1372          */
1373         if (table->ctl_name && table->procname &&
1374                 (table->proc_handler == proc_dointvec) &&
1375                 (!table->strategy)) {
1376                 table->strategy = sysctl_data;
1377         }
1378 }
1379
1380 static struct ctl_table *sysctl_check_lookup(struct ctl_table *table)
1381 {
1382         struct ctl_table_header *head;
1383         struct ctl_table *ref, *test;
1384         int depth, cur_depth;
1385
1386         depth = sysctl_depth(table);
1387
1388         for (head = sysctl_head_next(NULL); head;
1389              head = sysctl_head_next(head)) {
1390                 cur_depth = depth;
1391                 ref = head->ctl_table;
1392 repeat:
1393                 test = sysctl_parent(table, cur_depth);
1394                 for (; ref->ctl_name || ref->procname; ref++) {
1395                         int match = 0;
1396                         if (cur_depth && !ref->child)
1397                                 continue;
1398
1399                         if (test->procname && ref->procname &&
1400                             (strcmp(test->procname, ref->procname) == 0))
1401                                         match++;
1402
1403                         if (test->ctl_name && ref->ctl_name &&
1404                             (test->ctl_name == ref->ctl_name))
1405                                 match++;
1406
1407                         if (match) {
1408                                 if (cur_depth != 0) {
1409                                         cur_depth--;
1410                                         ref = ref->child;
1411                                         goto repeat;
1412                                 }
1413                                 goto out;
1414                         }
1415                 }
1416         }
1417         ref = NULL;
1418 out:
1419         sysctl_head_finish(head);
1420         return ref;
1421 }
1422
1423 static void set_fail(const char **fail, struct ctl_table *table, const char *str)
1424 {
1425         if (*fail) {
1426                 printk(KERN_ERR "sysctl table check failed: ");
1427                 sysctl_print_path(table);
1428                 printk(" %s\n", *fail);
1429                 dump_stack();
1430         }
1431         *fail = str;
1432 }
1433
1434 static int sysctl_check_dir(struct ctl_table *table)
1435 {
1436         struct ctl_table *ref;
1437         int error;
1438
1439         error = 0;
1440         ref = sysctl_check_lookup(table);
1441         if (ref) {
1442                 int match = 0;
1443                 if ((!table->procname && !ref->procname) ||
1444                     (table->procname && ref->procname &&
1445                      (strcmp(table->procname, ref->procname) == 0)))
1446                         match++;
1447
1448                 if ((!table->ctl_name && !ref->ctl_name) ||
1449                     (table->ctl_name && ref->ctl_name &&
1450                      (table->ctl_name == ref->ctl_name)))
1451                         match++;
1452
1453                 if (match != 2) {
1454                         printk(KERN_ERR "%s: failed: ", __func__);
1455                         sysctl_print_path(table);
1456                         printk(" ref: ");
1457                         sysctl_print_path(ref);
1458                         printk("\n");
1459                         error = -EINVAL;
1460                 }
1461         }
1462         return error;
1463 }
1464
1465 static void sysctl_check_leaf(struct ctl_table *table, const char **fail)
1466 {
1467         struct ctl_table *ref;
1468
1469         ref = sysctl_check_lookup(table);
1470         if (ref && (ref != table))
1471                 set_fail(fail, table, "Sysctl already exists");
1472 }
1473
1474 static void sysctl_check_bin_path(struct ctl_table *table, const char **fail)
1475 {
1476         struct trans_ctl_table *ref;
1477
1478         ref = sysctl_binary_lookup(table);
1479         if (table->ctl_name && !ref)
1480                 set_fail(fail, table, "Unknown sysctl binary path");
1481         if (ref) {
1482                 if (ref->procname &&
1483                     (!table->procname ||
1484                      (strcmp(table->procname, ref->procname) != 0)))
1485                         set_fail(fail, table, "procname does not match binary path procname");
1486
1487                 if (ref->ctl_name && table->ctl_name &&
1488                     (table->ctl_name != ref->ctl_name))
1489                         set_fail(fail, table, "ctl_name does not match binary path ctl_name");
1490         }
1491 }
1492
1493 int sysctl_check_table(struct ctl_table *table)
1494 {
1495         int error = 0;
1496         for (; table->ctl_name || table->procname; table++) {
1497                 const char *fail = NULL;
1498
1499                 sysctl_repair_table(table);
1500                 if (table->parent) {
1501                         if (table->procname && !table->parent->procname)
1502                                 set_fail(&fail, table, "Parent without procname");
1503                         if (table->ctl_name && !table->parent->ctl_name)
1504                                 set_fail(&fail, table, "Parent without ctl_name");
1505                 }
1506                 if (!table->procname)
1507                         set_fail(&fail, table, "No procname");
1508                 if (table->child) {
1509                         if (table->data)
1510                                 set_fail(&fail, table, "Directory with data?");
1511                         if (table->maxlen)
1512                                 set_fail(&fail, table, "Directory with maxlen?");
1513                         if ((table->mode & (S_IRUGO|S_IXUGO)) != table->mode)
1514                                 set_fail(&fail, table, "Writable sysctl directory");
1515                         if (table->proc_handler)
1516                                 set_fail(&fail, table, "Directory with proc_handler");
1517                         if (table->strategy)
1518                                 set_fail(&fail, table, "Directory with strategy");
1519                         if (table->extra1)
1520                                 set_fail(&fail, table, "Directory with extra1");
1521                         if (table->extra2)
1522                                 set_fail(&fail, table, "Directory with extra2");
1523                         if (sysctl_check_dir(table))
1524                                 set_fail(&fail, table, "Inconsistent directory names");
1525                 } else {
1526                         if ((table->strategy == sysctl_data) ||
1527                             (table->strategy == sysctl_string) ||
1528                             (table->strategy == sysctl_intvec) ||
1529                             (table->strategy == sysctl_jiffies) ||
1530                             (table->strategy == sysctl_ms_jiffies) ||
1531                             (table->proc_handler == proc_dostring) ||
1532                             (table->proc_handler == proc_dointvec) ||
1533 #ifdef CONFIG_SECURITY_CAPABILITIES
1534                             (table->proc_handler == proc_dointvec_bset) ||
1535 #endif /* def CONFIG_SECURITY_CAPABILITIES */
1536                             (table->proc_handler == proc_dointvec_minmax) ||
1537                             (table->proc_handler == proc_dointvec_jiffies) ||
1538                             (table->proc_handler == proc_dointvec_userhz_jiffies) ||
1539                             (table->proc_handler == proc_dointvec_ms_jiffies) ||
1540                             (table->proc_handler == proc_doulongvec_minmax) ||
1541                             (table->proc_handler == proc_doulongvec_ms_jiffies_minmax)) {
1542                                 if (!table->data)
1543                                         set_fail(&fail, table, "No data");
1544                                 if (!table->maxlen)
1545                                         set_fail(&fail, table, "No maxlen");
1546                         }
1547                         if ((table->proc_handler == proc_doulongvec_minmax) ||
1548                             (table->proc_handler == proc_doulongvec_ms_jiffies_minmax)) {
1549                                 if (table->maxlen > sizeof (unsigned long)) {
1550                                         if (!table->extra1)
1551                                                 set_fail(&fail, table, "No min");
1552                                         if (!table->extra2)
1553                                                 set_fail(&fail, table, "No max");
1554                                 }
1555                         }
1556 #ifdef CONFIG_SYSCTL_SYSCALL
1557                         if (table->ctl_name && !table->strategy)
1558                                 set_fail(&fail, table, "Missing strategy");
1559 #endif
1560 #if 0
1561                         if (!table->ctl_name && table->strategy)
1562                                 set_fail(&fail, table, "Strategy without ctl_name");
1563 #endif
1564 #ifdef CONFIG_PROC_FS
1565                         if (table->procname && !table->proc_handler)
1566                                 set_fail(&fail, table, "No proc_handler");
1567 #endif
1568 #if 0
1569                         if (!table->procname && table->proc_handler)
1570                                 set_fail(&fail, table, "proc_handler without procname");
1571 #endif
1572                         sysctl_check_leaf(table, &fail);
1573                 }
1574                 sysctl_check_bin_path(table, &fail);
1575                 if (fail) {
1576                         set_fail(&fail, table, NULL);
1577                         error = -EINVAL;
1578                 }
1579                 if (table->child)
1580                         error |= sysctl_check_table(table->child);
1581         }
1582         return error;
1583 }