From 52b80d312a3297f37e09e2802a52625dab0bbbfa Mon Sep 17 00:00:00 2001 From: Pablo Neira Ayuso Date: Fri, 6 Mar 2009 19:38:53 +0100 Subject: extensions: remove use of old libnetfilter API flags This patch removes the use of the obsolete old libnetfilter protocol flags. This patch also improves error reporting in TCP and UDP. Signed-off-by: Pablo Neira Ayuso --- extensions/libct_proto_icmp.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'extensions/libct_proto_icmp.c') diff --git a/extensions/libct_proto_icmp.c b/extensions/libct_proto_icmp.c index a2c9a85..51366f1 100644 --- a/extensions/libct_proto_icmp.c +++ b/extensions/libct_proto_icmp.c @@ -17,7 +17,12 @@ #include /* For htons */ #include #include -#include + +enum { + CT_ICMP_TYPE = (1 << 0), + CT_ICMP_CODE = (1 << 1), + CT_ICMP_ID = (1 << 2), +}; static struct option opts[] = { {"icmp-type", 1, 0, '1'}, @@ -73,19 +78,19 @@ static int parse(char c, tmp = atoi(optarg); nfct_set_attr_u8(ct, ATTR_ICMP_TYPE, tmp); nfct_set_attr_u8(ct, ATTR_L4PROTO, IPPROTO_ICMP); - *flags |= ICMP_TYPE; + *flags |= CT_ICMP_TYPE; break; case '2': tmp = atoi(optarg); nfct_set_attr_u8(ct, ATTR_ICMP_CODE, tmp); nfct_set_attr_u8(ct, ATTR_L4PROTO, IPPROTO_ICMP); - *flags |= ICMP_CODE; + *flags |= CT_ICMP_CODE; break; case '3': id = htons(atoi(optarg)); nfct_set_attr_u16(ct, ATTR_ICMP_ID, id); nfct_set_attr_u8(ct, ATTR_L4PROTO, IPPROTO_ICMP); - *flags |= ICMP_ID; + *flags |= CT_ICMP_ID; break; } return 1; -- cgit v1.2.3