]> The Tcpdump Group git mirrors - tcpdump/blobdiff - print-atm.c
Revert partially the commit 21b1273
[tcpdump] / print-atm.c
index e6b7caa3a3dc4cbe54275f6fc0951b2514d65dd2..434d901c98fd041b756ef00d7b5f450adc8c5964 100644 (file)
@@ -243,7 +243,7 @@ atm_llc_print(netdissect_options *ndo,
  * 'h->len' is the length of the packet off the wire, and 'h->caplen'
  * is the number of bytes actually captured.
  */
-u_int
+void
 atm_if_print(netdissect_options *ndo,
              const struct pcap_pkthdr *h, const u_char *p)
 {
@@ -252,10 +252,11 @@ atm_if_print(netdissect_options *ndo,
        uint32_t llchdr;
        u_int hdrlen = 0;
 
-       ndo->ndo_protocol = "atm_if";
+       ndo->ndo_protocol = "atm";
        if (caplen < 1) {
                nd_print_trunc(ndo);
-               return (caplen);
+               ndo->ndo_ll_hdr_len += caplen;
+               return;
        }
 
         /* Cisco Style NLPID ? */
@@ -263,7 +264,8 @@ atm_if_print(netdissect_options *ndo,
             if (ndo->ndo_eflag)
                 ND_PRINT("CNLPID ");
             isoclns_print(ndo, p + 1, length - 1);
-            return hdrlen;
+            ndo->ndo_ll_hdr_len += hdrlen;
+            return;
         }
 
        /*
@@ -272,7 +274,8 @@ atm_if_print(netdissect_options *ndo,
         */
        if (caplen < 3) {
                nd_print_trunc(ndo);
-               return (caplen);
+               ndo->ndo_ll_hdr_len += caplen;
+               return;
        }
 
        /*
@@ -304,7 +307,8 @@ atm_if_print(netdissect_options *ndo,
                 */
                if (caplen < 20) {
                        nd_print_trunc(ndo);
-                       return (caplen);
+                       ndo->ndo_ll_hdr_len += caplen;
+                       return;
                }
                if (ndo->ndo_eflag)
                        ND_PRINT("%08x%08x %08x%08x ",
@@ -318,7 +322,7 @@ atm_if_print(netdissect_options *ndo,
                hdrlen += 20;
        }
        hdrlen += atm_llc_print(ndo, p, length, caplen);
-       return (hdrlen);
+       ndo->ndo_ll_hdr_len += hdrlen;
 }
 
 /*
@@ -349,14 +353,12 @@ sig_print(netdissect_options *ndo,
 {
        uint32_t call_ref;
 
-       ND_TCHECK_1(p + PROTO_POS);
        if (GET_U_1(p + PROTO_POS) == Q2931) {
                /*
                 * protocol:Q.2931 for User to Network Interface
                 * (UNI 3.1) signalling
                 */
                ND_PRINT("Q.2931");
-               ND_TCHECK_1(p + MSG_TYPE_POS);
                ND_PRINT(":%s ",
                    tok2str(msgtype2str, "msgtype#%u", GET_U_1(p + MSG_TYPE_POS)));
 
@@ -372,10 +374,6 @@ sig_print(netdissect_options *ndo,
                /* SSCOP with some unknown protocol atop it */
                ND_PRINT("SSCOP, proto %u ", GET_U_1(p + PROTO_POS));
        }
-       return;
-
-trunc:
-       nd_print_trunc(ndo);
 }
 
 /*
@@ -461,7 +459,6 @@ oam_print(netdissect_options *ndo,
     } oam_ptr;
 
     ndo->ndo_protocol = "oam";
-    ND_TCHECK_1(p + ATM_HDR_LEN_NOHEC + hec);
     cell_header = GET_BE_U_4(p + hec);
     cell_type = (GET_U_1((p + ATM_HDR_LEN_NOHEC + hec)) >> 4) & 0x0f;
     func_type = GET_U_1((p + ATM_HDR_LEN_NOHEC + hec)) & 0x0f;
@@ -543,7 +540,6 @@ oam_print(netdissect_options *ndo,
     }
 
     /* crc10 checksum verification */
-    ND_TCHECK_2(p + OAM_CELLTYPE_FUNCTYPE_LEN + OAM_FUNCTION_SPECIFIC_LEN);
     cksum = GET_BE_U_2(p + OAM_CELLTYPE_FUNCTYPE_LEN + OAM_FUNCTION_SPECIFIC_LEN)
         & OAM_CRC10_MASK;
     cksum_shouldbe = verify_crc10_cksum(0, p, OAM_PAYLOAD_LEN);