summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeroen Roovers <jer@gentoo.org>2009-05-26 00:00:55 +0000
committerJeroen Roovers <jer@gentoo.org>2009-05-26 00:00:55 +0000
commitec73b1d126abae38c5e1d3d20f117fcf6751fd22 (patch)
tree607f32225338095cb6ae1d069890defd75aa4f74 /net-analyzer/dhcp_probe
parentLinux patch 2.6.29.4. Alpha/PCI patch to make PCI resources available (diff)
downloadgentoo-2-ec73b1d126abae38c5e1d3d20f117fcf6751fd22.tar.gz
gentoo-2-ec73b1d126abae38c5e1d3d20f117fcf6751fd22.tar.bz2
gentoo-2-ec73b1d126abae38c5e1d3d20f117fcf6751fd22.zip
Initial commit.
(Portage version: 2.2_rc33/cvs/Linux i686)
Diffstat (limited to 'net-analyzer/dhcp_probe')
-rw-r--r--net-analyzer/dhcp_probe/ChangeLog11
-rw-r--r--net-analyzer/dhcp_probe/dhcp_probe-1.3.0.ebuild42
-rw-r--r--net-analyzer/dhcp_probe/files/dhcp_probe.confd6
-rw-r--r--net-analyzer/dhcp_probe/files/dhcp_probe.initd48
-rw-r--r--net-analyzer/dhcp_probe/files/dhcp_probe_mail23
-rw-r--r--net-analyzer/dhcp_probe/metadata.xml13
6 files changed, 143 insertions, 0 deletions
diff --git a/net-analyzer/dhcp_probe/ChangeLog b/net-analyzer/dhcp_probe/ChangeLog
new file mode 100644
index 000000000000..b69dd1b57bc4
--- /dev/null
+++ b/net-analyzer/dhcp_probe/ChangeLog
@@ -0,0 +1,11 @@
+# ChangeLog for net-analyzer/dhcp_probe
+# Copyright 1999-2009 Gentoo Foundation; Distributed under the GPL v2
+# $Header: /var/cvsroot/gentoo-x86/net-analyzer/dhcp_probe/ChangeLog,v 1.1 2009/05/26 00:00:55 jer Exp $
+
+*dhcp_probe-1.3.0 (25 May 2009)
+
+ 25 May 2009; Jeroen Roovers <jer@gentoo.org> +dhcp_probe-1.3.0.ebuild,
+ +files/dhcp_probe.confd, +files/dhcp_probe.initd, +files/dhcp_probe_mail,
+ +metadata.xml:
+ Initial commit.
+
diff --git a/net-analyzer/dhcp_probe/dhcp_probe-1.3.0.ebuild b/net-analyzer/dhcp_probe/dhcp_probe-1.3.0.ebuild
new file mode 100644
index 000000000000..ec1ebd785de0
--- /dev/null
+++ b/net-analyzer/dhcp_probe/dhcp_probe-1.3.0.ebuild
@@ -0,0 +1,42 @@
+# Copyright 1999-2009 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/net-analyzer/dhcp_probe/dhcp_probe-1.3.0.ebuild,v 1.1 2009/05/26 00:00:55 jer Exp $
+
+EAPI="2"
+
+DESCRIPTION="dchp_probe attempts to discover DHCP and BootP servers on a directly-attached Ethernet network"
+HOMEPAGE="http://www.net.princeton.edu/software/dhcp_probe/"
+SRC_URI="http://www.net.princeton.edu/software/${PN}/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~x86"
+IUSE=""
+
+DEPEND="
+ net-libs/libpcap
+ >=net-libs/libnet-1.1.2.1-r2
+ "
+RDEPEND="${DEPEND}"
+
+src_configure() {
+ STRIP=true econf || die "econf failed"
+}
+
+src_install() {
+ newinitd "${FILESDIR}/${PN}.initd" ${PN}
+ newconfd "${FILESDIR}/${PN}.confd" ${PN}
+ dobin src/dhcp_probe "${FILESDIR}"/dhcp_probe_mail || die "dobin failed"
+ dodoc \
+ extras/dhcp_probe.cf.sample \
+ NEWS \
+ README \
+ ChangeLog \
+ AUTHORS \
+ TODO \
+ || die "dodoc failed"
+ doman \
+ doc/dhcp_probe.8 \
+ doc/dhcp_probe.cf.5 \
+ || die "doman failed"
+}
diff --git a/net-analyzer/dhcp_probe/files/dhcp_probe.confd b/net-analyzer/dhcp_probe/files/dhcp_probe.confd
new file mode 100644
index 000000000000..61e4582cade9
--- /dev/null
+++ b/net-analyzer/dhcp_probe/files/dhcp_probe.confd
@@ -0,0 +1,6 @@
+# Config file for /etc/init.d/dhcp_probe
+
+# For more information, see dhcp_probe(8).
+
+DHCP_PROBE_OPTIONS="-d 1"
+
diff --git a/net-analyzer/dhcp_probe/files/dhcp_probe.initd b/net-analyzer/dhcp_probe/files/dhcp_probe.initd
new file mode 100644
index 000000000000..4f13e5ba9d96
--- /dev/null
+++ b/net-analyzer/dhcp_probe/files/dhcp_probe.initd
@@ -0,0 +1,48 @@
+#!/sbin/runscript
+# Copyright 1999-2009 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/net-analyzer/dhcp_probe/files/dhcp_probe.initd,v 1.1 2009/05/26 00:00:55 jer Exp $
+
+opts="reload"
+
+DHCP_PROBE_BINARY="/usr/bin/dhcp_probe"
+DHCP_PROBE_CONFIG="/etc/dhcp_probe.cf"
+DHCP_PROBE_PIDFILE="/var/run/${SVCNAME}.pid"
+DHCP_PROBE_INTERFACE="${SVCNAME#*.}"
+
+depend() {
+ use logger
+ need net
+}
+
+checkconfig() {
+ if [ ! -e ${DHCP_PROBE_CONFIG} ]; then
+ eerror "You need an ${DHCP_PROBE_CONFIG} to run dhcp_probe."
+ eerror "A sample file is available in /usr/share/doc/dhcp_probe*"
+ return 1
+ elif [ ${SVCNAME} = dhcp_probe ]; then
+ eerror "Do not run this script directly! Instead, create symbolic links like so:"
+ eerror " # cd /etc/init.d"
+ eerror " # ln -s dhcp_probe dhcp_probe.[INTERFACE_NAME]"
+ eerror "for each interface that should be monitored"
+ return 1
+ fi
+}
+
+start() {
+ checkconfig
+ ebegin "Starting ${SVCNAME}"
+ ${DHCP_PROBE_BINARY} ${DHCP_PROBE_OPTIONS} -p ${DHCP_PROBE_PIDFILE} ${DHCP_PROBE_INTERFACE}
+ eend ${?}
+}
+
+stop() {
+ if [ "${RC_CMD}" = "restart" ] ; then
+ checkconfig || return 1
+ fi
+ ebegin "Stopping ${SVCNAME}"
+ start-stop-daemon --stop --signal 9 \
+ --pidfile ${DHCP_PROBE_PIDFILE}
+ eend ${?}
+}
+
diff --git a/net-analyzer/dhcp_probe/files/dhcp_probe_mail b/net-analyzer/dhcp_probe/files/dhcp_probe_mail
new file mode 100644
index 000000000000..58b07766bbb3
--- /dev/null
+++ b/net-analyzer/dhcp_probe/files/dhcp_probe_mail
@@ -0,0 +1,23 @@
+#!/bin/bash
+# Old style alert program:
+#
+# Syntax:
+# alert_program_name /absolute/path/name
+#
+# The program specified via 'alert_program_name' will be called as follows:
+# /absolute/path/name name_of_calling_program name_of_interface_on_which_the
+#_response_was_received IP_source_of_the_response ether_src_of_the_response
+
+DHCP_PROBE_DOMAIN=$(dnsdomainname)
+
+sendmail root <<EOF
+From: root@${DHCP_PROBE_DOMAIN}
+Subject: $1 ALERT - $3 is acting as a DHCP server
+
+Called program: $0
+Calling program: $1
+Interface on which response was received: $2
+IP source of the response: $3
+Ethernet source of the response: $4
+
+EOF
diff --git a/net-analyzer/dhcp_probe/metadata.xml b/net-analyzer/dhcp_probe/metadata.xml
new file mode 100644
index 000000000000..bfc69c95fdfb
--- /dev/null
+++ b/net-analyzer/dhcp_probe/metadata.xml
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>netmon</herd>
+ <maintainer>
+ <email>jer@gentoo.org</email>
+ <name>Jeroen Roovers</name>
+ </maintainer>
+ <longdescription>
+ dchp_probe attempts to discover DHCP and BootP servers on a
+ directly-attached Ethernet network
+ </longdescription>
+</pkgmetadata>