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