Vlad Yasevich | 60c778b | 2008-01-11 09:57:09 -0500 | [diff] [blame] | 1 | /* SCTP kernel implementation |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 2 | * (C) Copyright IBM Corp. 2002, 2004 |
| 3 | * Copyright (c) 2002 Intel Corp. |
| 4 | * |
Vlad Yasevich | 60c778b | 2008-01-11 09:57:09 -0500 | [diff] [blame] | 5 | * This file is part of the SCTP kernel implementation |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 6 | * |
| 7 | * Sysctl related interfaces for SCTP. |
| 8 | * |
Vlad Yasevich | 60c778b | 2008-01-11 09:57:09 -0500 | [diff] [blame] | 9 | * This SCTP implementation is free software; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 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) |
| 13 | * any later version. |
| 14 | * |
Vlad Yasevich | 60c778b | 2008-01-11 09:57:09 -0500 | [diff] [blame] | 15 | * This SCTP implementation is distributed in the hope that it |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 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. |
| 20 | * |
| 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. |
| 25 | * |
| 26 | * Please send any bug reports or fixes you make to the |
| 27 | * email address(es): |
Daniel Borkmann | 91705c6 | 2013-07-23 14:51:47 +0200 | [diff] [blame] | 28 | * lksctp developers <linux-sctp@vger.kernel.org> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 29 | * |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 30 | * Written or modified by: |
| 31 | * Mingqin Liu <liuming@us.ibm.com> |
| 32 | * Jon Grimm <jgrimm@us.ibm.com> |
| 33 | * Ardelle Fan <ardelle.fan@intel.com> |
| 34 | * Ryan Layer <rmlayer@us.ibm.com> |
| 35 | * Sridhar Samudrala <sri@us.ibm.com> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 36 | */ |
| 37 | |
| 38 | #include <net/sctp/structs.h> |
Adrian Bunk | 8c5955d | 2005-09-05 18:07:42 -0700 | [diff] [blame] | 39 | #include <net/sctp/sctp.h> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 40 | #include <linux/sysctl.h> |
| 41 | |
Vladislav Yasevich | 3fd091e | 2006-08-22 13:29:17 -0700 | [diff] [blame] | 42 | static int zero = 0; |
| 43 | static int one = 1; |
| 44 | static int timer_max = 86400000; /* ms in one day */ |
| 45 | static int int_max = INT_MAX; |
Jean-Mickael Guerin | d48e074 | 2009-05-13 00:03:20 +0200 | [diff] [blame] | 46 | static int sack_timer_min = 1; |
| 47 | static int sack_timer_max = 500; |
Bhaskar Dutta | 7238843 | 2009-09-03 17:25:47 +0530 | [diff] [blame] | 48 | static int addr_scope_max = 3; /* check sctp_scope_policy_t in include/net/sctp/constants.h for max entries */ |
Vlad Yasevich | 90f2f53 | 2009-11-23 15:53:57 -0500 | [diff] [blame] | 49 | static int rwnd_scale_max = 16; |
Xi Wang | 2692ba6 | 2011-12-16 12:44:15 +0000 | [diff] [blame] | 50 | static unsigned long max_autoclose_min = 0; |
| 51 | static unsigned long max_autoclose_max = |
| 52 | (MAX_SCHEDULE_TIMEOUT / HZ > UINT_MAX) |
| 53 | ? UINT_MAX : MAX_SCHEDULE_TIMEOUT / HZ; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 54 | |
Eric Dumazet | 8d987e5 | 2010-11-09 23:24:26 +0000 | [diff] [blame] | 55 | extern long sysctl_sctp_mem[3]; |
Vlad Yasevich | 007e393 | 2007-09-16 16:04:37 -0700 | [diff] [blame] | 56 | extern int sysctl_sctp_rmem[3]; |
| 57 | extern int sysctl_sctp_wmem[3]; |
Neil Horman | 4d93df0 | 2007-08-15 16:07:44 -0700 | [diff] [blame] | 58 | |
Joe Perches | fe2c633 | 2013-06-11 23:04:25 -0700 | [diff] [blame] | 59 | static int proc_sctp_do_hmac_alg(struct ctl_table *ctl, |
Neil Horman | 3c68198 | 2012-10-24 09:20:03 +0000 | [diff] [blame] | 60 | int write, |
| 61 | void __user *buffer, size_t *lenp, |
| 62 | |
| 63 | loff_t *ppos); |
Joe Perches | fe2c633 | 2013-06-11 23:04:25 -0700 | [diff] [blame] | 64 | static struct ctl_table sctp_table[] = { |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 65 | { |
Neil Horman | 4d93df0 | 2007-08-15 16:07:44 -0700 | [diff] [blame] | 66 | .procname = "sctp_mem", |
| 67 | .data = &sysctl_sctp_mem, |
| 68 | .maxlen = sizeof(sysctl_sctp_mem), |
| 69 | .mode = 0644, |
Eric Dumazet | 8d987e5 | 2010-11-09 23:24:26 +0000 | [diff] [blame] | 70 | .proc_handler = proc_doulongvec_minmax |
Neil Horman | 4d93df0 | 2007-08-15 16:07:44 -0700 | [diff] [blame] | 71 | }, |
| 72 | { |
Neil Horman | 4d93df0 | 2007-08-15 16:07:44 -0700 | [diff] [blame] | 73 | .procname = "sctp_rmem", |
| 74 | .data = &sysctl_sctp_rmem, |
| 75 | .maxlen = sizeof(sysctl_sctp_rmem), |
| 76 | .mode = 0644, |
Alexey Dobriyan | 6d9f239 | 2008-11-03 18:21:05 -0800 | [diff] [blame] | 77 | .proc_handler = proc_dointvec, |
Neil Horman | 4d93df0 | 2007-08-15 16:07:44 -0700 | [diff] [blame] | 78 | }, |
| 79 | { |
Neil Horman | 4d93df0 | 2007-08-15 16:07:44 -0700 | [diff] [blame] | 80 | .procname = "sctp_wmem", |
| 81 | .data = &sysctl_sctp_wmem, |
| 82 | .maxlen = sizeof(sysctl_sctp_wmem), |
| 83 | .mode = 0644, |
Alexey Dobriyan | 6d9f239 | 2008-11-03 18:21:05 -0800 | [diff] [blame] | 84 | .proc_handler = proc_dointvec, |
Neil Horman | 4d93df0 | 2007-08-15 16:07:44 -0700 | [diff] [blame] | 85 | }, |
Eric W. Biederman | e1fc3b1 | 2012-08-07 07:29:57 +0000 | [diff] [blame] | 86 | |
| 87 | { /* sentinel */ } |
| 88 | }; |
| 89 | |
Joe Perches | fe2c633 | 2013-06-11 23:04:25 -0700 | [diff] [blame] | 90 | static struct ctl_table sctp_net_table[] = { |
Vlad Yasevich | a29a5bd | 2007-09-16 19:31:35 -0700 | [diff] [blame] | 91 | { |
Eric W. Biederman | e1fc3b1 | 2012-08-07 07:29:57 +0000 | [diff] [blame] | 92 | .procname = "rto_initial", |
| 93 | .data = &init_net.sctp.rto_initial, |
| 94 | .maxlen = sizeof(unsigned int), |
| 95 | .mode = 0644, |
| 96 | .proc_handler = proc_dointvec_minmax, |
| 97 | .extra1 = &one, |
| 98 | .extra2 = &timer_max |
| 99 | }, |
| 100 | { |
| 101 | .procname = "rto_min", |
| 102 | .data = &init_net.sctp.rto_min, |
| 103 | .maxlen = sizeof(unsigned int), |
| 104 | .mode = 0644, |
| 105 | .proc_handler = proc_dointvec_minmax, |
| 106 | .extra1 = &one, |
| 107 | .extra2 = &timer_max |
| 108 | }, |
| 109 | { |
| 110 | .procname = "rto_max", |
| 111 | .data = &init_net.sctp.rto_max, |
| 112 | .maxlen = sizeof(unsigned int), |
| 113 | .mode = 0644, |
| 114 | .proc_handler = proc_dointvec_minmax, |
| 115 | .extra1 = &one, |
| 116 | .extra2 = &timer_max |
| 117 | }, |
| 118 | { |
| 119 | .procname = "rto_alpha_exp_divisor", |
| 120 | .data = &init_net.sctp.rto_alpha, |
| 121 | .maxlen = sizeof(int), |
| 122 | .mode = 0444, |
| 123 | .proc_handler = proc_dointvec, |
| 124 | }, |
| 125 | { |
| 126 | .procname = "rto_beta_exp_divisor", |
| 127 | .data = &init_net.sctp.rto_beta, |
| 128 | .maxlen = sizeof(int), |
| 129 | .mode = 0444, |
| 130 | .proc_handler = proc_dointvec, |
| 131 | }, |
| 132 | { |
| 133 | .procname = "max_burst", |
| 134 | .data = &init_net.sctp.max_burst, |
| 135 | .maxlen = sizeof(int), |
| 136 | .mode = 0644, |
| 137 | .proc_handler = proc_dointvec_minmax, |
| 138 | .extra1 = &zero, |
| 139 | .extra2 = &int_max |
| 140 | }, |
| 141 | { |
| 142 | .procname = "cookie_preserve_enable", |
| 143 | .data = &init_net.sctp.cookie_preserve_enable, |
| 144 | .maxlen = sizeof(int), |
| 145 | .mode = 0644, |
| 146 | .proc_handler = proc_dointvec, |
| 147 | }, |
| 148 | { |
Neil Horman | 3c68198 | 2012-10-24 09:20:03 +0000 | [diff] [blame] | 149 | .procname = "cookie_hmac_alg", |
| 150 | .maxlen = 8, |
| 151 | .mode = 0644, |
| 152 | .proc_handler = proc_sctp_do_hmac_alg, |
| 153 | }, |
| 154 | { |
Eric W. Biederman | e1fc3b1 | 2012-08-07 07:29:57 +0000 | [diff] [blame] | 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, |
| 160 | .extra1 = &one, |
| 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, |
| 178 | .extra1 = &one, |
| 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, |
| 187 | .extra1 = &one, |
| 188 | .extra2 = &int_max |
| 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, |
| 196 | .extra1 = &one, |
| 197 | .extra2 = &int_max |
| 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, |
| 205 | .extra1 = &one, |
| 206 | .extra2 = &int_max |
| 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, |
| 214 | .extra1 = &zero, |
| 215 | .extra2 = &int_max |
| 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 | }, |
| 224 | { |
| 225 | .procname = "rcvbuf_policy", |
| 226 | .data = &init_net.sctp.rcvbuf_policy, |
| 227 | .maxlen = sizeof(int), |
| 228 | .mode = 0644, |
| 229 | .proc_handler = proc_dointvec, |
| 230 | }, |
| 231 | { |
| 232 | .procname = "default_auto_asconf", |
| 233 | .data = &init_net.sctp.default_auto_asconf, |
| 234 | .maxlen = sizeof(int), |
| 235 | .mode = 0644, |
| 236 | .proc_handler = proc_dointvec, |
| 237 | }, |
| 238 | { |
| 239 | .procname = "addip_enable", |
| 240 | .data = &init_net.sctp.addip_enable, |
Vlad Yasevich | a29a5bd | 2007-09-16 19:31:35 -0700 | [diff] [blame] | 241 | .maxlen = sizeof(int), |
| 242 | .mode = 0644, |
Alexey Dobriyan | 6d9f239 | 2008-11-03 18:21:05 -0800 | [diff] [blame] | 243 | .proc_handler = proc_dointvec, |
Vlad Yasevich | a29a5bd | 2007-09-16 19:31:35 -0700 | [diff] [blame] | 244 | }, |
Vlad Yasevich | 73d9c4f | 2007-10-24 17:24:26 -0400 | [diff] [blame] | 245 | { |
Vlad Yasevich | 73d9c4f | 2007-10-24 17:24:26 -0400 | [diff] [blame] | 246 | .procname = "addip_noauth_enable", |
Eric W. Biederman | e1fc3b1 | 2012-08-07 07:29:57 +0000 | [diff] [blame] | 247 | .data = &init_net.sctp.addip_noauth, |
| 248 | .maxlen = sizeof(int), |
| 249 | .mode = 0644, |
| 250 | .proc_handler = proc_dointvec, |
| 251 | }, |
| 252 | { |
| 253 | .procname = "prsctp_enable", |
| 254 | .data = &init_net.sctp.prsctp_enable, |
| 255 | .maxlen = sizeof(int), |
| 256 | .mode = 0644, |
| 257 | .proc_handler = proc_dointvec, |
| 258 | }, |
| 259 | { |
| 260 | .procname = "auth_enable", |
| 261 | .data = &init_net.sctp.auth_enable, |
Vlad Yasevich | 73d9c4f | 2007-10-24 17:24:26 -0400 | [diff] [blame] | 262 | .maxlen = sizeof(int), |
| 263 | .mode = 0644, |
Alexey Dobriyan | 6d9f239 | 2008-11-03 18:21:05 -0800 | [diff] [blame] | 264 | .proc_handler = proc_dointvec, |
Vlad Yasevich | 73d9c4f | 2007-10-24 17:24:26 -0400 | [diff] [blame] | 265 | }, |
Bhaskar Dutta | 7238843 | 2009-09-03 17:25:47 +0530 | [diff] [blame] | 266 | { |
Bhaskar Dutta | 7238843 | 2009-09-03 17:25:47 +0530 | [diff] [blame] | 267 | .procname = "addr_scope_policy", |
Eric W. Biederman | e1fc3b1 | 2012-08-07 07:29:57 +0000 | [diff] [blame] | 268 | .data = &init_net.sctp.scope_policy, |
Bhaskar Dutta | 7238843 | 2009-09-03 17:25:47 +0530 | [diff] [blame] | 269 | .maxlen = sizeof(int), |
| 270 | .mode = 0644, |
Eric W. Biederman | 6d45611 | 2009-11-16 03:11:48 -0800 | [diff] [blame] | 271 | .proc_handler = proc_dointvec_minmax, |
Bhaskar Dutta | 7238843 | 2009-09-03 17:25:47 +0530 | [diff] [blame] | 272 | .extra1 = &zero, |
| 273 | .extra2 = &addr_scope_max, |
| 274 | }, |
Vlad Yasevich | 90f2f53 | 2009-11-23 15:53:57 -0500 | [diff] [blame] | 275 | { |
Vlad Yasevich | 90f2f53 | 2009-11-23 15:53:57 -0500 | [diff] [blame] | 276 | .procname = "rwnd_update_shift", |
Eric W. Biederman | e1fc3b1 | 2012-08-07 07:29:57 +0000 | [diff] [blame] | 277 | .data = &init_net.sctp.rwnd_upd_shift, |
Vlad Yasevich | 90f2f53 | 2009-11-23 15:53:57 -0500 | [diff] [blame] | 278 | .maxlen = sizeof(int), |
| 279 | .mode = 0644, |
| 280 | .proc_handler = &proc_dointvec_minmax, |
Vlad Yasevich | 90f2f53 | 2009-11-23 15:53:57 -0500 | [diff] [blame] | 281 | .extra1 = &one, |
| 282 | .extra2 = &rwnd_scale_max, |
| 283 | }, |
Xi Wang | 2692ba6 | 2011-12-16 12:44:15 +0000 | [diff] [blame] | 284 | { |
| 285 | .procname = "max_autoclose", |
Eric W. Biederman | e1fc3b1 | 2012-08-07 07:29:57 +0000 | [diff] [blame] | 286 | .data = &init_net.sctp.max_autoclose, |
Xi Wang | 2692ba6 | 2011-12-16 12:44:15 +0000 | [diff] [blame] | 287 | .maxlen = sizeof(unsigned long), |
| 288 | .mode = 0644, |
| 289 | .proc_handler = &proc_doulongvec_minmax, |
| 290 | .extra1 = &max_autoclose_min, |
| 291 | .extra2 = &max_autoclose_max, |
| 292 | }, |
David S. Miller | 71acc0d | 2013-08-09 13:09:41 -0700 | [diff] [blame] | 293 | |
Linus Torvalds | d7fc02c | 2009-12-08 07:55:01 -0800 | [diff] [blame] | 294 | { /* sentinel */ } |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 295 | }; |
| 296 | |
Joe Perches | fe2c633 | 2013-06-11 23:04:25 -0700 | [diff] [blame] | 297 | static int proc_sctp_do_hmac_alg(struct ctl_table *ctl, |
Neil Horman | 3c68198 | 2012-10-24 09:20:03 +0000 | [diff] [blame] | 298 | int write, |
| 299 | void __user *buffer, size_t *lenp, |
| 300 | loff_t *ppos) |
| 301 | { |
| 302 | struct net *net = current->nsproxy->net_ns; |
| 303 | char tmp[8]; |
Joe Perches | fe2c633 | 2013-06-11 23:04:25 -0700 | [diff] [blame] | 304 | struct ctl_table tbl; |
Neil Horman | 3c68198 | 2012-10-24 09:20:03 +0000 | [diff] [blame] | 305 | int ret; |
| 306 | int changed = 0; |
| 307 | char *none = "none"; |
| 308 | |
| 309 | memset(&tbl, 0, sizeof(struct ctl_table)); |
| 310 | |
| 311 | if (write) { |
| 312 | tbl.data = tmp; |
| 313 | tbl.maxlen = 8; |
| 314 | } else { |
| 315 | tbl.data = net->sctp.sctp_hmac_alg ? : none; |
| 316 | tbl.maxlen = strlen(tbl.data); |
| 317 | } |
| 318 | ret = proc_dostring(&tbl, write, buffer, lenp, ppos); |
| 319 | |
| 320 | if (write) { |
| 321 | #ifdef CONFIG_CRYPTO_MD5 |
| 322 | if (!strncmp(tmp, "md5", 3)) { |
| 323 | net->sctp.sctp_hmac_alg = "md5"; |
| 324 | changed = 1; |
| 325 | } |
| 326 | #endif |
| 327 | #ifdef CONFIG_CRYPTO_SHA1 |
| 328 | if (!strncmp(tmp, "sha1", 4)) { |
| 329 | net->sctp.sctp_hmac_alg = "sha1"; |
| 330 | changed = 1; |
| 331 | } |
| 332 | #endif |
| 333 | if (!strncmp(tmp, "none", 4)) { |
| 334 | net->sctp.sctp_hmac_alg = NULL; |
| 335 | changed = 1; |
| 336 | } |
| 337 | |
| 338 | if (!changed) |
| 339 | ret = -EINVAL; |
| 340 | } |
| 341 | |
| 342 | return ret; |
| 343 | } |
| 344 | |
Eric W. Biederman | ebb7e95 | 2012-08-07 07:23:59 +0000 | [diff] [blame] | 345 | int sctp_sysctl_net_register(struct net *net) |
| 346 | { |
| 347 | struct ctl_table *table; |
Eric W. Biederman | e1fc3b1 | 2012-08-07 07:29:57 +0000 | [diff] [blame] | 348 | int i; |
Eric W. Biederman | ebb7e95 | 2012-08-07 07:23:59 +0000 | [diff] [blame] | 349 | |
| 350 | table = kmemdup(sctp_net_table, sizeof(sctp_net_table), GFP_KERNEL); |
| 351 | if (!table) |
| 352 | return -ENOMEM; |
| 353 | |
Eric W. Biederman | e1fc3b1 | 2012-08-07 07:29:57 +0000 | [diff] [blame] | 354 | for (i = 0; table[i].data; i++) |
| 355 | table[i].data += (char *)(&net->sctp) - (char *)&init_net.sctp; |
| 356 | |
Eric W. Biederman | ebb7e95 | 2012-08-07 07:23:59 +0000 | [diff] [blame] | 357 | net->sctp.sysctl_header = register_net_sysctl(net, "net/sctp", table); |
| 358 | return 0; |
| 359 | } |
| 360 | |
| 361 | void sctp_sysctl_net_unregister(struct net *net) |
| 362 | { |
Vlad Yasevich | 5f19d12 | 2013-01-24 11:02:47 -0500 | [diff] [blame] | 363 | struct ctl_table *table; |
| 364 | |
| 365 | table = net->sctp.sysctl_header->ctl_table_arg; |
Eric W. Biederman | ebb7e95 | 2012-08-07 07:23:59 +0000 | [diff] [blame] | 366 | unregister_net_sysctl_table(net->sctp.sysctl_header); |
Vlad Yasevich | 5f19d12 | 2013-01-24 11:02:47 -0500 | [diff] [blame] | 367 | kfree(table); |
Eric W. Biederman | ebb7e95 | 2012-08-07 07:23:59 +0000 | [diff] [blame] | 368 | } |
| 369 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 370 | static struct ctl_table_header * sctp_sysctl_header; |
| 371 | |
| 372 | /* Sysctl registration. */ |
| 373 | void sctp_sysctl_register(void) |
| 374 | { |
Eric W. Biederman | ec8f23c | 2012-04-19 13:44:49 +0000 | [diff] [blame] | 375 | sctp_sysctl_header = register_net_sysctl(&init_net, "net/sctp", sctp_table); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 376 | } |
| 377 | |
| 378 | /* Sysctl deregistration. */ |
| 379 | void sctp_sysctl_unregister(void) |
| 380 | { |
Eric W. Biederman | 5dd3df1 | 2012-04-19 13:24:33 +0000 | [diff] [blame] | 381 | unregister_net_sysctl_table(sctp_sysctl_header); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 382 | } |