blob: df6d9dac21865845d88bdc52050a4d0aa6edcf51 [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001/*
2 * This program is free software; you can redistribute it and/or modify
3 * it under the terms of the GNU General Public License as published by
4 * the Free Software Foundation; either version 2 of the License, or
5 * (at your option) any later version.
6 *
7 * Copyright (C) 1996 Mike Shaver (shaver@zeroknowledge.com)
8 */
9#include <linux/mm.h>
10#include <linux/sysctl.h>
11#include <linux/init.h>
12#include <net/ax25.h>
13#include <net/rose.h>
14
15static int min_timer[] = {1 * HZ};
16static int max_timer[] = {300 * HZ};
17static int min_idle[] = {0 * HZ};
18static int max_idle[] = {65535 * HZ};
19static int min_route[1], max_route[] = {1};
20static int min_ftimer[] = {60 * HZ};
21static int max_ftimer[] = {600 * HZ};
22static int min_maxvcs[] = {1}, max_maxvcs[] = {254};
23static int min_window[] = {1}, max_window[] = {7};
24
25static struct ctl_table_header *rose_table_header;
26
27static ctl_table rose_table[] = {
YOSHIFUJI Hideaki3dcf7c52007-02-09 23:25:12 +090028 {
Linus Torvalds1da177e2005-04-16 15:20:36 -070029 .procname = "restart_request_timeout",
30 .data = &sysctl_rose_restart_request_timeout,
31 .maxlen = sizeof(int),
32 .mode = 0644,
Alexey Dobriyan6d9f2392008-11-03 18:21:05 -080033 .proc_handler = proc_dointvec_minmax,
Linus Torvalds1da177e2005-04-16 15:20:36 -070034 .extra1 = &min_timer,
35 .extra2 = &max_timer
36 },
YOSHIFUJI Hideaki3dcf7c52007-02-09 23:25:12 +090037 {
Linus Torvalds1da177e2005-04-16 15:20:36 -070038 .procname = "call_request_timeout",
39 .data = &sysctl_rose_call_request_timeout,
40 .maxlen = sizeof(int),
41 .mode = 0644,
Alexey Dobriyan6d9f2392008-11-03 18:21:05 -080042 .proc_handler = proc_dointvec_minmax,
Linus Torvalds1da177e2005-04-16 15:20:36 -070043 .extra1 = &min_timer,
44 .extra2 = &max_timer
45 },
YOSHIFUJI Hideaki3dcf7c52007-02-09 23:25:12 +090046 {
Linus Torvalds1da177e2005-04-16 15:20:36 -070047 .procname = "reset_request_timeout",
48 .data = &sysctl_rose_reset_request_timeout,
49 .maxlen = sizeof(int),
50 .mode = 0644,
Alexey Dobriyan6d9f2392008-11-03 18:21:05 -080051 .proc_handler = proc_dointvec_minmax,
Linus Torvalds1da177e2005-04-16 15:20:36 -070052 .extra1 = &min_timer,
53 .extra2 = &max_timer
54 },
YOSHIFUJI Hideaki3dcf7c52007-02-09 23:25:12 +090055 {
Linus Torvalds1da177e2005-04-16 15:20:36 -070056 .procname = "clear_request_timeout",
57 .data = &sysctl_rose_clear_request_timeout,
58 .maxlen = sizeof(int),
59 .mode = 0644,
Alexey Dobriyan6d9f2392008-11-03 18:21:05 -080060 .proc_handler = proc_dointvec_minmax,
Linus Torvalds1da177e2005-04-16 15:20:36 -070061 .extra1 = &min_timer,
62 .extra2 = &max_timer
63 },
YOSHIFUJI Hideaki3dcf7c52007-02-09 23:25:12 +090064 {
Linus Torvalds1da177e2005-04-16 15:20:36 -070065 .procname = "no_activity_timeout",
66 .data = &sysctl_rose_no_activity_timeout,
67 .maxlen = sizeof(int),
68 .mode = 0644,
Alexey Dobriyan6d9f2392008-11-03 18:21:05 -080069 .proc_handler = proc_dointvec_minmax,
Linus Torvalds1da177e2005-04-16 15:20:36 -070070 .extra1 = &min_idle,
71 .extra2 = &max_idle
72 },
YOSHIFUJI Hideaki3dcf7c52007-02-09 23:25:12 +090073 {
Linus Torvalds1da177e2005-04-16 15:20:36 -070074 .procname = "acknowledge_hold_back_timeout",
75 .data = &sysctl_rose_ack_hold_back_timeout,
76 .maxlen = sizeof(int),
77 .mode = 0644,
Alexey Dobriyan6d9f2392008-11-03 18:21:05 -080078 .proc_handler = proc_dointvec_minmax,
Linus Torvalds1da177e2005-04-16 15:20:36 -070079 .extra1 = &min_timer,
80 .extra2 = &max_timer
81 },
YOSHIFUJI Hideaki3dcf7c52007-02-09 23:25:12 +090082 {
Linus Torvalds1da177e2005-04-16 15:20:36 -070083 .procname = "routing_control",
84 .data = &sysctl_rose_routing_control,
85 .maxlen = sizeof(int),
86 .mode = 0644,
Alexey Dobriyan6d9f2392008-11-03 18:21:05 -080087 .proc_handler = proc_dointvec_minmax,
Linus Torvalds1da177e2005-04-16 15:20:36 -070088 .extra1 = &min_route,
89 .extra2 = &max_route
90 },
YOSHIFUJI Hideaki3dcf7c52007-02-09 23:25:12 +090091 {
Linus Torvalds1da177e2005-04-16 15:20:36 -070092 .procname = "link_fail_timeout",
93 .data = &sysctl_rose_link_fail_timeout,
94 .maxlen = sizeof(int),
95 .mode = 0644,
Alexey Dobriyan6d9f2392008-11-03 18:21:05 -080096 .proc_handler = proc_dointvec_minmax,
Linus Torvalds1da177e2005-04-16 15:20:36 -070097 .extra1 = &min_ftimer,
98 .extra2 = &max_ftimer
99 },
YOSHIFUJI Hideaki3dcf7c52007-02-09 23:25:12 +0900100 {
Linus Torvalds1da177e2005-04-16 15:20:36 -0700101 .procname = "maximum_virtual_circuits",
102 .data = &sysctl_rose_maximum_vcs,
103 .maxlen = sizeof(int),
104 .mode = 0644,
Alexey Dobriyan6d9f2392008-11-03 18:21:05 -0800105 .proc_handler = proc_dointvec_minmax,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700106 .extra1 = &min_maxvcs,
107 .extra2 = &max_maxvcs
108 },
YOSHIFUJI Hideaki3dcf7c52007-02-09 23:25:12 +0900109 {
Linus Torvalds1da177e2005-04-16 15:20:36 -0700110 .procname = "window_size",
111 .data = &sysctl_rose_window_size,
112 .maxlen = sizeof(int),
113 .mode = 0644,
Alexey Dobriyan6d9f2392008-11-03 18:21:05 -0800114 .proc_handler = proc_dointvec_minmax,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700115 .extra1 = &min_window,
116 .extra2 = &max_window
117 },
Eric W. Biedermanf8572d82009-11-05 13:32:03 -0800118 { }
Linus Torvalds1da177e2005-04-16 15:20:36 -0700119};
120
Pavel Emelyanovb5ccd792008-01-09 00:30:05 -0800121static struct ctl_path rose_path[] = {
Eric W. Biedermanf8572d82009-11-05 13:32:03 -0800122 { .procname = "net", },
123 { .procname = "rose", },
Pavel Emelyanovb5ccd792008-01-09 00:30:05 -0800124 { }
Linus Torvalds1da177e2005-04-16 15:20:36 -0700125};
126
127void __init rose_register_sysctl(void)
128{
Pavel Emelyanovb5ccd792008-01-09 00:30:05 -0800129 rose_table_header = register_sysctl_paths(rose_path, rose_table);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700130}
131
132void rose_unregister_sysctl(void)
133{
134 unregister_sysctl_table(rose_table_header);
135}