X-Git-Url: https://git.tcpdump.org/tcpdump/blobdiff_plain/e070cf232ffadbdbbca68b132ef369675890e566..8f94d68a09e1103353cc7d1133d6dfdf7d5a920d:/print-token.c diff --git a/print-token.c b/print-token.c index 5070e5b9..6478ff27 100644 --- a/print-token.c +++ b/print-token.c @@ -25,7 +25,7 @@ */ #ifndef lint static const char rcsid[] = - "@(#) $Header: /tcpdump/master/tcpdump/print-token.c,v 1.20 2002-12-18 08:53:24 guy Exp $"; + "@(#) $Header: /tcpdump/master/tcpdump/print-token.c,v 1.22 2002-12-19 09:39:16 guy Exp $"; #endif #ifdef HAVE_CONFIG_H @@ -118,13 +118,6 @@ token_print(const u_char *p, u_int length, u_int caplen) */ extract_token_addrs(trp, (char*)ESRC(&ehdr), (char*)EDST(&ehdr)); - /* - * Some printers want to check that they're not walking off the - * end of the packet. - * Rather than pass it all the way down, we set this global. - */ - snapend = p + caplen; - /* Adjust for source routing information in the MAC header */ if (IS_SOURCE_ROUTED(trp)) { /* Clear source-routed bit */ @@ -195,28 +188,8 @@ token_print(const u_char *p, u_int length, u_int caplen) * 'h->length' is the length of the packet off the wire, and 'h->caplen' * is the number of bytes actually captured. */ -void -token_if_print(u_char *user _U_, const struct pcap_pkthdr *h, const u_char *p) +u_int +token_if_print(const struct pcap_pkthdr *h, const u_char *p) { - u_int caplen = h->caplen; - u_int length = h->len; - u_int hdr_len; - - ++infodelay; - ts_print(&h->ts); - - hdr_len = token_print(p, length, caplen); - - /* - * If "-x" was specified, print stuff past the Token Ring header, - * if there's anything to print. - */ - if (xflag && caplen > hdr_len) - default_print(p + hdr_len, caplen - hdr_len); - - putchar('\n'); - - --infodelay; - if (infoprint) - info(0); + return (token_print(p, h->len, h->caplen)); }