diff options
author | Stephen Hemminger <shemminger@osdl.org> | 2006-11-09 19:32:06 -0500 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2006-12-03 00:21:48 -0500 |
commit | 3ff825b28d3345ef381eceae22bf9d92231f23dc (patch) | |
tree | c3ca6ec1888ff912e0434f6621ecb2e46e8826f3 /net/ipv4/tcp_cong.c | |
parent | b68dbcab1dc70938fa5516d0ee82c0bf94e9a768 (diff) |
[TCP]: Add tcp_available_congestion_control sysctl.
Create /proc/sys/net/ipv4/tcp_available_congestion_control
that reflects currently available TCP choices.
Signed-off-by: Stephen Hemminger <shemminger@osdl.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/tcp_cong.c')
-rw-r--r-- | net/ipv4/tcp_cong.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/net/ipv4/tcp_cong.c b/net/ipv4/tcp_cong.c index 1e2982f4acd4..d846d7b95e1f 100644 --- a/net/ipv4/tcp_cong.c +++ b/net/ipv4/tcp_cong.c | |||
@@ -139,6 +139,22 @@ static int __init tcp_congestion_default(void) | |||
139 | late_initcall(tcp_congestion_default); | 139 | late_initcall(tcp_congestion_default); |
140 | 140 | ||
141 | 141 | ||
142 | /* Build string with list of available congestion control values */ | ||
143 | void tcp_get_available_congestion_control(char *buf, size_t maxlen) | ||
144 | { | ||
145 | struct tcp_congestion_ops *ca; | ||
146 | size_t offs = 0; | ||
147 | |||
148 | rcu_read_lock(); | ||
149 | list_for_each_entry_rcu(ca, &tcp_cong_list, list) { | ||
150 | offs += snprintf(buf + offs, maxlen - offs, | ||
151 | "%s%s", | ||
152 | offs == 0 ? "" : " ", ca->name); | ||
153 | |||
154 | } | ||
155 | rcu_read_unlock(); | ||
156 | } | ||
157 | |||
142 | /* Get current default congestion control */ | 158 | /* Get current default congestion control */ |
143 | void tcp_get_default_congestion_control(char *name) | 159 | void tcp_get_default_congestion_control(char *name) |
144 | { | 160 | { |