blob: a5d3416522de124b7458c21641dcc2e648d03577 [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001/* -*- linux-c -*-
2 * sysctl_net_x25.c: sysctl interface to net X.25 subsystem.
3 *
4 * Begun April 1, 1996, Mike Shaver.
5 * Added /proc/sys/net/x25 directory entry (empty =) ). [MS]
6 */
7
8#include <linux/sysctl.h>
9#include <linux/skbuff.h>
10#include <linux/socket.h>
11#include <linux/netdevice.h>
12#include <linux/init.h>
13#include <net/x25.h>
14
15static int min_timer[] = { 1 * HZ };
16static int max_timer[] = { 300 * HZ };
17
18static struct ctl_table_header *x25_table_header;
19
20static struct ctl_table x25_table[] = {
YOSHIFUJI Hideakif8e1d2012007-02-09 23:25:27 +090021 {
Linus Torvalds1da177e2005-04-16 15:20:36 -070022 .ctl_name = NET_X25_RESTART_REQUEST_TIMEOUT,
23 .procname = "restart_request_timeout",
24 .data = &sysctl_x25_restart_request_timeout,
25 .maxlen = sizeof(int),
26 .mode = 0644,
Alexey Dobriyan6d9f2392008-11-03 18:21:05 -080027 .proc_handler = proc_dointvec_minmax,
28 .strategy = sysctl_intvec,
Linus Torvalds1da177e2005-04-16 15:20:36 -070029 .extra1 = &min_timer,
30 .extra2 = &max_timer,
31 },
YOSHIFUJI Hideakif8e1d2012007-02-09 23:25:27 +090032 {
Linus Torvalds1da177e2005-04-16 15:20:36 -070033 .ctl_name = NET_X25_CALL_REQUEST_TIMEOUT,
34 .procname = "call_request_timeout",
35 .data = &sysctl_x25_call_request_timeout,
36 .maxlen = sizeof(int),
37 .mode = 0644,
Alexey Dobriyan6d9f2392008-11-03 18:21:05 -080038 .proc_handler = proc_dointvec_minmax,
39 .strategy = sysctl_intvec,
Linus Torvalds1da177e2005-04-16 15:20:36 -070040 .extra1 = &min_timer,
41 .extra2 = &max_timer,
42 },
YOSHIFUJI Hideakif8e1d2012007-02-09 23:25:27 +090043 {
Linus Torvalds1da177e2005-04-16 15:20:36 -070044 .ctl_name = NET_X25_RESET_REQUEST_TIMEOUT,
45 .procname = "reset_request_timeout",
46 .data = &sysctl_x25_reset_request_timeout,
47 .maxlen = sizeof(int),
48 .mode = 0644,
Alexey Dobriyan6d9f2392008-11-03 18:21:05 -080049 .proc_handler = proc_dointvec_minmax,
50 .strategy = sysctl_intvec,
Linus Torvalds1da177e2005-04-16 15:20:36 -070051 .extra1 = &min_timer,
52 .extra2 = &max_timer,
53 },
YOSHIFUJI Hideakif8e1d2012007-02-09 23:25:27 +090054 {
Linus Torvalds1da177e2005-04-16 15:20:36 -070055 .ctl_name = NET_X25_CLEAR_REQUEST_TIMEOUT,
56 .procname = "clear_request_timeout",
57 .data = &sysctl_x25_clear_request_timeout,
58 .maxlen = sizeof(int),
59 .mode = 0644,
Alexey Dobriyan6d9f2392008-11-03 18:21:05 -080060 .proc_handler = proc_dointvec_minmax,
61 .strategy = sysctl_intvec,
Linus Torvalds1da177e2005-04-16 15:20:36 -070062 .extra1 = &min_timer,
63 .extra2 = &max_timer,
64 },
YOSHIFUJI Hideakif8e1d2012007-02-09 23:25:27 +090065 {
Linus Torvalds1da177e2005-04-16 15:20:36 -070066 .ctl_name = NET_X25_ACK_HOLD_BACK_TIMEOUT,
67 .procname = "acknowledgement_hold_back_timeout",
68 .data = &sysctl_x25_ack_holdback_timeout,
69 .maxlen = sizeof(int),
70 .mode = 0644,
Alexey Dobriyan6d9f2392008-11-03 18:21:05 -080071 .proc_handler = proc_dointvec_minmax,
72 .strategy = sysctl_intvec,
Linus Torvalds1da177e2005-04-16 15:20:36 -070073 .extra1 = &min_timer,
74 .extra2 = &max_timer,
75 },
Andrew Hendry39e21c02007-02-08 13:34:36 -080076 {
77 .ctl_name = NET_X25_FORWARD,
78 .procname = "x25_forward",
79 .data = &sysctl_x25_forward,
80 .maxlen = sizeof(int),
81 .mode = 0644,
Alexey Dobriyan6d9f2392008-11-03 18:21:05 -080082 .proc_handler = proc_dointvec,
Andrew Hendry39e21c02007-02-08 13:34:36 -080083 },
Linus Torvalds1da177e2005-04-16 15:20:36 -070084 { 0, },
85};
86
Pavel Emelyanovb5ccd792008-01-09 00:30:05 -080087static struct ctl_path x25_path[] = {
88 { .procname = "net", .ctl_name = CTL_NET, },
89 { .procname = "x25", .ctl_name = NET_X25, },
90 { }
Linus Torvalds1da177e2005-04-16 15:20:36 -070091};
92
93void __init x25_register_sysctl(void)
94{
Pavel Emelyanovb5ccd792008-01-09 00:30:05 -080095 x25_table_header = register_sysctl_paths(x25_path, x25_table);
Linus Torvalds1da177e2005-04-16 15:20:36 -070096}
97
98void x25_unregister_sysctl(void)
99{
100 unregister_sysctl_table(x25_table_header);
101}