#include "oui.h"
#include "af.h"
-static const char tstr[] = " [|cfm]";
struct cfm_common_header_t {
nd_uint8_t mdlevel_version;
};
#define CFM_VERSION 0
-#define CFM_EXTRACT_VERSION(x) (((x)&0x1f))
+#define CFM_EXTRACT_VERSION(x) ((x)&0x1f)
#define CFM_EXTRACT_MD_LEVEL(x) (((x)&0xe0)>>5)
#define CFM_OPCODE_CCM 1
#define CCM_INTERVAL_MAX_MULTIPLIER 3.5
#define CFM_CCM_RDI_FLAG 0x80
-#define CFM_EXTRACT_CCM_INTERVAL(x) (((x)&0x07))
+#define CFM_EXTRACT_CCM_INTERVAL(x) ((x)&0x07)
#define CFM_CCM_MD_FORMAT_8021 0
#define CFM_CCM_MD_FORMAT_NONE 1
const struct cfm_ltr_t *cfm_ltr;
} msg_ptr;
+ ndo->ndo_protocol = "cfm";
tptr=pptr;
cfm_common_header = (const struct cfm_common_header_t *)pptr;
if (length < sizeof(*cfm_common_header))
switch (md_nameformat) {
case CFM_CCM_MD_FORMAT_DNS:
case CFM_CCM_MD_FORMAT_CHAR:
- safeputs(ndo, md_name, md_namelength);
+ (void)nd_printzp(ndo, md_name, md_namelength, NULL);
break;
case CFM_CCM_MD_FORMAT_MAC:
ND_PRINT("\n\t MA Name: ");
switch (ma_nameformat) {
case CFM_CCM_MA_FORMAT_CHAR:
- safeputs(ndo, ma_name, ma_namelength);
+ (void)nd_printzp(ndo, ma_name, ma_namelength, NULL);
break;
/* FIXME add printers for those MA formats - hexdump for now */
case CFM_CHASSIS_ID_LOCAL:
case CFM_CHASSIS_ID_CHASSIS_COMPONENT:
case CFM_CHASSIS_ID_PORT_COMPONENT:
- safeputs(ndo, tptr + 1, chassis_id_length);
+ (void)nd_printzp(ndo, tptr + 1, chassis_id_length, NULL);
break;
default:
return;
trunc:
- ND_PRINT("%s", tstr);
+ nd_print_trunc(ndo);
}