blob: 7aebfe90324253121da27c32dc71625490fc886d [file] [log] [blame]
Greg Kroah-Hartmanb2441312017-11-01 15:07:57 +01001// SPDX-License-Identifier: GPL-2.0
Linus Torvalds1da177e2005-04-16 15:20:36 -07002/*
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
Linus Torvalds1da177e2005-04-16 15:20:36 -070010#include <linux/sysctl.h>
11#include <net/sock.h>
12#include <linux/atalk.h>
13
14static struct ctl_table atalk_table[] = {
15 {
Linus Torvalds1da177e2005-04-16 15:20:36 -070016 .procname = "aarp-expiry-time",
17 .data = &sysctl_aarp_expiry_time,
18 .maxlen = sizeof(int),
19 .mode = 0644,
Alexey Dobriyan6d9f2392008-11-03 18:21:05 -080020 .proc_handler = proc_dointvec_jiffies,
Linus Torvalds1da177e2005-04-16 15:20:36 -070021 },
22 {
Linus Torvalds1da177e2005-04-16 15:20:36 -070023 .procname = "aarp-tick-time",
24 .data = &sysctl_aarp_tick_time,
25 .maxlen = sizeof(int),
26 .mode = 0644,
Alexey Dobriyan6d9f2392008-11-03 18:21:05 -080027 .proc_handler = proc_dointvec_jiffies,
Linus Torvalds1da177e2005-04-16 15:20:36 -070028 },
29 {
Linus Torvalds1da177e2005-04-16 15:20:36 -070030 .procname = "aarp-retransmit-limit",
31 .data = &sysctl_aarp_retransmit_limit,
32 .maxlen = sizeof(int),
33 .mode = 0644,
Alexey Dobriyan6d9f2392008-11-03 18:21:05 -080034 .proc_handler = proc_dointvec,
Linus Torvalds1da177e2005-04-16 15:20:36 -070035 },
36 {
Linus Torvalds1da177e2005-04-16 15:20:36 -070037 .procname = "aarp-resolve-time",
38 .data = &sysctl_aarp_resolve_time,
39 .maxlen = sizeof(int),
40 .mode = 0644,
Alexey Dobriyan6d9f2392008-11-03 18:21:05 -080041 .proc_handler = proc_dointvec_jiffies,
Linus Torvalds1da177e2005-04-16 15:20:36 -070042 },
Linus Torvalds1da177e2005-04-16 15:20:36 -070043};
44
Linus Torvalds1da177e2005-04-16 15:20:36 -070045static struct ctl_table_header *atalk_table_header;
46
YueHaibing6377f782019-03-01 10:57:57 +080047int __init atalk_register_sysctl(void)
Linus Torvalds1da177e2005-04-16 15:20:36 -070048{
Eric W. Biedermanec8f23c2012-04-19 13:44:49 +000049 atalk_table_header = register_net_sysctl(&init_net, "net/appletalk", atalk_table);
YueHaibing6377f782019-03-01 10:57:57 +080050 if (!atalk_table_header)
51 return -ENOMEM;
52 return 0;
Linus Torvalds1da177e2005-04-16 15:20:36 -070053}
54
55void atalk_unregister_sysctl(void)
56{
Eric W. Biederman5dd3df12012-04-19 13:24:33 +000057 unregister_net_sysctl_table(atalk_table_header);
Linus Torvalds1da177e2005-04-16 15:20:36 -070058}