diff options
author | Ryan Thomas McBride <mcbride@cvs.openbsd.org> | 2003-01-01 16:55:17 +0000 |
---|---|---|
committer | Ryan Thomas McBride <mcbride@cvs.openbsd.org> | 2003-01-01 16:55:17 +0000 |
commit | 03cdd9a4388cb8cffa2b4c3a155a66329aef679f (patch) | |
tree | aa8dea090d215ed427205b187b62c270bae90c13 /usr.sbin/tcpdump | |
parent | 77851a167cfd9f734e26ab52a92f2413c7ff7fb7 (diff) |
Support all possible rule types ("scrub" rules can log packets being
dropped, others may as well in the future).
ok dhartmei@ henning@
Diffstat (limited to 'usr.sbin/tcpdump')
-rw-r--r-- | usr.sbin/tcpdump/print-pflog.c | 33 |
1 files changed, 28 insertions, 5 deletions
diff --git a/usr.sbin/tcpdump/print-pflog.c b/usr.sbin/tcpdump/print-pflog.c index 2b7f79efdee..96a8c82ca90 100644 --- a/usr.sbin/tcpdump/print-pflog.c +++ b/usr.sbin/tcpdump/print-pflog.c @@ -1,4 +1,4 @@ -/* $OpenBSD: print-pflog.c,v 1.10 2002/02/19 19:39:40 millert Exp $ */ +/* $OpenBSD: print-pflog.c,v 1.11 2003/01/01 16:55:16 mcbride Exp $ */ /* * Copyright (c) 1990, 1991, 1993, 1994, 1995, 1996 @@ -23,7 +23,7 @@ #ifndef lint static const char rcsid[] = - "@(#) $Header: /cvs/OpenBSD/src/usr.sbin/tcpdump/print-pflog.c,v 1.10 2002/02/19 19:39:40 millert Exp $ (LBL)"; + "@(#) $Header: /cvs/OpenBSD/src/usr.sbin/tcpdump/print-pflog.c,v 1.11 2003/01/01 16:55:16 mcbride Exp $ (LBL)"; #endif #include <sys/param.h> @@ -89,9 +89,32 @@ pflog_if_print(u_char *user, const struct pcap_pkthdr *h, snprintf(reason, sizeof(reason), "%d(%s)", res, why); - printf("rule %d/%s: %s %s on %s: ", - (short)ntohs(hdr->rnr), reason, - ntohs(hdr->action) == PF_PASS ? "pass" : "block", + printf("rule %d/%s: ", + (short)ntohs(hdr->rnr), reason); + switch (hdr->action) { + case PF_SCRUB: + printf("scrub"); + break; + case PF_PASS: + printf("pass"); + break; + case PF_DROP: + printf("block"); + break; + case PF_NAT: + case PF_NONAT: + printf("nat"); + break; + case PF_BINAT: + case PF_NOBINAT: + printf("binat"); + break; + case PF_RDR: + case PF_NORDR: + printf("rdr"); + break; + } + printf(" %s on %s: ", ntohs(hdr->dir) == PF_OUT ? "out" : "in", hdr->ifname); } |