From ff587205009a0d49e2d086765de87dc619b028bb Mon Sep 17 00:00:00 2001 From: Bart De Schuymer Date: Tue, 8 Feb 2005 20:02:28 +0000 Subject: general cleanup + add -C and -c --- extensions/ebt_802_3.c | 29 ++++++++++++++++------------- 1 file changed, 16 insertions(+), 13 deletions(-) (limited to 'extensions/ebt_802_3.c') 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 + * + * May 2003 + */ + #include #include #include @@ -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); -- cgit v1.2.3