From f1ea9b9233406c479c91e36c250c21dd3ef76496 Mon Sep 17 00:00:00 2001 From: Pablo Neira Ayuso Date: Sat, 11 Apr 2009 15:28:11 +0200 Subject: conntrack: save one indent in the TCP support This patch saves one extra indent in the switch(). Signed-off-by: Pablo Neira Ayuso --- extensions/libct_proto_tcp.c | 120 +++++++++++++++++++++---------------------- 1 file changed, 59 insertions(+), 61 deletions(-) (limited to 'extensions') diff --git a/extensions/libct_proto_tcp.c b/extensions/libct_proto_tcp.c index 0ba3a7f..30d7229 100644 --- a/extensions/libct_proto_tcp.c +++ b/extensions/libct_proto_tcp.c @@ -108,68 +108,66 @@ static int parse_options(char c, u_int16_t port; switch(c) { - case '1': - port = htons(atoi(optarg)); - nfct_set_attr_u16(ct, ATTR_ORIG_PORT_SRC, port); - nfct_set_attr_u8(ct, ATTR_ORIG_L4PROTO, IPPROTO_TCP); - *flags |= CT_TCP_ORIG_SPORT; - break; - case '2': - port = htons(atoi(optarg)); - nfct_set_attr_u16(ct, ATTR_ORIG_PORT_DST, port); - nfct_set_attr_u8(ct, ATTR_ORIG_L4PROTO, IPPROTO_TCP); - *flags |= CT_TCP_ORIG_DPORT; - break; - case '3': - port = htons(atoi(optarg)); - nfct_set_attr_u16(ct, ATTR_REPL_PORT_SRC, port); - nfct_set_attr_u8(ct, ATTR_REPL_L4PROTO, IPPROTO_TCP); - *flags |= CT_TCP_REPL_SPORT; - break; - case '4': - port = htons(atoi(optarg)); - nfct_set_attr_u16(ct, ATTR_REPL_PORT_DST, port); - nfct_set_attr_u8(ct, ATTR_REPL_L4PROTO, IPPROTO_TCP); - *flags |= CT_TCP_REPL_DPORT; - break; - case '5': - port = htons(atoi(optarg)); - nfct_set_attr_u16(mask, ATTR_ORIG_PORT_SRC, port); - nfct_set_attr_u8(mask, ATTR_ORIG_L4PROTO, IPPROTO_TCP); - *flags |= CT_TCP_MASK_SPORT; - break; - case '6': - port = htons(atoi(optarg)); - nfct_set_attr_u16(mask, ATTR_ORIG_PORT_DST, port); - nfct_set_attr_u8(mask, ATTR_ORIG_L4PROTO, IPPROTO_TCP); - *flags |= CT_TCP_MASK_DPORT; - break; - case '7': - for (i=0; i