/* \summary: IEEE 802.1ag Connectivity Fault Management (CFM) protocols printer */
-#ifdef HAVE_CONFIG_H
#include <config.h>
-#endif
#include "netdissect-stdinc.h"
struct cfm_ltm_t {
nd_uint32_t transaction_id;
nd_uint8_t ttl;
- nd_mac_addr original_mac;
- nd_mac_addr target_mac;
+ nd_mac48 original_mac;
+ nd_mac48 target_mac;
};
static const struct tok cfm_ltm_flag_values[] = {
break;
case CFM_CCM_MD_FORMAT_MAC:
- if (md_namelength == MAC_ADDR_LEN) {
- ND_PRINT("\n\t MAC %s", GET_ETHERADDR_STRING(md_name));
+ if (md_namelength == MAC48_LEN) {
+ ND_PRINT("\n\t MAC %s", GET_MAC48_STRING(md_name));
} else {
ND_PRINT("\n\t MAC (length invalid)");
}
GET_U_1(msg_ptr.cfm_ltm->ttl));
ND_PRINT("\n\t Original-MAC %s, Target-MAC %s",
- GET_ETHERADDR_STRING(msg_ptr.cfm_ltm->original_mac),
- GET_ETHERADDR_STRING(msg_ptr.cfm_ltm->target_mac));
+ GET_MAC48_STRING(msg_ptr.cfm_ltm->original_mac),
+ GET_MAC48_STRING(msg_ptr.cfm_ltm->target_mac));
break;
case CFM_OPCODE_LTR:
tptr += first_tlv_offset;
tlen -= first_tlv_offset;
- while (tlen > 0) {
+ while (tlen != 0) {
cfm_tlv_header = (const struct cfm_tlv_header_t *)tptr;
/* Enough to read the tlv type ? */
/* IEEE 802.1Q-2014 Section 21.5.3.3: Chassis ID */
switch (chassis_id_type) {
case CFM_CHASSIS_ID_MAC_ADDRESS:
- if (chassis_id_length != MAC_ADDR_LEN) {
+ if (chassis_id_length != MAC48_LEN) {
ND_PRINT(" (invalid MAC address length)");
hexdump = TRUE;
break;
}
- ND_PRINT("\n\t MAC %s", GET_ETHERADDR_STRING(tptr + 1));
+ ND_PRINT("\n\t MAC %s", GET_MAC48_STRING(tptr + 1));
break;
case CFM_CHASSIS_ID_NETWORK_ADDRESS: