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 long sack_timer_min
= 1;
53 static long sack_timer_max
= 500;
55 extern int sysctl_sctp_mem
[3];
56 extern int sysctl_sctp_rmem
[3];
57 extern int sysctl_sctp_wmem
[3];
59 static ctl_table sctp_table
[] = {
61 .ctl_name
= NET_SCTP_RTO_INITIAL
,
62 .procname
= "rto_initial",
63 .data
= &sctp_rto_initial
,
64 .maxlen
= sizeof(unsigned int),
66 .proc_handler
= &proc_dointvec_minmax
,
67 .strategy
= &sysctl_intvec
,
72 .ctl_name
= NET_SCTP_RTO_MIN
,
73 .procname
= "rto_min",
74 .data
= &sctp_rto_min
,
75 .maxlen
= sizeof(unsigned int),
77 .proc_handler
= &proc_dointvec_minmax
,
78 .strategy
= &sysctl_intvec
,
83 .ctl_name
= NET_SCTP_RTO_MAX
,
84 .procname
= "rto_max",
85 .data
= &sctp_rto_max
,
86 .maxlen
= sizeof(unsigned int),
88 .proc_handler
= &proc_dointvec_minmax
,
89 .strategy
= &sysctl_intvec
,
94 .ctl_name
= NET_SCTP_VALID_COOKIE_LIFE
,
95 .procname
= "valid_cookie_life",
96 .data
= &sctp_valid_cookie_life
,
97 .maxlen
= sizeof(unsigned int),
99 .proc_handler
= &proc_dointvec_minmax
,
100 .strategy
= &sysctl_intvec
,
105 .ctl_name
= NET_SCTP_MAX_BURST
,
106 .procname
= "max_burst",
107 .data
= &sctp_max_burst
,
108 .maxlen
= sizeof(int),
110 .proc_handler
= &proc_dointvec_minmax
,
111 .strategy
= &sysctl_intvec
,
116 .ctl_name
= NET_SCTP_ASSOCIATION_MAX_RETRANS
,
117 .procname
= "association_max_retrans",
118 .data
= &sctp_max_retrans_association
,
119 .maxlen
= sizeof(int),
121 .proc_handler
= &proc_dointvec_minmax
,
122 .strategy
= &sysctl_intvec
,
127 .ctl_name
= NET_SCTP_SNDBUF_POLICY
,
128 .procname
= "sndbuf_policy",
129 .data
= &sctp_sndbuf_policy
,
130 .maxlen
= sizeof(int),
132 .proc_handler
= &proc_dointvec
,
133 .strategy
= &sysctl_intvec
136 .ctl_name
= NET_SCTP_RCVBUF_POLICY
,
137 .procname
= "rcvbuf_policy",
138 .data
= &sctp_rcvbuf_policy
,
139 .maxlen
= sizeof(int),
141 .proc_handler
= &proc_dointvec
,
142 .strategy
= &sysctl_intvec
145 .ctl_name
= NET_SCTP_PATH_MAX_RETRANS
,
146 .procname
= "path_max_retrans",
147 .data
= &sctp_max_retrans_path
,
148 .maxlen
= sizeof(int),
150 .proc_handler
= &proc_dointvec_minmax
,
151 .strategy
= &sysctl_intvec
,
156 .ctl_name
= NET_SCTP_MAX_INIT_RETRANSMITS
,
157 .procname
= "max_init_retransmits",
158 .data
= &sctp_max_retrans_init
,
159 .maxlen
= sizeof(int),
161 .proc_handler
= &proc_dointvec_minmax
,
162 .strategy
= &sysctl_intvec
,
167 .ctl_name
= NET_SCTP_HB_INTERVAL
,
168 .procname
= "hb_interval",
169 .data
= &sctp_hb_interval
,
170 .maxlen
= sizeof(unsigned int),
172 .proc_handler
= &proc_dointvec_minmax
,
173 .strategy
= &sysctl_intvec
,
178 .ctl_name
= NET_SCTP_PRESERVE_ENABLE
,
179 .procname
= "cookie_preserve_enable",
180 .data
= &sctp_cookie_preserve_enable
,
181 .maxlen
= sizeof(int),
183 .proc_handler
= &proc_dointvec
,
184 .strategy
= &sysctl_intvec
187 .ctl_name
= NET_SCTP_RTO_ALPHA
,
188 .procname
= "rto_alpha_exp_divisor",
189 .data
= &sctp_rto_alpha
,
190 .maxlen
= sizeof(int),
192 .proc_handler
= &proc_dointvec
,
193 .strategy
= &sysctl_intvec
196 .ctl_name
= NET_SCTP_RTO_BETA
,
197 .procname
= "rto_beta_exp_divisor",
198 .data
= &sctp_rto_beta
,
199 .maxlen
= sizeof(int),
201 .proc_handler
= &proc_dointvec
,
202 .strategy
= &sysctl_intvec
205 .ctl_name
= NET_SCTP_ADDIP_ENABLE
,
206 .procname
= "addip_enable",
207 .data
= &sctp_addip_enable
,
208 .maxlen
= sizeof(int),
210 .proc_handler
= &proc_dointvec
,
211 .strategy
= &sysctl_intvec
214 .ctl_name
= NET_SCTP_PRSCTP_ENABLE
,
215 .procname
= "prsctp_enable",
216 .data
= &sctp_prsctp_enable
,
217 .maxlen
= sizeof(int),
219 .proc_handler
= &proc_dointvec
,
220 .strategy
= &sysctl_intvec
223 .ctl_name
= NET_SCTP_SACK_TIMEOUT
,
224 .procname
= "sack_timeout",
225 .data
= &sctp_sack_timeout
,
226 .maxlen
= sizeof(long),
228 .proc_handler
= &proc_dointvec_minmax
,
229 .strategy
= &sysctl_intvec
,
230 .extra1
= &sack_timer_min
,
231 .extra2
= &sack_timer_max
,
234 .ctl_name
= CTL_UNNUMBERED
,
235 .procname
= "sctp_mem",
236 .data
= &sysctl_sctp_mem
,
237 .maxlen
= sizeof(sysctl_sctp_mem
),
239 .proc_handler
= &proc_dointvec
,
242 .ctl_name
= CTL_UNNUMBERED
,
243 .procname
= "sctp_rmem",
244 .data
= &sysctl_sctp_rmem
,
245 .maxlen
= sizeof(sysctl_sctp_rmem
),
247 .proc_handler
= &proc_dointvec
,
250 .ctl_name
= CTL_UNNUMBERED
,
251 .procname
= "sctp_wmem",
252 .data
= &sysctl_sctp_wmem
,
253 .maxlen
= sizeof(sysctl_sctp_wmem
),
255 .proc_handler
= &proc_dointvec
,
258 .ctl_name
= CTL_UNNUMBERED
,
259 .procname
= "auth_enable",
260 .data
= &sctp_auth_enable
,
261 .maxlen
= sizeof(int),
263 .proc_handler
= &proc_dointvec
,
264 .strategy
= &sysctl_intvec
267 .ctl_name
= CTL_UNNUMBERED
,
268 .procname
= "addip_noauth_enable",
269 .data
= &sctp_addip_noauth
,
270 .maxlen
= sizeof(int),
272 .proc_handler
= &proc_dointvec
,
273 .strategy
= &sysctl_intvec
278 static struct ctl_path sctp_path
[] = {
279 { .procname
= "net", .ctl_name
= CTL_NET
, },
280 { .procname
= "sctp", .ctl_name
= NET_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
);