]> The Tcpdump Group git mirrors - tcpdump/blobdiff - print-pflog.c
From Albert Chin: IBM's C compiler, at least for AIX 4.3.3, doesn't
[tcpdump] / print-pflog.c
index 7b46749b47cc4e40c57ad4de4c86c2a7b6c3066b..6cd004cc1c68cddf97da3a8c30525ff92f9575c0 100644 (file)
@@ -21,7 +21,7 @@
 
 #ifndef lint
 static const char rcsid[] _U_ =
-    "@(#) $Header: /tcpdump/master/tcpdump/print-pflog.c,v 1.10 2004-03-28 20:33:28 fenner Exp $ (LBL)";
+    "@(#) $Header: /tcpdump/master/tcpdump/print-pflog.c,v 1.13 2005-04-06 21:32:41 mcr Exp $ (LBL)";
 #endif
 
 #ifdef HAVE_CONFIG_H
@@ -75,11 +75,14 @@ static struct tok pf_directions[] = {
 static void
 pflog_print(const struct pfloghdr *hdr)
 {
-       if (ntohl(hdr->subrulenr) == (u_int32_t)-1)
-               printf("rule %u/", ntohl(hdr->rulenr));
+       u_int32_t rulenr, subrulenr;
+
+       rulenr = ntohl(hdr->rulenr);
+       subrulenr = ntohl(hdr->subrulenr);
+       if (subrulenr == (u_int32_t)-1)
+               printf("rule %u/", rulenr);
        else
-               printf("rule %u.%s.%u/", ntohl(hdr->rulenr), hdr->ruleset,
-                   ntohl(hdr->subrulenr));
+               printf("rule %u.%s.%u/", rulenr, hdr->ruleset, subrulenr);
 
        printf("%s: %s %s on %s: ",
            tok2str(pf_reasons, "unkn(%u)", hdr->reason),
@@ -94,10 +97,6 @@ pflog_if_print(const struct pcap_pkthdr *h, register const u_char *p)
        u_int length = h->len;
        u_int hdrlen;
        u_int caplen = h->caplen;
-       const struct ip *ip;
-#ifdef INET6
-       const struct ip6_hdr *ip6;
-#endif
        const struct pfloghdr *hdr;
        u_int8_t af;
 
@@ -137,7 +136,7 @@ pflog_if_print(const struct pcap_pkthdr *h, register const u_char *p)
 #if OPENBSD_AF_INET != AF_INET
                case OPENBSD_AF_INET:           /* XXX: read pcap files */
 #endif
-                       ip_print(p, length);
+                       ip_print(gndo, p, length);
                        break;
 
 #ifdef INET6
@@ -162,3 +161,10 @@ trunc:
        printf("[|pflog]");
        return (hdrlen);
 }
+
+/*
+ * Local Variables:
+ * c-style: whitesmith
+ * c-basic-offset: 8
+ * End:
+ */