diff options
author | Francois-Xavier Le Bail <devel.fx.lebail@orange.fr> | 2017-11-22 23:54:09 +0100 |
---|---|---|
committer | Francois-Xavier Le Bail <devel.fx.lebail@orange.fr> | 2017-11-22 23:54:09 +0100 |
commit | da20bc56d6100b5275d6f85c4a25bac1dab4e57e (patch) | |
tree | 643c746e737c54d5a13d0b0083049d847d2cff24 /print-rpki-rtr.c | |
parent | 3c8f3e13b03380742c24070f8a7b56fe12c6b8ee (diff) | |
download | tcpdump-da20bc56d6100b5275d6f85c4a25bac1dab4e57e.tar.gz |
Rename EXTRACT_ macros
Now all the macros have a name meaning a count in bytes.
With _S_: signed, _U_: unsigned
e.g.:
EXTRACT_BE_32BITS -> EXTRACT_BE_U_4
EXTRACT_LE_32BITS -> EXTRACT_LE_U_4
...
EXTRACT_BE_INT32 -> EXTRACT_BE_S_4
and have:
EXTRACT_8BITS -> EXTRACT_U_1
EXTRACT_INT8 -> EXTRACT_S_1
Diffstat (limited to 'print-rpki-rtr.c')
-rw-r--r-- | print-rpki-rtr.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/print-rpki-rtr.c b/print-rpki-rtr.c index 69c69963..2c950fba 100644 --- a/print-rpki-rtr.c +++ b/print-rpki-rtr.c @@ -200,7 +200,7 @@ rpki_rtr_pdu_print (netdissect_options *ndo, const u_char *tptr, const u_int len ND_TCHECK2(*tptr, sizeof(rpki_rtr_pdu)); pdu_header = (const rpki_rtr_pdu *)tptr; pdu_type = pdu_header->pdu_type; - pdu_len = EXTRACT_BE_32BITS(pdu_header->length); + pdu_len = EXTRACT_BE_U_4(pdu_header->length); /* Do not check bounds with pdu_len yet, do it in the case blocks * below to make it possible to decode at least the beginning of * a truncated Error Report PDU or a truncated encapsulated PDU. @@ -229,8 +229,8 @@ rpki_rtr_pdu_print (netdissect_options *ndo, const u_char *tptr, const u_int len msg = (const u_char *)(pdu_header + 1); ND_PRINT((ndo, "%sSession ID: 0x%04x, Serial: %u", indent_string(indent+2), - EXTRACT_BE_16BITS(pdu_header->u.session_id), - EXTRACT_BE_32BITS(msg))); + EXTRACT_BE_U_2(pdu_header->u.session_id), + EXTRACT_BE_U_4(msg))); break; /* @@ -253,7 +253,7 @@ rpki_rtr_pdu_print (netdissect_options *ndo, const u_char *tptr, const u_int len /* no additional boundary to check */ ND_PRINT((ndo, "%sSession ID: 0x%04x", indent_string(indent+2), - EXTRACT_BE_16BITS(pdu_header->u.session_id))); + EXTRACT_BE_U_2(pdu_header->u.session_id))); break; case RPKI_RTR_IPV4_PREFIX_PDU: @@ -268,7 +268,7 @@ rpki_rtr_pdu_print (netdissect_options *ndo, const u_char *tptr, const u_int len indent_string(indent+2), ipaddr_string(ndo, pdu->prefix), pdu->prefix_length, pdu->max_length, - EXTRACT_BE_32BITS(pdu->as), pdu->flags)); + EXTRACT_BE_U_4(pdu->as), pdu->flags)); } break; @@ -284,7 +284,7 @@ rpki_rtr_pdu_print (netdissect_options *ndo, const u_char *tptr, const u_int len indent_string(indent+2), ip6addr_string(ndo, pdu->prefix), pdu->prefix_length, pdu->max_length, - EXTRACT_BE_32BITS(pdu->as), pdu->flags)); + EXTRACT_BE_U_4(pdu->as), pdu->flags)); } break; @@ -302,10 +302,10 @@ rpki_rtr_pdu_print (netdissect_options *ndo, const u_char *tptr, const u_int len * data element, more data elements may be present. */ pdu = (const rpki_rtr_pdu_error_report *)tptr; - encapsulated_pdu_length = EXTRACT_BE_32BITS(pdu->encapsulated_pdu_length); + encapsulated_pdu_length = EXTRACT_BE_U_4(pdu->encapsulated_pdu_length); tlen += 4; - error_code = EXTRACT_BE_16BITS(pdu->pdu_header.u.error_code); + error_code = EXTRACT_BE_U_2(pdu->pdu_header.u.error_code); ND_PRINT((ndo, "%sError code: %s (%u), Encapsulated PDU length: %u", indent_string(indent+2), tok2str(rpki_rtr_error_codes, "Unknown", error_code), @@ -347,7 +347,7 @@ rpki_rtr_pdu_print (netdissect_options *ndo, const u_char *tptr, const u_int len /* * Extract, trail-zero and print the Error message. */ - text_length = EXTRACT_BE_32BITS(tptr + tlen); + text_length = EXTRACT_BE_U_4(tptr + tlen); tlen += 4; if (text_length) { |