summaryrefslogtreecommitdiff
path: root/print-cfm.c
diff options
context:
space:
mode:
authorFrancois-Xavier Le Bail <devel.fx.lebail@orange.fr>2018-06-16 17:23:21 +0200
committerFrancois-Xavier Le Bail <devel.fx.lebail@orange.fr>2019-03-26 21:06:24 +0100
commitee68aa36460d7efeca48747f33b7f2adc0900bfb (patch)
tree72c1b65d29301835c0e064b433ea685fc856a68e /print-cfm.c
parent1af20c3adc4dfef93de41d4fcd02f0aeb6bbfd4e (diff)
downloadtcpdump-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-cfm.c')
-rw-r--r--print-cfm.c60
1 files changed, 30 insertions, 30 deletions
diff --git a/print-cfm.c b/print-cfm.c
index 45608256..971c9600 100644
--- a/print-cfm.c
+++ b/print-cfm.c
@@ -232,7 +232,7 @@ cfm_network_addr_print(netdissect_options *ndo,
return hexdump;
}
/* The calling function must make any due ND_TCHECK calls. */
- network_addr_type = EXTRACT_U_1(tptr);
+ network_addr_type = GET_U_1(tptr);
ND_PRINT("\n\t Network Address Type %s (%u)",
tok2str(af_values, "Unknown", network_addr_type),
network_addr_type);
@@ -301,14 +301,14 @@ cfm_print(netdissect_options *ndo,
/*
* Sanity checking of the header.
*/
- mdlevel_version = EXTRACT_U_1(cfm_common_header->mdlevel_version);
+ mdlevel_version = GET_U_1(cfm_common_header->mdlevel_version);
if (CFM_EXTRACT_VERSION(mdlevel_version) != CFM_VERSION) {
ND_PRINT("CFMv%u not supported, length %u",
CFM_EXTRACT_VERSION(mdlevel_version), length);
return;
}
- opcode = EXTRACT_U_1(cfm_common_header->opcode);
+ opcode = GET_U_1(cfm_common_header->opcode);
ND_PRINT("CFMv%u %s, MD Level %u, length %u",
CFM_EXTRACT_VERSION(mdlevel_version),
tok2str(cfm_opcode_values, "unknown (%u)", opcode),
@@ -322,8 +322,8 @@ cfm_print(netdissect_options *ndo,
return;
}
- flags = EXTRACT_U_1(cfm_common_header->flags);
- first_tlv_offset = EXTRACT_U_1(cfm_common_header->first_tlv_offset);
+ flags = GET_U_1(cfm_common_header->flags);
+ first_tlv_offset = GET_U_1(cfm_common_header->first_tlv_offset);
ND_PRINT("\n\tFirst TLV offset %u", first_tlv_offset);
tptr += sizeof(struct cfm_common_header_t);
@@ -367,8 +367,8 @@ cfm_print(netdissect_options *ndo,
}
ND_PRINT("\n\t Sequence Number 0x%08x, MA-End-Point-ID 0x%04x",
- EXTRACT_BE_U_4(msg_ptr.cfm_ccm->sequence),
- EXTRACT_BE_U_2(msg_ptr.cfm_ccm->ma_epi));
+ GET_BE_U_4(msg_ptr.cfm_ccm->sequence),
+ GET_BE_U_2(msg_ptr.cfm_ccm->ma_epi));
namesp = msg_ptr.cfm_ccm->names;
names_data_remaining = sizeof(msg_ptr.cfm_ccm->names);
@@ -376,11 +376,11 @@ cfm_print(netdissect_options *ndo,
/*
* Resolve the MD fields.
*/
- md_nameformat = EXTRACT_U_1(namesp);
+ md_nameformat = GET_U_1(namesp);
namesp++;
names_data_remaining--; /* We know this is != 0 */
if (md_nameformat != CFM_CCM_MD_FORMAT_NONE) {
- md_namelength = EXTRACT_U_1(namesp);
+ md_namelength = GET_U_1(namesp);
namesp++;
names_data_remaining--; /* We know this is !=0 */
ND_PRINT("\n\t MD Name Format %s (%u), MD Name length %u",
@@ -434,10 +434,10 @@ cfm_print(netdissect_options *ndo,
/*
* Resolve the MA fields.
*/
- ma_nameformat = EXTRACT_U_1(namesp);
+ ma_nameformat = GET_U_1(namesp);
namesp++;
names_data_remaining--; /* We know this is != 0 */
- ma_namelength = EXTRACT_U_1(namesp);
+ ma_namelength = GET_U_1(namesp);
namesp++;
names_data_remaining--; /* We know this is != 0 */
ND_PRINT("\n\t MA Name-Format %s (%u), MA name length %u",
@@ -483,8 +483,8 @@ cfm_print(netdissect_options *ndo,
bittok2str(cfm_ltm_flag_values, "none", flags));
ND_PRINT("\n\t Transaction-ID 0x%08x, ttl %u",
- EXTRACT_BE_U_4(msg_ptr.cfm_ltm->transaction_id),
- EXTRACT_U_1(msg_ptr.cfm_ltm->ttl));
+ GET_BE_U_4(msg_ptr.cfm_ltm->transaction_id),
+ GET_U_1(msg_ptr.cfm_ltm->ttl));
ND_PRINT("\n\t Original-MAC %s, Target-MAC %s",
etheraddr_string(ndo, msg_ptr.cfm_ltm->original_mac),
@@ -506,14 +506,14 @@ cfm_print(netdissect_options *ndo,
bittok2str(cfm_ltr_flag_values, "none", flags));
ND_PRINT("\n\t Transaction-ID 0x%08x, ttl %u",
- EXTRACT_BE_U_4(msg_ptr.cfm_ltr->transaction_id),
- EXTRACT_U_1(msg_ptr.cfm_ltr->ttl));
+ GET_BE_U_4(msg_ptr.cfm_ltr->transaction_id),
+ GET_U_1(msg_ptr.cfm_ltr->ttl));
ND_PRINT("\n\t Replay-Action %s (%u)",
tok2str(cfm_ltr_replay_action_values,
"Unknown",
- EXTRACT_U_1(msg_ptr.cfm_ltr->replay_action)),
- EXTRACT_U_1(msg_ptr.cfm_ltr->replay_action));
+ GET_U_1(msg_ptr.cfm_ltr->replay_action)),
+ GET_U_1(msg_ptr.cfm_ltr->replay_action));
break;
/*
@@ -536,7 +536,7 @@ cfm_print(netdissect_options *ndo,
/* Enough to read the tlv type ? */
ND_TCHECK_1(cfm_tlv_header->type);
- cfm_tlv_type = EXTRACT_U_1(cfm_tlv_header->type);
+ cfm_tlv_type = GET_U_1(cfm_tlv_header->type);
ND_PRINT("\n\t%s TLV (0x%02x)",
tok2str(cfm_tlv_values, "Unknown", cfm_tlv_type),
@@ -551,7 +551,7 @@ cfm_print(netdissect_options *ndo,
if (tlen < sizeof(struct cfm_tlv_header_t))
goto tooshort;
ND_TCHECK_LEN(tptr, sizeof(struct cfm_tlv_header_t));
- cfm_tlv_len=EXTRACT_BE_U_2(cfm_tlv_header->length);
+ cfm_tlv_len=GET_BE_U_2(cfm_tlv_header->length);
ND_PRINT(", length %u", cfm_tlv_len);
@@ -572,8 +572,8 @@ cfm_print(netdissect_options *ndo,
return;
}
ND_PRINT(", Status: %s (%u)",
- tok2str(cfm_tlv_port_status_values, "Unknown", EXTRACT_U_1(tptr)),
- EXTRACT_U_1(tptr));
+ tok2str(cfm_tlv_port_status_values, "Unknown", GET_U_1(tptr)),
+ GET_U_1(tptr));
break;
case CFM_TLV_INTERFACE_STATUS:
@@ -582,8 +582,8 @@ cfm_print(netdissect_options *ndo,
return;
}
ND_PRINT(", Status: %s (%u)",
- tok2str(cfm_tlv_interface_status_values, "Unknown", EXTRACT_U_1(tptr)),
- EXTRACT_U_1(tptr));
+ tok2str(cfm_tlv_interface_status_values, "Unknown", GET_U_1(tptr)),
+ GET_U_1(tptr));
break;
case CFM_TLV_PRIVATE:
@@ -592,9 +592,9 @@ cfm_print(netdissect_options *ndo,
return;
}
ND_PRINT(", Vendor: %s (%u), Sub-Type %u",
- tok2str(oui_values,"Unknown", EXTRACT_BE_U_3(tptr)),
- EXTRACT_BE_U_3(tptr),
- EXTRACT_U_1(tptr + 3));
+ tok2str(oui_values,"Unknown", GET_BE_U_3(tptr)),
+ GET_BE_U_3(tptr),
+ GET_U_1(tptr + 3));
hexdump = TRUE;
break;
@@ -612,7 +612,7 @@ cfm_print(netdissect_options *ndo,
* Get the Chassis ID length and check it.
* IEEE 802.1Q-2014 Section 21.5.3.1
*/
- chassis_id_length = EXTRACT_U_1(tptr);
+ chassis_id_length = GET_U_1(tptr);
tptr++;
tlen--;
cfm_tlv_len--;
@@ -627,7 +627,7 @@ cfm_print(netdissect_options *ndo,
ND_PRINT("\n\t (TLV too short)");
goto next_tlv;
}
- chassis_id_type = EXTRACT_U_1(tptr);
+ chassis_id_type = GET_U_1(tptr);
cfm_tlv_len--;
ND_PRINT("\n\t Chassis-ID Type %s (%u), Chassis-ID length %u",
tok2str(cfm_tlv_senderid_chassisid_values,
@@ -686,7 +686,7 @@ cfm_print(netdissect_options *ndo,
}
/* Here mgmt_addr_length stands for the management domain length. */
- mgmt_addr_length = EXTRACT_U_1(tptr);
+ mgmt_addr_length = GET_U_1(tptr);
tptr++;
tlen--;
cfm_tlv_len--;
@@ -716,7 +716,7 @@ cfm_print(netdissect_options *ndo,
}
/* Here mgmt_addr_length stands for the management address length. */
- mgmt_addr_length = EXTRACT_U_1(tptr);
+ mgmt_addr_length = GET_U_1(tptr);
tptr++;
tlen--;
cfm_tlv_len--;