]> The Tcpdump Group git mirrors - tcpdump/blobdiff - print-atm.c
Fix spaces
[tcpdump] / print-atm.c
index d93fec653ff3ab0df0bde2a2f6ee0fac2dc58d5a..06ecc0178a6ec628884f1366de4c7f5bea97a0cf 100644 (file)
 /* \summary: Asynchronous Transfer Mode (ATM) printer */
 
 #ifdef HAVE_CONFIG_H
-#include "config.h"
+#include <config.h>
 #endif
 
-#include <netdissect-stdinc.h>
+#include "netdissect-stdinc.h"
 
 #include "netdissect.h"
 #include "extract.h"
 
 /* end of the original atmuni31.h */
 
-static const char tstr[] = "[|atm]";
 
 #define OAM_CRC10_MASK 0x3ff
 #define OAM_PAYLOAD_LEN 48
@@ -253,8 +252,9 @@ atm_if_print(netdissect_options *ndo,
        uint32_t llchdr;
        u_int hdrlen = 0;
 
+       ndo->ndo_protocol = "atm_if";
        if (caplen < 1 || length < 1) {
-               ND_PRINT("%s", tstr);
+               nd_print_trunc(ndo);
                return (caplen);
        }
 
@@ -271,7 +271,7 @@ atm_if_print(netdissect_options *ndo,
         * control field.
         */
        if (caplen < 3 || length < 3) {
-               ND_PRINT("%s", tstr);
+               nd_print_trunc(ndo);
                return (caplen);
        }
 
@@ -303,7 +303,7 @@ atm_if_print(netdissect_options *ndo,
                 * new DLT_IEEE802_6 value if we added it?
                 */
                if (caplen < 20 || length < 20) {
-                       ND_PRINT("%s", tstr);
+                       nd_print_trunc(ndo);
                        return (caplen);
                }
                if (ndo->ndo_eflag)
@@ -358,7 +358,7 @@ sig_print(netdissect_options *ndo,
                ND_PRINT("Q.2931");
                ND_TCHECK_1(p + MSG_TYPE_POS);
                ND_PRINT(":%s ",
-                   tok2str(msgtype2str, "msgtype#%d", EXTRACT_U_1(p + MSG_TYPE_POS)));
+                   tok2str(msgtype2str, "msgtype#%u", EXTRACT_U_1(p + MSG_TYPE_POS)));
 
                /*
                 * The call reference comes before the message type,
@@ -370,12 +370,12 @@ sig_print(netdissect_options *ndo,
                ND_PRINT("CALL_REF:0x%06x", call_ref);
        } else {
                /* SSCOP with some unknown protocol atop it */
-               ND_PRINT("SSCOP, proto %d ", EXTRACT_U_1(p + PROTO_POS));
+               ND_PRINT("SSCOP, proto %u ", EXTRACT_U_1(p + PROTO_POS));
        }
        return;
 
 trunc:
-       ND_PRINT(" %s", tstr);
+       nd_print_trunc(ndo);
 }
 
 /*
@@ -386,6 +386,7 @@ atm_print(netdissect_options *ndo,
           u_int vpi, u_int vci, u_int traftype, const u_char *p, u_int length,
           u_int caplen)
 {
+       ndo->ndo_protocol = "atm";
        if (ndo->ndo_eflag)
                ND_PRINT("VPI:%u VCI:%u ", vpi, vci);
 
@@ -447,8 +448,8 @@ struct oam_fm_ais_rdi_t {
 };
 
 void
-oam_print (netdissect_options *ndo,
-           const u_char *p, u_int length, u_int hec)
+oam_print(netdissect_options *ndo,
+          const u_char *p, u_int length, u_int hec)
 {
     uint32_t cell_header;
     uint16_t vpi, vci, cksum, cksum_shouldbe, idx;
@@ -459,7 +460,7 @@ oam_print (netdissect_options *ndo,
         const struct oam_fm_ais_rdi_t *oam_fm_ais_rdi;
     } oam_ptr;
 
-
+    ndo->ndo_protocol = "oam";
     ND_TCHECK_1(p + ATM_HDR_LEN_NOHEC + hec);
     cell_header = EXTRACT_BE_U_4(p + hec);
     cell_type = (EXTRACT_U_1((p + ATM_HDR_LEN_NOHEC + hec)) >> 4) & 0x0f;
@@ -550,6 +551,6 @@ oam_print (netdissect_options *ndo,
     return;
 
 trunc:
-    ND_PRINT("[|oam]");
+    nd_print_trunc(ndo);
     return;
 }