sysctl_net_ipv6.c 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  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/in6.h>
  10. #include <linux/ipv6.h>
  11. #include <net/ndisc.h>
  12. #include <net/ipv6.h>
  13. #include <net/addrconf.h>
  14. #include <net/inet_frag.h>
  15. static ctl_table ipv6_table[] = {
  16. {
  17. .ctl_name = NET_IPV6_ROUTE,
  18. .procname = "route",
  19. .maxlen = 0,
  20. .mode = 0555,
  21. .child = ipv6_route_table
  22. },
  23. {
  24. .ctl_name = NET_IPV6_ICMP,
  25. .procname = "icmp",
  26. .maxlen = 0,
  27. .mode = 0555,
  28. .child = ipv6_icmp_table
  29. },
  30. {
  31. .ctl_name = NET_IPV6_BINDV6ONLY,
  32. .procname = "bindv6only",
  33. .data = &sysctl_ipv6_bindv6only,
  34. .maxlen = sizeof(int),
  35. .mode = 0644,
  36. .proc_handler = &proc_dointvec
  37. },
  38. {
  39. .ctl_name = NET_IPV6_IP6FRAG_HIGH_THRESH,
  40. .procname = "ip6frag_high_thresh",
  41. .data = &ip6_frags_ctl.high_thresh,
  42. .maxlen = sizeof(int),
  43. .mode = 0644,
  44. .proc_handler = &proc_dointvec
  45. },
  46. {
  47. .ctl_name = NET_IPV6_IP6FRAG_LOW_THRESH,
  48. .procname = "ip6frag_low_thresh",
  49. .data = &ip6_frags_ctl.low_thresh,
  50. .maxlen = sizeof(int),
  51. .mode = 0644,
  52. .proc_handler = &proc_dointvec
  53. },
  54. {
  55. .ctl_name = NET_IPV6_IP6FRAG_TIME,
  56. .procname = "ip6frag_time",
  57. .data = &ip6_frags_ctl.timeout,
  58. .maxlen = sizeof(int),
  59. .mode = 0644,
  60. .proc_handler = &proc_dointvec_jiffies,
  61. .strategy = &sysctl_jiffies,
  62. },
  63. {
  64. .ctl_name = NET_IPV6_IP6FRAG_SECRET_INTERVAL,
  65. .procname = "ip6frag_secret_interval",
  66. .data = &ip6_frags_ctl.secret_interval,
  67. .maxlen = sizeof(int),
  68. .mode = 0644,
  69. .proc_handler = &proc_dointvec_jiffies,
  70. .strategy = &sysctl_jiffies
  71. },
  72. {
  73. .ctl_name = NET_IPV6_MLD_MAX_MSF,
  74. .procname = "mld_max_msf",
  75. .data = &sysctl_mld_max_msf,
  76. .maxlen = sizeof(int),
  77. .mode = 0644,
  78. .proc_handler = &proc_dointvec
  79. },
  80. { .ctl_name = 0 }
  81. };
  82. struct ctl_path net_ipv6_ctl_path[] = {
  83. { .procname = "net", .ctl_name = CTL_NET, },
  84. { .procname = "ipv6", .ctl_name = NET_IPV6, },
  85. { },
  86. };
  87. EXPORT_SYMBOL_GPL(net_ipv6_ctl_path);
  88. static struct ctl_table_header *ipv6_sysctl_header;
  89. void ipv6_sysctl_register(void)
  90. {
  91. ipv6_sysctl_header = register_sysctl_paths(net_ipv6_ctl_path,
  92. ipv6_table);
  93. }
  94. void ipv6_sysctl_unregister(void)
  95. {
  96. unregister_sysctl_table(ipv6_sysctl_header);
  97. }