X-Git-Url: https://git.tcpdump.org/tcpdump/blobdiff_plain/64e8f9a9ed91a3cbfa8e66367f87ef50a1d62b99..refs/heads/coverity_scan:/print-token.c diff --git a/print-token.c b/print-token.c index 6a323308..74355ffd 100644 --- a/print-token.c +++ b/print-token.c @@ -26,9 +26,7 @@ /* \summary: Token Ring printer */ -#ifdef HAVE_CONFIG_H #include -#endif #include "netdissect-stdinc.h" @@ -83,8 +81,8 @@ struct token_header { nd_uint8_t token_ac; nd_uint8_t token_fc; - nd_mac_addr token_dhost; - nd_mac_addr token_shost; + nd_mac48 token_dhost; + nd_mac48 token_shost; nd_uint16_t token_rcf; nd_uint16_t token_rseg[ROUTING_SEGMENT_MAX]; }; @@ -108,8 +106,8 @@ token_hdr_print(netdissect_options *ndo, { const char *srcname, *dstname; - srcname = etheraddr_string(ndo, fsrc); - dstname = etheraddr_string(ndo, fdst); + srcname = mac48_string(ndo, fsrc); + dstname = mac48_string(ndo, fdst); if (!ndo->ndo_qflag) ND_PRINT("%02x %02x ", @@ -147,12 +145,12 @@ token_print(netdissect_options *ndo, const u_char *p, u_int length, u_int caplen { const struct token_header *trp; int llc_hdrlen; - nd_mac_addr srcmac, dstmac; + nd_mac48 srcmac, dstmac; struct lladdr_info src, dst; u_int route_len = 0, hdr_len = TOKEN_HDRLEN; int seg; - ndo->ndo_protocol = "token"; + ndo->ndo_protocol = "token-ring"; trp = (const struct token_header *)p; if (caplen < TOKEN_HDRLEN) { @@ -204,9 +202,9 @@ token_print(netdissect_options *ndo, const u_char *p, u_int length, u_int caplen } src.addr = srcmac; - src.addr_string = etheraddr_string; + src.addr_string = mac48_string; dst.addr = dstmac; - dst.addr_string = etheraddr_string; + dst.addr_string = mac48_string; /* Skip over token ring MAC header and routing information */ length -= hdr_len; @@ -242,9 +240,9 @@ token_print(netdissect_options *ndo, const u_char *p, u_int length, u_int caplen * 'h->len' is the length of the packet off the wire, and 'h->caplen' * is the number of bytes actually captured. */ -u_int +void token_if_print(netdissect_options *ndo, const struct pcap_pkthdr *h, const u_char *p) { - ndo->ndo_protocol = "token_if"; - return (token_print(ndo, p, h->len, h->caplen)); + ndo->ndo_protocol = "token-ring"; + ndo->ndo_ll_hdr_len += token_print(ndo, p, h->len, h->caplen); }