summaryrefslogtreecommitdiffstats
path: root/extensions/ebt_mark_m.c
diff options
context:
space:
mode:
Diffstat (limited to 'extensions/ebt_mark_m.c')
-rw-r--r--extensions/ebt_mark_m.c23
1 files changed, 14 insertions, 9 deletions
diff --git a/extensions/ebt_mark_m.c b/extensions/ebt_mark_m.c
index 2cc371a..8c5913e 100644
--- a/extensions/ebt_mark_m.c
+++ b/extensions/ebt_mark_m.c
@@ -1,3 +1,11 @@
+/* ebt_mark_m
+ *
+ * Authors:
+ * Bart De Schuymer <bdschuym@pandora.be>
+ *
+ * July, 2002
+ */
+
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -40,22 +48,19 @@ static int parse(int c, char **argv, int argc, const struct ebt_u_entry *entry,
switch (c) {
case MARK:
- ebt_check_option(flags, MARK);
- if (ebt_check_inverse(optarg))
+ ebt_check_option2(flags, MARK);
+ if (ebt_check_inverse2(optarg))
markinfo->invert = 1;
- if (optind > argc)
- ebt_print_error("No mark specified");
- markinfo->mark = strtoul(argv[optind - 1], &end, 0);
+ markinfo->mark = strtoul(optarg, &end, 0);
markinfo->bitmask = EBT_MARK_AND;
if (*end == '/') {
- if (end == argv[optind - 1])
+ if (end == optarg)
markinfo->bitmask = EBT_MARK_OR;
markinfo->mask = strtoul(end+1, &end, 0);
} else
markinfo->mask = 0xffffffff;
- if ( *end != '\0' || end == argv[optind - 1])
- ebt_print_error("Bad mark value '%s'",
- argv[optind - 1]);
+ if ( *end != '\0' || end == optarg)
+ ebt_print_error2("Bad mark value '%s'", optarg);
break;
default:
return 0;