xref: /linux/net/appletalk/sysctl_net_atalk.c (revision 36ec807b627b4c0a0a382f0ae48eac7187d14b2b)
1 // SPDX-License-Identifier: GPL-2.0
2 /*
3  * sysctl_net_atalk.c: sysctl interface to net AppleTalk subsystem.
4  *
5  * Begun April 1, 1996, Mike Shaver.
6  * Added /proc/sys/net/atalk directory entry (empty =) ). [MS]
7  * Dynamic registration, added aarp entries. (5/30/97 Chris Horn)
8  */
9 
10 #include <linux/sysctl.h>
11 #include <net/sock.h>
12 #include <linux/atalk.h>
13 
14 static struct ctl_table atalk_table[] = {
15 	{
16 		.procname	= "aarp-expiry-time",
17 		.data		= &sysctl_aarp_expiry_time,
18 		.maxlen		= sizeof(int),
19 		.mode		= 0644,
20 		.proc_handler	= proc_dointvec_jiffies,
21 	},
22 	{
23 		.procname	= "aarp-tick-time",
24 		.data		= &sysctl_aarp_tick_time,
25 		.maxlen		= sizeof(int),
26 		.mode		= 0644,
27 		.proc_handler	= proc_dointvec_jiffies,
28 	},
29 	{
30 		.procname	= "aarp-retransmit-limit",
31 		.data		= &sysctl_aarp_retransmit_limit,
32 		.maxlen		= sizeof(int),
33 		.mode		= 0644,
34 		.proc_handler	= proc_dointvec,
35 	},
36 	{
37 		.procname	= "aarp-resolve-time",
38 		.data		= &sysctl_aarp_resolve_time,
39 		.maxlen		= sizeof(int),
40 		.mode		= 0644,
41 		.proc_handler	= proc_dointvec_jiffies,
42 	},
43 };
44 
45 static struct ctl_table_header *atalk_table_header;
46 
47 int __init atalk_register_sysctl(void)
48 {
49 	atalk_table_header = register_net_sysctl(&init_net, "net/appletalk", atalk_table);
50 	if (!atalk_table_header)
51 		return -ENOMEM;
52 	return 0;
53 }
54 
55 void atalk_unregister_sysctl(void)
56 {
57 	unregister_net_sysctl_table(atalk_table_header);
58 }
59