1 /* SCTP kernel reference Implementation
2 * (C) Copyright IBM Corp. 2002, 2004
3 * Copyright (c) 2002 Intel Corp.
5 * This file is part of the SCTP kernel reference Implementation
7 * Sysctl related interfaces for SCTP.
9 * The SCTP reference implementation is free software;
10 * you can redistribute it and/or modify it under the terms of
11 * the GNU General Public License as published by
12 * the Free Software Foundation; either version 2, or (at your option)
15 * The SCTP reference implementation is distributed in the hope that it
16 * will be useful, but WITHOUT ANY WARRANTY; without even the implied
17 * ************************
18 * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
19 * See the GNU General Public License for more details.
21 * You should have received a copy of the GNU General Public License
22 * along with GNU CC; see the file COPYING. If not, write to
23 * the Free Software Foundation, 59 Temple Place - Suite 330,
24 * Boston, MA 02111-1307, USA.
26 * Please send any bug reports or fixes you make to the
28 * lksctp developers <lksctp-developers@lists.sourceforge.net>
30 * Or submit a bug report through the following website:
31 * http://www.sf.net/projects/lksctp
33 * Written or modified by:
34 * Mingqin Liu <liuming@us.ibm.com>
35 * Jon Grimm <jgrimm@us.ibm.com>
36 * Ardelle Fan <ardelle.fan@intel.com>
37 * Ryan Layer <rmlayer@us.ibm.com>
38 * Sridhar Samudrala <sri@us.ibm.com>
40 * Any bugs reported given to us we will try to fix... any fixes shared will
41 * be incorporated into the next SCTP release.
44 #include <net/sctp/structs.h>
45 #include <net/sctp/sctp.h>
46 #include <linux/sysctl.h>
50 static int timer_max = 86400000; /* ms in one day */
51 static int int_max = INT_MAX;
52 static long sack_timer_min = 1;
53 static long sack_timer_max = 500;
55 static ctl_table sctp_table[] = {
57 .ctl_name = NET_SCTP_RTO_INITIAL,
58 .procname = "rto_initial",
59 .data = &sctp_rto_initial,
60 .maxlen = sizeof(unsigned int),
62 .proc_handler = &proc_dointvec_minmax,
63 .strategy = &sysctl_intvec,
68 .ctl_name = NET_SCTP_RTO_MIN,
69 .procname = "rto_min",
70 .data = &sctp_rto_min,
71 .maxlen = sizeof(unsigned int),
73 .proc_handler = &proc_dointvec_minmax,
74 .strategy = &sysctl_intvec,
79 .ctl_name = NET_SCTP_RTO_MAX,
80 .procname = "rto_max",
81 .data = &sctp_rto_max,
82 .maxlen = sizeof(unsigned int),
84 .proc_handler = &proc_dointvec_minmax,
85 .strategy = &sysctl_intvec,
90 .ctl_name = NET_SCTP_VALID_COOKIE_LIFE,
91 .procname = "valid_cookie_life",
92 .data = &sctp_valid_cookie_life,
93 .maxlen = sizeof(unsigned int),
95 .proc_handler = &proc_dointvec_minmax,
96 .strategy = &sysctl_intvec,
101 .ctl_name = NET_SCTP_MAX_BURST,
102 .procname = "max_burst",
103 .data = &sctp_max_burst,
104 .maxlen = sizeof(int),
106 .proc_handler = &proc_dointvec_minmax,
107 .strategy = &sysctl_intvec,
112 .ctl_name = NET_SCTP_ASSOCIATION_MAX_RETRANS,
113 .procname = "association_max_retrans",
114 .data = &sctp_max_retrans_association,
115 .maxlen = sizeof(int),
117 .proc_handler = &proc_dointvec_minmax,
118 .strategy = &sysctl_intvec,
123 .ctl_name = NET_SCTP_SNDBUF_POLICY,
124 .procname = "sndbuf_policy",
125 .data = &sctp_sndbuf_policy,
126 .maxlen = sizeof(int),
128 .proc_handler = &proc_dointvec,
129 .strategy = &sysctl_intvec
132 .ctl_name = NET_SCTP_RCVBUF_POLICY,
133 .procname = "rcvbuf_policy",
134 .data = &sctp_rcvbuf_policy,
135 .maxlen = sizeof(int),
137 .proc_handler = &proc_dointvec,
138 .strategy = &sysctl_intvec
141 .ctl_name = NET_SCTP_PATH_MAX_RETRANS,
142 .procname = "path_max_retrans",
143 .data = &sctp_max_retrans_path,
144 .maxlen = sizeof(int),
146 .proc_handler = &proc_dointvec_minmax,
147 .strategy = &sysctl_intvec,
152 .ctl_name = NET_SCTP_MAX_INIT_RETRANSMITS,
153 .procname = "max_init_retransmits",
154 .data = &sctp_max_retrans_init,
155 .maxlen = sizeof(int),
157 .proc_handler = &proc_dointvec_minmax,
158 .strategy = &sysctl_intvec,
163 .ctl_name = NET_SCTP_HB_INTERVAL,
164 .procname = "hb_interval",
165 .data = &sctp_hb_interval,
166 .maxlen = sizeof(unsigned int),
168 .proc_handler = &proc_dointvec_minmax,
169 .strategy = &sysctl_intvec,
174 .ctl_name = NET_SCTP_PRESERVE_ENABLE,
175 .procname = "cookie_preserve_enable",
176 .data = &sctp_cookie_preserve_enable,
177 .maxlen = sizeof(int),
179 .proc_handler = &proc_dointvec,
180 .strategy = &sysctl_intvec
183 .ctl_name = NET_SCTP_RTO_ALPHA,
184 .procname = "rto_alpha_exp_divisor",
185 .data = &sctp_rto_alpha,
186 .maxlen = sizeof(int),
188 .proc_handler = &proc_dointvec,
189 .strategy = &sysctl_intvec
192 .ctl_name = NET_SCTP_RTO_BETA,
193 .procname = "rto_beta_exp_divisor",
194 .data = &sctp_rto_beta,
195 .maxlen = sizeof(int),
197 .proc_handler = &proc_dointvec,
198 .strategy = &sysctl_intvec
201 .ctl_name = NET_SCTP_ADDIP_ENABLE,
202 .procname = "addip_enable",
203 .data = &sctp_addip_enable,
204 .maxlen = sizeof(int),
206 .proc_handler = &proc_dointvec,
207 .strategy = &sysctl_intvec
210 .ctl_name = NET_SCTP_PRSCTP_ENABLE,
211 .procname = "prsctp_enable",
212 .data = &sctp_prsctp_enable,
213 .maxlen = sizeof(int),
215 .proc_handler = &proc_dointvec,
216 .strategy = &sysctl_intvec
219 .ctl_name = NET_SCTP_SACK_TIMEOUT,
220 .procname = "sack_timeout",
221 .data = &sctp_sack_timeout,
222 .maxlen = sizeof(long),
224 .proc_handler = &proc_dointvec_minmax,
225 .strategy = &sysctl_intvec,
226 .extra1 = &sack_timer_min,
227 .extra2 = &sack_timer_max,
232 static ctl_table sctp_net_table[] = {
234 .ctl_name = NET_SCTP,
242 static ctl_table sctp_root_table[] = {
247 .child = sctp_net_table
252 static struct ctl_table_header * sctp_sysctl_header;
254 /* Sysctl registration. */
255 void sctp_sysctl_register(void)
257 sctp_sysctl_header = register_sysctl_table(sctp_root_table, 0);
260 /* Sysctl deregistration. */
261 void sctp_sysctl_unregister(void)
263 unregister_sysctl_table(sctp_sysctl_header);