X-Git-Url: https://git.tcpdump.org/tcpdump/blobdiff_plain/da20bc56d6100b5275d6f85c4a25bac1dab4e57e..1f30eeb06a3e6b10389a99ca5657a25f3d367017:/print-ldp.c?ds=inline diff --git a/print-ldp.c b/print-ldp.c index 5a7608b9..ab4f6c63 100644 --- a/print-ldp.c +++ b/print-ldp.c @@ -210,7 +210,7 @@ static const struct tok ldp_fec_martini_ifparm_vccv_cv_values[] = { { 0, NULL} }; -static int ldp_pdu_print(netdissect_options *, register const u_char *); +static int ldp_pdu_print(netdissect_options *, const u_char *); /* * ldp tlv header @@ -230,11 +230,11 @@ static int ldp_pdu_print(netdissect_options *, register const u_char *); */ #define TLV_TCHECK(minlen) \ - ND_TCHECK2(*tptr, minlen); if (tlv_tlen < minlen) goto badtlv; + ND_TCHECK_LEN(tptr, minlen); if (tlv_tlen < minlen) goto badtlv; static int ldp_tlv_print(netdissect_options *ndo, - register const u_char *tptr, + const u_char *tptr, u_short msg_tlen) { struct ldp_tlv_header { @@ -304,7 +304,7 @@ ldp_tlv_print(netdissect_options *ndo, switch (af) { case AFNUM_INET: while(tlv_tlen >= sizeof(struct in_addr)) { - ND_TCHECK2(*tptr, sizeof(struct in_addr)); + ND_TCHECK_LEN(tptr, sizeof(struct in_addr)); ND_PRINT((ndo, " %s", ipaddr_string(ndo, tptr))); tlv_tlen-=sizeof(struct in_addr); tptr+=sizeof(struct in_addr); @@ -312,7 +312,7 @@ ldp_tlv_print(netdissect_options *ndo, break; case AFNUM_INET6: while(tlv_tlen >= sizeof(struct in6_addr)) { - ND_TCHECK2(*tptr, sizeof(struct in6_addr)); + ND_TCHECK_LEN(tptr, sizeof(struct in6_addr)); ND_PRINT((ndo, " %s", ip6addr_string(ndo, tptr))); tlv_tlen-=sizeof(struct in6_addr); tptr+=sizeof(struct in6_addr); @@ -335,7 +335,7 @@ ldp_tlv_print(netdissect_options *ndo, case LDP_TLV_FEC: TLV_TCHECK(1); - fec_type = *tptr; + fec_type = EXTRACT_U_1(tptr); ND_PRINT((ndo, "\n\t %s FEC (0x%02x)", tok2str(ldp_fec_values, "Unknown", fec_type), fec_type)); @@ -421,7 +421,7 @@ ldp_tlv_print(netdissect_options *ndo, TLV_TCHECK(vc_info_len); while (vc_info_len > 2) { - vc_info_tlv_type = *tptr; + vc_info_tlv_type = EXTRACT_U_1(tptr); vc_info_tlv_len = EXTRACT_U_1(tptr + 1); if (vc_info_tlv_len < 2) break; @@ -441,7 +441,7 @@ ldp_tlv_print(netdissect_options *ndo, case LDP_FEC_MARTINI_IFPARM_DESC: ND_PRINT((ndo, ": ")); for (idx = 2; idx < vc_info_tlv_len; idx++) - safeputchar(ndo, *(tptr + idx)); + safeputchar(ndo, EXTRACT_U_1(tptr + idx)); break; case LDP_FEC_MARTINI_IFPARM_VCCV: @@ -544,7 +544,7 @@ badtlv: void ldp_print(netdissect_options *ndo, - register const u_char *pptr, register u_int len) + const u_char *pptr, u_int len) { int processed; while (len > (sizeof(struct ldp_common_header) + sizeof(struct ldp_msg_header))) { @@ -558,7 +558,7 @@ ldp_print(netdissect_options *ndo, static int ldp_pdu_print(netdissect_options *ndo, - register const u_char *pptr) + const u_char *pptr) { const struct ldp_common_header *ldp_com_header; const struct ldp_msg_header *ldp_msg_header; @@ -607,7 +607,7 @@ ldp_pdu_print(netdissect_options *ndo, while(tlen>0) { /* did we capture enough for fully decoding the msg header ? */ - ND_TCHECK2(*tptr, sizeof(struct ldp_msg_header)); + ND_TCHECK_LEN(tptr, sizeof(struct ldp_msg_header)); ldp_msg_header = (const struct ldp_msg_header *)tptr; msg_len=EXTRACT_BE_U_2(ldp_msg_header->length); @@ -640,7 +640,7 @@ ldp_pdu_print(netdissect_options *ndo, msg_tlen=msg_len-(sizeof(struct ldp_msg_header)-4); /* Type & Length fields not included */ /* did we capture enough for fully decoding the message ? */ - ND_TCHECK2(*tptr, msg_len); + ND_TCHECK_LEN(tptr, msg_len); hexdump=FALSE; switch(msg_type) {