sysctl_check.c 50 KB

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