diff options
| author | Guy Harris <guy@alum.mit.edu> | 2017-12-12 10:36:21 -0800 |
|---|---|---|
| committer | Guy Harris <guy@alum.mit.edu> | 2017-12-12 10:36:21 -0800 |
| commit | 7068209574374db8934ceaaac8f92e5eb5c62880 (patch) | |
| tree | e967726d8cba09b29b68e09b77a9be62ff92be7a /print-symantec.c | |
| parent | a95802aa0d8731412a9b5e621692e594046605bd (diff) | |
| download | tcpdump-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-symantec.c')
| -rw-r--r-- | print-symantec.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/print-symantec.c b/print-symantec.c index c1fe3bd4..56f7fc26 100644 --- a/print-symantec.c +++ b/print-symantec.c @@ -31,8 +31,6 @@ #include "extract.h" #include "ethertype.h" -#include "ether.h" - struct symantec_header { uint8_t stuff1[6]; uint16_t ether_type; @@ -49,14 +47,14 @@ symantec_hdr_print(netdissect_options *ndo, register const u_char *bp, u_int len etype = EXTRACT_BE_U_2(&sp->ether_type); if (!ndo->ndo_qflag) { - if (etype <= ETHERMTU) + if (etype <= MAX_ETHERNET_LENGTH_VAL) ND_PRINT((ndo, "invalid ethertype %u", etype)); else ND_PRINT((ndo, "ethertype %s (0x%04x)", tok2str(ethertype_values,"Unknown", etype), etype)); } else { - if (etype <= ETHERMTU) + if (etype <= MAX_ETHERNET_LENGTH_VAL) ND_PRINT((ndo, "invalid ethertype %u", etype)); else ND_PRINT((ndo, "%s", tok2str(ethertype_values,"Unknown Ethertype (0x%04x)", etype))); @@ -94,7 +92,7 @@ symantec_if_print(netdissect_options *ndo, const struct pcap_pkthdr *h, const u_ ether_type = EXTRACT_BE_U_2(&sp->ether_type); - if (ether_type <= ETHERMTU) { + if (ether_type <= MAX_ETHERNET_LENGTH_VAL) { /* ether_type not known, print raw packet */ if (!ndo->ndo_eflag) symantec_hdr_print(ndo, (const u_char *)sp, length + sizeof (struct symantec_header)); |
