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 /src | |
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 'src')
-rw-r--r-- | src/conntrack.c | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/src/conntrack.c b/src/conntrack.c index ed97a86..676049e 100644 --- a/src/conntrack.c +++ b/src/conntrack.c @@ -46,7 +46,7 @@ #include "libct_proto.h" #define PROGNAME "conntrack" -#define VERSION "0.50" +#define VERSION "0.60" #if 0 #define DEBUGP printf @@ -182,7 +182,7 @@ static char commands_v_options[NUMBER_OF_CMD][NUMBER_OF_OPT] = /*EVENT*/ {'x','x','x','x','x','x','x','x','x',' ','x'}, /*ACTION*/ {'x','x','x','x','x','x','x','x',' ','x',' '}, /*VERSION*/ {'x','x','x','x','x','x','x','x','x','x','x'}, -/*HELP*/ {'x','x','x','x','x','x','x','x','x','x','x'}, +/*HELP*/ {'x','x','x','x',' ','x','x','x','x','x','x'}, }; /* FIXME: hardcoded!, this must be defined during compilation time */ @@ -203,6 +203,13 @@ enum exittype { VERSION_PROBLEM }; +void extension_help(struct ctproto_handler *h) +{ + fprintf(stdout, "\n"); + fprintf(stdout, "Proto `%s' help:\n", h->name); + h->help(); +} + void exit_tryhelp(int status) { @@ -624,6 +631,13 @@ int main(int argc, char *argv[]) generic_opt_check(command, options); + if (!(command & CT_HELP) + && h && h->final_check && !h->final_check(extra_flags)) { + usage(argv[0]); + extension_help(h); + exit_error(PARAMETER_PROBLEM, "Missing protocol arguments!\n"); + } + while (retry > 0) { retry--; switch(command) { @@ -697,6 +711,8 @@ int main(int argc, char *argv[]) break; case CT_HELP: usage(argv[0]); + if (options & CT_OPT_PROTO) + extension_help(h); break; default: usage(argv[0]); |