summaryrefslogtreecommitdiffstats
path: root/extensions/ebt_802_3.c
diff options
context:
space:
mode:
authorBart De Schuymer <bdschuym@pandora.be>2005-02-08 20:02:28 +0000
committerBart De Schuymer <bdschuym@pandora.be>2005-02-08 20:02:28 +0000
commitff587205009a0d49e2d086765de87dc619b028bb (patch)
treed1d7fd0768212c24f2adcfd9c720975394f85694 /extensions/ebt_802_3.c
parent96ce8685fe4011ef08b0f4fe2778b523c3740766 (diff)
general cleanup + add -C and -c
Diffstat (limited to 'extensions/ebt_802_3.c')
-rw-r--r--extensions/ebt_802_3.c29
1 files changed, 16 insertions, 13 deletions
diff --git a/extensions/ebt_802_3.c b/extensions/ebt_802_3.c
index e0b65ee..a43d060 100644
--- a/extensions/ebt_802_3.c
+++ b/extensions/ebt_802_3.c
@@ -1,3 +1,11 @@
+/* 802_3
+ *
+ * Author:
+ * Chris Vitale <csv@bluetail.com>
+ *
+ * May 2003
+ */
+
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
@@ -43,28 +51,23 @@ static int parse(int c, char **argv, int argc, const struct ebt_u_entry *entry,
switch (c) {
case _802_3_SAP:
- ebt_check_option(flags, _802_3_SAP);
- if (ebt_check_inverse(optarg))
+ ebt_check_option2(flags, _802_3_SAP);
+ if (ebt_check_inverse2(optarg))
info->invflags |= EBT_802_3_SAP;
-
- if (optind > argc)
- ebt_print_error("Missing 802.3-sap argument");
- i = strtoul(argv[optind - 1], &end, 16);
+ i = strtoul(optarg, &end, 16);
if (i > 255 || *end != '\0')
- ebt_print_error("Problem with specified "
+ ebt_print_error2("Problem with specified "
"sap hex value, %x",i);
info->sap = i; /* one byte, so no byte order worries */
info->bitmask |= EBT_802_3_SAP;
break;
case _802_3_TYPE:
- ebt_check_option(flags, _802_3_TYPE);
- if (ebt_check_inverse(optarg))
+ ebt_check_option2(flags, _802_3_TYPE);
+ if (ebt_check_inverse2(optarg))
info->invflags |= EBT_802_3_TYPE;
- if (optind > argc)
- ebt_print_error("Missing 802.3-type argument");
- i = strtoul(argv[optind - 1], &end, 16);
+ i = strtoul(optarg, &end, 16);
if (i > 65535 || *end != '\0') {
- ebt_print_error("Problem with the specified "
+ ebt_print_error2("Problem with the specified "
"type hex value, %x",i);
}
info->type = htons(i);