X-Git-Url: https://git.tcpdump.org/tcpdump/blobdiff_plain/5cea2703185c6af1616dc338c43c6cf67b0bec60..cda9bf8c5f842fc7110fbbf2234bcc898f78c0bd:/print-symantec.c diff --git a/print-symantec.c b/print-symantec.c index e80bd45c..6a0b4918 100644 --- a/print-symantec.c +++ b/print-symantec.c @@ -22,22 +22,22 @@ /* \summary: Symantec Enterprise Firewall printer */ #ifdef HAVE_CONFIG_H -#include "config.h" +#include #endif -#include +#include "netdissect-stdinc.h" #include "netdissect.h" #include "extract.h" #include "ethertype.h" struct symantec_header { - uint8_t stuff1[6]; - uint16_t ether_type; - uint8_t stuff2[36]; + nd_byte stuff1[6]; + nd_uint16_t ether_type; + nd_byte stuff2[36]; }; -static inline void +static void symantec_hdr_print(netdissect_options *ndo, const u_char *bp, u_int length) { const struct symantec_header *sp; @@ -45,22 +45,22 @@ symantec_hdr_print(netdissect_options *ndo, const u_char *bp, u_int length) sp = (const struct symantec_header *)bp; - etype = EXTRACT_BE_U_2(&sp->ether_type); + etype = GET_BE_U_2(sp->ether_type); if (!ndo->ndo_qflag) { if (etype <= MAX_ETHERNET_LENGTH_VAL) - ND_PRINT((ndo, "invalid ethertype %u", etype)); + ND_PRINT("invalid ethertype %u", etype); else - ND_PRINT((ndo, "ethertype %s (0x%04x)", + ND_PRINT("ethertype %s (0x%04x)", tok2str(ethertype_values,"Unknown", etype), - etype)); + etype); } else { if (etype <= MAX_ETHERNET_LENGTH_VAL) - ND_PRINT((ndo, "invalid ethertype %u", etype)); + ND_PRINT("invalid ethertype %u", etype); else - ND_PRINT((ndo, "%s", tok2str(ethertype_values,"Unknown Ethertype (0x%04x)", etype))); + ND_PRINT("%s", tok2str(ethertype_values,"Unknown Ethertype (0x%04x)", etype)); } - ND_PRINT((ndo, ", length %u: ", length)); + ND_PRINT(", length %u: ", length); } /* @@ -77,8 +77,9 @@ symantec_if_print(netdissect_options *ndo, const struct pcap_pkthdr *h, const u_ const struct symantec_header *sp; u_short ether_type; + ndo->ndo_protocol = "symantec_if"; if (caplen < sizeof (struct symantec_header)) { - ND_PRINT((ndo, "[|symantec]")); + nd_print_trunc(ndo); return caplen; } @@ -90,7 +91,7 @@ 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_BE_U_2(&sp->ether_type); + ether_type = GET_BE_U_2(sp->ether_type); if (ether_type <= MAX_ETHERNET_LENGTH_VAL) { /* ether_type not known, print raw packet */