#ifndef lint
static const char rcsid[] _U_ =
- "@(#) $Header: /tcpdump/master/tcpdump/print-pflog.c,v 1.13 2005-04-06 21:32:41 mcr Exp $ (LBL)";
+ "@(#) $Header: /tcpdump/master/tcpdump/print-pflog.c,v 1.16 2007-09-12 19:36:18 guy Exp $ (LBL)";
#endif
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
+#ifndef HAVE_NET_PFVAR_H
+#error "No pf headers available"
+#endif
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <net/if.h>
+#include <net/pfvar.h>
+#include <net/if_pflog.h>
+
#include <tcpdump-stdinc.h>
#include <stdio.h>
#include <pcap.h>
+#include "extract.h"
#include "interface.h"
#include "addrtoname.h"
-#include "pf.h"
static struct tok pf_reasons[] = {
{ 0, "0(match)" },
{ 3, "3(short)" },
{ 4, "4(normalize)" },
{ 5, "5(memory)" },
+ { 6, "6(bad-timestamp)" },
+ { 7, "7(congestion)" },
+ { 8, "8(ip-option)" },
+ { 9, "9(proto-cksum)" },
+ { 10, "10(state-mismatch)" },
+ { 11, "11(state-insert)" },
+ { 12, "12(state-limit)" },
+ { 13, "13(src-limit)" },
+ { 14, "14(synproxy)" },
{ 0, NULL }
};
{
u_int32_t rulenr, subrulenr;
- rulenr = ntohl(hdr->rulenr);
- subrulenr = ntohl(hdr->subrulenr);
+ rulenr = EXTRACT_32BITS(&hdr->rulenr);
+ subrulenr = EXTRACT_32BITS(&hdr->subrulenr);
if (subrulenr == (u_int32_t)-1)
printf("rule %u/", rulenr);
else
/* address family not handled, print raw packet */
if (!eflag)
pflog_print(hdr);
- if (!xflag && !qflag)
+ if (!suppress_default_print)
default_print(p, caplen);
}