sysctl.c (ecb41832bd2a7a3f8ac93527cec5e51e3827daed) sysctl.c (eec4844fae7c033a0c1fc1eb3b8517aeb8b6cc49)
1// SPDX-License-Identifier: GPL-2.0-or-later
2/* SCTP kernel implementation
3 * (C) Copyright IBM Corp. 2002, 2004
4 * Copyright (c) 2002 Intel Corp.
5 *
6 * This file is part of the SCTP kernel implementation
7 *
8 * Sysctl related interfaces for SCTP.

--- 11 unchanged lines hidden (view full) ---

20 */
21
22#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
23
24#include <net/sctp/structs.h>
25#include <net/sctp/sctp.h>
26#include <linux/sysctl.h>
27
1// SPDX-License-Identifier: GPL-2.0-or-later
2/* SCTP kernel implementation
3 * (C) Copyright IBM Corp. 2002, 2004
4 * Copyright (c) 2002 Intel Corp.
5 *
6 * This file is part of the SCTP kernel implementation
7 *
8 * Sysctl related interfaces for SCTP.

--- 11 unchanged lines hidden (view full) ---

20 */
21
22#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
23
24#include <net/sctp/structs.h>
25#include <net/sctp/sctp.h>
26#include <linux/sysctl.h>
27
28static int zero = 0;
29static int one = 1;
30static int timer_max = 86400000; /* ms in one day */
28static int timer_max = 86400000; /* ms in one day */
31static int int_max = INT_MAX;
32static int sack_timer_min = 1;
33static int sack_timer_max = 500;
34static int addr_scope_max = SCTP_SCOPE_POLICY_MAX;
35static int rwnd_scale_max = 16;
36static int rto_alpha_min = 0;
37static int rto_beta_min = 0;
38static int rto_alpha_max = 1000;
39static int rto_beta_max = 1000;

--- 47 unchanged lines hidden (view full) ---

