]> The Tcpdump Group git mirrors - tcpdump/blobdiff - print-sunatm.c
Makefile.in: don't remove configure and config.h.in in make distclean.
[tcpdump] / print-sunatm.c
index 0e8fe57d5d6825fb1ef2d917d5324d5be2c4a5ae..0fe5eee8e411b5f281cf1fc6baef6ae5176a1b03 100644 (file)
@@ -38,6 +38,7 @@
 
 #include "netdissect-stdinc.h"
 
+#define ND_LONGJMP_FROM_TCHECK
 #include "netdissect.h"
 #include "extract.h"
 
@@ -59,7 +60,7 @@
  * 'h->len' is the length of the packet off the wire, and 'h->caplen'
  * is the number of bytes actually captured.
  */
-u_int
+void
 sunatm_if_print(netdissect_options *ndo,
                 const struct pcap_pkthdr *h, const u_char *p)
 {
@@ -69,11 +70,7 @@ sunatm_if_print(netdissect_options *ndo,
        u_char vpi;
        u_int traftype;
 
-       ndo->ndo_protocol = "sunatm_if";
-       if (caplen < PKT_BEGIN_POS) {
-               nd_print_trunc(ndo);
-               return (caplen);
-       }
+       ndo->ndo_protocol = "sunatm";
 
        if (ndo->ndo_eflag) {
                ND_PRINT(GET_U_1(p + DIR_POS) & 0x80 ? "Tx: " : "Rx: ");
@@ -94,13 +91,12 @@ sunatm_if_print(netdissect_options *ndo,
                break;
        }
 
-       vci = GET_BE_U_2(p + VCI_POS);
        vpi = GET_U_1(p + VPI_POS);
+       vci = GET_BE_U_2(p + VCI_POS);
 
        p += PKT_BEGIN_POS;
        caplen -= PKT_BEGIN_POS;
        length -= PKT_BEGIN_POS;
+       ndo->ndo_ll_hdr_len += PKT_BEGIN_POS;
        atm_print(ndo, vpi, vci, traftype, p, length, caplen);
-
-       return (PKT_BEGIN_POS);
 }