1 /* SCTP kernel implementation
2 * (C) Copyright IBM Corp. 2002, 2004
3 * Copyright (c) 2002 Intel Corp.
5 * This file is part of the SCTP kernel implementation
7 * Sysctl related interfaces for SCTP.
9 * This SCTP 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 * This SCTP 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 int sack_timer_min = 1;
53 static int sack_timer_max = 500;
54 static int addr_scope_max = 3; /* check sctp_scope_policy_t in include/net/sctp/constants.h for max entries */
55 static int rwnd_scale_max = 16;
57 extern int sysctl_sctp_mem[3];
58 extern int sysctl_sctp_rmem[3];
59 extern int sysctl_sctp_wmem[3];
61 static ctl_table sctp_table[] = {
63 .ctl_name = NET_SCTP_RTO_INITIAL,
64 .procname = "rto_initial",
65 .data = &sctp_rto_initial,
66 .maxlen = sizeof(unsigned int),
68 .proc_handler = proc_dointvec_minmax,
69 .strategy = sysctl_intvec,
74 .ctl_name = NET_SCTP_RTO_MIN,
75 .procname = "rto_min",
76 .data = &sctp_rto_min,
77 .maxlen = sizeof(unsigned int),
79 .proc_handler = proc_dointvec_minmax,
80 .strategy = sysctl_intvec,
85 .ctl_name = NET_SCTP_RTO_MAX,
86 .procname = "rto_max",
87 .data = &sctp_rto_max,
88 .maxlen = sizeof(unsigned int),
90 .proc_handler = proc_dointvec_minmax,
91 .strategy = sysctl_intvec,
96 .ctl_name = NET_SCTP_VALID_COOKIE_LIFE,
97 .procname = "valid_cookie_life",
98 .data = &sctp_valid_cookie_life,
99 .maxlen = sizeof(unsigned int),
101 .proc_handler = proc_dointvec_minmax,
102 .strategy = sysctl_intvec,
107 .ctl_name = NET_SCTP_MAX_BURST,
108 .procname = "max_burst",
109 .data = &sctp_max_burst,
110 .maxlen = sizeof(int),
112 .proc_handler = proc_dointvec_minmax,
113 .strategy = sysctl_intvec,
118 .ctl_name = NET_SCTP_ASSOCIATION_MAX_RETRANS,
119 .procname = "association_max_retrans",
120 .data = &sctp_max_retrans_association,
121 .maxlen = sizeof(int),
123 .proc_handler = proc_dointvec_minmax,
124 .strategy = sysctl_intvec,
129 .ctl_name = NET_SCTP_SNDBUF_POLICY,
130 .procname = "sndbuf_policy",
131 .data = &sctp_sndbuf_policy,
132 .maxlen = sizeof(int),
134 .proc_handler = proc_dointvec,
135 .strategy = sysctl_intvec
138 .ctl_name = NET_SCTP_RCVBUF_POLICY,
139 .procname = "rcvbuf_policy",
140 .data = &sctp_rcvbuf_policy,
141 .maxlen = sizeof(int),
143 .proc_handler = proc_dointvec,
144 .strategy = sysctl_intvec
147 .ctl_name = NET_SCTP_PATH_MAX_RETRANS,
148 .procname = "path_max_retrans",
149 .data = &sctp_max_retrans_path,
150 .maxlen = sizeof(int),
152 .proc_handler = proc_dointvec_minmax,
153 .strategy = sysctl_intvec,
158 .ctl_name = NET_SCTP_MAX_INIT_RETRANSMITS,
159 .procname = "max_init_retransmits",
160 .data = &sctp_max_retrans_init,
161 .maxlen = sizeof(int),
163 .proc_handler = proc_dointvec_minmax,
164 .strategy = sysctl_intvec,
169 .ctl_name = NET_SCTP_HB_INTERVAL,
170 .procname = "hb_interval",
171 .data = &sctp_hb_interval,
172 .maxlen = sizeof(unsigned int),
174 .proc_handler = proc_dointvec_minmax,
175 .strategy = sysctl_intvec,
180 .ctl_name = NET_SCTP_PRESERVE_ENABLE,
181 .procname = "cookie_preserve_enable",
182 .data = &sctp_cookie_preserve_enable,
183 .maxlen = sizeof(int),
185 .proc_handler = proc_dointvec,
186 .strategy = sysctl_intvec
189 .ctl_name = NET_SCTP_RTO_ALPHA,
190 .procname = "rto_alpha_exp_divisor",
191 .data = &sctp_rto_alpha,
192 .maxlen = sizeof(int),
194 .proc_handler = proc_dointvec,
195 .strategy = sysctl_intvec
198 .ctl_name = NET_SCTP_RTO_BETA,
199 .procname = "rto_beta_exp_divisor",
200 .data = &sctp_rto_beta,
201 .maxlen = sizeof(int),
203 .proc_handler = proc_dointvec,
204 .strategy = sysctl_intvec
207 .ctl_name = NET_SCTP_ADDIP_ENABLE,
208 .procname = "addip_enable",
209 .data = &sctp_addip_enable,
210 .maxlen = sizeof(int),
212 .proc_handler = proc_dointvec,
213 .strategy = sysctl_intvec
216 .ctl_name = NET_SCTP_PRSCTP_ENABLE,
217 .procname = "prsctp_enable",
218 .data = &sctp_prsctp_enable,
219 .maxlen = sizeof(int),
221 .proc_handler = proc_dointvec,
222 .strategy = sysctl_intvec
225 .ctl_name = NET_SCTP_SACK_TIMEOUT,
226 .procname = "sack_timeout",
227 .data = &sctp_sack_timeout,
228 .maxlen = sizeof(int),
230 .proc_handler = proc_dointvec_minmax,
231 .strategy = sysctl_intvec,
232 .extra1 = &sack_timer_min,
233 .extra2 = &sack_timer_max,
236 .ctl_name = CTL_UNNUMBERED,
237 .procname = "sctp_mem",
238 .data = &sysctl_sctp_mem,
239 .maxlen = sizeof(sysctl_sctp_mem),
241 .proc_handler = proc_dointvec,
244 .ctl_name = CTL_UNNUMBERED,
245 .procname = "sctp_rmem",
246 .data = &sysctl_sctp_rmem,
247 .maxlen = sizeof(sysctl_sctp_rmem),
249 .proc_handler = proc_dointvec,
252 .ctl_name = CTL_UNNUMBERED,
253 .procname = "sctp_wmem",
254 .data = &sysctl_sctp_wmem,
255 .maxlen = sizeof(sysctl_sctp_wmem),
257 .proc_handler = proc_dointvec,
260 .ctl_name = CTL_UNNUMBERED,
261 .procname = "auth_enable",
262 .data = &sctp_auth_enable,
263 .maxlen = sizeof(int),
265 .proc_handler = proc_dointvec,
266 .strategy = sysctl_intvec
269 .ctl_name = CTL_UNNUMBERED,
270 .procname = "addip_noauth_enable",
271 .data = &sctp_addip_noauth,
272 .maxlen = sizeof(int),
274 .proc_handler = proc_dointvec,
275 .strategy = sysctl_intvec
278 .ctl_name = CTL_UNNUMBERED,
279 .procname = "addr_scope_policy",
280 .data = &sctp_scope_policy,
281 .maxlen = sizeof(int),
283 .proc_handler = &proc_dointvec_minmax,
284 .strategy = &sysctl_intvec,
286 .extra2 = &addr_scope_max,
289 .ctl_name = CTL_UNNUMBERED,
290 .procname = "rwnd_update_shift",
291 .data = &sctp_rwnd_upd_shift,
292 .maxlen = sizeof(int),
294 .proc_handler = &proc_dointvec_minmax,
295 .strategy = &sysctl_intvec,
297 .extra2 = &rwnd_scale_max,
303 static struct ctl_path sctp_path[] = {
304 { .procname = "net", .ctl_name = CTL_NET, },
305 { .procname = "sctp", .ctl_name = NET_SCTP, },
309 static struct ctl_table_header * sctp_sysctl_header;
311 /* Sysctl registration. */
312 void sctp_sysctl_register(void)
314 sctp_sysctl_header = register_sysctl_paths(sctp_path, sctp_table);
317 /* Sysctl deregistration. */
318 void sctp_sysctl_unregister(void)
320 unregister_sysctl_table(sctp_sysctl_header);