X-Git-Url: https://git.tcpdump.org/tcpdump/blobdiff_plain/49b23c5a9b0198bb382dcf43c458d46fcf2fa809..0ce779d1756e2bc1f5a845df5acf86f0dc698a14:/print-ppi.c diff --git a/print-ppi.c b/print-ppi.c index 72cd1b86..ad5eb27f 100644 --- a/print-ppi.c +++ b/print-ppi.c @@ -34,19 +34,19 @@ ppi_header_print(netdissect_options *ndo, const u_char *bp, u_int length) hdr = (const ppi_header_t *)bp; - len = EXTRACT_LE_16BITS(&hdr->ppi_len); - dlt = EXTRACT_LE_32BITS(&hdr->ppi_dlt); + len = EXTRACT_LE_U_2(&hdr->ppi_len); + dlt = EXTRACT_LE_U_4(&hdr->ppi_dlt); dltname = pcap_datalink_val_to_name(dlt); if (!ndo->ndo_qflag) { - ND_PRINT((ndo, "V.%d DLT %s (%d) len %d", hdr->ppi_ver, + ND_PRINT("V.%d DLT %s (%d) len %d", hdr->ppi_ver, (dltname != NULL ? dltname : "UNKNOWN"), dlt, - len)); + len); } else { - ND_PRINT((ndo, "%s", (dltname != NULL ? dltname : "UNKNOWN"))); + ND_PRINT("%s", (dltname != NULL ? dltname : "UNKNOWN")); } - ND_PRINT((ndo, ", length %u: ", length)); + ND_PRINT(", length %u: ", length); } static u_int @@ -63,25 +63,25 @@ ppi_print(netdissect_options *ndo, struct pcap_pkthdr nhdr; if (caplen < sizeof(ppi_header_t)) { - ND_PRINT((ndo, "[|ppi]")); + ND_PRINT("[|ppi]"); return (caplen); } hdr = (const ppi_header_t *)p; - len = EXTRACT_LE_16BITS(&hdr->ppi_len); + len = EXTRACT_LE_U_2(&hdr->ppi_len); if (caplen < len) { /* * If we don't have the entire PPI header, don't * bother. */ - ND_PRINT((ndo, "[|ppi]")); + ND_PRINT("[|ppi]"); return (caplen); } if (len < sizeof(ppi_header_t)) { - ND_PRINT((ndo, "[|ppi]")); + ND_PRINT("[|ppi]"); return (len); } - dlt = EXTRACT_LE_32BITS(&hdr->ppi_dlt); + dlt = EXTRACT_LE_U_4(&hdr->ppi_dlt); if (ndo->ndo_eflag) ppi_header_print(ndo, p, length);