Update to pftop-0.4

ok henning@, dhartmei@, jolan@
This commit is contained in:
canacar 2003-08-21 18:24:41 +00:00
parent 25e80e8611
commit 8aced87963
6 changed files with 5 additions and 177 deletions

View File

@ -1,9 +1,9 @@
# $OpenBSD: Makefile,v 1.2 2002/09/12 01:01:01 lebel Exp $
# $OpenBSD: Makefile,v 1.3 2003/08/21 18:24:41 canacar Exp $
#
COMMENT= "curses-based real time state and rule display for pf"
DISTNAME= pftop-0.3
DISTNAME= pftop-0.4
CATEGORIES= sysutils
HOMEPAGE= http://www.eee.metu.edu.tr/~canacar/pftop/

View File

@ -1,3 +1,3 @@
MD5 (pftop-0.3.tar.gz) = 6227be2a51ba79cca1fe9e18fbe495dc
RMD160 (pftop-0.3.tar.gz) = 6510a7c52295722d42bc61d49c3de735ba1fc5a4
SHA1 (pftop-0.3.tar.gz) = 7f3dfded88573df74a1bdc94c8347a415a29969e
MD5 (pftop-0.4.tar.gz) = d33b3a30152bac7d50d019a78bc58c72
RMD160 (pftop-0.4.tar.gz) = fc08e6ec45fbfdca30e32bd0d90f04968e323dc4
SHA1 (pftop-0.4.tar.gz) = 717d8a9527a412cf21c1a6b7e6fa054bf0298ab2

View File

@ -1,24 +0,0 @@
$OpenBSD: patch-Makefile,v 1.4 2003/01/02 06:27:03 pvalchev Exp $
--- Makefile.orig Tue Sep 10 12:56:40 2002
+++ Makefile Wed Jan 1 23:22:40 2003
@@ -1,8 +1,8 @@
# $Id: patch-Makefile,v 1.4 2003/01/02 06:27:03 pvalchev Exp $
# set OS level to 32 if using 3.1-current
-#OSLEVEL=32
-OSLEVEL=${OSrev}
+OSLEVEL=33
+#OSLEVEL=${OSrev}
PROG= pftop
SRCS= pftop.c
@@ -11,7 +11,7 @@ MAN= pftop.8
CFLAGS+= -Wall -DOS_LEVEL=${OSLEVEL}
LDADD+= -lcurses
-MANDIR=/usr/local/man/cat
-BINDIR=/usr/local/sbin
+MANDIR=${LOCALBASE}/man/cat
+BINDIR=${LOCALBASE}/sbin
.include <bsd.prog.mk>

View File

@ -1,40 +0,0 @@
$OpenBSD: patch-pftop_8,v 1.1 2003/06/25 18:08:57 david Exp $
--- pftop.8.orig Tue Sep 10 13:58:15 2002
+++ pftop.8 Tue Jun 24 18:15:19 2003
@@ -90,13 +90,6 @@ terminal.
.It Fl o Ar field
Sort the process display area using the specified field as the
primary key.
-.It Fl r
-Reverse the sort order.
-.It Fl s Ar time
-Set the delay between display updates to
-.Ar time
-seconds.
-The default delay is 5 seconds.
Accepted field arguments are:
.Ar age ,
.Ar bytes ,
@@ -109,6 +102,13 @@ Accepted field arguments are:
.Ar sport ,
and
.Ar src .
+.It Fl r
+Reverse the sort order.
+.It Fl s Ar time
+Set the delay between display updates to
+.Ar time
+seconds.
+The default delay is 5 seconds.
.It Fl v Ar view
Select the initial arrangement of the columns. Available
views are:
@@ -121,7 +121,7 @@ views are:
and
.Ar label .
The
-.Ar rule
+.Ar rules
and
.Ar label
views display rules, while the other views display states.

View File

