X-Git-Url: https://git.tcpdump.org/tcpdump/blobdiff_plain/73a1c3892c1b33aa5dd4ede34cb686f90676ed29..fe0fcd92e3ae841f7ccf84b250df1ec4afdaecbc:/print-pflog.c diff --git a/print-pflog.c b/print-pflog.c index 78dd4db1..3623e303 100644 --- a/print-pflog.c +++ b/print-pflog.c @@ -22,15 +22,15 @@ */ #ifndef lint -static const char rcsid[] = - "@(#) $Header: /tcpdump/master/tcpdump/print-pflog.c,v 1.1 2002-02-05 10:07:39 guy Exp $ (LBL)"; +static const char rcsid[] _U_ = + "@(#) $Header: /tcpdump/master/tcpdump/print-pflog.c,v 1.9 2003-11-16 09:36:32 guy Exp $ (LBL)"; #endif -#include -#include -#include +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif -#include +#include #include #include @@ -96,30 +96,19 @@ pflog_print(const struct pfloghdr *hdr) hdr->ifname); } -void -pflog_if_print(u_char *user, const struct pcap_pkthdr *h, - register const u_char *p) +u_int +pflog_if_print(const struct pcap_pkthdr *h, register const u_char *p) { u_int length = h->len; u_int caplen = h->caplen; const struct pfloghdr *hdr; u_int8_t af; - ts_print(&h->ts); - if (caplen < PFLOG_HDRLEN) { printf("[|pflog]"); - goto out; + return (caplen); } - /* - * 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. - */ - packetp = p; - snapend = p + caplen; - hdr = (const struct pfloghdr *)p; if (eflag) pflog_print(hdr); @@ -147,11 +136,5 @@ pflog_if_print(u_char *user, const struct pcap_pkthdr *h, default_print(p, caplen); } - if (xflag) - default_print(p, caplen); -out: - putchar('\n'); - --infodelay; - if (infoprint) - info(0); + return (PFLOG_HDRLEN); }