diff options
author | Francois-Xavier Le Bail <devel.fx.lebail@orange.fr> | 2018-06-16 17:23:21 +0200 |
---|---|---|
committer | Francois-Xavier Le Bail <devel.fx.lebail@orange.fr> | 2019-03-26 21:06:24 +0100 |
commit | ee68aa36460d7efeca48747f33b7f2adc0900bfb (patch) | |
tree | 72c1b65d29301835c0e064b433ea685fc856a68e /print-lisp.c | |
parent | 1af20c3adc4dfef93de41d4fcd02f0aeb6bbfd4e (diff) | |
download | tcpdump-ee68aa36460d7efeca48747f33b7f2adc0900bfb.tar.gz |
Use the new GET_ macros instead of the EXTRACT_ ones
The exceptions are currently:
Some EXTRACT_ in print-juniper.c, not used on packet buffer pointer.
An EXTRACT_BE_U_3 in addrtoname.c, not always used on packet buffer
pointer.
Diffstat (limited to 'print-lisp.c')
-rw-r--r-- | print-lisp.c | 40 |
1 files changed, 20 insertions, 20 deletions
diff --git a/print-lisp.c b/print-lisp.c index 74290639..a7d088d4 100644 --- a/print-lisp.c +++ b/print-lisp.c @@ -255,7 +255,7 @@ lisp_print(netdissect_options *ndo, const u_char *bp, u_int length) lisp_hdr = (const lisp_map_register_hdr *) bp; lisp_hdr_flag(ndo, lisp_hdr); /* Supporting only MAP NOTIFY and MAP REGISTER LISP packets */ - type_and_flag = EXTRACT_U_1(lisp_hdr->type_and_flag); + type_and_flag = GET_U_1(lisp_hdr->type_and_flag); type = extract_lisp_type(type_and_flag); if ((type != LISP_MAP_REGISTER) && (type != LISP_MAP_NOTIFY)) return; @@ -264,13 +264,13 @@ lisp_print(netdissect_options *ndo, const u_char *bp, u_int length) xtr_present = is_xtr_data_present(type, type_and_flag); /* Extract the number of EID records present */ - auth_data_len = EXTRACT_BE_U_2(lisp_hdr->auth_data_len); + auth_data_len = GET_BE_U_2(lisp_hdr->auth_data_len); packet_iterator = (const u_char *)(lisp_hdr); packet_offset = MAP_REGISTER_HDR_LEN; - record_count = EXTRACT_U_1(lisp_hdr->record_count); + record_count = GET_U_1(lisp_hdr->record_count); if (ndo->ndo_vflag) { - key_id = EXTRACT_BE_U_2(lisp_hdr->key_id); + key_id = GET_BE_U_2(lisp_hdr->key_id); ND_PRINT("\n %u record(s), ", record_count); ND_PRINT("Authentication %s,", tok2str(auth_type, "unknown-type", key_id)); @@ -293,15 +293,15 @@ lisp_print(netdissect_options *ndo, const u_char *bp, u_int length) lisp_eid = (const lisp_map_register_eid *) ((const u_char *)lisp_hdr + packet_offset); packet_offset += MAP_REGISTER_EID_LEN; - mask_len = EXTRACT_U_1(lisp_eid->eid_prefix_mask_length); - eid_afi = EXTRACT_BE_U_2(lisp_eid->eid_prefix_afi); - loc_count = EXTRACT_U_1(lisp_eid->locator_count); + mask_len = GET_U_1(lisp_eid->eid_prefix_mask_length); + eid_afi = GET_BE_U_2(lisp_eid->eid_prefix_afi); + loc_count = GET_U_1(lisp_eid->locator_count); if (ndo->ndo_vflag) { - ttl = EXTRACT_BE_U_4(lisp_eid->ttl); + ttl = GET_BE_U_4(lisp_eid->ttl); ND_PRINT(" Record TTL %u,", ttl); - action_flag(ndo, EXTRACT_U_1(lisp_eid->act_auth_inc_res)); - map_version = EXTRACT_BE_U_2(lisp_eid->reserved_and_version) & 0x0FFF; + action_flag(ndo, GET_U_1(lisp_eid->act_auth_inc_res)); + map_version = GET_BE_U_2(lisp_eid->reserved_and_version) & 0x0FFF; ND_PRINT(" Map Version: %u,", map_version); } @@ -334,7 +334,7 @@ lisp_print(netdissect_options *ndo, const u_char *bp, u_int length) lisp_loc = (const lisp_map_register_loc *) (packet_iterator + packet_offset); loc_ip_pointer = (const u_char *) (lisp_loc + 1); packet_offset += MAP_REGISTER_LOC_LEN; - loc_afi = EXTRACT_BE_U_2(lisp_loc->locator_afi); + loc_afi = GET_BE_U_2(lisp_loc->locator_afi); if (ndo->ndo_vflag) ND_PRINT("\n "); @@ -356,12 +356,12 @@ lisp_print(netdissect_options *ndo, const u_char *bp, u_int length) if (ndo->ndo_vflag) { ND_PRINT("\n Priority/Weight %u/%u," " Multicast Priority/Weight %u/%u,", - EXTRACT_U_1(lisp_loc->priority), - EXTRACT_U_1(lisp_loc->weight), - EXTRACT_U_1(lisp_loc->m_priority), - EXTRACT_U_1(lisp_loc->m_weight)); + GET_U_1(lisp_loc->priority), + GET_U_1(lisp_loc->weight), + GET_U_1(lisp_loc->m_priority), + GET_U_1(lisp_loc->m_weight)); loc_hdr_flag(ndo, - EXTRACT_BE_U_2(lisp_loc->unused_and_flag)); + GET_BE_U_2(lisp_loc->unused_and_flag)); } } } @@ -376,7 +376,7 @@ lisp_print(netdissect_options *ndo, const u_char *bp, u_int length) goto invalid; hex_print_with_offset(ndo, "\n xTR-ID: ", packet_iterator + packet_offset, 16, 0); ND_PRINT("\n SITE-ID: %" PRIu64, - EXTRACT_BE_U_8(packet_iterator + packet_offset + 16)); + GET_BE_U_8(packet_iterator + packet_offset + 16)); } else { /* Check if packet isn't over yet */ if (packet_iterator + packet_offset < ndo->ndo_snapend) { @@ -414,7 +414,7 @@ is_xtr_data_present(uint8_t type, uint8_t lisp_hdr_flags) static void lisp_hdr_flag(netdissect_options *ndo, const lisp_map_register_hdr *lisp_hdr) { - uint8_t type = extract_lisp_type(EXTRACT_U_1(lisp_hdr->type_and_flag)); + uint8_t type = extract_lisp_type(GET_U_1(lisp_hdr->type_and_flag)); if (!ndo->ndo_vflag) { ND_PRINT("%s,", tok2str(lisp_type, "unknown-type-%u", type)); @@ -425,10 +425,10 @@ static void lisp_hdr_flag(netdissect_options *ndo, const lisp_map_register_hdr * if (type == LISP_MAP_REGISTER) { ND_PRINT(" flags [%s],", bittok2str(map_register_hdr_flag, - "none", EXTRACT_BE_U_4(lisp_hdr))); + "none", GET_BE_U_4(lisp_hdr))); } else if (type == LISP_MAP_NOTIFY) { ND_PRINT(" flags [%s],", bittok2str(map_notify_hdr_flag, - "none", EXTRACT_BE_U_4(lisp_hdr))); + "none", GET_BE_U_4(lisp_hdr))); } return; |