X-Git-Url: https://git.tcpdump.org/tcpdump/blobdiff_plain/e2982e7f6f0b624a773ec5a58885ee80fab46d34..cc2d4cbd8ca150504127f375d8b51b194958d95b:/print-llc.c diff --git a/print-llc.c b/print-llc.c index a1a507bb..e7c50196 100644 --- a/print-llc.c +++ b/print-llc.c @@ -25,10 +25,10 @@ /* \summary: IEEE 802.2 LLC printer */ #ifdef HAVE_CONFIG_H -#include "config.h" +#include #endif -#include +#include "netdissect-stdinc.h" #include "netdissect.h" #include "addrtoname.h" @@ -155,13 +155,14 @@ llc_print(netdissect_options *ndo, const u_char *p, u_int length, u_int caplen, int hdrlen; int is_u; + ndo->ndo_protocol = "llc"; if (caplen < 3) { - ND_PRINT("[|llc]"); + nd_print_trunc(ndo); ND_DEFAULTPRINT((const u_char *)p, caplen); return (caplen); } if (length < 3) { - ND_PRINT("[|llc]"); + nd_print_trunc(ndo); ND_DEFAULTPRINT((const u_char *)p, caplen); return (length); } @@ -188,12 +189,12 @@ llc_print(netdissect_options *ndo, const u_char *p, u_int length, u_int caplen, * 2 bytes... */ if (caplen < 4) { - ND_PRINT("[|llc]"); + nd_print_trunc(ndo); ND_DEFAULTPRINT((const u_char *)p, caplen); return (caplen); } if (length < 4) { - ND_PRINT("[|llc]"); + nd_print_trunc(ndo); ND_DEFAULTPRINT((const u_char *)p, caplen); return (length); } @@ -367,14 +368,14 @@ llc_print(netdissect_options *ndo, const u_char *p, u_int length, u_int caplen, return (hdrlen); } if (caplen < 1) { - ND_PRINT("[|llc]"); + nd_print_trunc(ndo); if (caplen > 0) ND_DEFAULTPRINT((const u_char *)p, caplen); return (hdrlen); } if (EXTRACT_U_1(p) == LLC_XID_FI) { if (caplen < 3 || length < 3) { - ND_PRINT("[|llc]"); + nd_print_trunc(ndo); if (caplen > 0) ND_DEFAULTPRINT((const u_char *)p, caplen); } else @@ -427,6 +428,7 @@ snap_print(netdissect_options *ndo, const u_char *p, u_int length, u_int caplen, u_short et; int ret; + ndo->ndo_protocol = "snap"; ND_TCHECK_5(p); if (caplen < 5 || length < 5) goto trunc; @@ -603,14 +605,6 @@ snap_print(netdissect_options *ndo, const u_char *p, u_int length, u_int caplen, return (0); trunc: - ND_PRINT("[|snap]"); + nd_print_trunc(ndo); return (1); } - - -/* - * Local Variables: - * c-style: whitesmith - * c-basic-offset: 8 - * End: - */