87
88static struct ctl_table sctp_net_table[] = {
89 {
90 .procname = "rto_initial",
91 .data = &init_net.sctp.rto_initial,
92 .maxlen = sizeof(unsigned int),
93 .mode = 0644,
94 .proc_handler = proc_dointvec_minmax,
29static int sack_timer_min = 1;
30static int sack_timer_max = 500;
31static int addr_scope_max = SCTP_SCOPE_POLICY_MAX;
32static int rwnd_scale_max = 16;
33static int rto_alpha_min = 0;
34static int rto_beta_min = 0;
35static int rto_alpha_max = 1000;
36static int rto_beta_max = 1000;

--- 47 unchanged lines hidden (view full) ---

84
85static struct ctl_table sctp_net_table[] = {
86 {
87 .procname = "rto_initial",
88 .data = &init_net.sctp.rto_initial,
89 .maxlen = sizeof(unsigned int),
90 .mode = 0644,
91 .proc_handler = proc_dointvec_minmax,
95 .extra1 = &one,
92 .extra1 = SYSCTL_ONE,
96 .extra2 = &timer_max
97 },
98 {
99 .procname = "rto_min",
100 .data = &init_net.sctp.rto_min,
101 .maxlen = sizeof(unsigned int),
102 .mode = 0644,
103 .proc_handler = proc_sctp_do_rto_min,
93 .extra2 = &timer_max
94 },
95 {
96 .procname = "rto_min",
97 .data = &init_net.sctp.rto_min,
98 .maxlen = sizeof(unsigned int),
99 .mode = 0644,
100 .proc_handler = proc_sctp_do_rto_min,
104 .extra1 = &one,
101 .extra1 = SYSCTL_ONE,
105 .extra2 = &init_net.sctp.rto_max
106 },
107 {
108 .procname = "rto_max",
109 .data = &init_net.sctp.rto_max,
110 .maxlen = sizeof(unsigned int),
111 .mode = 0644,
112 .proc_handler = proc_sctp_do_rto_max,

--- 19 unchanged lines hidden (view full) ---

132 .extra2 = &rto_beta_max,
133 },
134 {
135 .procname = "max_burst",
136 .data = &init_net.sctp.max_burst,
137 .maxlen = sizeof(int),
138 .mode = 0644,
139 .proc_handler = proc_dointvec_minmax,
102 .extra2 = &init_net.sctp.rto_max
103 },
104 {
105 .procname = "rto_max",
106 .data = &init_net.sctp.rto_max,
107 .maxlen = sizeof(unsigned int),
108 .mode = 0644,
109 .proc_handler = proc_sctp_do_rto_max,

--- 19 unchanged lines hidden (view full) ---

129 .extra2 = &rto_beta_max,
130 },
131 {
132 .procname = "max_burst",
133 .data = &init_net.sctp.max_burst,
134 .maxlen = sizeof(int),
135 .mode = 0644,
136 .proc_handler = proc_dointvec_minmax,
140 .extra1 = &zero,
141 .extra2 = &int_max
137 .extra1 = SYSCTL_ZERO,
138 .extra2 = SYSCTL_INT_MAX,
142 },
143 {
144 .procname = "cookie_preserve_enable",
145 .data = &init_net.sctp.cookie_preserve_enable,
146 .maxlen = sizeof(int),
147 .mode = 0644,
148 .proc_handler = proc_dointvec,
149 },

--- 5 unchanged lines hidden (view full) ---

155 .proc_handler = proc_sctp_do_hmac_alg,
156 },
157 {
158 .procname = "valid_cookie_life",
159 .data = &init_net.sctp.valid_cookie_life,
160 .maxlen = sizeof(unsigned int),
161 .mode = 0644,
162 .proc_handler = proc_dointvec_minmax,
139 },
140 {
141 .procname = "cookie_preserve_enable",
142 .data = &init_net.sctp.cookie_preserve_enable,
143 .maxlen = sizeof(int),
144 .mode = 0644,
145 .proc_handler = proc_dointvec,
146 },

--- 5 unchanged lines hidden (view full) ---

152 .proc_handler = proc_sctp_do_hmac_alg,
153 },
154 {
155 .procname = "valid_cookie_life",
156 .data = &init_net.sctp.valid_cookie_life,
157 .maxlen = sizeof(unsigned int),
158 .mode = 0644,
159 .proc_handler = proc_dointvec_minmax,
163 .extra1 = &one,
160 .extra1 = SYSCTL_ONE,
164 .extra2 = &timer_max
165 },
166 {
167 .procname = "sack_timeout",
168 .data = &init_net.sctp.sack_timeout,
169 .maxlen = sizeof(int),
170 .mode = 0644,
171 .proc_handler = proc_dointvec_minmax,
172 .extra1 = &sack_timer_min,
173 .extra2 = &sack_timer_max,
174 },
175 {
176 .procname = "hb_interval",
177 .data = &init_net.sctp.hb_interval,
178 .maxlen = sizeof(unsigned int),
179 .mode = 0644,
180 .proc_handler = proc_dointvec_minmax,
161 .extra2 = &timer_max
162 },
163 {
164 .procname = "sack_timeout",
165 .data = &init_net.sctp.sack_timeout,
166 .maxlen = sizeof(int),
167 .mode = 0644,
168 .proc_handler = proc_dointvec_minmax,
169 .extra1 = &sack_timer_min,
170 .extra2 = &sack_timer_max,
171 },
172 {
173 .procname = "hb_interval",
174 .data = &init_net.sctp.hb_interval,
175 .maxlen = sizeof(unsigned int),
176 .mode = 0644,
177 .proc_handler = proc_dointvec_minmax,
181 .extra1 = &one,
178 .extra1 = SYSCTL_ONE,
182 .extra2 = &timer_max
183 },
184 {
185 .procname = "association_max_retrans",
186 .data = &init_net.sctp.max_retrans_association,
187 .maxlen = sizeof(int),
188 .mode = 0644,
189 .proc_handler = proc_dointvec_minmax,
179 .extra2 = &timer_max
180 },
181 {
182 .procname = "association_max_retrans",
183 .data = &init_net.sctp.max_retrans_association,
184 .maxlen = sizeof(int),
185 .mode = 0644,
186 .proc_handler = proc_dointvec_minmax,
190 .extra1 = &one,
191 .extra2 = &int_max
187 .extra1 = SYSCTL_ONE,
188 .extra2 = SYSCTL_INT_MAX,
192 },
193 {
194 .procname = "path_max_retrans",
195 .data = &init_net.sctp.max_retrans_path,
196 .maxlen = sizeof(int),
197 .mode = 0644,
198 .proc_handler = proc_dointvec_minmax,
189 },
190 {
191 .procname = "path_max_retrans",
192 .data = &init_net.sctp.max_retrans_path,
193 .maxlen = sizeof(int),
194 .mode = 0644,
195 .proc_handler = proc_dointvec_minmax,
199 .extra1 = &one,
200 .extra2 = &int_max
196 .extra1 = SYSCTL_ONE,
197 .extra2 = SYSCTL_INT_MAX,
201 },
202 {
203 .procname = "max_init_retransmits",
204 .data = &init_net.sctp.max_retrans_init,
205 .maxlen = sizeof(int),
206 .mode = 0644,
207 .proc_handler = proc_dointvec_minmax,
198 },
199 {
200 .procname = "max_init_retransmits",
201 .data = &init_net.sctp.max_retrans_init,
202 .maxlen = sizeof(int),
203 .mode = 0644,
204 .proc_handler = proc_dointvec_minmax,
208 .extra1 = &one,
209 .extra2 = &int_max
205 .extra1 = SYSCTL_ONE,
206 .extra2 = SYSCTL_INT_MAX,
210 },
211 {
212 .procname = "pf_retrans",
213 .data = &init_net.sctp.pf_retrans,
214 .maxlen = sizeof(int),
215 .mode = 0644,
216 .proc_handler = proc_dointvec_minmax,
207 },
208 {
209 .procname = "pf_retrans",
210 .data = &init_net.sctp.pf_retrans,
211 .maxlen = sizeof(int),
212 .mode = 0644,
213 .proc_handler = proc_dointvec_minmax,
217 .extra1 = &zero,
218 .extra2 = &int_max
214 .extra1 = SYSCTL_ZERO,
215 .extra2 = SYSCTL_INT_MAX,
219 },
220 {
221 .procname = "sndbuf_policy",
222 .data = &init_net.sctp.sndbuf_policy,
223 .maxlen = sizeof(int),
224 .mode = 0644,
225 .proc_handler = proc_dointvec,
226 },

--- 54 unchanged lines hidden (view full) ---

281 .proc_handler = proc_dointvec,
282 },
283 {
284 .procname = "addr_scope_policy",
285 .data = &init_net.sctp.scope_policy,
286 .maxlen = sizeof(int),
287 .mode = 0644,
288 .proc_handler = proc_dointvec_minmax,
216 },
217 {
218 .procname = "sndbuf_policy",
219 .data = &init_net.sctp.sndbuf_policy,
220 .maxlen = sizeof(int),
221 .mode = 0644,
222 .proc_handler = proc_dointvec,
223 },

