sysctl_net_ipv6.c 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  1. /*
  2. * sysctl_net_ipv6.c: sysctl interface to net IPV6 subsystem.
  3. *
  4. * Changes:
  5. * YOSHIFUJI Hideaki @USAGI: added icmp sysctl table.
  6. */
  7. #include <linux/mm.h>
  8. #include <linux/sysctl.h>
  9. #include <linux/config.h>
  10. #include <linux/in6.h>
  11. #include <linux/ipv6.h>
  12. #include <net/ndisc.h>
  13. #include <net/ipv6.h>
  14. #include <net/addrconf.h>
  15. #ifdef CONFIG_SYSCTL
  16. static ctl_table ipv6_table[] = {
  17. {
  18. .ctl_name = NET_IPV6_ROUTE,
  19. .procname = "route",
  20. .maxlen = 0,
  21. .mode = 0555,
  22. .child = ipv6_route_table
  23. },
  24. {
  25. .ctl_name = NET_IPV6_ICMP,
  26. .procname = "icmp",
  27. .maxlen = 0,
  28. .mode = 0555,
  29. .child = ipv6_icmp_table
  30. },
  31. {
  32. .ctl_name = NET_IPV6_BINDV6ONLY,
  33. .procname = "bindv6only",
  34. .data = &sysctl_ipv6_bindv6only,
  35. .maxlen = sizeof(int),
  36. .mode = 0644,
  37. .proc_handler = &proc_dointvec
  38. },
  39. {
  40. .ctl_name = NET_IPV6_IP6FRAG_HIGH_THRESH,
  41. .procname = "ip6frag_high_thresh",
  42. .data = &sysctl_ip6frag_high_thresh,
  43. .maxlen = sizeof(int),
  44. .mode = 0644,
  45. .proc_handler = &proc_dointvec
  46. },
  47. {
  48. .ctl_name = NET_IPV6_IP6FRAG_LOW_THRESH,
  49. .procname = "ip6frag_low_thresh",
  50. .data = &sysctl_ip6frag_low_thresh,
  51. .maxlen = sizeof(int),
  52. .mode = 0644,
  53. .proc_handler = &proc_dointvec
  54. },
  55. {
  56. .ctl_name = NET_IPV6_IP6FRAG_TIME,
  57. .procname = "ip6frag_time",
  58. .data = &sysctl_ip6frag_time,
  59. .maxlen = sizeof(int),
  60. .mode = 0644,
  61. .proc_handler = &proc_dointvec_jiffies,
  62. .strategy = &sysctl_jiffies,
  63. },
  64. {
  65. .ctl_name = NET_IPV6_IP6FRAG_SECRET_INTERVAL,
  66. .procname = "ip6frag_secret_interval",
  67. .data = &sysctl_ip6frag_secret_interval,
  68. .maxlen = sizeof(int),
  69. .mode = 0644,
  70. .proc_handler = &proc_dointvec_jiffies,
  71. .strategy = &sysctl_jiffies
  72. },
  73. {
  74. .ctl_name = NET_IPV6_MLD_MAX_MSF,
  75. .procname = "mld_max_msf",
  76. .data = &sysctl_mld_max_msf,
  77. .maxlen = sizeof(int),
  78. .mode = 0644,
  79. .proc_handler = &proc_dointvec
  80. },
  81. { .ctl_name = 0 }
  82. };
  83. static struct ctl_table_header *ipv6_sysctl_header;
  84. static ctl_table ipv6_net_table[] = {
  85. {
  86. .ctl_name = NET_IPV6,
  87. .procname = "ipv6",
  88. .mode = 0555,
  89. .child = ipv6_table
  90. },
  91. { .ctl_name = 0 }
  92. };
  93. static ctl_table ipv6_root_table[] = {
  94. {
  95. .ctl_name = CTL_NET,
  96. .procname = "net",
  97. .mode = 0555,
  98. .child = ipv6_net_table
  99. },
  100. { .ctl_name = 0 }
  101. };
  102. void ipv6_sysctl_register(void)
  103. {
  104. ipv6_sysctl_header = register_sysctl_table(ipv6_root_table, 0);
  105. }
  106. void ipv6_sysctl_unregister(void)
  107. {
  108. unregister_sysctl_table(ipv6_sysctl_header);
  109. }
  110. #endif /* CONFIG_SYSCTL */