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 int sysctl_sctp_mem
[3];
56 int sysctl_sctp_rmem
[3];
57 int sysctl_sctp_wmem
[3];
60 * per assoc memory limitationf for sends
62 int sysctl_sctp_wmem
[3];
64 static ctl_table sctp_table
[] = {
66 .ctl_name
= NET_SCTP_RTO_INITIAL
,
67 .procname
= "rto_initial",
68 .data
= &sctp_rto_initial
,
69 .maxlen
= sizeof(unsigned int),
71 .proc_handler
= &proc_dointvec_minmax
,
72 .strategy
= &sysctl_intvec
,
77 .ctl_name
= NET_SCTP_RTO_MIN
,
78 .procname
= "rto_min",
79 .data
= &sctp_rto_min
,
80 .maxlen
= sizeof(unsigned int),
82 .proc_handler
= &proc_dointvec_minmax
,
83 .strategy
= &sysctl_intvec
,
88 .ctl_name
= NET_SCTP_RTO_MAX
,
89 .procname
= "rto_max",
90 .data
= &sctp_rto_max
,
91 .maxlen
= sizeof(unsigned int),
93 .proc_handler
= &proc_dointvec_minmax
,
94 .strategy
= &sysctl_intvec
,
99 .ctl_name
= NET_SCTP_VALID_COOKIE_LIFE
,
100 .procname
= "valid_cookie_life",
101 .data
= &sctp_valid_cookie_life
,
102 .maxlen
= sizeof(unsigned int),
104 .proc_handler
= &proc_dointvec_minmax
,
105 .strategy
= &sysctl_intvec
,
110 .ctl_name
= NET_SCTP_MAX_BURST
,
111 .procname
= "max_burst",
112 .data
= &sctp_max_burst
,
113 .maxlen
= sizeof(int),
115 .proc_handler
= &proc_dointvec_minmax
,
116 .strategy
= &sysctl_intvec
,
121 .ctl_name
= NET_SCTP_ASSOCIATION_MAX_RETRANS
,
122 .procname
= "association_max_retrans",
123 .data
= &sctp_max_retrans_association
,
124 .maxlen
= sizeof(int),
126 .proc_handler
= &proc_dointvec_minmax
,
127 .strategy
= &sysctl_intvec
,
132 .ctl_name
= NET_SCTP_SNDBUF_POLICY
,
133 .procname
= "sndbuf_policy",
134 .data
= &sctp_sndbuf_policy
,
135 .maxlen
= sizeof(int),
137 .proc_handler
= &proc_dointvec
,
138 .strategy
= &sysctl_intvec
141 .ctl_name
= NET_SCTP_RCVBUF_POLICY
,
142 .procname
= "rcvbuf_policy",
143 .data
= &sctp_rcvbuf_policy
,
144 .maxlen
= sizeof(int),
146 .proc_handler
= &proc_dointvec
,
147 .strategy
= &sysctl_intvec
150 .ctl_name
= NET_SCTP_PATH_MAX_RETRANS
,
151 .procname
= "path_max_retrans",
152 .data
= &sctp_max_retrans_path
,
153 .maxlen
= sizeof(int),
155 .proc_handler
= &proc_dointvec_minmax
,
156 .strategy
= &sysctl_intvec
,
161 .ctl_name
= NET_SCTP_MAX_INIT_RETRANSMITS
,
162 .procname
= "max_init_retransmits",
163 .data
= &sctp_max_retrans_init
,
164 .maxlen
= sizeof(int),
166 .proc_handler
= &proc_dointvec_minmax
,
167 .strategy
= &sysctl_intvec
,
172 .ctl_name
= NET_SCTP_HB_INTERVAL
,
173 .procname
= "hb_interval",
174 .data
= &sctp_hb_interval
,
175 .maxlen
= sizeof(unsigned int),
177 .proc_handler
= &proc_dointvec_minmax
,
178 .strategy
= &sysctl_intvec
,
183 .ctl_name
= NET_SCTP_PRESERVE_ENABLE
,
184 .procname
= "cookie_preserve_enable",
185 .data
= &sctp_cookie_preserve_enable
,
186 .maxlen
= sizeof(int),
188 .proc_handler
= &proc_dointvec
,
189 .strategy
= &sysctl_intvec
192 .ctl_name
= NET_SCTP_RTO_ALPHA
,
193 .procname
= "rto_alpha_exp_divisor",
194 .data
= &sctp_rto_alpha
,
195 .maxlen
= sizeof(int),
197 .proc_handler
= &proc_dointvec
,
198 .strategy
= &sysctl_intvec
201 .ctl_name
= NET_SCTP_RTO_BETA
,
202 .procname
= "rto_beta_exp_divisor",
203 .data
= &sctp_rto_beta
,
204 .maxlen
= sizeof(int),
206 .proc_handler
= &proc_dointvec
,
207 .strategy
= &sysctl_intvec
210 .ctl_name
= NET_SCTP_ADDIP_ENABLE
,
211 .procname
= "addip_enable",
212 .data
= &sctp_addip_enable
,
213 .maxlen
= sizeof(int),
215 .proc_handler
= &proc_dointvec
,
216 .strategy
= &sysctl_intvec
219 .ctl_name
= NET_SCTP_PRSCTP_ENABLE
,
220 .procname
= "prsctp_enable",
221 .data
= &sctp_prsctp_enable
,
222 .maxlen
= sizeof(int),
224 .proc_handler
= &proc_dointvec
,
225 .strategy
= &sysctl_intvec
228 .ctl_name
= NET_SCTP_SACK_TIMEOUT
,
229 .procname
= "sack_timeout",
230 .data
= &sctp_sack_timeout
,
231 .maxlen
= sizeof(long),
233 .proc_handler
= &proc_dointvec_minmax
,
234 .strategy
= &sysctl_intvec
,
235 .extra1
= &sack_timer_min
,
236 .extra2
= &sack_timer_max
,
239 .ctl_name
= CTL_UNNUMBERED
,
240 .procname
= "sctp_mem",
241 .data
= &sysctl_sctp_mem
,
242 .maxlen
= sizeof(sysctl_sctp_mem
),
244 .proc_handler
= &proc_dointvec
,
247 .ctl_name
= CTL_UNNUMBERED
,
248 .procname
= "sctp_rmem",
249 .data
= &sysctl_sctp_rmem
,
250 .maxlen
= sizeof(sysctl_sctp_rmem
),
252 .proc_handler
= &proc_dointvec
,
255 .ctl_name
= CTL_UNNUMBERED
,
256 .procname
= "sctp_wmem",
257 .data
= &sysctl_sctp_wmem
,
258 .maxlen
= sizeof(sysctl_sctp_wmem
),
260 .proc_handler
= &proc_dointvec
,
265 static ctl_table sctp_net_table
[] = {
267 .ctl_name
= NET_SCTP
,
275 static ctl_table sctp_root_table
[] = {
280 .child
= sctp_net_table
285 static struct ctl_table_header
* sctp_sysctl_header
;
287 /* Sysctl registration. */
288 void sctp_sysctl_register(void)
290 sctp_sysctl_header
= register_sysctl_table(sctp_root_table
);
293 /* Sysctl deregistration. */
294 void sctp_sysctl_unregister(void)
296 unregister_sysctl_table(sctp_sysctl_header
);