]> The Tcpdump Group git mirrors - tcpdump/blobdiff - print-cfm.c
On Solaris, for 64-bit builds, use the 64-bit pcap-config.
[tcpdump] / print-cfm.c
index 5231088b131beca38637632df6df23cc8abfcf01..e950719e691d3dd40b6a25a0c272f0c7516ded65 100644 (file)
@@ -23,8 +23,6 @@
 
 #include "netdissect-stdinc.h"
 
-#include <stdio.h>
-
 #include "netdissect.h"
 #include "extract.h"
 #include "addrtoname.h"
@@ -223,7 +221,7 @@ cfm_network_addr_print(netdissect_options *ndo,
     u_int hexdump =  FALSE;
 
     /*
-     * Although AFIs are typically 2 octects wide,
+     * Although AFIs are typically 2 octets wide,
      * 802.1ab specifies that this field width
      * is only one octet.
      */
@@ -403,11 +401,11 @@ cfm_print(netdissect_options *ndo,
             switch (md_nameformat) {
             case CFM_CCM_MD_FORMAT_DNS:
             case CFM_CCM_MD_FORMAT_CHAR:
-                (void)nd_printzp(ndo, md_name, md_namelength, NULL);
+                nd_printjnp(ndo, md_name, md_namelength);
                 break;
 
             case CFM_CCM_MD_FORMAT_MAC:
-                if (md_namelength == 6) {
+                if (md_namelength == MAC_ADDR_LEN) {
                     ND_PRINT("\n\t  MAC %s", GET_ETHERADDR_STRING(md_name));
                 } else {
                     ND_PRINT("\n\t  MAC (length invalid)");
@@ -454,7 +452,7 @@ cfm_print(netdissect_options *ndo,
         ND_PRINT("\n\t  MA Name: ");
         switch (ma_nameformat) {
         case CFM_CCM_MA_FORMAT_CHAR:
-            (void)nd_printzp(ndo, ma_name, ma_namelength, NULL);
+            nd_printjnp(ndo, ma_name, ma_namelength);
             break;
 
             /* FIXME add printers for those MA formats - hexdump for now */
@@ -534,7 +532,6 @@ cfm_print(netdissect_options *ndo,
         cfm_tlv_header = (const struct cfm_tlv_header_t *)tptr;
 
         /* Enough to read the tlv type ? */
-        ND_TCHECK_1(cfm_tlv_header->type);
         cfm_tlv_type = GET_U_1(cfm_tlv_header->type);
 
         ND_PRINT("\n\t%s TLV (0x%02x)",
@@ -660,7 +657,7 @@ cfm_print(netdissect_options *ndo,
                 case CFM_CHASSIS_ID_LOCAL:
                 case CFM_CHASSIS_ID_CHASSIS_COMPONENT:
                 case CFM_CHASSIS_ID_PORT_COMPONENT:
-                    (void)nd_printzp(ndo, tptr + 1, chassis_id_length, NULL);
+                    nd_printjnp(ndo, tptr + 1, chassis_id_length);
                     break;
 
                 default: