ports/64728: New port: net-mgmt/sdig Find which switch/router port a given host is on
Russell Jackson
rjackson at cserv62.csub.edu
Thu Mar 25 21:10:15 UTC 2004
>Number: 64728
>Category: ports
>Synopsis: New port: net-mgmt/sdig Find which switch/router port a given host is on
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: freebsd-ports-bugs
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: change-request
>Submitter-Id: current-users
>Arrival-Date: Thu Mar 25 13:10:14 PST 2004
>Closed-Date:
>Last-Modified:
>Originator: Russell Jackson
>Release: FreeBSD 4.9-STABLE i386
>Organization:
>Environment:
System: FreeBSD cserv62.csub.edu 4.9-STABLE FreeBSD 4.9-STABLE #0: Mon Dec 15 16:35:36 PST 2003 rjackson at cserv62.csub.edu:/usr/obj/usr/src/sys/CSERV62 i386
>Description:
Find which switch/router port a given host is on
>How-To-Repeat:
>Fix:
# This is a shell archive. Save it in a file, remove anything before
# this line, and then unpack it by entering "sh file". Note, it may
# create directories; files and directories will be owned by you and
# have default permissions.
#
# This archive contains:
#
# sdig
# sdig/Makefile
# sdig/pkg-plist
# sdig/distinfo
# sdig/files
# sdig/files/patch-snmpget.c
# sdig/files/patch-Makefile
# sdig/files/patch-sdig.c
# sdig/pkg-descr
#
echo c - sdig
mkdir -p sdig > /dev/null 2>&1
echo x - sdig/Makefile
sed 's/^X//' >sdig/Makefile << 'END-of-sdig/Makefile'
X# New ports collection makefile for: sdig
X# Date created: 25 May 2004
X# Whom: Russell A. Jackson <rjackson at cserv62.csub.edu>
X#
X# $FreeBSD$
X#
X
XPORTNAME= sdig
XPORTVERSION= 0.30
XCATEGORIES= net-mgmt
XMASTER_SITES= http://www.exploits.org/sdig/
X
XMAINTAINER= rjackson at cserv62.csub.edu
XCOMMENT= Find which switch/router port a given host is on
X
XLIB_DEPENDS= netsnmp.6:${PORTSDIR}/net-mgmt/net-snmp:install
X
XMAN8= sdig.8
X
X.include <bsd.port.mk>
END-of-sdig/Makefile
echo x - sdig/pkg-plist
sed 's/^X//' >sdig/pkg-plist << 'END-of-sdig/pkg-plist'
Xbin/sdig
Xbin/nbname
Xbin/swc
Xetc/sdig.conf-sample
END-of-sdig/pkg-plist
echo x - sdig/distinfo
sed 's/^X//' >sdig/distinfo << 'END-of-sdig/distinfo'
XMD5 (sdig-0.30.tar.gz) = 4424502de8ee2ac8ee6d599e0f16e3b2
XSIZE (sdig-0.30.tar.gz) = 25301
END-of-sdig/distinfo
echo c - sdig/files
mkdir -p sdig/files > /dev/null 2>&1
echo x - sdig/files/patch-snmpget.c
sed 's/^X//' >sdig/files/patch-snmpget.c << 'END-of-sdig/files/patch-snmpget.c'
X--- snmpget.c.orig Thu Mar 25 10:35:19 2004
X+++ snmpget.c Thu Mar 25 11:12:40 2004
X@@ -27,9 +27,9 @@
X #include <stdarg.h>
X #include <string.h>
X
X-#include <ucd-snmp/ucd-snmp-config.h>
X-#include <ucd-snmp/ucd-snmp-includes.h>
X-#include <ucd-snmp/system.h>
X+#include <net-snmp/net-snmp-config.h>
X+#include <net-snmp/net-snmp-includes.h>
X+#include <net-snmp/system/freebsd4.h>
X
X #include "common.h"
END-of-sdig/files/patch-snmpget.c
echo x - sdig/files/patch-Makefile
sed 's/^X//' >sdig/files/patch-Makefile << 'END-of-sdig/files/patch-Makefile'
X--- Makefile.orig Thu Mar 25 10:42:04 2004
X+++ Makefile Thu Mar 25 12:45:08 2004
X@@ -1,21 +1,23 @@
X # sdig/Makefile: non-autoconf hack, for now
X #
X
X-CC = gcc
X-CFLAGS = -O2 -Wall # -g -static
X+CC ?= gcc
X+CFLAGS += -Wall -I/usr/local/include# -g -static
X+
X PROGS = sdig nbname swc
X
X # change this to whatever it takes to make these things link on your system
X
X-UCDSNMP_CFLAGS = -lsnmp
X-OPENSSL_CFLAGS = -L/usr/local/ssl/lib -lcrypto
X+UCDSNMP_LDFLAGS= -L/usr/local/lib -lnetsnmp
X+OPENSSL_LDFLAGS= -L/usr/local/ssl/lib -lcrypto
X
X all: $(PROGS)
X
X-sdig: sdig.c common.o snmpget.o
X- $(CC) $(CFLAGS) -o sdig sdig.c common.o snmpget.o $(UCDSNMP_CFLAGS) $(OPENSSL_CFLAGS)
X+sdig: sdig.o common.o snmpget.o
X+ $(CC) $(CFLAGS) -o sdig sdig.o common.o snmpget.o $(UCDSNMP_LDFLAGS) $(OPENSSL_LDFLAGS)
X
X-swc: swc.c common.o
X+swc: swc.o common.o
X+ $(CC) $(CFLAGS) -o swc swc.o common.o
X
X clean:
X rm -f $(PROGS) *.o
X@@ -23,9 +25,6 @@
X install: all
X cp sdig /usr/local/bin
X cp nbname /usr/local/bin
X- @if ( test -f /etc/sdig.conf ) \
X- then \
X- echo Not replacing existing file: /etc/sdig.conf; \
X- else \
X- cp sdig.conf /etc; \
X- fi
X+ cp swc /usr/local/bin
X+ cp sdig.8 /usr/local/man/man8
X+ cp sdig.conf /usr/local/etc/sdig.conf-sample
END-of-sdig/files/patch-Makefile
echo x - sdig/files/patch-sdig.c
sed 's/^X//' >sdig/files/patch-sdig.c << 'END-of-sdig/files/patch-sdig.c'
X--- sdig.c.orig Thu Mar 25 11:31:51 2004
X+++ sdig.c Thu Mar 25 11:32:04 2004
X@@ -34,7 +34,7 @@
X #include "snmpget.h"
X #include "version.h"
X
X-#define CONFIGFILE "/etc/sdig.conf"
X+#define CONFIGFILE "/usr/local/etc/sdig.conf"
X
X stype *firstsw = NULL;
X rtype *firstrt = NULL;
END-of-sdig/files/patch-sdig.c
echo x - sdig/pkg-descr
sed 's/^X//' >sdig/pkg-descr << 'END-of-sdig/pkg-descr'
XThis program is designed to track down computers to the finest level of
Xinformation available at the moment. Sometimes this can mean an exact
Xdescription of a port in a building anywhere in an enterprise. Other
Xtimes this may just be a vague notion of a faraway network. The results
Xare only as good as the data you feed to it.
X
XWWW: http://www.exploits.org/sdig
X
X- Russell A. Jackson
Xrjackson at cserv62.csub.edu
END-of-sdig/pkg-descr
exit
>Release-Note:
>Audit-Trail:
>Unformatted:
More information about the freebsd-ports-bugs
mailing list