Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 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 | |
| 8 | #include <linux/mm.h> |
| 9 | #include <linux/sysctl.h> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 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> |
Pavel Emelyanov | 04128f2 | 2007-10-15 02:33:45 -0700 | [diff] [blame^] | 15 | #include <net/inet_frag.h> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 16 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 17 | #ifdef CONFIG_SYSCTL |
| 18 | |
| 19 | static ctl_table ipv6_table[] = { |
| 20 | { |
| 21 | .ctl_name = NET_IPV6_ROUTE, |
| 22 | .procname = "route", |
| 23 | .maxlen = 0, |
| 24 | .mode = 0555, |
| 25 | .child = ipv6_route_table |
| 26 | }, |
| 27 | { |
| 28 | .ctl_name = NET_IPV6_ICMP, |
| 29 | .procname = "icmp", |
| 30 | .maxlen = 0, |
| 31 | .mode = 0555, |
| 32 | .child = ipv6_icmp_table |
| 33 | }, |
| 34 | { |
| 35 | .ctl_name = NET_IPV6_BINDV6ONLY, |
| 36 | .procname = "bindv6only", |
| 37 | .data = &sysctl_ipv6_bindv6only, |
| 38 | .maxlen = sizeof(int), |
| 39 | .mode = 0644, |
| 40 | .proc_handler = &proc_dointvec |
| 41 | }, |
| 42 | { |
| 43 | .ctl_name = NET_IPV6_IP6FRAG_HIGH_THRESH, |
| 44 | .procname = "ip6frag_high_thresh", |
Pavel Emelyanov | 04128f2 | 2007-10-15 02:33:45 -0700 | [diff] [blame^] | 45 | .data = &ip6_frags_ctl.high_thresh, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 46 | .maxlen = sizeof(int), |
| 47 | .mode = 0644, |
| 48 | .proc_handler = &proc_dointvec |
| 49 | }, |
| 50 | { |
| 51 | .ctl_name = NET_IPV6_IP6FRAG_LOW_THRESH, |
| 52 | .procname = "ip6frag_low_thresh", |
Pavel Emelyanov | 04128f2 | 2007-10-15 02:33:45 -0700 | [diff] [blame^] | 53 | .data = &ip6_frags_ctl.low_thresh, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 54 | .maxlen = sizeof(int), |
| 55 | .mode = 0644, |
| 56 | .proc_handler = &proc_dointvec |
| 57 | }, |
| 58 | { |
| 59 | .ctl_name = NET_IPV6_IP6FRAG_TIME, |
| 60 | .procname = "ip6frag_time", |
Pavel Emelyanov | 04128f2 | 2007-10-15 02:33:45 -0700 | [diff] [blame^] | 61 | .data = &ip6_frags_ctl.timeout, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 62 | .maxlen = sizeof(int), |
| 63 | .mode = 0644, |
| 64 | .proc_handler = &proc_dointvec_jiffies, |
| 65 | .strategy = &sysctl_jiffies, |
| 66 | }, |
| 67 | { |
| 68 | .ctl_name = NET_IPV6_IP6FRAG_SECRET_INTERVAL, |
| 69 | .procname = "ip6frag_secret_interval", |
Pavel Emelyanov | 04128f2 | 2007-10-15 02:33:45 -0700 | [diff] [blame^] | 70 | .data = &ip6_frags_ctl.secret_interval, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 71 | .maxlen = sizeof(int), |
| 72 | .mode = 0644, |
| 73 | .proc_handler = &proc_dointvec_jiffies, |
| 74 | .strategy = &sysctl_jiffies |
| 75 | }, |
| 76 | { |
| 77 | .ctl_name = NET_IPV6_MLD_MAX_MSF, |
| 78 | .procname = "mld_max_msf", |
| 79 | .data = &sysctl_mld_max_msf, |
| 80 | .maxlen = sizeof(int), |
| 81 | .mode = 0644, |
| 82 | .proc_handler = &proc_dointvec |
| 83 | }, |
| 84 | { .ctl_name = 0 } |
| 85 | }; |
| 86 | |
| 87 | static struct ctl_table_header *ipv6_sysctl_header; |
| 88 | |
| 89 | static ctl_table ipv6_net_table[] = { |
| 90 | { |
| 91 | .ctl_name = NET_IPV6, |
| 92 | .procname = "ipv6", |
| 93 | .mode = 0555, |
| 94 | .child = ipv6_table |
| 95 | }, |
YOSHIFUJI Hideaki | 1ab1457 | 2007-02-09 23:24:49 +0900 | [diff] [blame] | 96 | { .ctl_name = 0 } |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 97 | }; |
| 98 | |
| 99 | static ctl_table ipv6_root_table[] = { |
| 100 | { |
| 101 | .ctl_name = CTL_NET, |
| 102 | .procname = "net", |
| 103 | .mode = 0555, |
| 104 | .child = ipv6_net_table |
| 105 | }, |
YOSHIFUJI Hideaki | 1ab1457 | 2007-02-09 23:24:49 +0900 | [diff] [blame] | 106 | { .ctl_name = 0 } |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 107 | }; |
| 108 | |
| 109 | void ipv6_sysctl_register(void) |
| 110 | { |
Eric W. Biederman | 0b4d414 | 2007-02-14 00:34:09 -0800 | [diff] [blame] | 111 | ipv6_sysctl_header = register_sysctl_table(ipv6_root_table); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 112 | } |
| 113 | |
| 114 | void ipv6_sysctl_unregister(void) |
| 115 | { |
| 116 | unregister_sysctl_table(ipv6_sysctl_header); |
| 117 | } |
| 118 | |
| 119 | #endif /* CONFIG_SYSCTL */ |
| 120 | |
| 121 | |
| 122 | |