X-Git-Url: https://git.tcpdump.org/tcpdump/blobdiff_plain/11d3a01319e295dcabfb2647302d278938449226..9f957a5883cb4c5c99cefa71b42fc9d2d27d73e1:/print-symantec.c diff --git a/print-symantec.c b/print-symantec.c index 13ac4e15..e80bd45c 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; @@ -40,23 +38,23 @@ struct symantec_header { }; static inline void -symantec_hdr_print(netdissect_options *ndo, register const u_char *bp, u_int length) +symantec_hdr_print(netdissect_options *ndo, const u_char *bp, u_int length) { - register const struct symantec_header *sp; + const struct symantec_header *sp; uint16_t etype; sp = (const struct symantec_header *)bp; - etype = EXTRACT_16BITS(&sp->ether_type); + 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))); @@ -92,16 +90,16 @@ symantec_if_print(netdissect_options *ndo, const struct pcap_pkthdr *h, const u_ sp = (const struct symantec_header *)p; p += sizeof (struct symantec_header); - ether_type = EXTRACT_16BITS(&sp->ether_type); + 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)); if (!ndo->ndo_suppress_default_print) ND_DEFAULTPRINT(p, caplen); - } else if (ethertype_print(ndo, ether_type, p, length, caplen) == 0) { + } else if (ethertype_print(ndo, ether_type, p, length, caplen, NULL, NULL) == 0) { /* ether_type not known, print raw packet */ if (!ndo->ndo_eflag) symantec_hdr_print(ndo, (const u_char *)sp, length + sizeof (struct symantec_header));