X-Git-Url: https://git.tcpdump.org/tcpdump/blobdiff_plain/97de8ca7bd0e1a64714dc2819d65ee0863b1d6d1..aa37262ac40d0a26f1607f0f79202c5685605aa0:/print-ldp.c diff --git a/print-ldp.c b/print-ldp.c index 1131fe55..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; @@ -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) {