summaryrefslogtreecommitdiff
path: root/print-aoe.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2017-12-12 10:36:21 -0800
committerGuy Harris <guy@alum.mit.edu>2017-12-12 10:36:21 -0800
commit7068209574374db8934ceaaac8f92e5eb5c62880 (patch)
treee967726d8cba09b29b68e09b77a9be62ff92be7a /print-aoe.c
parenta95802aa0d8731412a9b5e621692e594046605bd (diff)
downloadtcpdump-7068209574374db8934ceaaac8f92e5eb5c62880.tar.gz
Use nd_ types in 802.x and FDDI headers.
Use EXTRACT_U_1() as required by those changes. Remove no-longer-necessary & operators from other EXTRACT_ calls. While we're at it, add MAC_ADDR_LEN to netdissect.h, and use it instead of ETHER_ADDR_LEN; eliminate ETHER_ADDR_LEN. Move the maximum Ethernet length field value to ethertype.h, under the name MAX_ETHERNET_LENGTH_VAL. Move the Ethernet header structure, and the #define for the Ethernet header length, to print-ether.c; in non-Ethernet dissectors that were using the Ethernet header structure, just declare two nd_mac_addr variables for the source and destination MAC addresses and use them instead of the Ethernet header (we don't need the type field there). These changes leave nothing in ether.h, so eliminate it.
Diffstat (limited to 'print-aoe.c')
-rw-r--r--print-aoe.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/print-aoe.c b/print-aoe.c
index 01f485dd..d821ec68 100644
--- a/print-aoe.c
+++ b/print-aoe.c
@@ -38,7 +38,6 @@
#include "netdissect.h"
#include "extract.h"
#include "addrtoname.h"
-#include "ether.h"
static const char tstr[] = " [|aoe]";
@@ -289,9 +288,9 @@ aoev1_mac_print(netdissect_options *ndo,
ND_PRINT((ndo, "\n\t DCmd: %s", tok2str(aoev1_dcmd_str, "Unknown (0x%02x)", EXTRACT_U_1(cp))));
cp += 1;
/* Ethernet Address */
- ND_TCHECK_LEN(cp, ETHER_ADDR_LEN);
+ ND_TCHECK_LEN(cp, MAC_ADDR_LEN);
ND_PRINT((ndo, ", Ethernet Address: %s", etheraddr_string(ndo, cp)));
- cp += ETHER_ADDR_LEN;
+ cp += MAC_ADDR_LEN;
}
return;
@@ -310,7 +309,7 @@ aoev1_reserve_print(netdissect_options *ndo,
const u_char *ep = cp + len;
uint8_t nmacs, i;
- if (len < AOEV1_RESERVE_ARG_LEN || (len - AOEV1_RESERVE_ARG_LEN) % ETHER_ADDR_LEN)
+ if (len < AOEV1_RESERVE_ARG_LEN || (len - AOEV1_RESERVE_ARG_LEN) % MAC_ADDR_LEN)
goto invalid;
/* RCmd */
ND_TCHECK_1(cp);
@@ -321,12 +320,12 @@ aoev1_reserve_print(netdissect_options *ndo,
nmacs = EXTRACT_U_1(cp);
cp += 1;
ND_PRINT((ndo, ", NMacs: %u", nmacs));
- if (AOEV1_RESERVE_ARG_LEN + nmacs * ETHER_ADDR_LEN != len)
+ if (AOEV1_RESERVE_ARG_LEN + nmacs * MAC_ADDR_LEN != len)
goto invalid;
/* addresses */
for (i = 0; i < nmacs; i++) {
ND_PRINT((ndo, "\n\tEthernet Address %u: %s", i, etheraddr_string(ndo, cp)));
- cp += ETHER_ADDR_LEN;
+ cp += MAC_ADDR_LEN;
}
return;