X-Git-Url: https://git.tcpdump.org/tcpdump/blobdiff_plain/d953299b94043156cab202c486dc5b864f71c633..refs/heads/tcpdump-4.1:/print-pflog.c diff --git a/print-pflog.c b/print-pflog.c index 0505af9d..ac325f4b 100644 --- a/print-pflog.c +++ b/print-pflog.c @@ -21,21 +21,30 @@ #ifndef lint static const char rcsid[] _U_ = - "@(#) $Header: /tcpdump/master/tcpdump/print-pflog.c,v 1.14 2005-07-07 01:22:20 guy 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 +#include +#include +#include +#include + #include #include #include +#include "extract.h" #include "interface.h" #include "addrtoname.h" -#include "pf.h" static struct tok pf_reasons[] = { { 0, "0(match)" }, @@ -44,6 +53,15 @@ static struct tok pf_reasons[] = { { 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 } }; @@ -77,8 +95,8 @@ pflog_print(const struct pfloghdr *hdr) { 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 @@ -144,7 +162,7 @@ pflog_if_print(const struct pcap_pkthdr *h, register const u_char *p) #if OPENBSD_AF_INET6 != AF_INET6 case OPENBSD_AF_INET6: /* XXX: read pcap files */ #endif - ip6_print(p, length); + ip6_print(gndo, p, length); break; #endif