Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1 | /* |
| 2 | * sysctl_net_ipv4.c: sysctl interface to net IPV4 subsystem. |
| 3 | * |
| 4 | * $Id: sysctl_net_ipv4.c,v 1.50 2001/10/20 00:00:11 davem Exp $ |
| 5 | * |
| 6 | * Begun April 1, 1996, Mike Shaver. |
| 7 | * Added /proc/sys/net/ipv4 directory entry (empty =) ). [MS] |
| 8 | */ |
| 9 | |
| 10 | #include <linux/mm.h> |
| 11 | #include <linux/module.h> |
| 12 | #include <linux/sysctl.h> |
| 13 | #include <linux/config.h> |
Arnaldo Carvalho de Melo | 2038073 | 2005-08-16 02:18:02 -0300 | [diff] [blame] | 14 | #include <linux/igmp.h> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 15 | #include <net/snmp.h> |
Arnaldo Carvalho de Melo | 2038073 | 2005-08-16 02:18:02 -0300 | [diff] [blame] | 16 | #include <net/icmp.h> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 17 | #include <net/ip.h> |
| 18 | #include <net/route.h> |
| 19 | #include <net/tcp.h> |
| 20 | |
| 21 | /* From af_inet.c */ |
| 22 | extern int sysctl_ip_nonlocal_bind; |
| 23 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 24 | #ifdef CONFIG_SYSCTL |
Herbert Xu | 89cee8b | 2005-12-13 23:14:27 -0800 | [diff] [blame^] | 25 | static int zero; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 26 | static int tcp_retr1_max = 255; |
| 27 | static int ip_local_port_range_min[] = { 1, 1 }; |
| 28 | static int ip_local_port_range_max[] = { 65535, 65535 }; |
| 29 | #endif |
| 30 | |
| 31 | struct ipv4_config ipv4_config; |
| 32 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 33 | #ifdef CONFIG_SYSCTL |
| 34 | |
| 35 | static |
| 36 | int ipv4_sysctl_forward(ctl_table *ctl, int write, struct file * filp, |
| 37 | void __user *buffer, size_t *lenp, loff_t *ppos) |
| 38 | { |
| 39 | int val = ipv4_devconf.forwarding; |
| 40 | int ret; |
| 41 | |
| 42 | ret = proc_dointvec(ctl, write, filp, buffer, lenp, ppos); |
| 43 | |
| 44 | if (write && ipv4_devconf.forwarding != val) |
| 45 | inet_forward_change(); |
| 46 | |
| 47 | return ret; |
| 48 | } |
| 49 | |
| 50 | static int ipv4_sysctl_forward_strategy(ctl_table *table, |
| 51 | int __user *name, int nlen, |
| 52 | void __user *oldval, size_t __user *oldlenp, |
| 53 | void __user *newval, size_t newlen, |
| 54 | void **context) |
| 55 | { |
| 56 | int *valp = table->data; |
| 57 | int new; |
| 58 | |
| 59 | if (!newval || !newlen) |
| 60 | return 0; |
| 61 | |
| 62 | if (newlen != sizeof(int)) |
| 63 | return -EINVAL; |
| 64 | |
| 65 | if (get_user(new, (int __user *)newval)) |
| 66 | return -EFAULT; |
| 67 | |
| 68 | if (new == *valp) |
| 69 | return 0; |
| 70 | |
| 71 | if (oldval && oldlenp) { |
| 72 | size_t len; |
| 73 | |
| 74 | if (get_user(len, oldlenp)) |
| 75 | return -EFAULT; |
| 76 | |
| 77 | if (len) { |
| 78 | if (len > table->maxlen) |
| 79 | len = table->maxlen; |
| 80 | if (copy_to_user(oldval, valp, len)) |
| 81 | return -EFAULT; |
| 82 | if (put_user(len, oldlenp)) |
| 83 | return -EFAULT; |
| 84 | } |
| 85 | } |
| 86 | |
| 87 | *valp = new; |
| 88 | inet_forward_change(); |
| 89 | return 1; |
| 90 | } |
| 91 | |
Stephen Hemminger | 317a76f | 2005-06-23 12:19:55 -0700 | [diff] [blame] | 92 | static int proc_tcp_congestion_control(ctl_table *ctl, int write, struct file * filp, |
| 93 | void __user *buffer, size_t *lenp, loff_t *ppos) |
| 94 | { |
| 95 | char val[TCP_CA_NAME_MAX]; |
| 96 | ctl_table tbl = { |
| 97 | .data = val, |
| 98 | .maxlen = TCP_CA_NAME_MAX, |
| 99 | }; |
| 100 | int ret; |
| 101 | |
| 102 | tcp_get_default_congestion_control(val); |
| 103 | |
| 104 | ret = proc_dostring(&tbl, write, filp, buffer, lenp, ppos); |
| 105 | if (write && ret == 0) |
| 106 | ret = tcp_set_default_congestion_control(val); |
| 107 | return ret; |
| 108 | } |
| 109 | |
Arnaldo Carvalho de Melo | 2038073 | 2005-08-16 02:18:02 -0300 | [diff] [blame] | 110 | static int sysctl_tcp_congestion_control(ctl_table *table, int __user *name, |
| 111 | int nlen, void __user *oldval, |
| 112 | size_t __user *oldlenp, |
| 113 | void __user *newval, size_t newlen, |
| 114 | void **context) |
Stephen Hemminger | 317a76f | 2005-06-23 12:19:55 -0700 | [diff] [blame] | 115 | { |
| 116 | char val[TCP_CA_NAME_MAX]; |
| 117 | ctl_table tbl = { |
| 118 | .data = val, |
| 119 | .maxlen = TCP_CA_NAME_MAX, |
| 120 | }; |
| 121 | int ret; |
| 122 | |
| 123 | tcp_get_default_congestion_control(val); |
| 124 | ret = sysctl_string(&tbl, name, nlen, oldval, oldlenp, newval, newlen, |
| 125 | context); |
| 126 | if (ret == 0 && newval && newlen) |
| 127 | ret = tcp_set_default_congestion_control(val); |
| 128 | return ret; |
| 129 | } |
| 130 | |
| 131 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 132 | ctl_table ipv4_table[] = { |
| 133 | { |
| 134 | .ctl_name = NET_IPV4_TCP_TIMESTAMPS, |
| 135 | .procname = "tcp_timestamps", |
| 136 | .data = &sysctl_tcp_timestamps, |
| 137 | .maxlen = sizeof(int), |
| 138 | .mode = 0644, |
| 139 | .proc_handler = &proc_dointvec |
| 140 | }, |
| 141 | { |
| 142 | .ctl_name = NET_IPV4_TCP_WINDOW_SCALING, |
| 143 | .procname = "tcp_window_scaling", |
| 144 | .data = &sysctl_tcp_window_scaling, |
| 145 | .maxlen = sizeof(int), |
| 146 | .mode = 0644, |
| 147 | .proc_handler = &proc_dointvec |
| 148 | }, |
| 149 | { |
| 150 | .ctl_name = NET_IPV4_TCP_SACK, |
| 151 | .procname = "tcp_sack", |
| 152 | .data = &sysctl_tcp_sack, |
| 153 | .maxlen = sizeof(int), |
| 154 | .mode = 0644, |
| 155 | .proc_handler = &proc_dointvec |
| 156 | }, |
| 157 | { |
| 158 | .ctl_name = NET_IPV4_TCP_RETRANS_COLLAPSE, |
| 159 | .procname = "tcp_retrans_collapse", |
| 160 | .data = &sysctl_tcp_retrans_collapse, |
| 161 | .maxlen = sizeof(int), |
| 162 | .mode = 0644, |
| 163 | .proc_handler = &proc_dointvec |
| 164 | }, |
| 165 | { |
| 166 | .ctl_name = NET_IPV4_FORWARD, |
| 167 | .procname = "ip_forward", |
| 168 | .data = &ipv4_devconf.forwarding, |
| 169 | .maxlen = sizeof(int), |
| 170 | .mode = 0644, |
| 171 | .proc_handler = &ipv4_sysctl_forward, |
| 172 | .strategy = &ipv4_sysctl_forward_strategy |
| 173 | }, |
| 174 | { |
| 175 | .ctl_name = NET_IPV4_DEFAULT_TTL, |
| 176 | .procname = "ip_default_ttl", |
| 177 | .data = &sysctl_ip_default_ttl, |
| 178 | .maxlen = sizeof(int), |
| 179 | .mode = 0644, |
| 180 | .proc_handler = &ipv4_doint_and_flush, |
| 181 | .strategy = &ipv4_doint_and_flush_strategy, |
| 182 | }, |
| 183 | { |
| 184 | .ctl_name = NET_IPV4_AUTOCONFIG, |
| 185 | .procname = "ip_autoconfig", |
| 186 | .data = &ipv4_config.autoconfig, |
| 187 | .maxlen = sizeof(int), |
| 188 | .mode = 0644, |
| 189 | .proc_handler = &proc_dointvec |
| 190 | }, |
| 191 | { |
| 192 | .ctl_name = NET_IPV4_NO_PMTU_DISC, |
| 193 | .procname = "ip_no_pmtu_disc", |
| 194 | .data = &ipv4_config.no_pmtu_disc, |
| 195 | .maxlen = sizeof(int), |
| 196 | .mode = 0644, |
| 197 | .proc_handler = &proc_dointvec |
| 198 | }, |
| 199 | { |
| 200 | .ctl_name = NET_IPV4_NONLOCAL_BIND, |
| 201 | .procname = "ip_nonlocal_bind", |
| 202 | .data = &sysctl_ip_nonlocal_bind, |
| 203 | .maxlen = sizeof(int), |
| 204 | .mode = 0644, |
| 205 | .proc_handler = &proc_dointvec |
| 206 | }, |
| 207 | { |
| 208 | .ctl_name = NET_IPV4_TCP_SYN_RETRIES, |
| 209 | .procname = "tcp_syn_retries", |
| 210 | .data = &sysctl_tcp_syn_retries, |
| 211 | .maxlen = sizeof(int), |
| 212 | .mode = 0644, |
| 213 | .proc_handler = &proc_dointvec |
| 214 | }, |
| 215 | { |
| 216 | .ctl_name = NET_TCP_SYNACK_RETRIES, |
| 217 | .procname = "tcp_synack_retries", |
| 218 | .data = &sysctl_tcp_synack_retries, |
| 219 | .maxlen = sizeof(int), |
| 220 | .mode = 0644, |
| 221 | .proc_handler = &proc_dointvec |
| 222 | }, |
| 223 | { |
| 224 | .ctl_name = NET_TCP_MAX_ORPHANS, |
| 225 | .procname = "tcp_max_orphans", |
| 226 | .data = &sysctl_tcp_max_orphans, |
| 227 | .maxlen = sizeof(int), |
| 228 | .mode = 0644, |
| 229 | .proc_handler = &proc_dointvec |
| 230 | }, |
| 231 | { |
| 232 | .ctl_name = NET_TCP_MAX_TW_BUCKETS, |
| 233 | .procname = "tcp_max_tw_buckets", |
Arnaldo Carvalho de Melo | 295ff7e | 2005-08-09 20:44:40 -0700 | [diff] [blame] | 234 | .data = &tcp_death_row.sysctl_max_tw_buckets, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 235 | .maxlen = sizeof(int), |
| 236 | .mode = 0644, |
| 237 | .proc_handler = &proc_dointvec |
| 238 | }, |
| 239 | { |
| 240 | .ctl_name = NET_IPV4_IPFRAG_HIGH_THRESH, |
| 241 | .procname = "ipfrag_high_thresh", |
| 242 | .data = &sysctl_ipfrag_high_thresh, |
| 243 | .maxlen = sizeof(int), |
| 244 | .mode = 0644, |
| 245 | .proc_handler = &proc_dointvec |
| 246 | }, |
| 247 | { |
| 248 | .ctl_name = NET_IPV4_IPFRAG_LOW_THRESH, |
| 249 | .procname = "ipfrag_low_thresh", |
| 250 | .data = &sysctl_ipfrag_low_thresh, |
| 251 | .maxlen = sizeof(int), |
| 252 | .mode = 0644, |
| 253 | .proc_handler = &proc_dointvec |
| 254 | }, |
| 255 | { |
| 256 | .ctl_name = NET_IPV4_DYNADDR, |
| 257 | .procname = "ip_dynaddr", |
| 258 | .data = &sysctl_ip_dynaddr, |
| 259 | .maxlen = sizeof(int), |
| 260 | .mode = 0644, |
| 261 | .proc_handler = &proc_dointvec |
| 262 | }, |
| 263 | { |
| 264 | .ctl_name = NET_IPV4_IPFRAG_TIME, |
| 265 | .procname = "ipfrag_time", |
| 266 | .data = &sysctl_ipfrag_time, |
| 267 | .maxlen = sizeof(int), |
| 268 | .mode = 0644, |
| 269 | .proc_handler = &proc_dointvec_jiffies, |
| 270 | .strategy = &sysctl_jiffies |
| 271 | }, |
| 272 | { |
| 273 | .ctl_name = NET_IPV4_TCP_KEEPALIVE_TIME, |
| 274 | .procname = "tcp_keepalive_time", |
| 275 | .data = &sysctl_tcp_keepalive_time, |
| 276 | .maxlen = sizeof(int), |
| 277 | .mode = 0644, |
| 278 | .proc_handler = &proc_dointvec_jiffies, |
| 279 | .strategy = &sysctl_jiffies |
| 280 | }, |
| 281 | { |
| 282 | .ctl_name = NET_IPV4_TCP_KEEPALIVE_PROBES, |
| 283 | .procname = "tcp_keepalive_probes", |
| 284 | .data = &sysctl_tcp_keepalive_probes, |
| 285 | .maxlen = sizeof(int), |
| 286 | .mode = 0644, |
| 287 | .proc_handler = &proc_dointvec |
| 288 | }, |
| 289 | { |
| 290 | .ctl_name = NET_IPV4_TCP_KEEPALIVE_INTVL, |
| 291 | .procname = "tcp_keepalive_intvl", |
| 292 | .data = &sysctl_tcp_keepalive_intvl, |
| 293 | .maxlen = sizeof(int), |
| 294 | .mode = 0644, |
| 295 | .proc_handler = &proc_dointvec_jiffies, |
| 296 | .strategy = &sysctl_jiffies |
| 297 | }, |
| 298 | { |
| 299 | .ctl_name = NET_IPV4_TCP_RETRIES1, |
| 300 | .procname = "tcp_retries1", |
| 301 | .data = &sysctl_tcp_retries1, |
| 302 | .maxlen = sizeof(int), |
| 303 | .mode = 0644, |
| 304 | .proc_handler = &proc_dointvec_minmax, |
| 305 | .strategy = &sysctl_intvec, |
| 306 | .extra2 = &tcp_retr1_max |
| 307 | }, |
| 308 | { |
| 309 | .ctl_name = NET_IPV4_TCP_RETRIES2, |
| 310 | .procname = "tcp_retries2", |
| 311 | .data = &sysctl_tcp_retries2, |
| 312 | .maxlen = sizeof(int), |
| 313 | .mode = 0644, |
| 314 | .proc_handler = &proc_dointvec |
| 315 | }, |
| 316 | { |
| 317 | .ctl_name = NET_IPV4_TCP_FIN_TIMEOUT, |
| 318 | .procname = "tcp_fin_timeout", |
| 319 | .data = &sysctl_tcp_fin_timeout, |
| 320 | .maxlen = sizeof(int), |
| 321 | .mode = 0644, |
| 322 | .proc_handler = &proc_dointvec_jiffies, |
| 323 | .strategy = &sysctl_jiffies |
| 324 | }, |
| 325 | #ifdef CONFIG_SYN_COOKIES |
| 326 | { |
| 327 | .ctl_name = NET_TCP_SYNCOOKIES, |
| 328 | .procname = "tcp_syncookies", |
| 329 | .data = &sysctl_tcp_syncookies, |
| 330 | .maxlen = sizeof(int), |
| 331 | .mode = 0644, |
| 332 | .proc_handler = &proc_dointvec |
| 333 | }, |
| 334 | #endif |
| 335 | { |
| 336 | .ctl_name = NET_TCP_TW_RECYCLE, |
| 337 | .procname = "tcp_tw_recycle", |
Arnaldo Carvalho de Melo | 295ff7e | 2005-08-09 20:44:40 -0700 | [diff] [blame] | 338 | .data = &tcp_death_row.sysctl_tw_recycle, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 339 | .maxlen = sizeof(int), |
| 340 | .mode = 0644, |
| 341 | .proc_handler = &proc_dointvec |
| 342 | }, |
| 343 | { |
| 344 | .ctl_name = NET_TCP_ABORT_ON_OVERFLOW, |
| 345 | .procname = "tcp_abort_on_overflow", |
| 346 | .data = &sysctl_tcp_abort_on_overflow, |
| 347 | .maxlen = sizeof(int), |
| 348 | .mode = 0644, |
| 349 | .proc_handler = &proc_dointvec |
| 350 | }, |
| 351 | { |
| 352 | .ctl_name = NET_TCP_STDURG, |
| 353 | .procname = "tcp_stdurg", |
| 354 | .data = &sysctl_tcp_stdurg, |
| 355 | .maxlen = sizeof(int), |
| 356 | .mode = 0644, |
| 357 | .proc_handler = &proc_dointvec |
| 358 | }, |
| 359 | { |
| 360 | .ctl_name = NET_TCP_RFC1337, |
| 361 | .procname = "tcp_rfc1337", |
| 362 | .data = &sysctl_tcp_rfc1337, |
| 363 | .maxlen = sizeof(int), |
| 364 | .mode = 0644, |
| 365 | .proc_handler = &proc_dointvec |
| 366 | }, |
| 367 | { |
| 368 | .ctl_name = NET_TCP_MAX_SYN_BACKLOG, |
| 369 | .procname = "tcp_max_syn_backlog", |
| 370 | .data = &sysctl_max_syn_backlog, |
| 371 | .maxlen = sizeof(int), |
| 372 | .mode = 0644, |
| 373 | .proc_handler = &proc_dointvec |
| 374 | }, |
| 375 | { |
| 376 | .ctl_name = NET_IPV4_LOCAL_PORT_RANGE, |
| 377 | .procname = "ip_local_port_range", |
| 378 | .data = &sysctl_local_port_range, |
| 379 | .maxlen = sizeof(sysctl_local_port_range), |
| 380 | .mode = 0644, |
| 381 | .proc_handler = &proc_dointvec_minmax, |
| 382 | .strategy = &sysctl_intvec, |
| 383 | .extra1 = ip_local_port_range_min, |
| 384 | .extra2 = ip_local_port_range_max |
| 385 | }, |
| 386 | { |
| 387 | .ctl_name = NET_IPV4_ICMP_ECHO_IGNORE_ALL, |
| 388 | .procname = "icmp_echo_ignore_all", |
| 389 | .data = &sysctl_icmp_echo_ignore_all, |
| 390 | .maxlen = sizeof(int), |
| 391 | .mode = 0644, |
| 392 | .proc_handler = &proc_dointvec |
| 393 | }, |
| 394 | { |
| 395 | .ctl_name = NET_IPV4_ICMP_ECHO_IGNORE_BROADCASTS, |
| 396 | .procname = "icmp_echo_ignore_broadcasts", |
| 397 | .data = &sysctl_icmp_echo_ignore_broadcasts, |
| 398 | .maxlen = sizeof(int), |
| 399 | .mode = 0644, |
| 400 | .proc_handler = &proc_dointvec |
| 401 | }, |
| 402 | { |
| 403 | .ctl_name = NET_IPV4_ICMP_IGNORE_BOGUS_ERROR_RESPONSES, |
| 404 | .procname = "icmp_ignore_bogus_error_responses", |
| 405 | .data = &sysctl_icmp_ignore_bogus_error_responses, |
| 406 | .maxlen = sizeof(int), |
| 407 | .mode = 0644, |
| 408 | .proc_handler = &proc_dointvec |
| 409 | }, |
| 410 | { |
J. Simonetti | 1c2fb7f | 2005-06-13 15:19:03 -0700 | [diff] [blame] | 411 | .ctl_name = NET_IPV4_ICMP_ERRORS_USE_INBOUND_IFADDR, |
| 412 | .procname = "icmp_errors_use_inbound_ifaddr", |
| 413 | .data = &sysctl_icmp_errors_use_inbound_ifaddr, |
| 414 | .maxlen = sizeof(int), |
| 415 | .mode = 0644, |
| 416 | .proc_handler = &proc_dointvec |
| 417 | }, |
| 418 | { |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 419 | .ctl_name = NET_IPV4_ROUTE, |
| 420 | .procname = "route", |
| 421 | .maxlen = 0, |
| 422 | .mode = 0555, |
| 423 | .child = ipv4_route_table |
| 424 | }, |
| 425 | #ifdef CONFIG_IP_MULTICAST |
| 426 | { |
| 427 | .ctl_name = NET_IPV4_IGMP_MAX_MEMBERSHIPS, |
| 428 | .procname = "igmp_max_memberships", |
| 429 | .data = &sysctl_igmp_max_memberships, |
| 430 | .maxlen = sizeof(int), |
| 431 | .mode = 0644, |
| 432 | .proc_handler = &proc_dointvec |
| 433 | }, |
| 434 | |
| 435 | #endif |
| 436 | { |
| 437 | .ctl_name = NET_IPV4_IGMP_MAX_MSF, |
| 438 | .procname = "igmp_max_msf", |
| 439 | .data = &sysctl_igmp_max_msf, |
| 440 | .maxlen = sizeof(int), |
| 441 | .mode = 0644, |
| 442 | .proc_handler = &proc_dointvec |
| 443 | }, |
| 444 | { |
| 445 | .ctl_name = NET_IPV4_INET_PEER_THRESHOLD, |
| 446 | .procname = "inet_peer_threshold", |
| 447 | .data = &inet_peer_threshold, |
| 448 | .maxlen = sizeof(int), |
| 449 | .mode = 0644, |
| 450 | .proc_handler = &proc_dointvec |
| 451 | }, |
| 452 | { |
| 453 | .ctl_name = NET_IPV4_INET_PEER_MINTTL, |
| 454 | .procname = "inet_peer_minttl", |
| 455 | .data = &inet_peer_minttl, |
| 456 | .maxlen = sizeof(int), |
| 457 | .mode = 0644, |
| 458 | .proc_handler = &proc_dointvec_jiffies, |
| 459 | .strategy = &sysctl_jiffies |
| 460 | }, |
| 461 | { |
| 462 | .ctl_name = NET_IPV4_INET_PEER_MAXTTL, |
| 463 | .procname = "inet_peer_maxttl", |
| 464 | .data = &inet_peer_maxttl, |
| 465 | .maxlen = sizeof(int), |
| 466 | .mode = 0644, |
| 467 | .proc_handler = &proc_dointvec_jiffies, |
| 468 | .strategy = &sysctl_jiffies |
| 469 | }, |
| 470 | { |
| 471 | .ctl_name = NET_IPV4_INET_PEER_GC_MINTIME, |
| 472 | .procname = "inet_peer_gc_mintime", |
| 473 | .data = &inet_peer_gc_mintime, |
| 474 | .maxlen = sizeof(int), |
| 475 | .mode = 0644, |
| 476 | .proc_handler = &proc_dointvec_jiffies, |
| 477 | .strategy = &sysctl_jiffies |
| 478 | }, |
| 479 | { |
| 480 | .ctl_name = NET_IPV4_INET_PEER_GC_MAXTIME, |
| 481 | .procname = "inet_peer_gc_maxtime", |
| 482 | .data = &inet_peer_gc_maxtime, |
| 483 | .maxlen = sizeof(int), |
| 484 | .mode = 0644, |
| 485 | .proc_handler = &proc_dointvec_jiffies, |
| 486 | .strategy = &sysctl_jiffies |
| 487 | }, |
| 488 | { |
| 489 | .ctl_name = NET_TCP_ORPHAN_RETRIES, |
| 490 | .procname = "tcp_orphan_retries", |
| 491 | .data = &sysctl_tcp_orphan_retries, |
| 492 | .maxlen = sizeof(int), |
| 493 | .mode = 0644, |
| 494 | .proc_handler = &proc_dointvec |
| 495 | }, |
| 496 | { |
| 497 | .ctl_name = NET_TCP_FACK, |
| 498 | .procname = "tcp_fack", |
| 499 | .data = &sysctl_tcp_fack, |
| 500 | .maxlen = sizeof(int), |
| 501 | .mode = 0644, |
| 502 | .proc_handler = &proc_dointvec |
| 503 | }, |
| 504 | { |
| 505 | .ctl_name = NET_TCP_REORDERING, |
| 506 | .procname = "tcp_reordering", |
| 507 | .data = &sysctl_tcp_reordering, |
| 508 | .maxlen = sizeof(int), |
| 509 | .mode = 0644, |
| 510 | .proc_handler = &proc_dointvec |
| 511 | }, |
| 512 | { |
| 513 | .ctl_name = NET_TCP_ECN, |
| 514 | .procname = "tcp_ecn", |
| 515 | .data = &sysctl_tcp_ecn, |
| 516 | .maxlen = sizeof(int), |
| 517 | .mode = 0644, |
| 518 | .proc_handler = &proc_dointvec |
| 519 | }, |
| 520 | { |
| 521 | .ctl_name = NET_TCP_DSACK, |
| 522 | .procname = "tcp_dsack", |
| 523 | .data = &sysctl_tcp_dsack, |
| 524 | .maxlen = sizeof(int), |
| 525 | .mode = 0644, |
| 526 | .proc_handler = &proc_dointvec |
| 527 | }, |
| 528 | { |
| 529 | .ctl_name = NET_TCP_MEM, |
| 530 | .procname = "tcp_mem", |
| 531 | .data = &sysctl_tcp_mem, |
| 532 | .maxlen = sizeof(sysctl_tcp_mem), |
| 533 | .mode = 0644, |
| 534 | .proc_handler = &proc_dointvec |
| 535 | }, |
| 536 | { |
| 537 | .ctl_name = NET_TCP_WMEM, |
| 538 | .procname = "tcp_wmem", |
| 539 | .data = &sysctl_tcp_wmem, |
| 540 | .maxlen = sizeof(sysctl_tcp_wmem), |
| 541 | .mode = 0644, |
| 542 | .proc_handler = &proc_dointvec |
| 543 | }, |
| 544 | { |
| 545 | .ctl_name = NET_TCP_RMEM, |
| 546 | .procname = "tcp_rmem", |
| 547 | .data = &sysctl_tcp_rmem, |
| 548 | .maxlen = sizeof(sysctl_tcp_rmem), |
| 549 | .mode = 0644, |
| 550 | .proc_handler = &proc_dointvec |
| 551 | }, |
| 552 | { |
| 553 | .ctl_name = NET_TCP_APP_WIN, |
| 554 | .procname = "tcp_app_win", |
| 555 | .data = &sysctl_tcp_app_win, |
| 556 | .maxlen = sizeof(int), |
| 557 | .mode = 0644, |
| 558 | .proc_handler = &proc_dointvec |
| 559 | }, |
| 560 | { |
| 561 | .ctl_name = NET_TCP_ADV_WIN_SCALE, |
| 562 | .procname = "tcp_adv_win_scale", |
| 563 | .data = &sysctl_tcp_adv_win_scale, |
| 564 | .maxlen = sizeof(int), |
| 565 | .mode = 0644, |
| 566 | .proc_handler = &proc_dointvec |
| 567 | }, |
| 568 | { |
| 569 | .ctl_name = NET_IPV4_ICMP_RATELIMIT, |
| 570 | .procname = "icmp_ratelimit", |
| 571 | .data = &sysctl_icmp_ratelimit, |
| 572 | .maxlen = sizeof(int), |
| 573 | .mode = 0644, |
| 574 | .proc_handler = &proc_dointvec |
| 575 | }, |
| 576 | { |
| 577 | .ctl_name = NET_IPV4_ICMP_RATEMASK, |
| 578 | .procname = "icmp_ratemask", |
| 579 | .data = &sysctl_icmp_ratemask, |
| 580 | .maxlen = sizeof(int), |
| 581 | .mode = 0644, |
| 582 | .proc_handler = &proc_dointvec |
| 583 | }, |
| 584 | { |
| 585 | .ctl_name = NET_TCP_TW_REUSE, |
| 586 | .procname = "tcp_tw_reuse", |
| 587 | .data = &sysctl_tcp_tw_reuse, |
| 588 | .maxlen = sizeof(int), |
| 589 | .mode = 0644, |
| 590 | .proc_handler = &proc_dointvec |
| 591 | }, |
| 592 | { |
| 593 | .ctl_name = NET_TCP_FRTO, |
| 594 | .procname = "tcp_frto", |
| 595 | .data = &sysctl_tcp_frto, |
| 596 | .maxlen = sizeof(int), |
| 597 | .mode = 0644, |
| 598 | .proc_handler = &proc_dointvec |
| 599 | }, |
| 600 | { |
| 601 | .ctl_name = NET_TCP_LOW_LATENCY, |
| 602 | .procname = "tcp_low_latency", |
| 603 | .data = &sysctl_tcp_low_latency, |
| 604 | .maxlen = sizeof(int), |
| 605 | .mode = 0644, |
| 606 | .proc_handler = &proc_dointvec |
| 607 | }, |
| 608 | { |
| 609 | .ctl_name = NET_IPV4_IPFRAG_SECRET_INTERVAL, |
| 610 | .procname = "ipfrag_secret_interval", |
| 611 | .data = &sysctl_ipfrag_secret_interval, |
| 612 | .maxlen = sizeof(int), |
| 613 | .mode = 0644, |
| 614 | .proc_handler = &proc_dointvec_jiffies, |
| 615 | .strategy = &sysctl_jiffies |
| 616 | }, |
| 617 | { |
Herbert Xu | 89cee8b | 2005-12-13 23:14:27 -0800 | [diff] [blame^] | 618 | .ctl_name = NET_IPV4_IPFRAG_MAX_DIST, |
| 619 | .procname = "ipfrag_max_dist", |
| 620 | .data = &sysctl_ipfrag_max_dist, |
| 621 | .maxlen = sizeof(int), |
| 622 | .mode = 0644, |
| 623 | .proc_handler = &proc_dointvec_minmax, |
| 624 | .extra1 = &zero |
| 625 | }, |
| 626 | { |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 627 | .ctl_name = NET_TCP_NO_METRICS_SAVE, |
| 628 | .procname = "tcp_no_metrics_save", |
| 629 | .data = &sysctl_tcp_nometrics_save, |
| 630 | .maxlen = sizeof(int), |
| 631 | .mode = 0644, |
| 632 | .proc_handler = &proc_dointvec, |
| 633 | }, |
| 634 | { |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 635 | .ctl_name = NET_TCP_MODERATE_RCVBUF, |
| 636 | .procname = "tcp_moderate_rcvbuf", |
| 637 | .data = &sysctl_tcp_moderate_rcvbuf, |
| 638 | .maxlen = sizeof(int), |
| 639 | .mode = 0644, |
| 640 | .proc_handler = &proc_dointvec, |
| 641 | }, |
| 642 | { |
| 643 | .ctl_name = NET_TCP_TSO_WIN_DIVISOR, |
| 644 | .procname = "tcp_tso_win_divisor", |
| 645 | .data = &sysctl_tcp_tso_win_divisor, |
| 646 | .maxlen = sizeof(int), |
| 647 | .mode = 0644, |
| 648 | .proc_handler = &proc_dointvec, |
| 649 | }, |
| 650 | { |
Stephen Hemminger | 317a76f | 2005-06-23 12:19:55 -0700 | [diff] [blame] | 651 | .ctl_name = NET_TCP_CONG_CONTROL, |
| 652 | .procname = "tcp_congestion_control", |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 653 | .mode = 0644, |
Stephen Hemminger | 317a76f | 2005-06-23 12:19:55 -0700 | [diff] [blame] | 654 | .maxlen = TCP_CA_NAME_MAX, |
| 655 | .proc_handler = &proc_tcp_congestion_control, |
| 656 | .strategy = &sysctl_tcp_congestion_control, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 657 | }, |
Stephen Hemminger | 9772efb | 2005-11-10 17:09:53 -0800 | [diff] [blame] | 658 | { |
| 659 | .ctl_name = NET_TCP_ABC, |
| 660 | .procname = "tcp_abc", |
| 661 | .data = &sysctl_tcp_abc, |
| 662 | .maxlen = sizeof(int), |
| 663 | .mode = 0644, |
| 664 | .proc_handler = &proc_dointvec, |
| 665 | }, |
Stephen Hemminger | 317a76f | 2005-06-23 12:19:55 -0700 | [diff] [blame] | 666 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 667 | { .ctl_name = 0 } |
| 668 | }; |
| 669 | |
| 670 | #endif /* CONFIG_SYSCTL */ |
| 671 | |
| 672 | EXPORT_SYMBOL(ipv4_config); |