xref: /openbmc/linux/net/appletalk/sysctl_net_atalk.c (revision 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2)
1*1da177e4SLinus Torvalds /*
2*1da177e4SLinus Torvalds  * sysctl_net_atalk.c: sysctl interface to net AppleTalk subsystem.
3*1da177e4SLinus Torvalds  *
4*1da177e4SLinus Torvalds  * Begun April 1, 1996, Mike Shaver.
5*1da177e4SLinus Torvalds  * Added /proc/sys/net/atalk directory entry (empty =) ). [MS]
6*1da177e4SLinus Torvalds  * Dynamic registration, added aarp entries. (5/30/97 Chris Horn)
7*1da177e4SLinus Torvalds  */
8*1da177e4SLinus Torvalds 
9*1da177e4SLinus Torvalds #include <linux/config.h>
10*1da177e4SLinus Torvalds #include <linux/sysctl.h>
11*1da177e4SLinus Torvalds #include <net/sock.h>
12*1da177e4SLinus Torvalds #include <linux/atalk.h>
13*1da177e4SLinus Torvalds 
14*1da177e4SLinus Torvalds static struct ctl_table atalk_table[] = {
15*1da177e4SLinus Torvalds 	{
16*1da177e4SLinus Torvalds 		.ctl_name	= NET_ATALK_AARP_EXPIRY_TIME,
17*1da177e4SLinus Torvalds 		.procname	= "aarp-expiry-time",
18*1da177e4SLinus Torvalds 		.data		= &sysctl_aarp_expiry_time,
19*1da177e4SLinus Torvalds 		.maxlen		= sizeof(int),
20*1da177e4SLinus Torvalds 		.mode		= 0644,
21*1da177e4SLinus Torvalds 		.proc_handler	= &proc_dointvec_jiffies,
22*1da177e4SLinus Torvalds 		.strategy	= &sysctl_jiffies,
23*1da177e4SLinus Torvalds 	},
24*1da177e4SLinus Torvalds 	{
25*1da177e4SLinus Torvalds 		.ctl_name	= NET_ATALK_AARP_TICK_TIME,
26*1da177e4SLinus Torvalds 		.procname	= "aarp-tick-time",
27*1da177e4SLinus Torvalds 		.data		= &sysctl_aarp_tick_time,
28*1da177e4SLinus Torvalds 		.maxlen		= sizeof(int),
29*1da177e4SLinus Torvalds 		.mode		= 0644,
30*1da177e4SLinus Torvalds 		.proc_handler	= &proc_dointvec_jiffies,
31*1da177e4SLinus Torvalds 		.strategy	= &sysctl_jiffies,
32*1da177e4SLinus Torvalds 	},
33*1da177e4SLinus Torvalds 	{
34*1da177e4SLinus Torvalds 		.ctl_name	= NET_ATALK_AARP_RETRANSMIT_LIMIT,
35*1da177e4SLinus Torvalds 		.procname	= "aarp-retransmit-limit",
36*1da177e4SLinus Torvalds 		.data		= &sysctl_aarp_retransmit_limit,
37*1da177e4SLinus Torvalds 		.maxlen		= sizeof(int),
38*1da177e4SLinus Torvalds 		.mode		= 0644,
39*1da177e4SLinus Torvalds 		.proc_handler	= &proc_dointvec,
40*1da177e4SLinus Torvalds 	},
41*1da177e4SLinus Torvalds 	{
42*1da177e4SLinus Torvalds 		.ctl_name	= NET_ATALK_AARP_RESOLVE_TIME,
43*1da177e4SLinus Torvalds 		.procname	= "aarp-resolve-time",
44*1da177e4SLinus Torvalds 		.data		= &sysctl_aarp_resolve_time,
45*1da177e4SLinus Torvalds 		.maxlen		= sizeof(int),
46*1da177e4SLinus Torvalds 		.mode		= 0644,
47*1da177e4SLinus Torvalds 		.proc_handler	= &proc_dointvec_jiffies,
48*1da177e4SLinus Torvalds 		.strategy	= &sysctl_jiffies,
49*1da177e4SLinus Torvalds 	},
50*1da177e4SLinus Torvalds 	{ 0 },
51*1da177e4SLinus Torvalds };
52*1da177e4SLinus Torvalds 
53*1da177e4SLinus Torvalds static struct ctl_table atalk_dir_table[] = {
54*1da177e4SLinus Torvalds 	{
55*1da177e4SLinus Torvalds 		.ctl_name	= NET_ATALK,
56*1da177e4SLinus Torvalds 		.procname	= "appletalk",
57*1da177e4SLinus Torvalds 		.mode		= 0555,
58*1da177e4SLinus Torvalds 		.child		= atalk_table,
59*1da177e4SLinus Torvalds 	},
60*1da177e4SLinus Torvalds 	{ 0 },
61*1da177e4SLinus Torvalds };
62*1da177e4SLinus Torvalds 
63*1da177e4SLinus Torvalds static struct ctl_table atalk_root_table[] = {
64*1da177e4SLinus Torvalds 	{
65*1da177e4SLinus Torvalds 		.ctl_name	= CTL_NET,
66*1da177e4SLinus Torvalds 		.procname	= "net",
67*1da177e4SLinus Torvalds 		.mode		= 0555,
68*1da177e4SLinus Torvalds 		.child		= atalk_dir_table,
69*1da177e4SLinus Torvalds 	},
70*1da177e4SLinus Torvalds 	{ 0 },
71*1da177e4SLinus Torvalds };
72*1da177e4SLinus Torvalds 
73*1da177e4SLinus Torvalds static struct ctl_table_header *atalk_table_header;
74*1da177e4SLinus Torvalds 
75*1da177e4SLinus Torvalds void atalk_register_sysctl(void)
76*1da177e4SLinus Torvalds {
77*1da177e4SLinus Torvalds 	atalk_table_header = register_sysctl_table(atalk_root_table, 1);
78*1da177e4SLinus Torvalds }
79*1da177e4SLinus Torvalds 
80*1da177e4SLinus Torvalds void atalk_unregister_sysctl(void)
81*1da177e4SLinus Torvalds {
82*1da177e4SLinus Torvalds 	unregister_sysctl_table(atalk_table_header);
83*1da177e4SLinus Torvalds }
84