X-Git-Url: https://git.tcpdump.org/tcpdump/blobdiff_plain/a57421867fff43381f2ca80c43bb0be3037c562e..b54ff914a1ea5c40da3687b52a508748ecb801b0:/print-fddi.c diff --git a/print-fddi.c b/print-fddi.c index bf090d7c..84aea552 100644 --- a/print-fddi.c +++ b/print-fddi.c @@ -20,24 +20,16 @@ */ #ifndef lint -static const char rcsid[] = - "@(#) $Header: /tcpdump/master/tcpdump/print-fddi.c,v 1.54 2002-04-07 09:50:32 guy Exp $ (LBL)"; +static const char rcsid[] _U_ = + "@(#) $Header: /tcpdump/master/tcpdump/print-fddi.c,v 1.64 2004-03-17 23:24:37 guy Exp $ (LBL)"; #endif #ifdef HAVE_CONFIG_H #include "config.h" #endif -#include -#include -#include -#include -#include +#include -#include - -#include -#include #include #include #include @@ -241,7 +233,7 @@ fddi_hdr_print(register const struct fddi_header *fddip, register u_int length, } static inline void -fddi_smt_print(const u_char *p, u_int length) +fddi_smt_print(const u_char *p _U_, u_int length _U_) { printf(""); } @@ -255,25 +247,13 @@ fddi_print(const u_char *p, u_int length, u_int caplen) if (caplen < FDDI_HDRLEN) { printf("[|fddi]"); - goto out; + return; } + /* * Get the FDDI addresses into a canonical form */ extract_fddi_addrs(fddip, (char *)ESRC(&ehdr), (char *)EDST(&ehdr)); - /* - * Some printers want to get back at the link level addresses, - * and/or check that they're not walking off the end of the packet. - * Rather than pass them all the way down, we set these globals. - */ - snapend = p + caplen; - /* - * Actually, the only printers that use packetp are print-arp.c - * and print-bootp.c, and they assume that packetp points to an - * Ethernet header. The right thing to do is to fix them to know - * which link type is in use when they excavate. XXX - */ - packetp = (u_char *)&ehdr; if (eflag) fddi_hdr_print(fddip, length, ESRC(&ehdr), EDST(&ehdr)); @@ -313,31 +293,18 @@ fddi_print(const u_char *p, u_int length, u_int caplen) if (!xflag && !qflag) default_print(p, caplen); } - if (xflag) - default_print(p, caplen); -out: - putchar('\n'); } /* - * This is the top level routine of the printer. 'sp' is the points - * to the FDDI header of the packet, 'tvp' is the timestamp, - * 'length' is the length of the packet off the wire, and 'caplen' + * This is the top level routine of the printer. 'p' points + * to the FDDI header of the packet, 'h->ts' is the timestamp, + * 'h->len' is the length of the packet off the wire, and 'h->caplen' * is the number of bytes actually captured. */ -void -fddi_if_print(u_char *pcap, const struct pcap_pkthdr *h, - register const u_char *p) +u_int +fddi_if_print(const struct pcap_pkthdr *h, register const u_char *p) { - u_int caplen = h->caplen; - u_int length = h->len; - - ++infodelay; - ts_print(&h->ts); - - fddi_print(p, length, caplen); + fddi_print(p, h->len, h->caplen); - --infodelay; - if (infoprint) - info(0); + return (FDDI_HDRLEN); }