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