sysctl_check.c 50 KB

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