17 #include <linux/sysctl.h>
19 #include <linux/netdevice.h>
20 #include <linux/string.h>
25 #include <asm/uaccess.h>
47 static int min_decnet_time_wait[] = { 5 };
48 static int max_decnet_time_wait[] = { 600 };
49 static int min_state_count[] = { 1 };
51 static int min_decnet_dst_gc_interval[] = { 1 };
52 static int max_decnet_dst_gc_interval[] = { 60 };
62 #define ISNUM(x) (((x) >= '0') && ((x) <= '9'))
63 #define ISLOWER(x) (((x) >= 'a') && ((x) <= 'z'))
64 #define ISUPPER(x) (((x) >= 'A') && ((x) <= 'Z'))
65 #define ISALPHA(x) (ISLOWER(x) || ISUPPER(x))
66 #define INVALID_END_CHAR(x) (ISNUM(x) || ISALPHA(x))
68 static void strip_it(
char *
str)
93 while(*str && !ISNUM(*str)) str++;
98 area = (*str++ -
'0');
101 area += (*str++ -
'0');
113 node += (*str++ -
'0');
117 node += (*str++ -
'0');
121 node += (*str++ -
'0');
124 if ((node > 1023) || (area > 63))
127 if (INVALID_END_CHAR(*str))
137 size_t *lenp, loff_t *ppos)
143 if (!*lenp || (*ppos && !write)) {
157 if (parse_addr(&dnaddr, addr))
175 if (len > *lenp) len = *lenp;
186 static int dn_def_dev_handler(
ctl_table *table,
int write,
188 size_t *lenp, loff_t *ppos)
194 if (!*lenp || (*ppos && !write)) {
236 devname[len++] =
'\n';
238 if (len > *lenp) len = *lenp;
254 .proc_handler = dn_node_address_handler,
257 .procname =
"node_name",
264 .procname =
"default_device",
267 .proc_handler = dn_def_dev_handler,
270 .procname =
"time_wait",
272 .maxlen =
sizeof(
int),
275 .extra1 = &min_decnet_time_wait,
276 .extra2 = &max_decnet_time_wait
279 .procname =
"dn_count",
281 .maxlen =
sizeof(
int),
284 .extra1 = &min_state_count,
285 .extra2 = &max_state_count
288 .procname =
"di_count",
290 .maxlen =
sizeof(
int),
293 .extra1 = &min_state_count,
294 .extra2 = &max_state_count
297 .procname =
"dr_count",
299 .maxlen =
sizeof(
int),
302 .extra1 = &min_state_count,
303 .extra2 = &max_state_count
306 .procname =
"dst_gc_interval",
308 .maxlen =
sizeof(
int),
311 .extra1 = &min_decnet_dst_gc_interval,
312 .extra2 = &max_decnet_dst_gc_interval
315 .procname =
"no_fc_max_cwnd",
317 .maxlen =
sizeof(
int),
320 .extra1 = &min_decnet_no_fc_max_cwnd,
321 .extra2 = &max_decnet_no_fc_max_cwnd
324 .procname =
"decnet_mem",
331 .procname =
"decnet_rmem",
338 .procname =
"decnet_wmem",
347 .maxlen =
sizeof(
int),