@ -1,106 +0,0 @@
--- pftop.c.orig Fri Feb 21 23:56:22 2003
+++ pftop.c Fri Feb 21 23:58:32 2003
@@ -1344,6 +1344,7 @@
struct pfioc_rule pr;
u_int32_t nr;
+ memset(&pr, 0, sizeof(pr));
if (ioctl(dev, DIOCGETRULES, &pr)) {
warnx("DIOCGETRULES");
return (-1);
@@ -1381,10 +1382,10 @@
void
tb_print_addrw(struct pf_addr_wrap *addr, struct pf_addr *mask, u_int8_t af)
{
- if (addr->addr_dyn != NULL)
- tbprintf("(%s)", addr->addr.pfa.ifname);
+ if (addr->type == PF_ADDR_DYNIFTL)
+ tbprintf("(%s)", addr->v.ifname);
else
- tb_print_addr(&addr->addr, mask, af);
+ tb_print_addr(&addr->v.a.addr, mask, af);
}
#endif
@@ -1432,39 +1433,40 @@
{
if (
#if OS_LEVEL > 31
- PF_AZERO(&src->addr.addr, AF_INET6) &&
- PF_AZERO(&dst->addr.addr, AF_INET6) &&
- !src->noroute && !dst->noroute &&
+ src->addr.type != PF_ADDR_NOROUTE &&
+ dst->addr.type != PF_ADDR_NOROUTE &&
+ PF_AZERO(&src->addr.v.a.addr, AF_INET6) &&
+ PF_AZERO(&dst->addr.v.a.addr, AF_INET6) &&
#else
PF_AZERO(&src->addr, AF_INET6) &&
PF_AZERO(&dst->addr, AF_INET6) &&
#endif
- PF_AZERO(&src->mask, AF_INET6) &&
- PF_AZERO(&dst->mask, AF_INET6) &&
+ PF_AZERO(&src->addr.v.a.mask, AF_INET6) &&
+ PF_AZERO(&dst->addr.v.a.mask, AF_INET6) &&
!src->port_op && !dst->port_op)
tbprintf("all ");
else {
tbprintf("from ");
#if OS_LEVEL > 30
- if (src->noroute)
+ if (src->addr.type == PF_ADDR_NOROUTE)
tbprintf("no-route ");
#if OS_LEVEL > 31
- else if (PF_AZERO(&src->addr.addr, AF_INET6) &&
+ else if (PF_AZERO(&src->addr.v.a.addr, AF_INET6) &&
#else
else if (PF_AZERO(&src->addr, AF_INET6) &&
#endif
#else
if (PF_AZERO(&src->addr, AF_INET6) &&
#endif
- PF_AZERO(&src->mask, AF_INET6))
+ PF_AZERO(&src->addr.v.a.mask, AF_INET6))
tbprintf("any ");
else {
if (src->not)
tbprintf("! ");
#if OS_LEVEL > 31
- tb_print_addrw(&src->addr, &src->mask, af);
+ tb_print_addrw(&src->addr, &src->addr.v.a.mask, af);
#else
- tb_print_addr(&src->addr, &src->mask, af);
+ tb_print_addr(&src->addr, &src->addr.v.a.mask, af);
#endif
tbprintf(" ");
}
@@ -1475,25 +1477,25 @@
tbprintf("to ");
#if OS_LEVEL > 30
- if (dst->noroute)
+ if (dst->addr.type == PF_ADDR_NOROUTE)
tbprintf("no-route ");
#if OS_LEVEL > 31
- else if (PF_AZERO(&dst->addr.addr, AF_INET6) &&
+ else if (PF_AZERO(&dst->addr.v.a.addr, AF_INET6) &&
#else
else if (PF_AZERO(&dst->addr, AF_INET6) &&
#endif
#else
if (PF_AZERO(&dst->addr, AF_INET6) &&
#endif
- PF_AZERO(&dst->mask, AF_INET6))
+ PF_AZERO(&dst->addr.v.a.mask, AF_INET6))
tbprintf("any ");
else {
if (dst->not)
tbprintf("! ");
#if OS_LEVEL > 31
- tb_print_addrw(&dst->addr, &dst->mask, af);
+ tb_print_addrw(&dst->addr, &dst->addr.v.a.mask, af);
#else
- tb_print_addr(&dst->addr, &dst->mask, af);
+ tb_print_addr(&dst->addr, &dst->addr.v.a.mask, af);
#endif
tbprintf(" ");
}

View File

@ -1,5 +1,3 @@
pfTop is a curses-based utility for real-time display of
active states and rules for pf. It is a cross between top
and pfctl -sr and pfctl -ss.
WWW: ${HOMEPAGE}