X-Git-Url: https://git.tcpdump.org/tcpdump/blobdiff_plain/9d046ee0503d4c8cbfcb200c88986de876f6cae7..296d466cd6bbf2f7e75e15bb6a01268e88c76ed0:/print-atalk.c diff --git a/print-atalk.c b/print-atalk.c index ae342069..1f067ed6 100644 --- a/print-atalk.c +++ b/print-atalk.c @@ -21,9 +21,7 @@ /* \summary: AppleTalk printer */ -#ifdef HAVE_CONFIG_H #include -#endif #include "netdissect-stdinc.h" @@ -51,9 +49,9 @@ struct aarp { nd_uint16_t htype, ptype; nd_uint8_t halen, palen; nd_uint16_t op; - uint8_t hsaddr[6]; + nd_mac_addr hsaddr; uint8_t psaddr[4]; - uint8_t hdaddr[6]; + nd_mac_addr hdaddr; uint8_t pdaddr[4]; }; @@ -72,19 +70,20 @@ static const char *ddpskt_string(netdissect_options *, u_int); /* * Print LLAP packets received on a physical LocalTalk interface. */ -u_int +void ltalk_if_print(netdissect_options *ndo, const struct pcap_pkthdr *h, const u_char *p) { u_int hdrlen; - ndo->ndo_protocol = "ltalk_if"; + ndo->ndo_protocol = "ltalk"; hdrlen = llap_print(ndo, p, h->len); if (hdrlen == 0) { /* Cut short by the snapshot length. */ - return (h->caplen); + ndo->ndo_ll_hdr_len += h->caplen; + return; } - return (hdrlen); + ndo->ndo_ll_hdr_len += hdrlen; } /* @@ -237,7 +236,7 @@ aarp_print(netdissect_options *ndo, } if (GET_BE_U_2(ap->htype) == 1 && GET_BE_U_2(ap->ptype) == ETHERTYPE_ATALK && - GET_U_1(ap->halen) == 6 && GET_U_1(ap->palen) == 4 ) + GET_U_1(ap->halen) == MAC_ADDR_LEN && GET_U_1(ap->palen) == 4) switch (GET_BE_U_2(ap->op)) { case 1: /* request */ @@ -635,7 +634,7 @@ ataddr_string(netdissect_options *ndo, if (tp->name == NULL) (*ndo->ndo_error)(ndo, S_ERR_ND_MEM_ALLOC, - "ataddr_string: strdup(nambuf)"); + "%s: strdup(nambuf)", __func__); } fclose(fp); } @@ -660,7 +659,7 @@ ataddr_string(netdissect_options *ndo, tp->name = strdup(nambuf); if (tp->name == NULL) (*ndo->ndo_error)(ndo, S_ERR_ND_MEM_ALLOC, - "ataddr_string: strdup(nambuf)"); + "%s: strdup(nambuf)", __func__); return (tp->name); } @@ -673,7 +672,7 @@ ataddr_string(netdissect_options *ndo, tp->name = strdup(nambuf); if (tp->name == NULL) (*ndo->ndo_error)(ndo, S_ERR_ND_MEM_ALLOC, - "ataddr_string: strdup(nambuf)"); + "%s: strdup(nambuf)", __func__); return (tp->name); }