sysctl_net_ipv6.c 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  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. extern ctl_table ipv6_route_table[];
  16. extern ctl_table ipv6_icmp_table[];
  17. #ifdef CONFIG_SYSCTL
  18. static ctl_table ipv6_table[] = {
  19. {
  20. .ctl_name = NET_IPV6_ROUTE,
  21. .procname = "route",
  22. .maxlen = 0,
  23. .mode = 0555,
  24. .child = ipv6_route_table
  25. },
  26. {
  27. .ctl_name = NET_IPV6_ICMP,
  28. .procname = "icmp",
  29. .maxlen = 0,
  30. .mode = 0555,
  31. .child = ipv6_icmp_table
  32. },
  33. {
  34. .ctl_name = NET_IPV6_BINDV6ONLY,
  35. .procname = "bindv6only",
  36. .data = &sysctl_ipv6_bindv6only,
  37. .maxlen = sizeof(int),
  38. .mode = 0644,
  39. .proc_handler = &proc_dointvec
  40. },
  41. {
  42. .ctl_name = NET_IPV6_IP6FRAG_HIGH_THRESH,
  43. .procname = "ip6frag_high_thresh",
  44. .data = &sysctl_ip6frag_high_thresh,
  45. .maxlen = sizeof(int),
  46. .mode = 0644,
  47. .proc_handler = &proc_dointvec
  48. },
  49. {
  50. .ctl_name = NET_IPV6_IP6FRAG_LOW_THRESH,
  51. .procname = "ip6frag_low_thresh",
  52. .data = &sysctl_ip6frag_low_thresh,
  53. .maxlen = sizeof(int),
  54. .mode = 0644,
  55. .proc_handler = &proc_dointvec
  56. },
  57. {
  58. .ctl_name = NET_IPV6_IP6FRAG_TIME,
  59. .procname = "ip6frag_time",
  60. .data = &sysctl_ip6frag_time,
  61. .maxlen = sizeof(int),
  62. .mode = 0644,
  63. .proc_handler = &proc_dointvec_jiffies,
  64. .strategy = &sysctl_jiffies,
  65. },
  66. {
  67. .ctl_name = NET_IPV6_IP6FRAG_SECRET_INTERVAL,
  68. .procname = "ip6frag_secret_interval",
  69. .data = &sysctl_ip6frag_secret_interval,
  70. .maxlen = sizeof(int),
  71. .mode = 0644,
  72. .proc_handler = &proc_dointvec_jiffies,
  73. .strategy = &sysctl_jiffies
  74. },
  75. {
  76. .ctl_name = NET_IPV6_MLD_MAX_MSF,
  77. .procname = "mld_max_msf",
  78. .data = &sysctl_mld_max_msf,
  79. .maxlen = sizeof(int),
  80. .mode = 0644,
  81. .proc_handler = &proc_dointvec
  82. },
  83. { .ctl_name = 0 }
  84. };
  85. static struct ctl_table_header *ipv6_sysctl_header;
  86. static ctl_table ipv6_net_table[] = {
  87. {
  88. .ctl_name = NET_IPV6,
  89. .procname = "ipv6",
  90. .mode = 0555,
  91. .child = ipv6_table
  92. },
  93. { .ctl_name = 0 }
  94. };
  95. static ctl_table ipv6_root_table[] = {
  96. {
  97. .ctl_name = CTL_NET,
  98. .procname = "net",
  99. .mode = 0555,
  100. .child = ipv6_net_table
  101. },
  102. { .ctl_name = 0 }
  103. };
  104. void ipv6_sysctl_register(void)
  105. {
  106. ipv6_sysctl_header = register_sysctl_table(ipv6_root_table, 0);
  107. }
  108. void ipv6_sysctl_unregister(void)
  109. {
  110. unregister_sysctl_table(ipv6_sysctl_header);
  111. }
  112. #endif /* CONFIG_SYSCTL */