]> The Tcpdump Group git mirrors - tcpdump/blobdiff - print-atm.c
Add program_name field in the netdissect_options structure
[tcpdump] / print-atm.c
index 82a012ba03139ac35224a06169b9da88bc1bdc5a..c2514d22ec39fc69c98530f97596feaee2f3cd3c 100644 (file)
@@ -25,7 +25,7 @@
 
 #include <tcpdump-stdinc.h>
 
-#include "interface.h"
+#include "netdissect.h"
 #include "extract.h"
 #include "addrtoname.h"
 #include "atm.h"
@@ -214,15 +214,20 @@ static const struct tok *oam_functype_values[16] = {
 /*
  * Print an RFC 1483 LLC-encapsulated ATM frame.
  */
-static void
+static u_int
 atm_llc_print(netdissect_options *ndo,
               const u_char *p, int length, int caplen)
 {
-       if (!llc_print(ndo, p, length, caplen, NULL, NULL)) {
-               /* ether_type not known, print raw packet */
+       int llc_hdrlen;
+
+       llc_hdrlen = llc_print(ndo, p, length, caplen, NULL, NULL);
+       if (llc_hdrlen < 0) {
+               /* packet not known, print raw packet */
                if (!ndo->ndo_suppress_default_print)
                        ND_DEFAULTPRINT(p, caplen);
+               llc_hdrlen = -llc_hdrlen;
        }
+       return (llc_hdrlen);
 }
 
 /*
@@ -310,7 +315,7 @@ atm_if_print(netdissect_options *ndo,
                caplen -= 20;
                hdrlen += 20;
        }
-       atm_llc_print(ndo, p, length, caplen);
+       hdrlen += atm_llc_print(ndo, p, length, caplen);
        return (hdrlen);
 }