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;
56 static unsigned long max_autoclose_min
= 0;
57 static unsigned long max_autoclose_max
=
58 (MAX_SCHEDULE_TIMEOUT
/ HZ
> UINT_MAX
)
59 ? UINT_MAX
: MAX_SCHEDULE_TIMEOUT
/ HZ
;
61 extern long sysctl_sctp_mem
[3];
62 extern int sysctl_sctp_rmem
[3];
63 extern int sysctl_sctp_wmem
[3];
65 static ctl_table sctp_table
[] = {
67 .procname
= "rto_initial",
68 .data
= &sctp_rto_initial
,
69 .maxlen
= sizeof(unsigned int),
71 .proc_handler
= proc_dointvec_minmax
,
76 .procname
= "rto_min",
77 .data
= &sctp_rto_min
,
78 .maxlen
= sizeof(unsigned int),
80 .proc_handler
= proc_dointvec_minmax
,
85 .procname
= "rto_max",
86 .data
= &sctp_rto_max
,
87 .maxlen
= sizeof(unsigned int),
89 .proc_handler
= proc_dointvec_minmax
,
94 .procname
= "valid_cookie_life",
95 .data
= &sctp_valid_cookie_life
,
96 .maxlen
= sizeof(unsigned int),
98 .proc_handler
= proc_dointvec_minmax
,
103 .procname
= "max_burst",
104 .data
= &sctp_max_burst
,
105 .maxlen
= sizeof(int),
107 .proc_handler
= proc_dointvec_minmax
,
112 .procname
= "association_max_retrans",
113 .data
= &sctp_max_retrans_association
,
114 .maxlen
= sizeof(int),
116 .proc_handler
= proc_dointvec_minmax
,
121 .procname
= "sndbuf_policy",
122 .data
= &sctp_sndbuf_policy
,
123 .maxlen
= sizeof(int),
125 .proc_handler
= proc_dointvec
,
128 .procname
= "rcvbuf_policy",
129 .data
= &sctp_rcvbuf_policy
,
130 .maxlen
= sizeof(int),
132 .proc_handler
= proc_dointvec
,
135 .procname
= "path_max_retrans",
136 .data
= &sctp_max_retrans_path
,
137 .maxlen
= sizeof(int),
139 .proc_handler
= proc_dointvec_minmax
,
144 .procname
= "max_init_retransmits",
145 .data
= &sctp_max_retrans_init
,
146 .maxlen
= sizeof(int),
148 .proc_handler
= proc_dointvec_minmax
,
153 .procname
= "hb_interval",
154 .data
= &sctp_hb_interval
,
155 .maxlen
= sizeof(unsigned int),
157 .proc_handler
= proc_dointvec_minmax
,
162 .procname
= "cookie_preserve_enable",
163 .data
= &sctp_cookie_preserve_enable
,
164 .maxlen
= sizeof(int),
166 .proc_handler
= proc_dointvec
,
169 .procname
= "rto_alpha_exp_divisor",
170 .data
= &sctp_rto_alpha
,
171 .maxlen
= sizeof(int),
173 .proc_handler
= proc_dointvec
,
176 .procname
= "rto_beta_exp_divisor",
177 .data
= &sctp_rto_beta
,
178 .maxlen
= sizeof(int),
180 .proc_handler
= proc_dointvec
,
183 .procname
= "addip_enable",
184 .data
= &sctp_addip_enable
,
185 .maxlen
= sizeof(int),
187 .proc_handler
= proc_dointvec
,
190 .procname
= "default_auto_asconf",
191 .data
= &sctp_default_auto_asconf
,
192 .maxlen
= sizeof(int),
194 .proc_handler
= proc_dointvec
,
197 .procname
= "prsctp_enable",
198 .data
= &sctp_prsctp_enable
,
199 .maxlen
= sizeof(int),
201 .proc_handler
= proc_dointvec
,
204 .procname
= "sack_timeout",
205 .data
= &sctp_sack_timeout
,
206 .maxlen
= sizeof(int),
208 .proc_handler
= proc_dointvec_minmax
,
209 .extra1
= &sack_timer_min
,
210 .extra2
= &sack_timer_max
,
213 .procname
= "sctp_mem",
214 .data
= &sysctl_sctp_mem
,
215 .maxlen
= sizeof(sysctl_sctp_mem
),
217 .proc_handler
= proc_doulongvec_minmax
220 .procname
= "sctp_rmem",
221 .data
= &sysctl_sctp_rmem
,
222 .maxlen
= sizeof(sysctl_sctp_rmem
),
224 .proc_handler
= proc_dointvec
,
227 .procname
= "sctp_wmem",
228 .data
= &sysctl_sctp_wmem
,
229 .maxlen
= sizeof(sysctl_sctp_wmem
),
231 .proc_handler
= proc_dointvec
,
234 .procname
= "auth_enable",
235 .data
= &sctp_auth_enable
,
236 .maxlen
= sizeof(int),
238 .proc_handler
= proc_dointvec
,
241 .procname
= "addip_noauth_enable",
242 .data
= &sctp_addip_noauth
,
243 .maxlen
= sizeof(int),
245 .proc_handler
= proc_dointvec
,
248 .procname
= "addr_scope_policy",
249 .data
= &sctp_scope_policy
,
250 .maxlen
= sizeof(int),
252 .proc_handler
= proc_dointvec_minmax
,
254 .extra2
= &addr_scope_max
,
257 .procname
= "rwnd_update_shift",
258 .data
= &sctp_rwnd_upd_shift
,
259 .maxlen
= sizeof(int),
261 .proc_handler
= &proc_dointvec_minmax
,
263 .extra2
= &rwnd_scale_max
,
266 .procname
= "max_autoclose",
267 .data
= &sctp_max_autoclose
,
268 .maxlen
= sizeof(unsigned long),
270 .proc_handler
= &proc_doulongvec_minmax
,
271 .extra1
= &max_autoclose_min
,
272 .extra2
= &max_autoclose_max
,
278 static struct ctl_path sctp_path
[] = {
279 { .procname
= "net", },
280 { .procname
= "sctp", },
284 static struct ctl_table_header
* sctp_sysctl_header
;
286 /* Sysctl registration. */
287 void sctp_sysctl_register(void)
289 sctp_sysctl_header
= register_sysctl_paths(sctp_path
, sctp_table
);
292 /* Sysctl deregistration. */
293 void sctp_sysctl_unregister(void)
295 unregister_sysctl_table(sctp_sysctl_header
);