]> The Tcpdump Group git mirrors - tcpdump/blobdiff - print-pflog.c
Merge remote-tracking branch 'upstream/master'
[tcpdump] / print-pflog.c
index 2f93619023fa966ed51ee8848ecc4045673408bd..ac325f4b0e63674b56fd7882f7f049e1d0c1073e 100644 (file)
 
 #ifndef lint
 static const char rcsid[] _U_ =
-    "@(#) $Header: /tcpdump/master/tcpdump/print-pflog.c,v 1.15 2006-10-25 22:13:10 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 <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)" },
@@ -86,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
@@ -153,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