1 // SPDX-License-Identifier: GPL-2.0-or-later
4 * Copyright (C) 1996 Mike Shaver (shaver@zeroknowledge.com)
7 #include <linux/sysctl.h>
8 #include <linux/init.h>
10 #include <net/netrom.h>
13 * Values taken from NET/ROM documentation.
15 static int min_quality[] = {0}, max_quality[] = {255};
16 static int min_obs[] = {0}, max_obs[] = {255};
17 static int min_ttl[] = {0}, max_ttl[] = {255};
18 static int min_t1[] = {5 * HZ};
19 static int max_t1[] = {600 * HZ};
20 static int min_n2[] = {2}, max_n2[] = {127};
21 static int min_t2[] = {1 * HZ};
22 static int max_t2[] = {60 * HZ};
23 static int min_t4[] = {1 * HZ};
24 static int max_t4[] = {1000 * HZ};
25 static int min_window[] = {1}, max_window[] = {127};
26 static int min_idle[] = {0 * HZ};
27 static int max_idle[] = {65535 * HZ};
28 static int min_route[] = {0}, max_route[] = {1};
29 static int min_fails[] = {1}, max_fails[] = {10};
30 static int min_reset[] = {0}, max_reset[] = {1};
32 static struct ctl_table_header *nr_table_header;
34 static struct ctl_table nr_table[] = {
36 .procname = "default_path_quality",
37 .data = &sysctl_netrom_default_path_quality,
38 .maxlen = sizeof(int),
40 .proc_handler = proc_dointvec_minmax,
41 .extra1 = &min_quality,
42 .extra2 = &max_quality
45 .procname = "obsolescence_count_initialiser",
46 .data = &sysctl_netrom_obsolescence_count_initialiser,
47 .maxlen = sizeof(int),
49 .proc_handler = proc_dointvec_minmax,
54 .procname = "network_ttl_initialiser",
55 .data = &sysctl_netrom_network_ttl_initialiser,
56 .maxlen = sizeof(int),
58 .proc_handler = proc_dointvec_minmax,
63 .procname = "transport_timeout",
64 .data = &sysctl_netrom_transport_timeout,
65 .maxlen = sizeof(int),
67 .proc_handler = proc_dointvec_minmax,
72 .procname = "transport_maximum_tries",
73 .data = &sysctl_netrom_transport_maximum_tries,
74 .maxlen = sizeof(int),
76 .proc_handler = proc_dointvec_minmax,
81 .procname = "transport_acknowledge_delay",
82 .data = &sysctl_netrom_transport_acknowledge_delay,
83 .maxlen = sizeof(int),
85 .proc_handler = proc_dointvec_minmax,
90 .procname = "transport_busy_delay",
91 .data = &sysctl_netrom_transport_busy_delay,
92 .maxlen = sizeof(int),
94 .proc_handler = proc_dointvec_minmax,
99 .procname = "transport_requested_window_size",
100 .data = &sysctl_netrom_transport_requested_window_size,
101 .maxlen = sizeof(int),
103 .proc_handler = proc_dointvec_minmax,
104 .extra1 = &min_window,
105 .extra2 = &max_window
108 .procname = "transport_no_activity_timeout",
109 .data = &sysctl_netrom_transport_no_activity_timeout,
110 .maxlen = sizeof(int),
112 .proc_handler = proc_dointvec_minmax,
117 .procname = "routing_control",
118 .data = &sysctl_netrom_routing_control,
119 .maxlen = sizeof(int),
121 .proc_handler = proc_dointvec_minmax,
122 .extra1 = &min_route,
126 .procname = "link_fails_count",
127 .data = &sysctl_netrom_link_fails_count,
128 .maxlen = sizeof(int),
130 .proc_handler = proc_dointvec_minmax,
131 .extra1 = &min_fails,
136 .data = &sysctl_netrom_reset_circuit,
137 .maxlen = sizeof(int),
139 .proc_handler = proc_dointvec_minmax,
140 .extra1 = &min_reset,
146 int __init nr_register_sysctl(void)
148 nr_table_header = register_net_sysctl(&init_net, "net/netrom", nr_table);
149 if (!nr_table_header)
154 void nr_unregister_sysctl(void)
156 unregister_net_sysctl_table(nr_table_header);