aboutsummaryrefslogtreecommitdiffstats
path: root/net/dccp/options.c
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@mandriva.com>2006-03-20 22:25:02 -0500
committerDavid S. Miller <davem@davemloft.net>2006-03-20 22:25:02 -0500
commite55d912f5b75723159348a7fc7692f869a86636a (patch)
treec00be180cac20e4247ffda446ad266d885a1a811 /net/dccp/options.c
parent04e2661e9c00386412b64612549cf24c8baef67c (diff)
[DCCP] feat: Introduce sysctls for the default features
[root@qemu ~]# for a in /proc/sys/net/dccp/default/* ; do echo $a ; cat $a ; done /proc/sys/net/dccp/default/ack_ratio 2 /proc/sys/net/dccp/default/rx_ccid 3 /proc/sys/net/dccp/default/send_ackvec 1 /proc/sys/net/dccp/default/send_ndp 1 /proc/sys/net/dccp/default/seq_window 100 /proc/sys/net/dccp/default/tx_ccid 3 [root@qemu ~]# So if wanting to test ccid3 as the tx CCID one can just do: [root@qemu ~]# echo 3 > /proc/sys/net/dccp/default/tx_ccid [root@qemu ~]# echo 2 > /proc/sys/net/dccp/default/rx_ccid [root@qemu ~]# cat /proc/sys/net/dccp/default/[tr]x_ccid 2 3 [root@qemu ~]# Of course we also need the setsockopt for each app to tell its preferences, but for testing or defining something other than CCID2 as the default for apps that don't explicitely set their preference the sysctl interface is handy. Signed-off-by: Arnaldo Carvalho de Melo <acme@mandriva.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/dccp/options.c')
-rw-r--r--net/dccp/options.c22
1 files changed, 12 insertions, 10 deletions
diff --git a/net/dccp/options.c b/net/dccp/options.c
index 7d73b33a6043..3ecd319c0f59 100644
--- a/net/dccp/options.c
+++ b/net/dccp/options.c
@@ -23,19 +23,21 @@
23#include "dccp.h" 23#include "dccp.h"
24#include "feat.h" 24#include "feat.h"
25 25
26/* stores the default values for new connection. may be changed with sysctl */ 26int dccp_feat_default_sequence_window = DCCPF_INITIAL_SEQUENCE_WINDOW;
27static const struct dccp_options dccpo_default_values = { 27int dccp_feat_default_rx_ccid = DCCPF_INITIAL_CCID;
28 .dccpo_sequence_window = DCCPF_INITIAL_SEQUENCE_WINDOW, 28int dccp_feat_default_tx_ccid = DCCPF_INITIAL_CCID;
29 .dccpo_rx_ccid = DCCPF_INITIAL_CCID, 29int dccp_feat_default_ack_ratio = DCCPF_INITIAL_ACK_RATIO;
30 .dccpo_tx_ccid = DCCPF_INITIAL_CCID, 30int dccp_feat_default_send_ack_vector = DCCPF_INITIAL_SEND_ACK_VECTOR;
31 .dccpo_ack_ratio = DCCPF_INITIAL_ACK_RATIO, 31int dccp_feat_default_send_ndp_count = DCCPF_INITIAL_SEND_NDP_COUNT;
32 .dccpo_send_ack_vector = DCCPF_INITIAL_SEND_ACK_VECTOR,
33 .dccpo_send_ndp_count = DCCPF_INITIAL_SEND_NDP_COUNT,
34};
35 32
36void dccp_options_init(struct dccp_options *dccpo) 33void dccp_options_init(struct dccp_options *dccpo)
37{ 34{
38 memcpy(dccpo, &dccpo_default_values, sizeof(*dccpo)); 35 dccpo->dccpo_sequence_window = dccp_feat_default_sequence_window;
36 dccpo->dccpo_rx_ccid = dccp_feat_default_rx_ccid;
37 dccpo->dccpo_tx_ccid = dccp_feat_default_tx_ccid;
38 dccpo->dccpo_ack_ratio = dccp_feat_default_ack_ratio;
39 dccpo->dccpo_send_ack_vector = dccp_feat_default_send_ack_vector;
40 dccpo->dccpo_send_ndp_count = dccp_feat_default_send_ndp_count;
39} 41}
40 42
41static u32 dccp_decode_value_var(const unsigned char *bf, const u8 len) 43static u32 dccp_decode_value_var(const unsigned char *bf, const u8 len)