# ChangeLog for net-analyzer/darkstat
# Copyright 2000-2007 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/net-analyzer/darkstat/ChangeLog,v 1.23 2007/02/01 21:33:06 jokey Exp $
+# $Header: /var/cvsroot/gentoo-x86/net-analyzer/darkstat/ChangeLog,v 1.24 2007/02/01 21:35:33 jokey Exp $
+
+ 01 Feb 2007; Markus Ullmann <jokey@gentoo.org> files/darkstat-confd,
+ -files/darkstat-confd2, -files/darkstat-confd3, files/darkstat-init,
+ -files/darkstat-init2, -files/darkstat-init3, -files/ipcheck.patch,
+ -darkstat-2.6-r1.ebuild:
+ cleanup
01 Feb 2007; Markus Ullmann <jokey@gentoo.org> -darkstat-3.0.540.ebuild,
darkstat-3.0.540-r1.ebuild:
+++ /dev/null
-# Copyright 1999-2006 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/net-analyzer/darkstat/darkstat-2.6-r1.ebuild,v 1.10 2006/10/31 13:31:00 pva Exp $
-
-inherit eutils
-
-DESCRIPTION="darkstat is a network traffic analyzer"
-HOMEPAGE="http://dmr.ath.cx/net/darkstat/"
-SRC_URI="http://dmr.ath.cx/net/darkstat/${P}.tar.gz"
-
-KEYWORDS="x86 ~ppc ppc-macos ~amd64"
-IUSE="nls"
-LICENSE="GPL-2"
-SLOT="0"
-
-DEPEND="net-libs/libpcap
- nls? ( virtual/libintl )"
-
-src_unpack() {
- unpack ${A}
- cd "${S}"
- epatch "${FILESDIR}"/ipcheck.patch
-}
-
-src_compile() {
- econf $(use_with nls) || die "./configure failed"
- emake || die "compilation failed"
-}
-
-src_install() {
- make DESTDIR="${D}" install || die
-
- keepdir /var/spool/darkstat
-
- dodoc AUTHORS ChangeLog ISSUES README
-
- newinitd "${FILESDIR}"/darkstat-init darkstat
- newconfd "${FILESDIR}"/darkstat-confd darkstat
-}
-
-# Config file for /etc/init.d/darkstat
-# $Header: /var/cvsroot/gentoo-x86/net-analyzer/darkstat/files/darkstat-confd,v 1.2 2004/07/18 03:46:13 dragonheart Exp $
-# Set preferred options here
-DARKSTAT_OPTS="-i ppp0"
+# The interface to listen on
+# Use only with /etc/init.d/darkstat init script. If you use
+# /etc/init.d/darkstat.if init script, then this option should be ignored.
+#INTERFACE="eth0"
+
+# The port for the embedded webserver
+#PORT="667"
+
+# The address embedded webserver should bind to
+#ADDRESS="0.0.0.0"
+
+# Set the filter. See tcpdump documenation for details.
+#FILTER=""
+++ /dev/null
-# /etc/conf.d/darkstat
-# Config file for /etc/init.d/darkstat
-# Copyright 1999-2006 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/net-analyzer/darkstat/files/darkstat-confd2,v 1.1 2006/07/08 02:30:32 vanquirius Exp $
-
-# Set preferred options here
-DARKSTAT_OPTS="-i eth0"
+++ /dev/null
-# The interface to listen on
-# Use only with /etc/init.d/darkstat init script. If you use
-# /etc/init.d/darkstat.if init script, then this option should be ignored.
-#INTERFACE="eth0"
-
-# The port for the embedded webserver
-#PORT="667"
-
-# The address embedded webserver should bind to
-#ADDRESS="0.0.0.0"
-
-# Set the filter. See tcpdump documenation for details.
-#FILTER=""
#!/sbin/runscript
-# Copyright 1999-2004 Gentoo Foundation
+# Copyright 1999-2006 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/net-analyzer/darkstat/files/darkstat-init,v 1.3 2004/08/14 13:39:25 swegener Exp $
+# $Header: /var/cvsroot/gentoo-x86/net-analyzer/darkstat/files/darkstat-init,v 1.4 2007/02/01 21:35:33 jokey Exp $
+
+IF=${SVCNAME##*.}
+
+if [[ -n "${IF}" && ${SVCNAME} != "darkstat" ]] ; then
+ PIDFILE=/var/run/darkstat.${IF}.pid
+else
+ PIDFILE=/var/run/darkstat.pid
+fi
depend() {
need net
}
+chkconfig() {
+ if [[ -n "${IF}" && ${SVCNAME} != "darkstat" ]] ; then
+ if [[ ! -f "/etc/conf.d/darkstat.${IF}" ]]; then
+ eerror "/etc/conf.d/darkstat.${IF} does not exist. Please, create."
+ return 1
+ fi
+ INTERFACE=${IF}
+ else
+ if [[ ! -f "/etc/conf.d/darkstat" ]]; then
+ eerror "/etc/conf.d/darkstat does not exist. Please, create."
+ return 1
+ fi
+ fi
+
+ if [[ -z "${INTERFACE}" ]]; then
+ ewarn "No interface specified. Trying to use eth0."
+ INTERFACE="eth0"
+ fi
+
+ DARKSTAT_OPTS="-i ${INTERFACE}"
+ [[ -n "${PORT}" ]] && DARKSTAT_OPTS="${DARKSTAT_OPTS} -p ${PORT}"
+ [[ -n "${ADDRESS}" ]] && DARKSTAT_OPTS="${DARKSTAT_OPTS} -b ${ADDRESS}"
+ [[ -n "${FILTER}" ]] && DARKSTAT_OPTS="${DARKSTAT_OPTS} -f ${FILTER}"
+ return 0
+}
+
start() {
- ebegin "Starting darkstat"
- start-stop-daemon --start --quiet --exec /usr/sbin/darkstat -- --detach -d /var/spool/darkstat ${DARKSTAT_OPTS} >/dev/null
+ chkconfig || return 1
+ ebegin "Starting darkstat on ${INTERFACE}"
+ # Remove --background option for debugging.
+ start-stop-daemon --start --exec /usr/sbin/darkstat --pidfile ${PIDFILE} --make-pidfile --background -- ${DARKSTAT_OPTS}
eend $?
}
stop() {
- ebegin "Stopping darkstat"
- start-stop-daemon --stop --quiet --retry 5 --exec /usr/sbin/darkstat
+ ebegin "Stopping darkstat on ${INTERFACE}"
+ start-stop-daemon --stop --quiet --retry 5 --pidfile ${PIDFILE}
eend $?
}
+++ /dev/null
-#!/sbin/runscript
-# Copyright 1999-2006 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/net-analyzer/darkstat/files/darkstat-init2,v 1.1 2006/07/08 02:30:32 vanquirius Exp $
-
-depend() {
- need net
-}
-
-start() {
- ebegin "Starting darkstat"
- start-stop-daemon --start --quiet --exec /usr/sbin/darkstat -- -d /var/spool/darkstat ${DARKSTAT_OPTS} >/dev/null
- eend $?
-}
-
-stop() {
- ebegin "Stopping darkstat"
- start-stop-daemon --stop --quiet --retry 5 --exec /usr/sbin/darkstat
- eend $?
-}
+++ /dev/null
-#!/sbin/runscript
-# Copyright 1999-2006 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/net-analyzer/darkstat/files/darkstat-init3,v 1.1 2006/10/31 13:31:00 pva Exp $
-
-IF=${SVCNAME##*.}
-
-if [[ -n "${IF}" && ${SVCNAME} != "darkstat" ]] ; then
- PIDFILE=/var/run/darkstat.${IF}.pid
-else
- PIDFILE=/var/run/darkstat.pid
-fi
-
-depend() {
- need net
-}
-
-chkconfig() {
- if [[ -n "${IF}" && ${SVCNAME} != "darkstat" ]] ; then
- if [[ ! -f "/etc/conf.d/darkstat.${IF}" ]]; then
- eerror "/etc/conf.d/darkstat.${IF} does not exist. Please, create."
- return 1
- fi
- INTERFACE=${IF}
- else
- if [[ ! -f "/etc/conf.d/darkstat" ]]; then
- eerror "/etc/conf.d/darkstat does not exist. Please, create."
- return 1
- fi
- fi
-
- if [[ -z "${INTERFACE}" ]]; then
- ewarn "No interface specified. Trying to use eth0."
- INTERFACE="eth0"
- fi
-
- DARKSTAT_OPTS="-i ${INTERFACE}"
- [[ -n "${PORT}" ]] && DARKSTAT_OPTS="${DARKSTAT_OPTS} -p ${PORT}"
- [[ -n "${ADDRESS}" ]] && DARKSTAT_OPTS="${DARKSTAT_OPTS} -b ${ADDRESS}"
- [[ -n "${FILTER}" ]] && DARKSTAT_OPTS="${DARKSTAT_OPTS} -f ${FILTER}"
- return 0
-}
-
-start() {
- chkconfig || return 1
- ebegin "Starting darkstat on ${INTERFACE}"
- # Remove --background option for debugging.
- start-stop-daemon --start --exec /usr/sbin/darkstat --pidfile ${PIDFILE} --make-pidfile --background -- ${DARKSTAT_OPTS}
- eend $?
-}
-
-stop() {
- ebegin "Stopping darkstat on ${INTERFACE}"
- start-stop-daemon --stop --quiet --retry 5 --pidfile ${PIDFILE}
- eend $?
-}
+++ /dev/null
-MD5 0a1a407acb6f9b35a46d64885c30d08d darkstat-2.6.tar.gz 230950
-RMD160 139d938033ad7e98505e006747f64285136a1f06 darkstat-2.6.tar.gz 230950
-SHA256 de84a7a9ef1f8abdc8eecd3faeb562fd4bf72f6fb605129fa1b1254a4f4573b0 darkstat-2.6.tar.gz 230950
+++ /dev/null
-diff -ur darkstat-2.6/src/acct.c darkstat-2.6-patched/src/acct.c
---- darkstat-2.6/src/acct.c 2003-11-07 09:47:00.000000000 +0100
-+++ darkstat-2.6-patched/src/acct.c 2004-07-16 18:34:19.070212872 +0200
-@@ -20,11 +20,13 @@
- #if defined(sun) && (defined(__svr4__) || defined(__SVR4))
- #include <sys/sockio.h>
- #endif
-+#include <errno.h>
-
- int64 num_packets, total_data;
--dword local_ip = 0, lan_ip = 0xFFFFFFFF, lan_mask = 0;
-+dword local_ip = 0, lan_ip = 0xFFFFFFFF, lan_mask = 0, check_ip = 0;
- int acct_linktype = 0;
--time_t t_start, t_already = 0, t_lastsave = 0;
-+time_t t_start, t_already = 0, t_lastsave = 0, t_lastipcheck = 0;
-+int network_down = 0;
- pcap_t *acct_pcap = NULL;
- host_record *local_host_rec;
-
-@@ -367,22 +369,10 @@
- }
-
-
--
--void acct_main(void *ignored unused)
-+void init_pcap(void)
- {
- char err[PCAP_ERRBUF_SIZE];
-
-- if (!local_ip) local_ip = get_local_ip(acctdev);
-- printf("Sniffing on device %s, local IP is ", acctdev);
-- print_addr(local_ip);
-- putchar('\n');
--
-- init_db();
-- init_graph();
-- load_db(db_file);
--
-- local_host_rec = host_from_ip(local_ip);
--
- err[0] = '\0'; /* zero length string */
- acct_pcap = pcap_open_live(acctdev, 100, promisc, PCAP_TIMEOUT, err);
- if (!acct_pcap)
-@@ -418,7 +408,23 @@
- #endif
- }
-
-+}
-+
-+
-+void acct_main(void *ignored unused)
-+{
-+ if (!local_ip) local_ip = get_local_ip(acctdev);
-+ printf("Sniffing on device %s, local IP is ", acctdev);
-+ print_addr(local_ip);
-+ putchar('\n');
-+
-+ init_db();
-+ init_graph();
-+ load_db(db_file);
-+
-+ local_host_rec = host_from_ip(local_ip);
-
-+ init_pcap();
-
- t_lastsave = t_start = time(NULL);
- acct_linktype = pcap_datalink(acct_pcap);
-@@ -432,13 +438,38 @@
- {
- struct pcap_stat ps;
-
-+ /* check if we still have the same IP from time to time */
-+ if (time(NULL) - t_lastipcheck > IPCHECK_TIME)
-+ {
-+ t_lastipcheck = time(NULL);
-+ check_ip = get_local_ip(acctdev);
-+ if (local_ip != check_ip)
-+ {
-+ printf("New IP ");
-+ print_addr(check_ip);
-+ printf(" detected, old IP was ");
-+ print_addr(local_ip);
-+ putchar('\n');
-+ local_ip = check_ip;
-+ network_down = 0;
-+ init_pcap();
-+ }
-+ }
-+
-+ if (network_down)
-+ continue;
-+
- /* capture some packets for accounting */
- if (pcap_dispatch(acct_pcap, -1,
- (pcap_handler)handle_pkt, NULL) == -1)
- {
- printf("Error: pcap_dispatch(): %s\n",
- pcap_geterr(acct_pcap));
-- FAIL();
-+ if (errno == ENETDOWN) {
-+ network_down = 1;
-+ } else {
-+ FAIL();
-+ }
- }
-
- /* print out cap statistics */
-diff -ur darkstat-2.6/src/darkstat.h darkstat-2.6-patched/src/darkstat.h
---- darkstat-2.6/src/darkstat.h 2003-11-07 09:51:19.000000000 +0100
-+++ darkstat-2.6-patched/src/darkstat.h 2004-07-16 18:35:50.738277208 +0200
-@@ -52,6 +52,7 @@
- #define EXIT_SUCCESS 0
- #define EXIT_FAIL 1
- #define SAVE_TIME 60*5 /* secs inbetween DB dumps */
-+#define IPCHECK_TIME 60 /* seconds between local ip checks */
- #define MSEC 1000 /* for usleep() */
- #define SOCKET int /* WinSock? err... */
-
# ChangeLog for net-analyzer/driftnet
-# Copyright 2002-2006 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/net-analyzer/driftnet/ChangeLog,v 1.28 2006/11/08 16:57:03 gustavoz Exp $
+# Copyright 2002-2007 Gentoo Foundation; Distributed under the GPL v2
+# $Header: /var/cvsroot/gentoo-x86/net-analyzer/driftnet/ChangeLog,v 1.29 2007/02/01 21:39:00 jokey Exp $
+
+ 01 Feb 2007; Markus Ullmann <jokey@gentoo.org>
+ -files/driftnet-0.1.6-tmpnam-is-bad.diff, -driftnet-0.1.6.ebuild,
+ driftnet-0.1.6-r3.ebuild:
+ cleanup
08 Nov 2006; Gustavo Zacarias <gustavoz@gentoo.org> driftnet-0.1.6.ebuild,
driftnet-0.1.6-r3.ebuild:
-# Copyright 1999-2006 Gentoo Foundation
+# Copyright 1999-2007 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/net-analyzer/driftnet/driftnet-0.1.6-r3.ebuild,v 1.5 2006/11/08 16:57:03 gustavoz Exp $
+# $Header: /var/cvsroot/gentoo-x86/net-analyzer/driftnet/driftnet-0.1.6-r3.ebuild,v 1.6 2007/02/01 21:39:00 jokey Exp $
inherit eutils flag-o-matic
DEPEND="${RDEPEND}
|| (
- ( >=x11-misc/makedepend-1.0.0 )
- virtual/x11
+ >=x11-misc/makedepend-1.0.0
+ virtual/x11
)
dev-util/pkgconfig"
+++ /dev/null
-# Copyright 1999-2006 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/net-analyzer/driftnet/driftnet-0.1.6.ebuild,v 1.22 2006/11/08 16:57:03 gustavoz Exp $
-
-inherit eutils flag-o-matic
-
-DESCRIPTION="A program which listens to network traffic and picks out images from TCP streams it observes"
-HOMEPAGE="http://www.ex-parrot.com/~chris/driftnet/"
-SRC_URI="http://www.ex-parrot.com/~chris/${PN}/${P}.tar.gz"
-
-LICENSE="GPL-2"
-KEYWORDS="~amd64 ppc -sparc x86"
-SLOT="0"
-IUSE="gtk"
-
-DEPEND="media-libs/jpeg
- media-libs/giflib
- net-libs/libpcap
- gtk? ( <x11-libs/gtk+-1.3.0 )
- || ( x11-misc/makedepend virtual/x11 )"
-
-# Note: x11 is necessary because of makedepend
-
-RDEPEND="${DEPEND}
- virtual/mpg123"
-
-DEPEND="${DEPEND}
- dev-util/pkgconfig"
-
-src_unpack() {
- unpack ${A}
- cd ${S}
-
- # use giflib - bug 85720
- sed -i 's/-lungif/-lgif/' Makefile || die "sed giflib failed"
- # don't use gtk+ by default
- sed -i 's:^\(.*gtk-config.*\)$:#\1:g' Makefile || die "sed disable gtk failed"
-
- epatch ${FILESDIR}/${P}-tmpnam-is-bad.diff
-}
-
-src_compile() {
- append-ldflags $(bindnow-flags)
-
- if use gtk; then
- sed -i 's:^#\(.*gtk-config.*\)$:\1:g' Makefile || die "sed enable gtk failed"
- emake || die "gtk+ build failed"
- mv driftnet driftnet-gtk
- make clean || die
- else
- append-flags -DNO_DISPLAY_WINDOW
- fi
-
- emake || die "emake failed"
-}
-
-src_install () {
- dobin driftnet || die "dobin failed"
- doman driftnet.1 || die "doman failed"
-
- use gtk && { dobin driftnet-gtk || die "dobin failed (gtk)" ; }
-
- dodoc CHANGES CREDITS README TODO || die "dodoc failed"
-
- einfo "marking the no-display driftnet as setuid root."
- chown root:wheel "${D}/usr/bin/driftnet"
- chmod 750 "${D}/usr/bin/driftnet"
- chmod u+s "${D}/usr/bin/driftnet"
-}
+++ /dev/null
-MD5 8e11d77770452f97bb3c23f510489815 driftnet-0.1.6.tar.gz 36989
-RMD160 01057f3cb992faa537a8b188e116c6f21016cfac driftnet-0.1.6.tar.gz 36989
-SHA256 dbdf7ead3ae14b109f88c86dedeb7524be8c257aa773a781891216f013373d6d driftnet-0.1.6.tar.gz 36989
+++ /dev/null
-diff --exclude='*~' -urN driftnet-0.1.6.orig/display.c driftnet-0.1.6/display.c
---- driftnet-0.1.6.orig/display.c 2005-03-18 07:55:41.000000000 -0500
-+++ driftnet-0.1.6/display.c 2005-03-18 09:03:59.000000000 -0500
-@@ -20,6 +20,7 @@
- #include <fcntl.h>
- #include <string.h>
- #include <errno.h>
-+#include <time.h>
-
- #include <sys/stat.h>
-
-@@ -297,7 +298,7 @@
- gboolean pipe_event(GIOChannel chan, GIOCondition cond, gpointer data) {
- static char *path;
- char name[TMPNAMELEN];
-- ssize_t rr;
-+ ssize_t rr = 0;
- int nimgs = 0;
-
- if (!path)
-diff --exclude='*~' -urN driftnet-0.1.6.orig/driftnet.c driftnet-0.1.6/driftnet.c
---- driftnet-0.1.6.orig/driftnet.c 2005-03-18 07:55:41.000000000 -0500
-+++ driftnet-0.1.6/driftnet.c 2005-03-18 09:07:43.000000000 -0500
-@@ -50,6 +50,7 @@
- int verbose, adjunct;
- int tmpdir_specified;
- char *tmpdir;
-+char tmpdir_template[] = "driftnet-XXXXXX";
- int max_tmpfiles;
-
- enum mediatype extract_type = m_image;
-@@ -474,6 +475,8 @@
- int mpeg_player_specified = 0;
- pthread_t packetth;
-
-+ tmpdir = NULL;
-+
- /* Handle command-line options. */
- opterr = 0;
- while ((c = getopt(argc, argv, optstring)) != -1) {
-@@ -584,12 +587,10 @@
- }
- } else {
- /* need to make a temporary directory. */
-- for (;;) {
-- tmpdir = strdup(tmpnam(NULL));
-- if (mkdir(tmpdir, 0700) == 0)
-- break;
-- free(tmpdir);
-- }
-+ if (!(tmpdir = mkdtemp(tmpdir_template))) {
-+ fprintf(stderr, PROGNAME": mkdtemp: %s\n", strerror(errno));
-+ return -1;
-+ }
- }
-
- if (verbose)
-diff --exclude='*~' -urN driftnet-0.1.6.orig/playaudio.c driftnet-0.1.6/playaudio.c
---- driftnet-0.1.6.orig/playaudio.c 2005-03-18 07:55:41.000000000 -0500
-+++ driftnet-0.1.6/playaudio.c 2005-03-18 09:03:59.000000000 -0500
-@@ -167,7 +167,7 @@
- static void mpeg_player_manager(void) {
- extern sig_atomic_t foad; /* in driftnet.c */
- struct sigaction sa = {0};
-- pid_t mpeg_pid;
-+ pid_t mpeg_pid = -1;
-
- sa.sa_handler = SIG_DFL;
- sigaction(SIGCHLD, &sa, NULL);