[TCP]: Add tcp_available_congestion_control sysctl.
[linux-2.6] / net / ipv4 / sysctl_net_ipv4.c
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/igmp.h>
14 #include <linux/inetdevice.h>
15 #include <net/snmp.h>
16 #include <net/icmp.h>
17 #include <net/ip.h>
18 #include <net/route.h>
19 #include <net/tcp.h>
20 #include <net/cipso_ipv4.h>
21
22 /* From af_inet.c */
23 extern int sysctl_ip_nonlocal_bind;
24
25 #ifdef CONFIG_SYSCTL
26 static int zero;
27 static int tcp_retr1_max = 255; 
28 static int ip_local_port_range_min[] = { 1, 1 };
29 static int ip_local_port_range_max[] = { 65535, 65535 };
30 #endif
31
32 struct ipv4_config ipv4_config;
33
34 #ifdef CONFIG_SYSCTL
35
36 static
37 int ipv4_sysctl_forward(ctl_table *ctl, int write, struct file * filp,
38                         void __user *buffer, size_t *lenp, loff_t *ppos)
39 {
40         int val = ipv4_devconf.forwarding;
41         int ret;
42
43         ret = proc_dointvec(ctl, write, filp, buffer, lenp, ppos);
44
45         if (write && ipv4_devconf.forwarding != val)
46                 inet_forward_change();
47
48         return ret;
49 }
50
51 static int ipv4_sysctl_forward_strategy(ctl_table *table,
52                          int __user *name, int nlen,
53                          void __user *oldval, size_t __user *oldlenp,
54                          void __user *newval, size_t newlen, 
55                          void **context)
56 {
57         int *valp = table->data;
58         int new;
59
60         if (!newval || !newlen)
61                 return 0;
62
63         if (newlen != sizeof(int))
64                 return -EINVAL;
65
66         if (get_user(new, (int __user *)newval))
67                 return -EFAULT;
68
69         if (new == *valp)
70                 return 0;
71
72         if (oldval && oldlenp) {
73                 size_t len;
74
75                 if (get_user(len, oldlenp))
76                         return -EFAULT;
77
78                 if (len) {
79                         if (len > table->maxlen)
80                                 len = table->maxlen;
81                         if (copy_to_user(oldval, valp, len))
82                                 return -EFAULT;
83                         if (put_user(len, oldlenp))
84                                 return -EFAULT;
85                 }
86         }
87
88         *valp = new;
89         inet_forward_change();
90         return 1;
91 }
92
93 static int proc_tcp_congestion_control(ctl_table *ctl, int write, struct file * filp,
94                                        void __user *buffer, size_t *lenp, loff_t *ppos)
95 {
96         char val[TCP_CA_NAME_MAX];
97         ctl_table tbl = {
98                 .data = val,
99                 .maxlen = TCP_CA_NAME_MAX,
100         };
101         int ret;
102
103         tcp_get_default_congestion_control(val);
104
105         ret = proc_dostring(&tbl, write, filp, buffer, lenp, ppos);
106         if (write && ret == 0)
107                 ret = tcp_set_default_congestion_control(val);
108         return ret;
109 }
110
111 static int sysctl_tcp_congestion_control(ctl_table *table, int __user *name,
112                                          int nlen, void __user *oldval,
113                                          size_t __user *oldlenp,
114                                          void __user *newval, size_t newlen,
115                                          void **context)
116 {
117         char val[TCP_CA_NAME_MAX];
118         ctl_table tbl = {
119                 .data = val,
120                 .maxlen = TCP_CA_NAME_MAX,
121         };
122         int ret;
123
124         tcp_get_default_congestion_control(val);
125         ret = sysctl_string(&tbl, name, nlen, oldval, oldlenp, newval, newlen,
126                             context);
127         if (ret == 0 && newval && newlen)
128                 ret = tcp_set_default_congestion_control(val);
129         return ret;
130 }
131
132 static int proc_tcp_available_congestion_control(ctl_table *ctl,
133                                                  int write, struct file * filp,
134                                                  void __user *buffer, size_t *lenp,
135                                                  loff_t *ppos)
136 {
137         ctl_table tbl = { .maxlen = TCP_CA_BUF_MAX, };
138         int ret;
139
140         tbl.data = kmalloc(tbl.maxlen, GFP_USER);
141         if (!tbl.data)
142                 return -ENOMEM;
143         tcp_get_available_congestion_control(tbl.data, TCP_CA_BUF_MAX);
144         ret = proc_dostring(&tbl, write, filp, buffer, lenp, ppos);
145         kfree(tbl.data);
146         return ret;
147 }
148
149 ctl_table ipv4_table[] = {
150         {
151                 .ctl_name       = NET_IPV4_TCP_TIMESTAMPS,
152                 .procname       = "tcp_timestamps",
153                 .data           = &sysctl_tcp_timestamps,
154                 .maxlen         = sizeof(int),
155                 .mode           = 0644,
156                 .proc_handler   = &proc_dointvec
157         },
158         {
159                 .ctl_name       = NET_IPV4_TCP_WINDOW_SCALING,
160                 .procname       = "tcp_window_scaling",
161                 .data           = &sysctl_tcp_window_scaling,
162                 .maxlen         = sizeof(int),
163                 .mode           = 0644,
164                 .proc_handler   = &proc_dointvec
165         },
166         {
167                 .ctl_name       = NET_IPV4_TCP_SACK,
168                 .procname       = "tcp_sack",
169                 .data           = &sysctl_tcp_sack,
170                 .maxlen         = sizeof(int),
171                 .mode           = 0644,
172                 .proc_handler   = &proc_dointvec
173         },
174         {
175                 .ctl_name       = NET_IPV4_TCP_RETRANS_COLLAPSE,
176                 .procname       = "tcp_retrans_collapse",
177                 .data           = &sysctl_tcp_retrans_collapse,
178                 .maxlen         = sizeof(int),
179                 .mode           = 0644,
180                 .proc_handler   = &proc_dointvec
181         },
182         {
183                 .ctl_name       = NET_IPV4_FORWARD,
184                 .procname       = "ip_forward",
185                 .data           = &ipv4_devconf.forwarding,
186                 .maxlen         = sizeof(int),
187                 .mode           = 0644,
188                 .proc_handler   = &ipv4_sysctl_forward,
189                 .strategy       = &ipv4_sysctl_forward_strategy
190         },
191         {
192                 .ctl_name       = NET_IPV4_DEFAULT_TTL,
193                 .procname       = "ip_default_ttl",
194                 .data           = &sysctl_ip_default_ttl,
195                 .maxlen         = sizeof(int),
196                 .mode           = 0644,
197                 .proc_handler   = &ipv4_doint_and_flush,
198                 .strategy       = &ipv4_doint_and_flush_strategy,
199         },
200         {
201                 .ctl_name       = NET_IPV4_NO_PMTU_DISC,
202                 .procname       = "ip_no_pmtu_disc",
203                 .data           = &ipv4_config.no_pmtu_disc,
204                 .maxlen         = sizeof(int),
205                 .mode           = 0644,
206                 .proc_handler   = &proc_dointvec
207         },
208         {
209                 .ctl_name       = NET_IPV4_NONLOCAL_BIND,
210                 .procname       = "ip_nonlocal_bind",
211                 .data           = &sysctl_ip_nonlocal_bind,
212                 .maxlen         = sizeof(int),
213                 .mode           = 0644,
214                 .proc_handler   = &proc_dointvec
215         },
216         {
217                 .ctl_name       = NET_IPV4_TCP_SYN_RETRIES,
218                 .procname       = "tcp_syn_retries",
219                 .data           = &sysctl_tcp_syn_retries,
220                 .maxlen         = sizeof(int),
221                 .mode           = 0644,
222                 .proc_handler   = &proc_dointvec
223         },
224         {
225                 .ctl_name       = NET_TCP_SYNACK_RETRIES,
226                 .procname       = "tcp_synack_retries",
227                 .data           = &sysctl_tcp_synack_retries,
228                 .maxlen         = sizeof(int),
229                 .mode           = 0644,
230                 .proc_handler   = &proc_dointvec
231         },
232         {
233                 .ctl_name       = NET_TCP_MAX_ORPHANS,
234                 .procname       = "tcp_max_orphans",
235                 .data           = &sysctl_tcp_max_orphans,
236                 .maxlen         = sizeof(int),
237                 .mode           = 0644,
238                 .proc_handler   = &proc_dointvec
239         },
240         {
241                 .ctl_name       = NET_TCP_MAX_TW_BUCKETS,
242                 .procname       = "tcp_max_tw_buckets",
243                 .data           = &tcp_death_row.sysctl_max_tw_buckets,
244                 .maxlen         = sizeof(int),
245                 .mode           = 0644,
246                 .proc_handler   = &proc_dointvec
247         },
248         {
249                 .ctl_name       = NET_IPV4_IPFRAG_HIGH_THRESH,
250                 .procname       = "ipfrag_high_thresh",
251                 .data           = &sysctl_ipfrag_high_thresh,
252                 .maxlen         = sizeof(int),
253                 .mode           = 0644,
254                 .proc_handler   = &proc_dointvec
255         },
256         {
257                 .ctl_name       = NET_IPV4_IPFRAG_LOW_THRESH,
258                 .procname       = "ipfrag_low_thresh",
259                 .data           = &sysctl_ipfrag_low_thresh,
260                 .maxlen         = sizeof(int),
261                 .mode           = 0644,
262                 .proc_handler   = &proc_dointvec
263         },
264         {
265                 .ctl_name       = NET_IPV4_DYNADDR,
266                 .procname       = "ip_dynaddr",
267                 .data           = &sysctl_ip_dynaddr,
268                 .maxlen         = sizeof(int),
269                 .mode           = 0644,
270                 .proc_handler   = &proc_dointvec
271         },
272         {
273                 .ctl_name       = NET_IPV4_IPFRAG_TIME,
274                 .procname       = "ipfrag_time",
275                 .data           = &sysctl_ipfrag_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_TIME,
283                 .procname       = "tcp_keepalive_time",
284                 .data           = &sysctl_tcp_keepalive_time,
285                 .maxlen         = sizeof(int),
286                 .mode           = 0644,
287                 .proc_handler   = &proc_dointvec_jiffies,
288                 .strategy       = &sysctl_jiffies
289         },
290         {
291                 .ctl_name       = NET_IPV4_TCP_KEEPALIVE_PROBES,
292                 .procname       = "tcp_keepalive_probes",
293                 .data           = &sysctl_tcp_keepalive_probes,
294                 .maxlen         = sizeof(int),
295                 .mode           = 0644,
296                 .proc_handler   = &proc_dointvec
297         },
298         {
299                 .ctl_name       = NET_IPV4_TCP_KEEPALIVE_INTVL,
300                 .procname       = "tcp_keepalive_intvl",
301                 .data           = &sysctl_tcp_keepalive_intvl,
302                 .maxlen         = sizeof(int),
303                 .mode           = 0644,
304                 .proc_handler   = &proc_dointvec_jiffies,
305                 .strategy       = &sysctl_jiffies
306         },
307         {
308                 .ctl_name       = NET_IPV4_TCP_RETRIES1,
309                 .procname       = "tcp_retries1",
310                 .data           = &sysctl_tcp_retries1,
311                 .maxlen         = sizeof(int),
312                 .mode           = 0644,
313                 .proc_handler   = &proc_dointvec_minmax,
314                 .strategy       = &sysctl_intvec,
315                 .extra2         = &tcp_retr1_max
316         },
317         {
318                 .ctl_name       = NET_IPV4_TCP_RETRIES2,
319                 .procname       = "tcp_retries2",
320                 .data           = &sysctl_tcp_retries2,
321                 .maxlen         = sizeof(int),
322                 .mode           = 0644,
323                 .proc_handler   = &proc_dointvec
324         },
325         {
326                 .ctl_name       = NET_IPV4_TCP_FIN_TIMEOUT,
327                 .procname       = "tcp_fin_timeout",
328                 .data           = &sysctl_tcp_fin_timeout,
329                 .maxlen         = sizeof(int),
330                 .mode           = 0644,
331                 .proc_handler   = &proc_dointvec_jiffies,
332                 .strategy       = &sysctl_jiffies
333         },
334 #ifdef CONFIG_SYN_COOKIES
335         {
336                 .ctl_name       = NET_TCP_SYNCOOKIES,
337                 .procname       = "tcp_syncookies",
338                 .data           = &sysctl_tcp_syncookies,
339                 .maxlen         = sizeof(int),
340                 .mode           = 0644,
341                 .proc_handler   = &proc_dointvec
342         },
343 #endif
344         {
345                 .ctl_name       = NET_TCP_TW_RECYCLE,
346                 .procname       = "tcp_tw_recycle",
347                 .data           = &tcp_death_row.sysctl_tw_recycle,
348                 .maxlen         = sizeof(int),
349                 .mode           = 0644,
350                 .proc_handler   = &proc_dointvec
351         },
352         {
353                 .ctl_name       = NET_TCP_ABORT_ON_OVERFLOW,
354                 .procname       = "tcp_abort_on_overflow",
355                 .data           = &sysctl_tcp_abort_on_overflow,
356                 .maxlen         = sizeof(int),
357                 .mode           = 0644,
358                 .proc_handler   = &proc_dointvec
359         },
360         {
361                 .ctl_name       = NET_TCP_STDURG,
362                 .procname       = "tcp_stdurg",
363                 .data           = &sysctl_tcp_stdurg,
364                 .maxlen         = sizeof(int),
365                 .mode           = 0644,
366                 .proc_handler   = &proc_dointvec
367         },
368         {
369                 .ctl_name       = NET_TCP_RFC1337,
370                 .procname       = "tcp_rfc1337",
371                 .data           = &sysctl_tcp_rfc1337,
372                 .maxlen         = sizeof(int),
373                 .mode           = 0644,
374                 .proc_handler   = &proc_dointvec
375         },
376         {
377                 .ctl_name       = NET_TCP_MAX_SYN_BACKLOG,
378                 .procname       = "tcp_max_syn_backlog",
379                 .data           = &sysctl_max_syn_backlog,
380                 .maxlen         = sizeof(int),
381                 .mode           = 0644,
382                 .proc_handler   = &proc_dointvec
383         },
384         {
385                 .ctl_name       = NET_IPV4_LOCAL_PORT_RANGE,
386                 .procname       = "ip_local_port_range",
387                 .data           = &sysctl_local_port_range,
388                 .maxlen         = sizeof(sysctl_local_port_range),
389                 .mode           = 0644,
390                 .proc_handler   = &proc_dointvec_minmax,
391                 .strategy       = &sysctl_intvec,
392                 .extra1         = ip_local_port_range_min,
393                 .extra2         = ip_local_port_range_max
394         },
395         {
396                 .ctl_name       = NET_IPV4_ICMP_ECHO_IGNORE_ALL,
397                 .procname       = "icmp_echo_ignore_all",
398                 .data           = &sysctl_icmp_echo_ignore_all,
399                 .maxlen         = sizeof(int),
400                 .mode           = 0644,
401                 .proc_handler   = &proc_dointvec
402         },
403         {
404                 .ctl_name       = NET_IPV4_ICMP_ECHO_IGNORE_BROADCASTS,
405                 .procname       = "icmp_echo_ignore_broadcasts",
406                 .data           = &sysctl_icmp_echo_ignore_broadcasts,
407                 .maxlen         = sizeof(int),
408                 .mode           = 0644,
409                 .proc_handler   = &proc_dointvec
410         },
411         {
412                 .ctl_name       = NET_IPV4_ICMP_IGNORE_BOGUS_ERROR_RESPONSES,
413                 .procname       = "icmp_ignore_bogus_error_responses",
414                 .data           = &sysctl_icmp_ignore_bogus_error_responses,
415                 .maxlen         = sizeof(int),
416                 .mode           = 0644,
417                 .proc_handler   = &proc_dointvec
418         },
419         {
420                 .ctl_name       = NET_IPV4_ICMP_ERRORS_USE_INBOUND_IFADDR,
421                 .procname       = "icmp_errors_use_inbound_ifaddr",
422                 .data           = &sysctl_icmp_errors_use_inbound_ifaddr,
423                 .maxlen         = sizeof(int),
424                 .mode           = 0644,
425                 .proc_handler   = &proc_dointvec
426         },
427         {
428                 .ctl_name       = NET_IPV4_ROUTE,
429                 .procname       = "route",
430                 .maxlen         = 0,
431                 .mode           = 0555,
432                 .child          = ipv4_route_table
433         },
434 #ifdef CONFIG_IP_MULTICAST
435         {
436                 .ctl_name       = NET_IPV4_IGMP_MAX_MEMBERSHIPS,
437                 .procname       = "igmp_max_memberships",
438                 .data           = &sysctl_igmp_max_memberships,
439                 .maxlen         = sizeof(int),
440                 .mode           = 0644,
441                 .proc_handler   = &proc_dointvec
442         },
443
444 #endif
445         {
446                 .ctl_name       = NET_IPV4_IGMP_MAX_MSF,
447                 .procname       = "igmp_max_msf",
448                 .data           = &sysctl_igmp_max_msf,
449                 .maxlen         = sizeof(int),
450                 .mode           = 0644,
451                 .proc_handler   = &proc_dointvec
452         },
453         {
454                 .ctl_name       = NET_IPV4_INET_PEER_THRESHOLD,
455                 .procname       = "inet_peer_threshold",
456                 .data           = &inet_peer_threshold,
457                 .maxlen         = sizeof(int),
458                 .mode           = 0644,
459                 .proc_handler   = &proc_dointvec
460         },
461         {
462                 .ctl_name       = NET_IPV4_INET_PEER_MINTTL,
463                 .procname       = "inet_peer_minttl",
464                 .data           = &inet_peer_minttl,
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_MAXTTL,
472                 .procname       = "inet_peer_maxttl",
473                 .data           = &inet_peer_maxttl,
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_MINTIME,
481                 .procname       = "inet_peer_gc_mintime",
482                 .data           = &inet_peer_gc_mintime,
483                 .maxlen         = sizeof(int),
484                 .mode           = 0644,
485                 .proc_handler   = &proc_dointvec_jiffies,
486                 .strategy       = &sysctl_jiffies
487         },
488         {
489                 .ctl_name       = NET_IPV4_INET_PEER_GC_MAXTIME,
490                 .procname       = "inet_peer_gc_maxtime",
491                 .data           = &inet_peer_gc_maxtime,
492                 .maxlen         = sizeof(int),
493                 .mode           = 0644,
494                 .proc_handler   = &proc_dointvec_jiffies,
495                 .strategy       = &sysctl_jiffies
496         },
497         {
498                 .ctl_name       = NET_TCP_ORPHAN_RETRIES,
499                 .procname       = "tcp_orphan_retries",
500                 .data           = &sysctl_tcp_orphan_retries,
501                 .maxlen         = sizeof(int),
502                 .mode           = 0644,
503                 .proc_handler   = &proc_dointvec
504         },
505         {
506                 .ctl_name       = NET_TCP_FACK,
507                 .procname       = "tcp_fack",
508                 .data           = &sysctl_tcp_fack,
509                 .maxlen         = sizeof(int),
510                 .mode           = 0644,
511                 .proc_handler   = &proc_dointvec
512         },
513         {
514                 .ctl_name       = NET_TCP_REORDERING,
515                 .procname       = "tcp_reordering",
516                 .data           = &sysctl_tcp_reordering,
517                 .maxlen         = sizeof(int),
518                 .mode           = 0644,
519                 .proc_handler   = &proc_dointvec
520         },
521         {
522                 .ctl_name       = NET_TCP_ECN,
523                 .procname       = "tcp_ecn",
524                 .data           = &sysctl_tcp_ecn,
525                 .maxlen         = sizeof(int),
526                 .mode           = 0644,
527                 .proc_handler   = &proc_dointvec
528         },
529         {
530                 .ctl_name       = NET_TCP_DSACK,
531                 .procname       = "tcp_dsack",
532                 .data           = &sysctl_tcp_dsack,
533                 .maxlen         = sizeof(int),
534                 .mode           = 0644,
535                 .proc_handler   = &proc_dointvec
536         },
537         {
538                 .ctl_name       = NET_TCP_MEM,
539                 .procname       = "tcp_mem",
540                 .data           = &sysctl_tcp_mem,
541                 .maxlen         = sizeof(sysctl_tcp_mem),
542                 .mode           = 0644,
543                 .proc_handler   = &proc_dointvec
544         },
545         {
546                 .ctl_name       = NET_TCP_WMEM,
547                 .procname       = "tcp_wmem",
548                 .data           = &sysctl_tcp_wmem,
549                 .maxlen         = sizeof(sysctl_tcp_wmem),
550                 .mode           = 0644,
551                 .proc_handler   = &proc_dointvec
552         },
553         {
554                 .ctl_name       = NET_TCP_RMEM,
555                 .procname       = "tcp_rmem",
556                 .data           = &sysctl_tcp_rmem,
557                 .maxlen         = sizeof(sysctl_tcp_rmem),
558                 .mode           = 0644,
559                 .proc_handler   = &proc_dointvec
560         },
561         {
562                 .ctl_name       = NET_TCP_APP_WIN,
563                 .procname       = "tcp_app_win",
564                 .data           = &sysctl_tcp_app_win,
565                 .maxlen         = sizeof(int),
566                 .mode           = 0644,
567                 .proc_handler   = &proc_dointvec
568         },
569         {
570                 .ctl_name       = NET_TCP_ADV_WIN_SCALE,
571                 .procname       = "tcp_adv_win_scale",
572                 .data           = &sysctl_tcp_adv_win_scale,
573                 .maxlen         = sizeof(int),
574                 .mode           = 0644,
575                 .proc_handler   = &proc_dointvec
576         },
577         {
578                 .ctl_name       = NET_IPV4_ICMP_RATELIMIT,
579                 .procname       = "icmp_ratelimit",
580                 .data           = &sysctl_icmp_ratelimit,
581                 .maxlen         = sizeof(int),
582                 .mode           = 0644,
583                 .proc_handler   = &proc_dointvec
584         },
585         {
586                 .ctl_name       = NET_IPV4_ICMP_RATEMASK,
587                 .procname       = "icmp_ratemask",
588                 .data           = &sysctl_icmp_ratemask,
589                 .maxlen         = sizeof(int),
590                 .mode           = 0644,
591                 .proc_handler   = &proc_dointvec
592         },
593         {
594                 .ctl_name       = NET_TCP_TW_REUSE,
595                 .procname       = "tcp_tw_reuse",
596                 .data           = &sysctl_tcp_tw_reuse,
597                 .maxlen         = sizeof(int),
598                 .mode           = 0644,
599                 .proc_handler   = &proc_dointvec
600         },
601         {
602                 .ctl_name       = NET_TCP_FRTO,
603                 .procname       = "tcp_frto",
604                 .data           = &sysctl_tcp_frto,
605                 .maxlen         = sizeof(int),
606                 .mode           = 0644,
607                 .proc_handler   = &proc_dointvec
608         },
609         {
610                 .ctl_name       = NET_TCP_LOW_LATENCY,
611                 .procname       = "tcp_low_latency",
612                 .data           = &sysctl_tcp_low_latency,
613                 .maxlen         = sizeof(int),
614                 .mode           = 0644,
615                 .proc_handler   = &proc_dointvec
616         },
617         {
618                 .ctl_name       = NET_IPV4_IPFRAG_SECRET_INTERVAL,
619                 .procname       = "ipfrag_secret_interval",
620                 .data           = &sysctl_ipfrag_secret_interval,
621                 .maxlen         = sizeof(int),
622                 .mode           = 0644,
623                 .proc_handler   = &proc_dointvec_jiffies,
624                 .strategy       = &sysctl_jiffies
625         },
626         {
627                 .ctl_name       = NET_IPV4_IPFRAG_MAX_DIST,
628                 .procname       = "ipfrag_max_dist",
629                 .data           = &sysctl_ipfrag_max_dist,
630                 .maxlen         = sizeof(int),
631                 .mode           = 0644,
632                 .proc_handler   = &proc_dointvec_minmax,
633                 .extra1         = &zero
634         },
635         {
636                 .ctl_name       = NET_TCP_NO_METRICS_SAVE,
637                 .procname       = "tcp_no_metrics_save",
638                 .data           = &sysctl_tcp_nometrics_save,
639                 .maxlen         = sizeof(int),
640                 .mode           = 0644,
641                 .proc_handler   = &proc_dointvec,
642         },
643         {
644                 .ctl_name       = NET_TCP_MODERATE_RCVBUF,
645                 .procname       = "tcp_moderate_rcvbuf",
646                 .data           = &sysctl_tcp_moderate_rcvbuf,
647                 .maxlen         = sizeof(int),
648                 .mode           = 0644,
649                 .proc_handler   = &proc_dointvec,
650         },
651         {
652                 .ctl_name       = NET_TCP_TSO_WIN_DIVISOR,
653                 .procname       = "tcp_tso_win_divisor",
654                 .data           = &sysctl_tcp_tso_win_divisor,
655                 .maxlen         = sizeof(int),
656                 .mode           = 0644,
657                 .proc_handler   = &proc_dointvec,
658         },
659         {
660                 .ctl_name       = NET_TCP_CONG_CONTROL,
661                 .procname       = "tcp_congestion_control",
662                 .mode           = 0644,
663                 .maxlen         = TCP_CA_NAME_MAX,
664                 .proc_handler   = &proc_tcp_congestion_control,
665                 .strategy       = &sysctl_tcp_congestion_control,
666         },
667         {
668                 .ctl_name       = NET_TCP_ABC,
669                 .procname       = "tcp_abc",
670                 .data           = &sysctl_tcp_abc,
671                 .maxlen         = sizeof(int),
672                 .mode           = 0644,
673                 .proc_handler   = &proc_dointvec,
674         },
675         {
676                 .ctl_name       = NET_TCP_MTU_PROBING,
677                 .procname       = "tcp_mtu_probing",
678                 .data           = &sysctl_tcp_mtu_probing,
679                 .maxlen         = sizeof(int),
680                 .mode           = 0644,
681                 .proc_handler   = &proc_dointvec,
682         },
683         {
684                 .ctl_name       = NET_TCP_BASE_MSS,
685                 .procname       = "tcp_base_mss",
686                 .data           = &sysctl_tcp_base_mss,
687                 .maxlen         = sizeof(int),
688                 .mode           = 0644,
689                 .proc_handler   = &proc_dointvec,
690         },
691         {
692                 .ctl_name       = NET_IPV4_TCP_WORKAROUND_SIGNED_WINDOWS,
693                 .procname       = "tcp_workaround_signed_windows",
694                 .data           = &sysctl_tcp_workaround_signed_windows,
695                 .maxlen         = sizeof(int),
696                 .mode           = 0644,
697                 .proc_handler   = &proc_dointvec
698         },
699 #ifdef CONFIG_NET_DMA
700         {
701                 .ctl_name       = NET_TCP_DMA_COPYBREAK,
702                 .procname       = "tcp_dma_copybreak",
703                 .data           = &sysctl_tcp_dma_copybreak,
704                 .maxlen         = sizeof(int),
705                 .mode           = 0644,
706                 .proc_handler   = &proc_dointvec
707         },
708 #endif
709         {
710                 .ctl_name       = NET_TCP_SLOW_START_AFTER_IDLE,
711                 .procname       = "tcp_slow_start_after_idle",
712                 .data           = &sysctl_tcp_slow_start_after_idle,
713                 .maxlen         = sizeof(int),
714                 .mode           = 0644,
715                 .proc_handler   = &proc_dointvec
716         },
717 #ifdef CONFIG_NETLABEL
718         {
719                 .ctl_name       = NET_CIPSOV4_CACHE_ENABLE,
720                 .procname       = "cipso_cache_enable",
721                 .data           = &cipso_v4_cache_enabled,
722                 .maxlen         = sizeof(int),
723                 .mode           = 0644,
724                 .proc_handler   = &proc_dointvec,
725         },
726         {
727                 .ctl_name       = NET_CIPSOV4_CACHE_BUCKET_SIZE,
728                 .procname       = "cipso_cache_bucket_size",
729                 .data           = &cipso_v4_cache_bucketsize,
730                 .maxlen         = sizeof(int),
731                 .mode           = 0644,
732                 .proc_handler   = &proc_dointvec,
733         },
734         {
735                 .ctl_name       = NET_CIPSOV4_RBM_OPTFMT,
736                 .procname       = "cipso_rbm_optfmt",
737                 .data           = &cipso_v4_rbm_optfmt,
738                 .maxlen         = sizeof(int),
739                 .mode           = 0644,
740                 .proc_handler   = &proc_dointvec,
741         },
742         {
743                 .ctl_name       = NET_CIPSOV4_RBM_STRICTVALID,
744                 .procname       = "cipso_rbm_strictvalid",
745                 .data           = &cipso_v4_rbm_strictvalid,
746                 .maxlen         = sizeof(int),
747                 .mode           = 0644,
748                 .proc_handler   = &proc_dointvec,
749         },
750 #endif /* CONFIG_NETLABEL */
751         {
752                 .ctl_name       = NET_TCP_AVAIL_CONG_CONTROL,
753                 .procname       = "tcp_available_congestion_control",
754                 .maxlen         = TCP_CA_BUF_MAX,
755                 .mode           = 0444,
756                 .proc_handler   = &proc_tcp_available_congestion_control,
757         },
758         { .ctl_name = 0 }
759 };
760
761 #endif /* CONFIG_SYSCTL */
762
763 EXPORT_SYMBOL(ipv4_config);