From 557179b1eecabc3731707d7ce1487026ba132cde Mon Sep 17 00:00:00 2001
From: Ollivier Robert <roberto@FreeBSD.org>
Date: Fri, 12 Jul 2002 13:33:21 +0000
Subject: cdpr (Cisco Discovery Protocol Reporter) shows the switch and port
 that a machine is connected to, provided that the device supports CDP. It can
 also optionally decode the full CDP packet. cdpr was written to help
 network/system administrators find out about the equipment that i a machine
 is connected to. This is done by capturing and decoding a Cisco Discovery
 Protocol (CDP) packet.

PR:		ports/40435
Submitted by:	Michael L. Hostbaek <mich@freebsdcluster.org>
---
 net-mgmt/cdpr/Makefile       | 32 ++++++++++++++++++++++++++++++++
 net-mgmt/cdpr/distinfo       |  1 +
 net-mgmt/cdpr/files/patch-aa | 14 ++++++++++++++
 net-mgmt/cdpr/files/patch-ab | 11 +++++++++++
 net-mgmt/cdpr/pkg-comment    |  1 +
 net-mgmt/cdpr/pkg-descr      |  9 +++++++++
 net-mgmt/cdpr/pkg-plist      |  3 +++
 7 files changed, 71 insertions(+)
 create mode 100644 net-mgmt/cdpr/Makefile
 create mode 100644 net-mgmt/cdpr/distinfo
 create mode 100644 net-mgmt/cdpr/files/patch-aa
 create mode 100644 net-mgmt/cdpr/files/patch-ab
 create mode 100644 net-mgmt/cdpr/pkg-comment
 create mode 100644 net-mgmt/cdpr/pkg-descr
 create mode 100644 net-mgmt/cdpr/pkg-plist

(limited to 'net-mgmt')

diff --git a/net-mgmt/cdpr/Makefile b/net-mgmt/cdpr/Makefile
new file mode 100644
index 000000000000..d05c5d822805
--- /dev/null
+++ b/net-mgmt/cdpr/Makefile
@@ -0,0 +1,32 @@
+# ex:ts=8
+# Ports collection makefile for:  cdpr
+# Date created:                          Tue Jul 08, 2002
+# Whom:                                  Michael L. Hostbaek (mich@freebsdcluster.org)
+#
+# $FreeBSD$
+#
+
+PORTNAME=	cdpr
+PORTVERSION=	1.0.2
+CATEGORIES=	net
+MASTER_SITES=	http://www.monkeymental.com/mmfiles/ \
+		${MASTER_SITE_LOCAL}
+MASTER_SITE_SUBDIR=	${PORTNAME}
+EXTRACT_SUFX=	.tgz
+
+MAINTAINER=	mich@freebsdcluster.org
+
+USE_GCC=	yes
+ALL_TARGET=	cdpr
+
+DOCSDIR?=       ${PREFIX}/share/doc/${PKGNAMEPREFIX}${PORTNAME}
+
+do-install:
+	${INSTALL_PROGRAM} ${WRKSRC}/${PORTNAME} ${PREFIX}/bin/${PORTNAME}
+
+.if !defined(NOPORTDOCS)
+	${MKDIR} ${DOCSDIR}
+	${INSTALL_DATA} ${WRKSRC}/README ${DOCSDIR}/README
+.endif
+
+.include <bsd.port.mk>
diff --git a/net-mgmt/cdpr/distinfo b/net-mgmt/cdpr/distinfo
new file mode 100644
index 000000000000..3ae6341f2406
--- /dev/null
+++ b/net-mgmt/cdpr/distinfo
@@ -0,0 +1 @@
+MD5 (cdpr-1.0.2.tgz) = 1e863e357add0ea4fc5e28f8d151401a
diff --git a/net-mgmt/cdpr/files/patch-aa b/net-mgmt/cdpr/files/patch-aa
new file mode 100644
index 000000000000..b8a15ef9e223
--- /dev/null
+++ b/net-mgmt/cdpr/files/patch-aa
@@ -0,0 +1,14 @@
+--- cdpr.c.orig	Tue Jul  2 09:18:44 2002
++++ cdpr.c	Wed Jul  3 13:07:38 2002
+@@ -452,7 +452,10 @@
+ 
+ 	/* Get the next packet that comes in, we only need one */
+ 	printf("Waiting for CDP advertisement, default config is to transmit CDP packets every 60 seconds\n");
+-	packet = pcap_next(handle, &header);
++	do
++	{
++		packet = pcap_next(handle, &header);
++	} while (!packet);
+ 
+ 	/* Print its length */
+ 	if(verbose > 0)
diff --git a/net-mgmt/cdpr/files/patch-ab b/net-mgmt/cdpr/files/patch-ab
new file mode 100644
index 000000000000..02091fff0929
--- /dev/null
+++ b/net-mgmt/cdpr/files/patch-ab
@@ -0,0 +1,11 @@
+--- cdpr.c.orig	2002-07-09 21:13:43.000000000 -0700
++++ cdpr.c	2002-07-09 21:12:33.000000000 -0700
+@@ -437,7 +437,7 @@
+ 	pcap_lookupnet(dev, &net, &mask, errbuf);
+ 
+ 	/* Open the pcap device */
+-	if((handle = pcap_open_live(dev, BUFSIZ, 1, 0, errbuf)) == NULL)
++	if((handle = pcap_open_live(dev, BUFSIZ, 1, 1, errbuf)) == NULL)
+ 	{
+ 		printf("Error opening device (%s)\n", errbuf);
+ 		exit(1);
diff --git a/net-mgmt/cdpr/pkg-comment b/net-mgmt/cdpr/pkg-comment
new file mode 100644
index 000000000000..6a1ba91d8881
--- /dev/null
+++ b/net-mgmt/cdpr/pkg-comment
@@ -0,0 +1 @@
+Cisco Discovery Protocol Reporter
diff --git a/net-mgmt/cdpr/pkg-descr b/net-mgmt/cdpr/pkg-descr
new file mode 100644
index 000000000000..ce827dc3c673
--- /dev/null
+++ b/net-mgmt/cdpr/pkg-descr
@@ -0,0 +1,9 @@
+cdpr (Cisco Discovery Protocol Reporter) shows the switch and port that 
+a machine is connected to, provided that the device supports CDP. It 
+can also optionally decode the full CDP packet. cdpr was written to 
+help network/system administrators find out about the equipment that i
+a machine is connected to. This is done by capturing and decoding a 
+Cisco Discovery Protocol (CDP) packet.
+
+	- Michael L. Hostbaek
+	mich@freebsdcluster.org
diff --git a/net-mgmt/cdpr/pkg-plist b/net-mgmt/cdpr/pkg-plist
new file mode 100644
index 000000000000..fb3967614e3f
--- /dev/null
+++ b/net-mgmt/cdpr/pkg-plist
@@ -0,0 +1,3 @@
+bin/cdpr
+share/doc/cdpr/README
+@dirrm share/doc/cdpr
-- 
cgit debian/1.2.3+git2.25.1-1-2-gaceb0