X-Git-Url: https://git.tcpdump.org/tcpdump/blobdiff_plain/c1b92ea1d4f508c72b1ffe8e08eb766ac39c7018..a8abce5c5e2dce2ba6dbccd5d3829da104b80f9c:/print-cfm.c diff --git a/print-cfm.c b/print-cfm.c index 050a99a3..45608256 100644 --- a/print-cfm.c +++ b/print-cfm.c @@ -31,7 +31,6 @@ #include "oui.h" #include "af.h" -static const char tstr[] = " [|cfm]"; struct cfm_common_header_t { nd_uint8_t mdlevel_version; @@ -41,7 +40,7 @@ struct cfm_common_header_t { }; #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 @@ -78,7 +77,7 @@ static const float ccm_interval_base[8] = {0.0f, 0.003333f, 0.01f, 0.1f, 1.0f, 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 @@ -292,6 +291,7 @@ cfm_print(netdissect_options *ndo, 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)) @@ -403,7 +403,7 @@ cfm_print(netdissect_options *ndo, 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: @@ -455,7 +455,7 @@ cfm_print(netdissect_options *ndo, 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 */ @@ -661,7 +661,7 @@ cfm_print(netdissect_options *ndo, 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: @@ -766,5 +766,5 @@ tooshort: return; trunc: - ND_PRINT("%s", tstr); + nd_print_trunc(ndo); }