X-Git-Url: https://git.tcpdump.org/tcpdump/blobdiff_plain/ba8936b39b0ce2ff02f3aeb307df4c27657652d8..1bcd37991fa57d9e966a6f96e7cbff59b16c28bd:/print-dtp.c diff --git a/print-dtp.c b/print-dtp.c index 8f6921e5..4c3d6c78 100644 --- a/print-dtp.c +++ b/print-dtp.c @@ -43,7 +43,7 @@ static const struct tok dtp_tlv_values[] = { }; void -dtp_print (netdissect_options *ndo, const u_char *pptr, u_int length) +dtp_print(netdissect_options *ndo, const u_char *pptr, u_int length) { int type, len; const u_char *tptr; @@ -57,7 +57,7 @@ dtp_print (netdissect_options *ndo, const u_char *pptr, u_int length) ND_TCHECK_LEN(tptr, DTP_HEADER_LEN); ND_PRINT("DTPv%u, length %u", - EXTRACT_U_1(tptr), + GET_U_1(tptr), length); /* @@ -72,8 +72,8 @@ dtp_print (netdissect_options *ndo, const u_char *pptr, u_int length) while (tptr < (pptr+length)) { ND_TCHECK_4(tptr); - type = EXTRACT_BE_U_2(tptr); - len = EXTRACT_BE_U_2(tptr + 2); + type = GET_BE_U_2(tptr); + len = GET_BE_U_2(tptr + 2); /* XXX: should not be but sometimes it is, see the test captures */ if (type == 0) return; @@ -96,13 +96,13 @@ dtp_print (netdissect_options *ndo, const u_char *pptr, u_int length) case DTP_DTP_TYPE_TLV: if (len < 5) goto invalid; - ND_PRINT(", 0x%x", EXTRACT_U_1(tptr + 4)); + ND_PRINT(", 0x%x", GET_U_1(tptr + 4)); break; case DTP_NEIGHBOR_TLV: if (len < 10) goto invalid; - ND_PRINT(", %s", etheraddr_string(ndo, tptr+4)); + ND_PRINT(", %s", GET_ETHERADDR_STRING(tptr+4)); break; default: @@ -114,7 +114,7 @@ dtp_print (netdissect_options *ndo, const u_char *pptr, u_int length) return; invalid: - ND_PRINT("%s", istr); + nd_print_invalid(ndo); return; trunc: nd_print_trunc(ndo);