2 * sysctl_net_ipv4.c: sysctl interface to net IPV4 subsystem. 4 * Begun April 1, 1996, Mike Shaver. 5 * Added /proc/sys/net/ipv4 directory entry (empty =) ). [MS] 9 #include <linux/sysctl.h> 10 #include <linux/config.h> 13 #include <net/route.h> 17 * TCP configuration parameters 20 #define TCP_PMTU_DISC 0x00000001/* perform PMTU discovery */ 21 #define TCP_CONG_AVOID 0x00000002/* congestion avoidance algorithm */ 22 #define TCP_DELAY_ACKS 0x00000003/* delayed ack stategy */ 25 static int boolean_min
=0; 26 static int boolean_max
=1; 30 externint sysctl_arp_res_time
; 31 externint sysctl_arp_dead_res_time
; 32 externint sysctl_arp_max_tries
; 33 externint sysctl_arp_timeout
; 34 externint sysctl_arp_check_interval
; 35 externint sysctl_arp_confirm_interval
; 36 externint sysctl_arp_confirm_timeout
; 38 externint sysctl_tcp_cong_avoidance
; 39 externinttcp_sysctl_congavoid(ctl_table
*ctl
,int write
,struct file
* filp
, 40 void*buffer
,size_t*lenp
); 42 struct ipv4_config ipv4_config
= {1,1,1,1, }; 46 struct ipv4_config ipv4_def_router_config
= {0,1,1,1,1,1,1, }; 47 struct ipv4_config ipv4_def_host_config
= {1,1,1,1, }; 49 intipv4_sysctl_forwarding(ctl_table
*ctl
,int write
,struct file
* filp
, 50 void*buffer
,size_t*lenp
) 55 ret
=proc_dointvec(ctl
, write
, filp
, buffer
, lenp
); 57 if(write
&& IS_ROUTER
!= val
) { 59 ipv4_config
= ipv4_def_router_config
; 61 ipv4_config
= ipv4_def_host_config
; 67 ctl_table ipv4_table
[] = { 68 {NET_IPV4_ARP_RES_TIME
,"arp_res_time", 69 &sysctl_arp_res_time
,sizeof(int),0644, NULL
, &proc_dointvec
}, 70 {NET_IPV4_ARP_DEAD_RES_TIME
,"arp_dead_res_time", 71 &sysctl_arp_dead_res_time
,sizeof(int),0644, NULL
, &proc_dointvec
}, 72 {NET_IPV4_ARP_MAX_TRIES
,"arp_max_tries", 73 &sysctl_arp_max_tries
,sizeof(int),0644, NULL
, &proc_dointvec
}, 74 {NET_IPV4_ARP_TIMEOUT
,"arp_timeout", 75 &sysctl_arp_timeout
,sizeof(int),0644, NULL
, &proc_dointvec
}, 76 {NET_IPV4_ARP_CHECK_INTERVAL
,"arp_check_interval", 77 &sysctl_arp_check_interval
,sizeof(int),0644, NULL
, &proc_dointvec
}, 78 {NET_IPV4_ARP_CONFIRM_INTERVAL
,"arp_confirm_interval", 79 &sysctl_arp_confirm_interval
,sizeof(int),0644, NULL
, 81 {NET_IPV4_ARP_CONFIRM_TIMEOUT
,"arp_confirm_timeout", 82 &sysctl_arp_confirm_timeout
,sizeof(int),0644, NULL
, 84 {NET_IPV4_TCP_VEGAS_CONG_AVOID
,"tcp_vegas_cong_avoid", 85 &sysctl_tcp_cong_avoidance
,sizeof(int),0644, 86 NULL
, &tcp_sysctl_congavoid
}, 87 {NET_IPV4_FORWARDING
,"ip_forwarding", 88 &ip_statistics
.IpForwarding
,sizeof(int),0644, NULL
, 89 &ipv4_sysctl_forwarding
}, 90 {NET_IPV4_DEFAULT_TTL
,"ip_default_ttl", 91 &ip_statistics
.IpDefaultTTL
,sizeof(int),0644, NULL
, 93 {NET_IPV4_RFC1812_FILTER
,"ip_rfc1812_filter", 94 &ipv4_config
.rfc1812_filter
,sizeof(int),0644, NULL
, 96 {NET_IPV4_LOG_MARTIANS
,"ip_log_martians", 97 &ipv4_config
.log_martians
,sizeof(int),0644, NULL
, 99 {NET_IPV4_SOURCE_ROUTE
,"ip_source_route", 100 &ipv4_config
.source_route
,sizeof(int),0644, NULL
, 102 {NET_IPV4_ADDRMASK_AGENT
,"ip_addrmask_agent", 103 &ipv4_config
.addrmask_agent
,sizeof(int),0644, NULL
, 105 {NET_IPV4_BOOTP_AGENT
,"ip_bootp_agent", 106 &ipv4_config
.bootp_agent
,sizeof(int),0644, NULL
, 108 {NET_IPV4_BOOTP_RELAY
,"ip_bootp_relay", 109 &ipv4_config
.bootp_relay
,sizeof(int),0644, NULL
, 111 {NET_IPV4_FIB_MODEL
,"ip_fib_model", 112 &ipv4_config
.fib_model
,sizeof(int),0644, NULL
, 114 {NET_IPV4_NO_PMTU_DISC
,"ip_no_pmtu_disc", 115 &ipv4_config
.no_pmtu_disc
,sizeof(int),0644, NULL
, 117 {NET_IPV4_ACCEPT_REDIRECTS
,"ip_accept_redirects", 118 &ipv4_config
.accept_redirects
,sizeof(int),0644, NULL
, 120 {NET_IPV4_SECURE_REDIRECTS
,"ip_secure_redirects", 121 &ipv4_config
.secure_redirects
,sizeof(int),0644, NULL
, 123 {NET_IPV4_RFC1620_REDIRECTS
,"ip_rfc1620_redirects", 124 &ipv4_config
.rfc1620_redirects
,sizeof(int),0644, NULL
, 129 #endif/* CONFIG_SYSCTL */