X-Git-Url: https://git.tcpdump.org/tcpdump/blobdiff_plain/546558eabd81cfc36a81a4df728fdfea0d83b41a..a8abce5c5e2dce2ba6dbccd5d3829da104b80f9c:/print-cfm.c diff --git a/print-cfm.c b/print-cfm.c index 568e3036..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 @@ -404,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: @@ -456,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 */ @@ -662,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: @@ -767,5 +766,5 @@ tooshort: return; trunc: - ND_PRINT("%s", tstr); + nd_print_trunc(ndo); }