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 | static ctl_table ipv6_table[] = { |
| 18 | { |
| 19 | .ctl_name = NET_IPV6_ROUTE, |
| 20 | .procname = "route", |
| 21 | .maxlen = 0, |
| 22 | .mode = 0555, |
| 23 | .child = ipv6_route_table |
| 24 | }, |
| 25 | { |
| 26 | .ctl_name = NET_IPV6_ICMP, |
| 27 | .procname = "icmp", |
| 28 | .maxlen = 0, |
| 29 | .mode = 0555, |
| 30 | .child = ipv6_icmp_table |
| 31 | }, |
| 32 | { |
| 33 | .ctl_name = NET_IPV6_BINDV6ONLY, |
| 34 | .procname = "bindv6only", |
| 35 | .data = &sysctl_ipv6_bindv6only, |
| 36 | .maxlen = sizeof(int), |
| 37 | .mode = 0644, |
| 38 | .proc_handler = &proc_dointvec |
| 39 | }, |
| 40 | { |
| 41 | .ctl_name = NET_IPV6_IP6FRAG_HIGH_THRESH, |
| 42 | .procname = "ip6frag_high_thresh", |
Pavel Emelyanov | 04128f2 | 2007-10-15 02:33:45 -0700 | [diff] [blame] | 43 | .data = &ip6_frags_ctl.high_thresh, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 44 | .maxlen = sizeof(int), |
| 45 | .mode = 0644, |
| 46 | .proc_handler = &proc_dointvec |
| 47 | }, |
| 48 | { |
| 49 | .ctl_name = NET_IPV6_IP6FRAG_LOW_THRESH, |
| 50 | .procname = "ip6frag_low_thresh", |
Pavel Emelyanov | 04128f2 | 2007-10-15 02:33:45 -0700 | [diff] [blame] | 51 | .data = &ip6_frags_ctl.low_thresh, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 52 | .maxlen = sizeof(int), |
| 53 | .mode = 0644, |
| 54 | .proc_handler = &proc_dointvec |
| 55 | }, |
| 56 | { |
| 57 | .ctl_name = NET_IPV6_IP6FRAG_TIME, |
| 58 | .procname = "ip6frag_time", |
Pavel Emelyanov | 04128f2 | 2007-10-15 02:33:45 -0700 | [diff] [blame] | 59 | .data = &ip6_frags_ctl.timeout, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 60 | .maxlen = sizeof(int), |
| 61 | .mode = 0644, |
| 62 | .proc_handler = &proc_dointvec_jiffies, |
| 63 | .strategy = &sysctl_jiffies, |
| 64 | }, |
| 65 | { |
| 66 | .ctl_name = NET_IPV6_IP6FRAG_SECRET_INTERVAL, |
| 67 | .procname = "ip6frag_secret_interval", |
Pavel Emelyanov | 04128f2 | 2007-10-15 02:33:45 -0700 | [diff] [blame] | 68 | .data = &ip6_frags_ctl.secret_interval, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 69 | .maxlen = sizeof(int), |
| 70 | .mode = 0644, |
| 71 | .proc_handler = &proc_dointvec_jiffies, |
| 72 | .strategy = &sysctl_jiffies |
| 73 | }, |
| 74 | { |
| 75 | .ctl_name = NET_IPV6_MLD_MAX_MSF, |
| 76 | .procname = "mld_max_msf", |
| 77 | .data = &sysctl_mld_max_msf, |
| 78 | .maxlen = sizeof(int), |
| 79 | .mode = 0644, |
| 80 | .proc_handler = &proc_dointvec |
| 81 | }, |
| 82 | { .ctl_name = 0 } |
| 83 | }; |
| 84 | |
Pavel Emelyanov | 3d7cc2b | 2008-01-09 00:33:11 -0800 | [diff] [blame^] | 85 | struct ctl_path net_ipv6_ctl_path[] = { |
Pavel Emelyanov | 4d43b78 | 2007-12-05 01:44:02 -0800 | [diff] [blame] | 86 | { .procname = "net", .ctl_name = CTL_NET, }, |
| 87 | { .procname = "ipv6", .ctl_name = NET_IPV6, }, |
| 88 | { }, |
| 89 | }; |
Pavel Emelyanov | 3d7cc2b | 2008-01-09 00:33:11 -0800 | [diff] [blame^] | 90 | EXPORT_SYMBOL_GPL(net_ipv6_ctl_path); |
Pavel Emelyanov | 4d43b78 | 2007-12-05 01:44:02 -0800 | [diff] [blame] | 91 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 92 | static struct ctl_table_header *ipv6_sysctl_header; |
| 93 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 94 | void ipv6_sysctl_register(void) |
| 95 | { |
Pavel Emelyanov | 3d7cc2b | 2008-01-09 00:33:11 -0800 | [diff] [blame^] | 96 | ipv6_sysctl_header = register_sysctl_paths(net_ipv6_ctl_path, |
| 97 | ipv6_table); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 98 | } |
| 99 | |
| 100 | void ipv6_sysctl_unregister(void) |
| 101 | { |
| 102 | unregister_sysctl_table(ipv6_sysctl_header); |
| 103 | } |