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 long 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 .procname
= "rto_initial",
64 .data
= &sctp_rto_initial
,
65 .maxlen
= sizeof(unsigned int),
67 .proc_handler
= proc_dointvec_minmax
,
72 .procname
= "rto_min",
73 .data
= &sctp_rto_min
,
74 .maxlen
= sizeof(unsigned int),
76 .proc_handler
= proc_dointvec_minmax
,
81 .procname
= "rto_max",
82 .data
= &sctp_rto_max
,
83 .maxlen
= sizeof(unsigned int),
85 .proc_handler
= proc_dointvec_minmax
,
90 .procname
= "valid_cookie_life",
91 .data
= &sctp_valid_cookie_life
,
92 .maxlen
= sizeof(unsigned int),
94 .proc_handler
= proc_dointvec_minmax
,
99 .procname
= "max_burst",
100 .data
= &sctp_max_burst
,
101 .maxlen
= sizeof(int),
103 .proc_handler
= proc_dointvec_minmax
,
108 .procname
= "association_max_retrans",
109 .data
= &sctp_max_retrans_association
,
110 .maxlen
= sizeof(int),
112 .proc_handler
= proc_dointvec_minmax
,
117 .procname
= "sndbuf_policy",
118 .data
= &sctp_sndbuf_policy
,
119 .maxlen
= sizeof(int),
121 .proc_handler
= proc_dointvec
,
124 .procname
= "rcvbuf_policy",
125 .data
= &sctp_rcvbuf_policy
,
126 .maxlen
= sizeof(int),
128 .proc_handler
= proc_dointvec
,
131 .procname
= "path_max_retrans",
132 .data
= &sctp_max_retrans_path
,
133 .maxlen
= sizeof(int),
135 .proc_handler
= proc_dointvec_minmax
,
140 .procname
= "max_init_retransmits",
141 .data
= &sctp_max_retrans_init
,
142 .maxlen
= sizeof(int),
144 .proc_handler
= proc_dointvec_minmax
,
149 .procname
= "hb_interval",
150 .data
= &sctp_hb_interval
,
151 .maxlen
= sizeof(unsigned int),
153 .proc_handler
= proc_dointvec_minmax
,
158 .procname
= "cookie_preserve_enable",
159 .data
= &sctp_cookie_preserve_enable
,
160 .maxlen
= sizeof(int),
162 .proc_handler
= proc_dointvec
,
165 .procname
= "rto_alpha_exp_divisor",
166 .data
= &sctp_rto_alpha
,
167 .maxlen
= sizeof(int),
169 .proc_handler
= proc_dointvec
,
172 .procname
= "rto_beta_exp_divisor",
173 .data
= &sctp_rto_beta
,
174 .maxlen
= sizeof(int),
176 .proc_handler
= proc_dointvec
,
179 .procname
= "addip_enable",
180 .data
= &sctp_addip_enable
,
181 .maxlen
= sizeof(int),
183 .proc_handler
= proc_dointvec
,
186 .procname
= "prsctp_enable",
187 .data
= &sctp_prsctp_enable
,
188 .maxlen
= sizeof(int),
190 .proc_handler
= proc_dointvec
,
193 .procname
= "sack_timeout",
194 .data
= &sctp_sack_timeout
,
195 .maxlen
= sizeof(int),
197 .proc_handler
= proc_dointvec_minmax
,
198 .extra1
= &sack_timer_min
,
199 .extra2
= &sack_timer_max
,
202 .procname
= "sctp_mem",
203 .data
= &sysctl_sctp_mem
,
204 .maxlen
= sizeof(sysctl_sctp_mem
),
206 .proc_handler
= proc_doulongvec_minmax
209 .procname
= "sctp_rmem",
210 .data
= &sysctl_sctp_rmem
,
211 .maxlen
= sizeof(sysctl_sctp_rmem
),
213 .proc_handler
= proc_dointvec
,
216 .procname
= "sctp_wmem",
217 .data
= &sysctl_sctp_wmem
,
218 .maxlen
= sizeof(sysctl_sctp_wmem
),
220 .proc_handler
= proc_dointvec
,
223 .procname
= "auth_enable",
224 .data
= &sctp_auth_enable
,
225 .maxlen
= sizeof(int),
227 .proc_handler
= proc_dointvec
,
230 .procname
= "addip_noauth_enable",
231 .data
= &sctp_addip_noauth
,
232 .maxlen
= sizeof(int),
234 .proc_handler
= proc_dointvec
,
237 .procname
= "addr_scope_policy",
238 .data
= &sctp_scope_policy
,
239 .maxlen
= sizeof(int),
241 .proc_handler
= proc_dointvec_minmax
,
243 .extra2
= &addr_scope_max
,
246 .procname
= "rwnd_update_shift",
247 .data
= &sctp_rwnd_upd_shift
,
248 .maxlen
= sizeof(int),
250 .proc_handler
= &proc_dointvec_minmax
,
252 .extra2
= &rwnd_scale_max
,
258 static struct ctl_path sctp_path
[] = {
259 { .procname
= "net", },
260 { .procname
= "sctp", },
264 static struct ctl_table_header
* sctp_sysctl_header
;
266 /* Sysctl registration. */
267 void sctp_sysctl_register(void)
269 sctp_sysctl_header
= register_sysctl_paths(sctp_path
, sctp_table
);
272 /* Sysctl deregistration. */
273 void sctp_sysctl_unregister(void)
275 unregister_sysctl_table(sctp_sysctl_header
);