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-05-15 14:23:16 +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-05-15 14:23:16 +0000 |
commit | a75bb977ff16c9f3b3bdccdcd4173e9ef033463f (patch) | |
tree | 382d0595b23f15e3d091408da88b23030378d6c1 /extensions/libct_proto_tcp.c | |
parent | b48c2c0e44ea8e2e84ee84a313f5ab4a1add0dfd (diff) | |
download | conntrack-tools-a75bb977ff16c9f3b3bdccdcd4173e9ef033463f.tar.gz conntrack-tools-a75bb977ff16c9f3b3bdccdcd4173e9ef033463f.zip |
Completed some stuff related to protocol helpers:
o final_check
o help
o ICMP support
Diffstat (limited to 'extensions/libct_proto_tcp.c')
-rw-r--r-- | extensions/libct_proto_tcp.c | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/extensions/libct_proto_tcp.c b/extensions/libct_proto_tcp.c index 58005b0..a2243dc 100644 --- a/extensions/libct_proto_tcp.c +++ b/extensions/libct_proto_tcp.c @@ -54,6 +54,15 @@ static const char *states[] = { "LISTEN" }; +void help() +{ + fprintf(stdout, "--orig-port-src original source port\n"); + fprintf(stdout, "--orig-port-dst original destination port\n"); + fprintf(stdout, "--reply-port-src reply source port\n"); + fprintf(stdout, "--reply-port-dst reply destination port\n"); + fprintf(stdout, "--state TCP state, fe. ESTABLISHED\n"); +} + int parse(char c, char *argv[], struct ip_conntrack_tuple *orig, struct ip_conntrack_tuple *reply, @@ -104,6 +113,20 @@ int parse(char c, char *argv[], return 1; } +int final_check(unsigned int flags) +{ + if (!(flags & ORIG_SPORT)) + return 0; + else if (!(flags & ORIG_DPORT)) + return 0; + else if (!(flags & REPL_SPORT)) + return 0; + else if (!(flags & REPL_DPORT)) + return 0; + + return 1; +} + void print_tuple(struct ip_conntrack_tuple *t) { fprintf(stdout, "sport=%d dport=%d ", ntohs(t->src.u.tcp.port), @@ -121,6 +144,8 @@ static struct ctproto_handler tcp = { .parse = parse, .print_tuple = print_tuple, .print_proto = print_proto, + .final_check = final_check, + .help = help, .opts = opts }; |