summaryrefslogtreecommitdiff
path: root/print-rpki-rtr.c
diff options
context:
space:
mode:
authorFrancois-Xavier Le Bail <devel.fx.lebail@orange.fr>2017-12-11 12:46:51 +0100
committerFrancois-Xavier Le Bail <devel.fx.lebail@orange.fr>2017-12-11 22:11:01 +0100
commit84ef17ac0eecb3efc11a63c3f2c578ae78732c02 (patch)
treec62632ddf7ae57a999a89938ecaf8e590bfcc019 /print-rpki-rtr.c
parent264ed29aae3407c1a6816c64813806a077ccebcb (diff)
downloadtcpdump-84ef17ac0eecb3efc11a63c3f2c578ae78732c02.tar.gz
Replace ND_TTEST2()/ND_TCHECK2() macros by macros using pointers (1/n)
ND_TTEST2(var, l) -> ND_TTEST_LEN(p, l) ND_TCHECK2(var, l) -> ND_TCHECK_LEN(p, l)
Diffstat (limited to 'print-rpki-rtr.c')
-rw-r--r--print-rpki-rtr.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/print-rpki-rtr.c b/print-rpki-rtr.c
index 4e2e7c14..47a13114 100644
--- a/print-rpki-rtr.c
+++ b/print-rpki-rtr.c
@@ -197,7 +197,7 @@ rpki_rtr_pdu_print (netdissect_options *ndo, const u_char *tptr, const u_int len
ND_PRINT((ndo, "(%u bytes is too few to decode)", len));
goto invalid;
}
- ND_TCHECK2(*tptr, sizeof(rpki_rtr_pdu));
+ ND_TCHECK_LEN(tptr, sizeof(rpki_rtr_pdu));
pdu_header = (const rpki_rtr_pdu *)tptr;
pdu_type = pdu_header->pdu_type;
pdu_len = EXTRACT_BE_U_4(pdu_header->length);
@@ -225,7 +225,7 @@ rpki_rtr_pdu_print (netdissect_options *ndo, const u_char *tptr, const u_int len
case RPKI_RTR_END_OF_DATA_PDU:
if (pdu_len != sizeof(rpki_rtr_pdu) + 4)
goto invalid;
- ND_TCHECK2(*tptr, pdu_len);
+ ND_TCHECK_LEN(tptr, pdu_len);
msg = (const u_char *)(pdu_header + 1);
ND_PRINT((ndo, "%sSession ID: 0x%04x, Serial: %u",
indent_string(indent+2),
@@ -262,7 +262,7 @@ rpki_rtr_pdu_print (netdissect_options *ndo, const u_char *tptr, const u_int len
if (pdu_len != sizeof(rpki_rtr_pdu) + 12)
goto invalid;
- ND_TCHECK2(*tptr, pdu_len);
+ ND_TCHECK_LEN(tptr, pdu_len);
pdu = (const rpki_rtr_pdu_ipv4_prefix *)tptr;
ND_PRINT((ndo, "%sIPv4 Prefix %s/%u-%u, origin-as %u, flags 0x%02x",
indent_string(indent+2),
@@ -278,7 +278,7 @@ rpki_rtr_pdu_print (netdissect_options *ndo, const u_char *tptr, const u_int len
if (pdu_len != sizeof(rpki_rtr_pdu) + 24)
goto invalid;
- ND_TCHECK2(*tptr, pdu_len);
+ ND_TCHECK_LEN(tptr, pdu_len);
pdu = (const rpki_rtr_pdu_ipv6_prefix *)tptr;
ND_PRINT((ndo, "%sIPv6 Prefix %s/%u-%u, origin-as %u, flags 0x%02x",
indent_string(indent+2),
@@ -297,7 +297,7 @@ rpki_rtr_pdu_print (netdissect_options *ndo, const u_char *tptr, const u_int len
/* Do not test for the "Length of Error Text" data element yet. */
if (pdu_len < tlen + 4)
goto invalid;
- ND_TCHECK2(*tptr, tlen + 4);
+ ND_TCHECK_LEN(tptr, tlen + 4);
/* Safe up to and including the "Length of Encapsulated PDU"
* data element, more data elements may be present.
*/
@@ -327,7 +327,7 @@ rpki_rtr_pdu_print (netdissect_options *ndo, const u_char *tptr, const u_int len
if (pdu_len < tlen + encapsulated_pdu_length)
goto invalid;
if (! recurse) {
- ND_TCHECK2(*tptr, tlen + encapsulated_pdu_length);
+ ND_TCHECK_LEN(tptr, tlen + encapsulated_pdu_length);
}
else {
ND_PRINT((ndo, "%s-----encapsulated PDU-----", indent_string(indent+4)));
@@ -339,7 +339,7 @@ rpki_rtr_pdu_print (netdissect_options *ndo, const u_char *tptr, const u_int len
if (pdu_len < tlen + 4)
goto invalid;
- ND_TCHECK2(*tptr, tlen + 4);
+ ND_TCHECK_LEN(tptr, tlen + 4);
/* Safe up to and including the "Length of Error Text" data element,
* one more data element may be present.
*/
@@ -362,7 +362,7 @@ rpki_rtr_pdu_print (netdissect_options *ndo, const u_char *tptr, const u_int len
break;
default:
- ND_TCHECK2(*tptr, pdu_len);
+ ND_TCHECK_LEN(tptr, pdu_len);
/*
* Unknown data, please hexdump.
@@ -378,7 +378,7 @@ rpki_rtr_pdu_print (netdissect_options *ndo, const u_char *tptr, const u_int len
invalid:
ND_PRINT((ndo, "%s", istr));
- ND_TCHECK2(*tptr, len);
+ ND_TCHECK_LEN(tptr, len);
return len;
trunc:
ND_PRINT((ndo, "\n\t%s", tstr));