diff options
author | Bart De Schuymer <bdschuym@pandora.be> | 2005-02-08 20:02:28 +0000 |
---|---|---|
committer | Bart De Schuymer <bdschuym@pandora.be> | 2005-02-08 20:02:28 +0000 |
commit | ff587205009a0d49e2d086765de87dc619b028bb (patch) | |
tree | d1d7fd0768212c24f2adcfd9c720975394f85694 /extensions/ebt_log.c | |
parent | 96ce8685fe4011ef08b0f4fe2778b523c3740766 (diff) |
general cleanup + add -C and -c
Diffstat (limited to 'extensions/ebt_log.c')
-rw-r--r-- | extensions/ebt_log.c | 31 |
1 files changed, 23 insertions, 8 deletions
diff --git a/extensions/ebt_log.c b/extensions/ebt_log.c index f455f9f..07a5fe9 100644 --- a/extensions/ebt_log.c +++ b/extensions/ebt_log.c @@ -1,3 +1,11 @@ +/* ebt_log + * + * Authors: + * Bart De Schuymer <bdschuym@pandora.be> + * + * April, 2002 + */ + #include <stdio.h> #include <stdlib.h> #include <string.h> @@ -103,35 +111,43 @@ static int parse(int c, char **argv, int argc, const struct ebt_u_entry *entry, switch (c) { case LOG_PREFIX: - ebt_check_option(flags, OPT_PREFIX); + ebt_check_option2(flags, OPT_PREFIX); + if (ebt_check_inverse(optarg)) + ebt_print_error2("Unexpected `!' after --log-prefix"); if (strlen(optarg) > sizeof(loginfo->prefix) - 1) - ebt_print_error("Prefix too long"); + ebt_print_error2("Prefix too long"); strcpy(loginfo->prefix, optarg); break; case LOG_LEVEL: - ebt_check_option(flags, OPT_LEVEL); + ebt_check_option2(flags, OPT_LEVEL); i = strtol(optarg, &end, 16); if (*end != '\0' || i < 0 || i > 7) loginfo->loglevel = name_to_loglevel(optarg); else loginfo->loglevel = i; if (loginfo->loglevel == 9) - ebt_print_error("Problem with the log-level"); + ebt_print_error2("Problem with the log-level"); break; case LOG_IP: - ebt_check_option(flags, OPT_IP); + ebt_check_option2(flags, OPT_IP); + if (ebt_check_inverse(optarg)) + ebt_print_error2("Unexpected `!' after --log-ip"); loginfo->bitmask |= EBT_LOG_IP; break; case LOG_ARP: - ebt_check_option(flags, OPT_ARP); + ebt_check_option2(flags, OPT_ARP); + if (ebt_check_inverse(optarg)) + ebt_print_error2("Unexpected `!' after --log-arp"); loginfo->bitmask |= EBT_LOG_ARP; break; case LOG_LOG: - ebt_check_option(flags, OPT_LOG); + ebt_check_option2(flags, OPT_LOG); + if (ebt_check_inverse(optarg)) + ebt_print_error2("Unexpected `!' after --log"); break; default: return 0; @@ -143,7 +159,6 @@ static void final_check(const struct ebt_u_entry *entry, const struct ebt_entry_watcher *watcher, const char *name, unsigned int hookmask, unsigned int time) { - return; } static void print(const struct ebt_u_entry *entry, |