diff options
author | Javier Villavicencio <the_paya@gentoo.org> | 2009-01-27 12:50:33 +0000 |
---|---|---|
committer | Javier Villavicencio <the_paya@gentoo.org> | 2009-01-27 12:50:33 +0000 |
commit | c4efa6dd464a7962fe059caf679ee42ab695391f (patch) | |
tree | 44d1821a79da18359a35de1c74256a3cd2088d6e /net-firewall/pftop | |
parent | Added sqlite support, bug #247271, thank Marcin Deranek for report. Sqlite su... (diff) | |
download | gentoo-2-c4efa6dd464a7962fe059caf679ee42ab695391f.tar.gz gentoo-2-c4efa6dd464a7962fe059caf679ee42ab695391f.tar.bz2 gentoo-2-c4efa6dd464a7962fe059caf679ee42ab695391f.zip |
New version.
(Portage version: 2.2_rc23/cvs/FreeBSD i386)
Diffstat (limited to 'net-firewall/pftop')
-rw-r--r-- | net-firewall/pftop/ChangeLog | 12 | ||||
-rw-r--r-- | net-firewall/pftop/files/pftop-0.7-dead.patch | 42 | ||||
-rw-r--r-- | net-firewall/pftop/files/pftop-0.7-pcap.patch | 61 | ||||
-rw-r--r-- | net-firewall/pftop/files/pftop-0.7-pr123670.patch | 43 | ||||
-rw-r--r-- | net-firewall/pftop/files/pftop-0.7-queue.patch.bz2 | bin | 0 -> 3734 bytes | |||
-rw-r--r-- | net-firewall/pftop/files/pftop-0.7-strnvis_fix.patch | 13 | ||||
-rw-r--r-- | net-firewall/pftop/pftop-0.7.ebuild | 52 |
7 files changed, 221 insertions, 2 deletions
diff --git a/net-firewall/pftop/ChangeLog b/net-firewall/pftop/ChangeLog index 9a02b8d65e50..a7f25c717198 100644 --- a/net-firewall/pftop/ChangeLog +++ b/net-firewall/pftop/ChangeLog @@ -1,6 +1,14 @@ # ChangeLog for net-firewall/pftop -# Copyright 1999-2006 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/net-firewall/pftop/ChangeLog,v 1.3 2006/10/22 21:17:41 the_paya Exp $ +# Copyright 1999-2009 Gentoo Foundation; Distributed under the GPL v2 +# $Header: /var/cvsroot/gentoo-x86/net-firewall/pftop/ChangeLog,v 1.4 2009/01/27 12:50:32 the_paya Exp $ + +*pftop-0.7 (27 Jan 2009) + + 27 Jan 2009; Javier Villavicencio <the_paya@gentoo.org> + +files/pftop-0.7-dead.patch, +files/pftop-0.7-pcap.patch, + +files/pftop-0.7-pr123670.patch, +files/pftop-0.7-queue.patch.bz2, + +files/pftop-0.7-strnvis_fix.patch, +pftop-0.7.ebuild: + New version. 22 Oct 2006; Javier Villavicencio <the_paya@gentoo.org> pftop-0.5.ebuild: Add support for FreeBSD 6.2. diff --git a/net-firewall/pftop/files/pftop-0.7-dead.patch b/net-firewall/pftop/files/pftop-0.7-dead.patch new file mode 100644 index 000000000000..70aa19a420dd --- /dev/null +++ b/net-firewall/pftop/files/pftop-0.7-dead.patch @@ -0,0 +1,42 @@ +Patch from FreeBSD ports. + +--- pftop-0.7.orig/sf-gencode.c ++++ pftop-0.7/sf-gencode.c +@@ -32,7 +32,7 @@ + #include <netinet/in.h> + #include <netinet/if_ether.h> + +-#include <net/if_pflog.h> ++/* #include <net/if_pflog.h> */ + #include <net/pfvar.h> + + #include <netdb.h> +@@ -60,7 +60,7 @@ + static char sf_errbuf[PFTOP_ERRBUF_SIZE]; + + /* VARARGS */ +-__dead void ++__dead2 void + sf_error(const char *fmt, ...) + { + va_list ap; +--- pftop-0.7.orig/sf-gencode.h ++++ pftop-0.7/sf-gencode.h +@@ -169,7 +169,7 @@ + struct arth *gen_loadexpire(void); + + void bpf_optimize(struct block **); +-__dead void bpf_error(const char *, ...) ++__dead2 void bpf_error(const char *, ...) + __attribute__((volatile, __format__ (printf, 1, 2))); + + void finish_parse(struct block *); +@@ -184,7 +184,7 @@ + #define JT(b) ((b)->et.succ) + #define JF(b) ((b)->ef.succ) + +-__dead void sf_error(const char *fmt, ...); ++__dead2 void sf_error(const char *fmt, ...); + const char *sf_get_error(void); + int sf_compile(struct bpf_program *, char *, int, bpf_u_int32); + void sf_freecode(struct bpf_program *); diff --git a/net-firewall/pftop/files/pftop-0.7-pcap.patch b/net-firewall/pftop/files/pftop-0.7-pcap.patch new file mode 100644 index 000000000000..5c012ffbc12e --- /dev/null +++ b/net-firewall/pftop/files/pftop-0.7-pcap.patch @@ -0,0 +1,61 @@ +Fix compilation against libpcap-1.0.0. + +--- pftop-0.7.orig/bpf_dump.c ++++ pftop-0.7/bpf_dump.c +@@ -33,10 +33,10 @@ + #include <stdio.h> + + +-extern void bpf_dump(struct bpf_program *, int); ++extern void bpf_dump(const struct bpf_program *, int); + + void +-bpf_dump(struct bpf_program *p, int option) ++bpf_dump(const struct bpf_program *p, int option) + { + struct bpf_insn *insn; + int i; +--- pftop-0.7.orig/bpf_filter.c ++++ pftop-0.7/bpf_filter.c +@@ -134,7 +134,7 @@ + } + #endif + +-#include <net/bpf.h> ++//#include <net/bpf.h> + + /* + * Execute the filter program starting at pc on the packet p +@@ -143,8 +143,8 @@ + */ + u_int + bpf_filter(pc, p, wirelen, buflen) +- struct bpf_insn *pc; +- u_char *p; ++ const struct bpf_insn *pc; ++ const u_char *p; + u_int wirelen; + u_int buflen; + { +--- pftop-0.7.orig/bpf_image.c ++++ pftop-0.7/bpf_image.c +@@ -36,7 +36,7 @@ + + char * + bpf_image(p, n) +- struct bpf_insn *p; ++ const struct bpf_insn *p; + int n; + { + int v; +--- pftop-0.7.orig/sf-gencode.h ++++ pftop-0.7/sf-gencode.h +@@ -188,7 +188,7 @@ + const char *sf_get_error(void); + int sf_compile(struct bpf_program *, char *, int, bpf_u_int32); + void sf_freecode(struct bpf_program *); +-void bpf_dump(struct bpf_program *, int); ++void bpf_dump(const struct bpf_program *, int); + + extern int no_optimize; + diff --git a/net-firewall/pftop/files/pftop-0.7-pr123670.patch b/net-firewall/pftop/files/pftop-0.7-pr123670.patch new file mode 100644 index 000000000000..537c1daa3d06 --- /dev/null +++ b/net-firewall/pftop/files/pftop-0.7-pr123670.patch @@ -0,0 +1,43 @@ +--- pftop.c.orig 2007-11-07 01:36:46.000000000 -0500 ++++ pftop.c 2008-05-16 15:57:12.000000000 -0400 +@@ -1486,7 +1486,13 @@ + print_fld_size(FLD_BYTES, pr->bytes); + #endif + print_fld_uint(FLD_RULE, pr->nr); +- print_fld_str(FLD_DIR, pr->direction == PF_OUT ? "Out" : "In"); ++ if (pr->direction == PF_IN) ++ print_fld_str(FLD_DIR, "In"); ++ else if (pr->direction == PF_OUT) ++ print_fld_str(FLD_DIR, "Out"); ++ else ++ print_fld_str(FLD_DIR, "Any"); ++ + if (pr->quick) + print_fld_str(FLD_QUICK, "Quick"); + +@@ -1570,10 +1576,10 @@ + #ifdef HAVE_RULE_UGID + if (pr->uid.op) + tb_print_ugid(pr->uid.op, pr->uid.uid[0], pr->uid.uid[1], +- "user", UID_MAX); ++ "user", UINT_MAX); + if (pr->gid.op) + tb_print_ugid(pr->gid.op, pr->gid.gid[0], pr->gid.gid[1], +- "group", GID_MAX); ++ "group", UINT_MAX); + #endif + + if (pr->flags || pr->flagset) { +@@ -1765,7 +1771,12 @@ + strerror(errno)); + return (-1); + } ++#ifdef PFALTQ_FLAG_IF_REMOVED ++ if (pa.altq.qid > 0 && ++ !(pa.altq.local_flags & PFALTQ_FLAG_IF_REMOVED)) { ++#else + if (pa.altq.qid > 0) { ++#endif + pq.nr = nr; + pq.ticket = pa.ticket; + pq.buf = &qstats; diff --git a/net-firewall/pftop/files/pftop-0.7-queue.patch.bz2 b/net-firewall/pftop/files/pftop-0.7-queue.patch.bz2 Binary files differnew file mode 100644 index 000000000000..84e0c0d06265 --- /dev/null +++ b/net-firewall/pftop/files/pftop-0.7-queue.patch.bz2 diff --git a/net-firewall/pftop/files/pftop-0.7-strnvis_fix.patch b/net-firewall/pftop/files/pftop-0.7-strnvis_fix.patch new file mode 100644 index 000000000000..73b4be6146cf --- /dev/null +++ b/net-firewall/pftop/files/pftop-0.7-strnvis_fix.patch @@ -0,0 +1,13 @@ +Fix from FreeBSD ports. + +--- sf-scanner.l.orig ++++ sf-scanner.l +@@ -233,7 +233,7 @@ + size_t len = strlen(yytext) * 4 + 1; + char *v = malloc(len); + if (v != NULL) +- strnvis(v, yytext, len, 0); ++ strvis(v, yytext, 0); + sf_error("illegal token: %s", v); + free(v); + } diff --git a/net-firewall/pftop/pftop-0.7.ebuild b/net-firewall/pftop/pftop-0.7.ebuild new file mode 100644 index 000000000000..782a44ed0eda --- /dev/null +++ b/net-firewall/pftop/pftop-0.7.ebuild @@ -0,0 +1,52 @@ +# Copyright 2006-2009 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/net-firewall/pftop/pftop-0.7.ebuild,v 1.1 2009/01/27 12:50:32 the_paya Exp $ + +inherit bsdmk flag-o-matic +DESCRIPTION="Pftop: curses-based utility for real-time display of active states and rule statistics for pf" + +HOMEPAGE="http://www.eee.metu.edu.tr/~canacar/pftop/" + +SRC_URI="http://www.eee.metu.edu.tr/~canacar/${P}.tar.gz" + +LICENSE="BSD" +SLOT="0" +KEYWORDS="~x86-fbsd" +IUSE="" + +RDEPEND="sys-libs/ncurses" + +src_unpack() { + unpack ${A} + cd "${S}" + epatch "${FILESDIR}/${PN}-0.7-pcap.patch" + epatch "${FILESDIR}/${PN}-0.7-dead.patch" + epatch "${FILESDIR}/${PN}-0.7-pr123670.patch" + epatch "${FILESDIR}/${PN}-0.7-queue.patch.bz2" + epatch "${FILESDIR}/${PN}-0.7-strnvis_fix.patch" +} + +src_compile() { + # OS_LEVEL variable refers to the version of pf shipped with OpenBSD. + # On FreeBSD we have to know it. + local OSLEVEL + + case ${CHOST} in + *-openbsd*) + local obsdver=${CHOST/*-openbsd/} + OSLEVEL=${obsdver//.} + ;; + *-freebsd5.[34]) OSLEVEL=35 ;; + *-freebsd6.[012]) OSLEVEL=37 ;; + *-freebsd*) OSLEVEL=41 ;; + *) + die "Your OS/Version is not supported (${CHOST}), please report." + ;; + esac + append-flags "-DHAVE_SNPRINTF -DHAVE_VSNPRINTF -DOS_LEVEL=${OSLEVEL}" + mkmake LOCALBASE="/usr" CFLAGS="${CFLAGS}" || die "pmake failed" +} + +src_install() { + mkinstall DESTDIR="${D}" LOCALBASE="/usr" MANDIR="/usr/share/man/man" install || die +} |