1
0
mirror of https://git.FreeBSD.org/ports.git synced 2025-01-13 07:34:50 +00:00

- Update to 0.42

PR:		ports/74392
Submitted by:	maintainer
This commit is contained in:
Sergey Matveychuk 2004-11-27 11:38:47 +00:00
parent 4082ca1e8a
commit 7c9ecf4e7a
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=122603
5 changed files with 13 additions and 94 deletions

View File

@ -6,13 +6,13 @@
#
PORTNAME= sdig
PORTVERSION= 0.40
PORTREVISION= 1
PORTVERSION= 0.42
CATEGORIES= net-mgmt
MASTER_SITES= http://www.exploits.org/sdig/
MASTER_SITES= ${MASTER_SITE_SOURCEFORGE}
MASTER_SITE_SUBDIR= ${PORTNAME}
MAINTAINER= rjackson@cserv62.csub.edu
COMMENT= Find which switch/router port a given host is on
MAINTAINER= raj@cserv62.csub.edu
COMMENT= Translate IP/DNS/WINS/MAC address into port description
LIB_DEPENDS= netsnmp.6:${PORTSDIR}/net-mgmt/net-snmp
@ -21,6 +21,6 @@ GNU_CONFIGURE= yes
MAN5= sdig.conf.5
MAN8= sdig.8
PLIST_FILES= bin/sdig etc/sdig.conf-sample
PLIST_FILES= bin/sdig etc/sdig.conf-sample etc/mactable-sample
.include <bsd.port.mk>

View File

@ -1,2 +1,2 @@
MD5 (sdig-0.40.tar.gz) = 60132d49076f0e51d7cccc99cb72b7f4
SIZE (sdig-0.40.tar.gz) = 72623
MD5 (sdig-0.42.tar.gz) = e3a718b4eabaefd6bf9dbe9fe76fd0a8
SIZE (sdig-0.42.tar.gz) = 111033

View File

@ -1,37 +0,0 @@
--- Makefile.in.orig Fri Apr 4 08:35:54 2003
+++ Makefile.in Thu Mar 25 13:36:34 2004
@@ -9,8 +9,8 @@
MANDIR = $(DESTDIR)@mandir@
# other definitions
-CC = @CC@
-CFLAGS = -Iinclude -O2 -Wall # -g -static
+CC ?= @CC@
+CFLAGS += -Iinclude -I/usr/local/include
INSTALLCMD = @INSTALL@
INSTALLMODE_BIN = 0755
@@ -32,6 +32,9 @@
$(CC) $(CFLAGS) -o sdig sdig.o common.o snmpget.o \
$(NETSNMP_LIBS)
+snmpget.o: snmpget.c
+ $(CC) $(CFLAGS) -c snmpget.c
+
clean:
rm -f $(PROGS) *.o
@@ -49,12 +52,7 @@
install-conf:
./install-sh -d $(CONFDIR)
- @if ( test -f $(CONFDIR)/sdig.conf ) \
- then \
- echo Not replacing existing file: $(CONFDIR)/sdig.conf; \
- else \
- $(INSTALLCMD) -m $(INSTALLMODE_CONF) sdig.conf $(CONFDIR); \
- fi
+ $(INSTALLCMD) -m $(INSTALLMODE_CONF) sdig.conf $(CONFDIR)/sdig.conf-sample
install-man:
./install-sh -d $(MANDIR)/man5

View File

@ -1,42 +0,0 @@
--- sdig.c.orig Mon Mar 24 13:08:00 2003
+++ sdig.c Wed May 19 13:17:43 2004
@@ -426,7 +426,7 @@
static void do_ifdescr(stype *sw, long port)
{
- char query[256], *ifdescr;
+ char query[256], *ifdescr, *ifname;
long ifnum;
/* first get the switch's ifnum for the port */
@@ -437,13 +437,28 @@
if (ifnum == -1)
return;
- snprintf(query, sizeof(query), "interfaces.ifTable.ifEntry.ifDescr.%ld",
+ snprintf(query, sizeof(query), "IF-MIB::ifName.%ld",
+ ifnum);
+
+ ifname = snmpget_str(sw->ip, sw->pw, query);
+
+ if (!ifname) {
+ snprintf(query, sizeof(query), "IF-MIB::ifAlias.%ld", ifnum);
+ snmpget_str(sw->ip, sw->pw, query);
+ }
+
+ snprintf(query, sizeof(query), "IF-MIB::ifDescr.%ld",
ifnum);
ifdescr = snmpget_str(sw->ip, sw->pw, query);
+ if (ifname) {
+ printf(" (%s)", ifname);
+ free(ifname);
+ }
+
if (ifdescr) {
- printf(" (%s)", ifdescr);
+ printf(" [%s]", ifdescr);
free(ifdescr);
}
}

View File

@ -1,10 +1,8 @@
This program is designed to track down computers to the finest level of
information available at the moment. Sometimes this can mean an exact
description of a port in a building anywhere in an enterprise. Other
times this may just be a vague notion of a faraway network. The results
are only as good as the data you feed to it.
WWW: http://www.exploits.org/sdig
Given SNMP-capable routers and switches, sdig can
turn an IP address, DNS/WINS host name or a MAC
address into a port description. Sdig will run on
most any platform that net-snmp supports. It
currently compiles on FreeBSD and Linux.
- Russell A. Jackson
rjackson@cserv62.csub.edu