summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFerry Meyndert <m0rpheus@gentoo.org>2002-02-21 19:43:38 +0000
committerFerry Meyndert <m0rpheus@gentoo.org>2002-02-21 19:43:38 +0000
commitb3e3219db3aa297e5d0c18da758d0e5f874f59f4 (patch)
tree36250560bce96fa2c580c286d5102da5d83b432e /net-analyzer/p0f
parentscrollkeeper update (diff)
downloadhistorical-b3e3219db3aa297e5d0c18da758d0e5f874f59f4.tar.gz
historical-b3e3219db3aa297e5d0c18da758d0e5f874f59f4.tar.bz2
historical-b3e3219db3aa297e5d0c18da758d0e5f874f59f4.zip
added ebuild for p0f
Diffstat (limited to 'net-analyzer/p0f')
-rw-r--r--net-analyzer/p0f/ChangeLog10
-rw-r--r--net-analyzer/p0f/files/digest-p0f-1.8.21
-rw-r--r--net-analyzer/p0f/files/p0f-1.8.2-makefile.patch12
-rw-r--r--net-analyzer/p0f/files/p0f-1.8.2.init46
-rw-r--r--net-analyzer/p0f/p0f-1.8.2.ebuild29
5 files changed, 98 insertions, 0 deletions
diff --git a/net-analyzer/p0f/ChangeLog b/net-analyzer/p0f/ChangeLog
new file mode 100644
index 000000000000..020c2718d2c4
--- /dev/null
+++ b/net-analyzer/p0f/ChangeLog
@@ -0,0 +1,10 @@
+# ChangeLog for net-analyzer/geotrace
+# Copyright 2002 Gentoo Technologies, Inc.; Distributed under the GPL
+
+*p0f-1.8.2 (21 Feb 2002)
+
+ 21 Feb 2002; F.Meyndert <m0rpheus@gentoo.org> p0f-1.8.2.ebuild
+ Added ebuild for p0f, p0f performs passive OS detection based
+ on SYN packets.
+
+
diff --git a/net-analyzer/p0f/files/digest-p0f-1.8.2 b/net-analyzer/p0f/files/digest-p0f-1.8.2
new file mode 100644
index 000000000000..4f8cdc1bf001
--- /dev/null
+++ b/net-analyzer/p0f/files/digest-p0f-1.8.2
@@ -0,0 +1 @@
+MD5 fdc811dda8e0d261a5564d1f3ad5c24c p0f-1.8.2.tgz 23969
diff --git a/net-analyzer/p0f/files/p0f-1.8.2-makefile.patch b/net-analyzer/p0f/files/p0f-1.8.2-makefile.patch
new file mode 100644
index 000000000000..5f322360a5da
--- /dev/null
+++ b/net-analyzer/p0f/files/p0f-1.8.2-makefile.patch
@@ -0,0 +1,12 @@
+--- Makefil 2002-02-14 21:47:28.000000000 +0200
++++ Makefile 2002-02-14 21:49:57.000000000 +0200
+@@ -17,8 +17,7 @@
+ all: $(FILE) strip
+
+ $(FILE): p0f.c
+- $(CC) $(CFLAGS) -DVER=\"$(VERSION)\" -o $@ p0f.c $(CLIBS) \
+- `uname|egrep -i 'sunos|solar' >/dev/null && echo "$(SUNLIBS)"`
++ $(CC) $(CFLAGS) -DVER=\"$(VERSION)\" -o $@ p0f.c $(CLIBS)
+
+ strip:
+ strip $(FILE) || true
diff --git a/net-analyzer/p0f/files/p0f-1.8.2.init b/net-analyzer/p0f/files/p0f-1.8.2.init
new file mode 100644
index 000000000000..8c3c670c1ec6
--- /dev/null
+++ b/net-analyzer/p0f/files/p0f-1.8.2.init
@@ -0,0 +1,46 @@
+#!/sbin/runscript
+# Based upon a script copyrighted under LGPL
+# Modified by Ilian Zarov <coder@descom.com>
+# description: p0f - the p0f monitoring program.
+# processname: p0f
+# pidfile: /var/run/p0f.pid
+
+PATH=/usr/bin:/sbin:/bin:/usr/sbin
+export PATH
+export P0FLOGFILE=/var/log/p0f
+
+# Source function library.
+source /etc/init.d/functions.sh
+
+start() {
+ ebegin "Starting p0f"
+ # The 'tcp and tcp[13] & 2 = 2' requires at least syn set.
+ # An alternative would be 'tcp and tcp[13] & 0x3f = 2', which
+ # is syn and no other major flags (but ECN enabled packets are OK)
+ if [ -z "$BpfFilter" ]; then
+ BpfFilter='tcp and tcp[13] & 2 = 2'
+ else
+ BpfFilter="$BpfFilter and tcp and tcp[13] & 2 = 2"
+ fi
+
+ # The command in backticks returns all the local IP addresses on this machine.
+ for OneIP in `/sbin/ifconfig 2>/dev/null | grep 'inet addr' | sed -e 's/.*addr://' -e 's/ .*//'` ; do
+ BpfFilter="$BpfFilter and not src host $OneIP"
+ done
+
+ # Create a lock file.
+ mkdir -p /var/lock/subsys
+ touch /var/lock/subsys/p0f
+
+ # Start up p0f and filter out all packets originating from any of this machines IP's.
+ einfo "Logfile: ${P0FLOGFILE}"
+ start-stop-daemon --start --quiet --exec /usr/sbin/p0f -- -v "$BpfFilter" >>"$P0FLOGFILE" 2>&1 &
+ eend ${?}
+}
+
+stop() {
+ ebegin "Stopping p0f"
+ start-stop-daemon --stop --quiet --exec /usr/sbin/p0f
+ rm -f /var/lock/subsys/p0f
+ eend ${?}
+} \ No newline at end of file
diff --git a/net-analyzer/p0f/p0f-1.8.2.ebuild b/net-analyzer/p0f/p0f-1.8.2.ebuild
new file mode 100644
index 000000000000..b4e00e6c9460
--- /dev/null
+++ b/net-analyzer/p0f/p0f-1.8.2.ebuild
@@ -0,0 +1,29 @@
+# Copyright 1999-2002 Gentoo Technologies, Inc.
+# Distributed under the terms of the GNU General Public License, v2
+# Author: Ilian Zarov <coder@descom.com>
+# Maintainer: Ilian Zarov <coder@descom.com>
+
+S=${WORKDIR}/${P}
+DESCRIPTION="p0f performs passive OS detection based on SYN packets."
+SRC_URI="http://www.stearns.org/p0f/p0f-1.8.2.tgz"
+DEPEND="net-libs/libpcap"
+
+src_compile() {
+ patch < ${FILESDIR}/${P}-makefile.patch
+ cp ${FILESDIR}/${P}.init p0f.init
+ make || die
+}
+
+src_install () {
+ mkdir -p ${D}/usr/bin
+ mkdir -p ${D}/usr/sbin
+ mkdir -p ${D}/usr/share/doc
+ mkdir -p ${D}/usr/share/man/man1
+ mkdir -p ${D}/etc/init.d
+ make DESTDIR=${D} install
+}
+
+pkg_postinst () {
+ einfo "You can start the p0f monitoring program on boot time by running"
+ einfo "rc-update add p0f default"
+}