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