diff options
author | /C=DE/ST=Berlin/L=Berlin/O=Netfilter Project/OU=Development/CN=pablo/emailAddress=pablo@netfilter.org </C=DE/ST=Berlin/L=Berlin/O=Netfilter Project/OU=Development/CN=pablo/emailAddress=pablo@netfilter.org> | 2005-12-03 22:33:53 +0000 |
---|---|---|
committer | /C=DE/ST=Berlin/L=Berlin/O=Netfilter Project/OU=Development/CN=pablo/emailAddress=pablo@netfilter.org </C=DE/ST=Berlin/L=Berlin/O=Netfilter Project/OU=Development/CN=pablo/emailAddress=pablo@netfilter.org> | 2005-12-03 22:33:53 +0000 |
commit | 5891b45e0eee0307a29ed5103fe6d596f6a37ebd (patch) | |
tree | 4da61210c620c3dc173257bf556f83627e52f7d6 /extensions/libct_proto_icmp.c | |
parent | 2082ea8a70a1c3b7c8b47115f00fcbe70fac9ffa (diff) | |
download | conntrack-tools-5891b45e0eee0307a29ed5103fe6d596f6a37ebd.tar.gz conntrack-tools-5891b45e0eee0307a29ed5103fe6d596f6a37ebd.zip |
o Add support to filter events. ie: -p tcp --orig-port-dst 80 in
conjuction with -E to get all the requests to HTTP servers
o Update manpage
o Missing static function declaration in the protocol handlers
o Use protocol flags defined in libnetfilter_conntrack
o Kill leftover #include "conntrack.h" in the ICMP helper
o Bumped version to 0.991
Diffstat (limited to 'extensions/libct_proto_icmp.c')
-rw-r--r-- | extensions/libct_proto_icmp.c | 39 |
1 files changed, 14 insertions, 25 deletions
diff --git a/extensions/libct_proto_icmp.c b/extensions/libct_proto_icmp.c index dc7374e..afae25e 100644 --- a/extensions/libct_proto_icmp.c +++ b/extensions/libct_proto_icmp.c @@ -14,7 +14,7 @@ #include <netinet/in.h> /* For htons */ #include <netinet/ip_icmp.h> #include <libnetfilter_conntrack/libnetfilter_conntrack.h> -#include "conntrack.h" +#include <libnetfilter_conntrack/libnetfilter_conntrack_icmp.h> static struct option opts[] = { {"icmp-type", 1, 0, '1'}, @@ -23,18 +23,7 @@ static struct option opts[] = { {0, 0, 0, 0} }; -enum icmp_param_flags { - ICMP_TYPE_BIT = 0, - ICMP_TYPE = (1 << ICMP_TYPE_BIT), - - ICMP_CODE_BIT = 1, - ICMP_CODE = (1 << ICMP_CODE_BIT), - - ICMP_ID_BIT = 2, - ICMP_ID = (1 << ICMP_ID_BIT) -}; - -void help() +static void help() { fprintf(stdout, "--icmp-type icmp type\n"); fprintf(stdout, "--icmp-code icmp code\n"); @@ -52,12 +41,12 @@ static u_int8_t invmap[] [ICMP_ADDRESS] = ICMP_ADDRESSREPLY + 1, [ICMP_ADDRESSREPLY] = ICMP_ADDRESS + 1}; -int parse(char c, char *argv[], - struct nfct_tuple *orig, - struct nfct_tuple *reply, - struct nfct_tuple *mask, - union nfct_protoinfo *proto, - unsigned int *flags) +static int parse(char c, char *argv[], + struct nfct_tuple *orig, + struct nfct_tuple *reply, + struct nfct_tuple *mask, + union nfct_protoinfo *proto, + unsigned int *flags) { switch(c) { case '1': @@ -86,10 +75,10 @@ int parse(char c, char *argv[], return 1; } -int final_check(unsigned int flags, - unsigned int command, - struct nfct_tuple *orig, - struct nfct_tuple *reply) +static int final_check(unsigned int flags, + unsigned int command, + struct nfct_tuple *orig, + struct nfct_tuple *reply) { if (!(flags & ICMP_TYPE)) return 0; @@ -109,9 +98,9 @@ static struct ctproto_handler icmp = { .version = VERSION, }; -void __attribute__ ((constructor)) init(void); +static void __attribute__ ((constructor)) init(void); -void init(void) +static void init(void) { register_proto(&icmp); } |