summaryrefslogtreecommitdiff
path: root/net
diff options
context:
space:
mode:
authoradam <adam>2005-01-06 11:44:16 +0000
committeradam <adam>2005-01-06 11:44:16 +0000
commit0aad556fd3c38c833a587d89b44c6b2d6d5479a2 (patch)
treedfb211c1b26a3d8c9373fd8ae99d3f10e9c2267e /net
parent9c1b692d75130a9b494f813923081c68e57315f5 (diff)
downloadpkgsrc-0aad556fd3c38c833a587d89b44c6b2d6d5479a2.tar.gz
net/ntop renamed to net/ntop1
Diffstat (limited to 'net')
-rw-r--r--net/ntop1/DESCR10
-rw-r--r--net/ntop1/Makefile22
-rw-r--r--net/ntop1/PLIST3
-rw-r--r--net/ntop1/distinfo8
-rw-r--r--net/ntop1/patches/patch-aa22
-rw-r--r--net/ntop1/patches/patch-ab108
-rw-r--r--net/ntop1/patches/patch-ac28
-rw-r--r--net/ntop1/patches/patch-ad80
8 files changed, 281 insertions, 0 deletions
diff --git a/net/ntop1/DESCR b/net/ntop1/DESCR
new file mode 100644
index 00000000000..0cf209b3d48
--- /dev/null
+++ b/net/ntop1/DESCR
@@ -0,0 +1,10 @@
+ntop is a tool that shows the network usage, similar to what the
+popular top Unix command does. ntop has been written in a portable
+way in order to virtually run on every Unix platform.
+
+ntop can be used in both interactive or web mode. In the first case,
+ntop displays the network status on the user's terminal whereas in
+web mode a web browser (e.g. netscape) can attach to ntop (that acts
+as a web server) and get a dump of the network status. In the latter
+case, ntop can be seen as a simple RMON-like agent with an embedded
+web interface.
diff --git a/net/ntop1/Makefile b/net/ntop1/Makefile
new file mode 100644
index 00000000000..e5e37bd5fca
--- /dev/null
+++ b/net/ntop1/Makefile
@@ -0,0 +1,22 @@
+# $NetBSD: Makefile,v 1.1.1.1 2005/01/06 11:44:16 adam Exp $
+
+DISTNAME= ntop-1.1
+PKGREVISION= 4
+CATEGORIES= net
+MASTER_SITES= ftp://ftp.unipi.it/pub/local/ntop/source/
+EXTRACT_SUFX= -src.tar.gz
+
+MAINTAINER= kim@tac.nyc.ny.us
+HOMEPAGE= http://www.ntop.org/
+COMMENT= Shows network usage (similar to "top" for processes)
+
+USE_BUILDLINK3= yes
+GNU_CONFIGURE= yes
+CONFIGURE_ARGS+= --enable-threads=no
+
+INSTALL_TARGET= install install-man
+
+.include "../../net/libpcap/buildlink3.mk"
+.include "../../devel/ncurses/buildlink3.mk"
+
+.include "../../mk/bsd.pkg.mk"
diff --git a/net/ntop1/PLIST b/net/ntop1/PLIST
new file mode 100644
index 00000000000..36933a90a78
--- /dev/null
+++ b/net/ntop1/PLIST
@@ -0,0 +1,3 @@
+@comment $NetBSD: PLIST,v 1.1.1.1 2005/01/06 11:44:16 adam Exp $
+sbin/ntop
+man/man8/ntop.8
diff --git a/net/ntop1/distinfo b/net/ntop1/distinfo
new file mode 100644
index 00000000000..5a455cf66fb
--- /dev/null
+++ b/net/ntop1/distinfo
@@ -0,0 +1,8 @@
+$NetBSD: distinfo,v 1.1.1.1 2005/01/06 11:44:16 adam Exp $
+
+SHA1 (ntop-1.1-src.tar.gz) = b244f025709cfcdae14d59e78778e2daf2e7bc55
+Size (ntop-1.1-src.tar.gz) = 220950 bytes
+SHA1 (patch-aa) = 1d9002e962061ddc174cb0f904f868ca91070465
+SHA1 (patch-ab) = f0d6be0bde866803f25da5ace473e244514e3d14
+SHA1 (patch-ac) = 1f32b536470e77bf6e029d0933bb375c1b08aee0
+SHA1 (patch-ad) = b2ef6583696880a55888a549ad5d4a7d3c8d49c0
diff --git a/net/ntop1/patches/patch-aa b/net/ntop1/patches/patch-aa
new file mode 100644
index 00000000000..9866b41ff45
--- /dev/null
+++ b/net/ntop1/patches/patch-aa
@@ -0,0 +1,22 @@
+$NetBSD: patch-aa,v 1.1.1.1 2005/01/06 11:44:16 adam Exp $
+
+--- Makefile.in.orig Mon May 3 09:03:10 1999
++++ Makefile.in
+@@ -54,7 +54,7 @@
+ DEFS = @DEFS@
+
+ # Standard CFLAGS
+-CFLAGS = $(CCOPT) $(DEFS) @G_THREAD_CFLAGS@ @LSOF_DEFS@ @OS_DEFS@ $(INCLS)
++CFLAGS = $(CCOPT) $(DEFS) @G_THREAD_CFLAGS@ @LSOF_DEFS@ @OS_DEFS@ $(INCLS) $(CPPFLAGS)
+
+ # Standard LDFLAGS
+ LDFLAGS = @LDFLAGS@
+@@ -105,7 +105,7 @@
+ report.c: ntop.h
+
+ install:
+- $(INSTALL) -m 6550 $(PROG) $(DESTDIR)$(BINDEST)/$(PROG)
++ $(INSTALL) -m 555 $(PROG) $(DESTDIR)$(BINDEST)/$(PROG)
+
+ install-man:
+ $(INSTALL) -m 444 $(PROG).8 $(DESTDIR)$(MANDEST)/man8/$(PROG).8
diff --git a/net/ntop1/patches/patch-ab b/net/ntop1/patches/patch-ab
new file mode 100644
index 00000000000..9766ba24a50
--- /dev/null
+++ b/net/ntop1/patches/patch-ab
@@ -0,0 +1,108 @@
+$NetBSD: patch-ab,v 1.1.1.1 2005/01/06 11:44:16 adam Exp $
+
+--- ntop.c.orig Wed Apr 28 19:49:00 1999
++++ ntop.c
+@@ -254,7 +254,7 @@
+ initIPServices();
+
+ #ifndef WIN32
+- while ((op = getopt(argc, argv, "df:F:hr:i:p:l:nw:m:")) != EOF)
++ while ((op = getopt(argc, argv, "df:F:hr:i:p:l:nm:")) != EOF)
+ switch (op) {
+
+ #ifndef WIN32
+@@ -324,6 +324,7 @@
+ numericFlag++;
+ break;
+
++#if 0
+ case 'w':
+ if(!isdigit(optarg[0])) {
+ printf("FATAL ERROR: flag -w expects a numeric argument.\n");
+@@ -332,6 +333,7 @@
+ webMode++;
+ webPort = atoi(optarg);
+ break;
++#endif
+
+ default:
+ usage(0);
+@@ -348,11 +350,6 @@
+ #endif
+
+ #ifndef WIN32
+- if((rFileName == NULL) && (getuid () && geteuid ()) || setuid (0)) {
+- printf("Sorry, you must be superuser in order to run ntop.\n");
+- return(-1);
+- }
+-
+ if(daemonMode && (!webMode)) {
+ printf("WARNING: -d is incompatible with interactive mode.\n");
+ } else if(daemonMode)
+@@ -392,13 +389,30 @@
+ #ifndef WIN32
+ /* Determine the device name if not specified */
+ if (device == NULL && (device = pcap_lookupdev(ebuf)) == NULL) {
+- printf(ebuf);
++ printf("%s\n", ebuf);
+ return(-1);
+ }
+
+ getLocalHostAddress(&localHostAddress, device);
+
+ if(rFileName == NULL) {
++ /* Fire up libpcap */
++ pcapPtr = pcap_open_live(device, DEFAULT_SNAPLEN, !pflag, 1000, ebuf);
++ } else {
++ pcapPtr = pcap_open_offline(rFileName, ebuf);
++ }
++
++ if (pcapPtr == NULL) {
++ printf("%s\n", ebuf);
++ return(-1);
++ }
++
++ if (pcap_lookupnet(device, &localnet, &netmask, ebuf) < 0) {
++ printf("%s\n", ebuf);
++ return(-1);
++ }
++
++ if(rFileName == NULL) {
+ if(webMode) {
+ (void)fprintf(stderr, "ntop v.%s %s [%s]"
+ #ifndef WIN32
+@@ -418,21 +432,6 @@
+ init_curses();
+ }
+ #endif
+-
+- /* Fire up libpcap */
+- pcapPtr = pcap_open_live(device, DEFAULT_SNAPLEN, !pflag, 1000, ebuf);
+- } else {
+- pcapPtr = pcap_open_offline(rFileName, ebuf);
+- }
+-
+- if (pcapPtr == NULL) {
+- printf(ebuf);
+- return(-1);
+- }
+-
+- if (pcap_lookupnet(device, &localnet, &netmask, ebuf) < 0) {
+- printf(ebuf);
+- return(-1);
+ }
+ #else /* WIN32 */
+ printf("ntop v.%s %s [%s]"
+@@ -458,12 +457,6 @@
+ free(localAddresses);
+ localAddresses = NULL;
+ }
+-
+-#ifndef WIN32
+- /* Now that the socket is open, throw away potential setuid/setgid */
+- (void)setgid(getgid());
+- (void)setuid(getuid());
+-#endif
+
+ #ifndef WIN32
+ /* get datalink type */
diff --git a/net/ntop1/patches/patch-ac b/net/ntop1/patches/patch-ac
new file mode 100644
index 00000000000..046203fad03
--- /dev/null
+++ b/net/ntop1/patches/patch-ac
@@ -0,0 +1,28 @@
+$NetBSD: patch-ac,v 1.1.1.1 2005/01/06 11:44:16 adam Exp $
+
+--- pbuf.c.orig Mon May 3 17:43:09 1999
++++ pbuf.c
+@@ -843,20 +843,18 @@
+
+ int checkKeyPressed() {
+ int theChar = getch();
+- unsigned char in_char;
+ int rc = 1, numScreens;
+
+- if((theChar != EOF)
+- && ((in_char = (unsigned char)theChar)) != 255) {
++ if((theChar != EOF) && (theChar != ERR)) {
+
+ /*
+ char buf[32];
+
+- sprintf(buf, ">%c-%d<", in_char, in_char);
++ sprintf(buf, ">%c-%d<", theChar, theChar);
+ mvprintw(0, 40, buf); refresh();
+ sleep(2);
+ */
+- switch(in_char) {
++ switch(theChar) {
+ case 'q':
+ case 'Q':
+ cleanup(-1);
diff --git a/net/ntop1/patches/patch-ad b/net/ntop1/patches/patch-ad
new file mode 100644
index 00000000000..ee44970141a
--- /dev/null
+++ b/net/ntop1/patches/patch-ad
@@ -0,0 +1,80 @@
+$NetBSD: patch-ad,v 1.1.1.1 2005/01/06 11:44:17 adam Exp $
+
+--- ntop.8.orig 1999-04-13 10:20:11.000000000 +0200
++++ ntop.8
+@@ -19,8 +19,6 @@ ntop \- display top network users
+ .IR "IP protocols to monitor" ]
+ .RB [ -i
+ .IR interface ]
+-.RB [ -w
+-.IR port ]
+ .RB [ -d ]
+ .RB [ -m
+ .IR "local subnet" ]
+@@ -34,12 +32,7 @@ ntop \- display top network users
+ shows the current network usage. It displays a list of hosts that are
+ currently using the network and reports information concerning the (IP and non-IP)
+ traffic generated by each host.
+-.B ntop
+-can be started either in a terminal window (interactive mode) or in
+-web mode. In the latter case, a web browser is needed to use the
+-program. The traffic is sorted according to the host and the protocol. Whenever
+-.B ntop
+-is started in web mode (-w flag), multiple remote users can access the traffic information. See below for more information.
++The traffic is sorted according to the host and the protocol.
+ .PP
+ .SH "COMMAND\-LINE OPTIONS"
+ .It -r
+@@ -77,28 +70,10 @@ Specifies the network interface used by
+ .
+
+ .It -w
+-Starts
+-.B ntop
+-in web mode. Users can attach their web browsers to the specified port and browse
+-traffic information remotely. Supposing to start
+-.B ntop
+-at the port 3000 (ntop -w 3000), the URL to access is
+-http://hostname:3000/. The file ~/.ntop specifies the HTTP
+-user/password of those people who are allowed to access ntop. If the
+-~/.ntop file is missing no security will be used hence everyone can
+-access traffic information. A simple .ntop file is the following:
+-.
+-#
+-# .ntop File format
+-#
+-# user<tab>/<space>pw
+-#
+-#
+-luca linux
+-.
+-Please note that an HTTP server is NOT
+-needed in order to use the program in interactive mode.
+-.
++Is disabled in this version of ntop for security reasons.
++See
++.B http://www.securityfocus.com/advisories/2520
++for details.
+
+ .It -d
+ This flag (it has to be used with -w) causes ntop to become a daemon, i.e. it is started in background and detached from the terminal.
+@@ -185,12 +160,6 @@ three
+ columns are toggled. Please note that these columns represent either
+ the traffic sent or received, according to the the way the list is sorted (see previous
+ command).
+-
+-.SH "WEB VIEWS (Web mode)"
+-While
+-.B ntop
+-is running in web mode (-w flag), multiple users can access the traffic information using conventional web browsers. The main HTML page, is divided is two frames. The left frame allows users to select the traffic view that will be displayed in the right frame. Available sections are: sort traffic by data sent, sort traffic by data received, traffic statistics, active hosts list, remote to local (i.e. inside the subnet defined for the network board from which the program is currently sniffing) IP traffic, local to remote IP traffic, local to local IP traffic, list of active TCP sessions, IP protocol distribution statistics, IP protocol usage, IP traffic matrix.
+-
+ .
+ .SH "FIELD DESCRIPTIONS (Interactive mode)"
+ .B ntop
+@@ -247,4 +216,4 @@ at ftp://ftp.ee.lbl.gov/libpcap.tar.Z.
+ .
+ .
+ .SH AUTHOR
+-Please send bug reports to the ntop mailing list <ntop@unipi.it>. ntop's author is Luca Deri <deri@unipi.it>.
+\ No newline at end of file
++Please send bug reports to the ntop mailing list <ntop@unipi.it>. ntop's author is Luca Deri <deri@unipi.it>.