--- 54 unchanged lines hidden (view full) ---

278 .proc_handler = proc_dointvec,
279 },
280 {
281 .procname = "addr_scope_policy",
282 .data = &init_net.sctp.scope_policy,
283 .maxlen = sizeof(int),
284 .mode = 0644,
285 .proc_handler = proc_dointvec_minmax,
289 .extra1 = &zero,
286 .extra1 = SYSCTL_ZERO,
290 .extra2 = &addr_scope_max,
291 },
292 {
293 .procname = "rwnd_update_shift",
294 .data = &init_net.sctp.rwnd_upd_shift,
295 .maxlen = sizeof(int),
296 .mode = 0644,
297 .proc_handler = &proc_dointvec_minmax,
287 .extra2 = &addr_scope_max,
288 },
289 {
290 .procname = "rwnd_update_shift",
291 .data = &init_net.sctp.rwnd_upd_shift,
292 .maxlen = sizeof(int),
293 .mode = 0644,
294 .proc_handler = &proc_dointvec_minmax,
298 .extra1 = &one,
295 .extra1 = SYSCTL_ONE,
299 .extra2 = &rwnd_scale_max,
300 },
301 {
302 .procname = "max_autoclose",
303 .data = &init_net.sctp.max_autoclose,
304 .maxlen = sizeof(unsigned long),
305 .mode = 0644,
306 .proc_handler = &proc_doulongvec_minmax,

--- 201 unchanged lines hidden ---
296 .extra2 = &rwnd_scale_max,
297 },
298 {
299 .procname = "max_autoclose",
300 .data = &init_net.sctp.max_autoclose,
301 .maxlen = sizeof(unsigned long),
302 .mode = 0644,
303 .proc_handler = &proc_doulongvec_minmax,

--- 201 unchanged lines hidden ---