]> The Tcpdump Group git mirrors - tcpdump/blobdiff - print-cfm.c
Fix spaces
[tcpdump] / print-cfm.c
index d553b6b71a4a3f20ed22d2b937f4b5f7a62261a2..45608256ec3b4fff5708ed51f2beec63bd82f8af 100644 (file)
@@ -31,6 +31,7 @@
 #include "oui.h"
 #include "af.h"
 
+
 struct cfm_common_header_t {
     nd_uint8_t mdlevel_version;
     nd_uint8_t opcode;
@@ -39,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
@@ -76,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
@@ -290,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))
@@ -401,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:
@@ -453,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 */
@@ -659,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:
@@ -764,5 +766,5 @@ tooshort:
     return;
 
 trunc:
-    ND_PRINT("\n\t\t packet exceeded snapshot");
+    nd_print_trunc(ndo);
 }