Greg Kroah-Hartman | b244131 | 2017-11-01 15:07:57 +0100 | [diff] [blame] | 1 | // SPDX-License-Identifier: GPL-2.0 |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 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 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 10 | #include <linux/sysctl.h> |
| 11 | #include <net/sock.h> |
| 12 | #include <linux/atalk.h> |
| 13 | |
| 14 | static struct ctl_table atalk_table[] = { |
| 15 | { |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 16 | .procname = "aarp-expiry-time", |
| 17 | .data = &sysctl_aarp_expiry_time, |
| 18 | .maxlen = sizeof(int), |
| 19 | .mode = 0644, |
Alexey Dobriyan | 6d9f239 | 2008-11-03 18:21:05 -0800 | [diff] [blame] | 20 | .proc_handler = proc_dointvec_jiffies, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 21 | }, |
| 22 | { |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 23 | .procname = "aarp-tick-time", |
| 24 | .data = &sysctl_aarp_tick_time, |
| 25 | .maxlen = sizeof(int), |
| 26 | .mode = 0644, |
Alexey Dobriyan | 6d9f239 | 2008-11-03 18:21:05 -0800 | [diff] [blame] | 27 | .proc_handler = proc_dointvec_jiffies, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 28 | }, |
| 29 | { |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 30 | .procname = "aarp-retransmit-limit", |
| 31 | .data = &sysctl_aarp_retransmit_limit, |
| 32 | .maxlen = sizeof(int), |
| 33 | .mode = 0644, |
Alexey Dobriyan | 6d9f239 | 2008-11-03 18:21:05 -0800 | [diff] [blame] | 34 | .proc_handler = proc_dointvec, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 35 | }, |
| 36 | { |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 37 | .procname = "aarp-resolve-time", |
| 38 | .data = &sysctl_aarp_resolve_time, |
| 39 | .maxlen = sizeof(int), |
| 40 | .mode = 0644, |
Alexey Dobriyan | 6d9f239 | 2008-11-03 18:21:05 -0800 | [diff] [blame] | 41 | .proc_handler = proc_dointvec_jiffies, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 42 | }, |
Eric W. Biederman | f8572d8 | 2009-11-05 13:32:03 -0800 | [diff] [blame] | 43 | { }, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 44 | }; |
| 45 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 46 | static struct ctl_table_header *atalk_table_header; |
| 47 | |
YueHaibing | 6c42507 | 2019-03-01 10:57:57 +0800 | [diff] [blame] | 48 | int __init atalk_register_sysctl(void) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 49 | { |
Eric W. Biederman | ec8f23c | 2012-04-19 13:44:49 +0000 | [diff] [blame] | 50 | atalk_table_header = register_net_sysctl(&init_net, "net/appletalk", atalk_table); |
YueHaibing | 6c42507 | 2019-03-01 10:57:57 +0800 | [diff] [blame] | 51 | if (!atalk_table_header) |
| 52 | return -ENOMEM; |
| 53 | return 0; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 54 | } |
| 55 | |
| 56 | void atalk_unregister_sysctl(void) |
| 57 | { |
Eric W. Biederman | 5dd3df1 | 2012-04-19 13:24:33 +0000 | [diff] [blame] | 58 | unregister_net_sysctl_table(atalk_table_header); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 59 | } |