X-Git-Url: https://git.tcpdump.org/tcpdump/blobdiff_plain/ba05b1bf39d2cbcd11dade29f7fc5c5b61f6ede8..refs/pull/482/head:/print-atm.c diff --git a/print-atm.c b/print-atm.c index b5d3385f..7489158b 100644 --- a/print-atm.c +++ b/print-atm.c @@ -23,9 +23,9 @@ #include "config.h" #endif -#include +#include -#include "interface.h" +#include "netdissect.h" #include "extract.h" #include "addrtoname.h" #include "atm.h" @@ -214,22 +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) { - u_short extracted_ethertype; - - if (!llc_print(ndo, p, length, caplen, NULL, NULL, - &extracted_ethertype)) { - /* ether_type not known, print raw packet */ - if (extracted_ethertype) { - ND_PRINT((ndo, "(LLC %s) ", - etherproto_string(htons(extracted_ethertype)))); - } + 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); } /* @@ -317,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); }