Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 20 Aug 2002 03:00:49 +0200 (CEST)
From:      "Simon 'corecode' Schubert" <corecode@corecode.ath.cx>
To:        FreeBSD-gnats-submit@FreeBSD.org
Subject:   ports/41806: maintainer-update: net/driftnet to upstream version 0.1.6
Message-ID:  <200208200100.g7K10n7t028285@terrorfish.uni.stoert.net>

next in thread | raw e-mail | index | archive | help

>Number:         41806
>Category:       ports
>Synopsis:       maintainer-update: net/driftnet to upstream version 0.1.6
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          maintainer-update
>Submitter-Id:   current-users
>Arrival-Date:   Mon Aug 19 18:10:01 PDT 2002
>Closed-Date:
>Last-Modified:
>Originator:     Simon 'corecode' Schubert
>Release:        FreeBSD 5.0-CURRENT i386
>Organization:
>Environment:
System: FreeBSD terrorfish.uni.stoert.net 5.0-CURRENT FreeBSD 5.0-CURRENT #22: Thu Aug 15 01:45:41 CEST 2002 corecode@terrorfish.uni.stoert.net:/usr/obj/k7/usr/src/sys/TERRORFISH i386


	
>Description:
	o update to upstream version 0.1.6
	o use supplied Makefile
	o thus new file files/patch-Makefile
	o dead files files/patch-img.h and files/Makefile
	
>How-To-Repeat:
	
>Fix:

Index: Makefile
===================================================================
RCS file: /usr/local/cvs/ports/driftnet/Makefile,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- Makefile	10 Jun 2002 00:39:17 -0000	1.2
+++ Makefile	20 Aug 2002 01:00:40 -0000	1.3
@@ -6,7 +6,7 @@
 #
 
 PORTNAME=	driftnet
-PORTVERSION=	0.1.4
+PORTVERSION=	0.1.6
 CATEGORIES=	net
 MASTER_SITES=	http://www.ex-parrot.com/~chris/driftnet/ \
 		http://www.vanheusden.com/mirrors/
@@ -18,6 +18,15 @@
 
 USE_GTK=	yes
 USE_X_PREFIX=	yes
-MAKEFILE=	${FILESDIR}/Makefile
+USE_GMAKE=	yes
+
+ALL_TARGET=	default
+MAKE_ENV=	PTHREAD_LIBS="${PTHREAD_LIBS}" PTHREAD_CFLAGS="${PTHREAD_CFLAGS}"
+
+MAN1=	driftnet.1
+
+do-install:
+	${INSTALL_PROGRAM} ${WRKSRC}/driftnet ${PREFIX}/bin/
+	${INSTALL_MAN} ${WRKSRC}/driftnet.1 ${MAN1PREFIX}/man/man1/
 
 .include <bsd.port.mk>
Index: distinfo
===================================================================
RCS file: /usr/local/cvs/ports/driftnet/distinfo,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- distinfo	1 Mar 2002 02:31:17 -0000	1.1
+++ distinfo	20 Aug 2002 01:00:40 -0000	1.2
@@ -1 +1 @@
-MD5 (driftnet-0.1.4.tar.gz) = d7bcc13ee9237287104b55b67fd10a19
+MD5 (driftnet-0.1.6.tar.gz) = 8e11d77770452f97bb3c23f510489815
Index: files/Makefile
===================================================================
RCS file: files/Makefile
diff -N files/Makefile
--- files/Makefile	10 Jun 2002 00:39:17 -0000	1.2
+++ /dev/null	1 Jan 1970 00:00:00 -0000
@@ -1,23 +0,0 @@
-# $corecode: ports/driftnet/files/Makefile,v 1.2 2002/06/10 00:39:17 corecode Exp $
-# $FreeBSD: ports/net/driftnet/files/Makefile,v 1.1 2002/06/09 23:51:16 petef Exp $
-
-VERSION?=	0.1.4
-
-PROG=		driftnet
-SRCS=		gif.c img.c jpeg.c png.c driftnet.c image.c display.c
-CFLAGS+=	-I${LOCALBASE}/include -DDRIFTNET_VERSION='"${VERSION}"' ${GTK_CFLAGS}
-LDFLAGS+=	${GTK_LDFLAGS} -lpcap -ljpeg -lungif
-
-NOMAN=		yes
-
-.if defined(PREFIX)
-DESTDIR=	${PREFIX}/bin
-.else
-DESTDIR?=	/usr/X11R6/bin
-.endif
-
-GTK_CONFIG?=	gtk12-config
-GTK_CFLAGS!=	${GTK_CONFIG} --cflags
-GTK_LDFLAGS!=	${GTK_CONFIG} --libs
-
-.include <bsd.prog.mk>
Index: files/patch-Makefile
===================================================================
RCS file: files/patch-Makefile
diff -N files/patch-Makefile
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ files/patch-Makefile	20 Aug 2002 01:00:40 -0000	1.1
@@ -0,0 +1,42 @@
+--- Makefile.orig	Tue Jul  9 21:26:41 2002
++++ Makefile	Tue Aug 20 02:33:18 2002
+@@ -16,23 +16,23 @@
+ #CC = gcc
+ 
+ # Basic compiler, linker flags; should not need any changes.
+-CFLAGS += -g -Wall
+-LDFLAGS += -g
++#CFLAGS += -g -Wall
++#LDFLAGS += -g
+ 
+ # You might need these if libpcap is installed somewhere random.
+-CFLAGS += -I/usr/include/pcap
++#CFLAGS += -I/usr/include/pcap
+ #LDFLAGS += -L/path/to/libpcap.so
+ 
+ # Required on Linux to get BSDish definitions of the TCP/IP structs.
+-CFLAGS += -D_BSD_SOURCE
++#CFLAGS += -D_BSD_SOURCE
+ 
+ # We always need the pcap and pthread libraries.
+-LDLIBS += -lpcap -lpthread
++LDLIBS += -lpcap ${PTHREAD_LIBS}
+ 
+ # Optional C compiler and linker flags. Typical driftnet builds have support
+ # for displaying captured images in an X window, and need the following flags:
+-CFLAGS  += `gtk-config --cflags`
+-LDLIBS  += -ljpeg -lungif `gtk-config --libs`
++CFLAGS  += ${PTHREAD_CFLAGS} `${GTK_CONFIG} --cflags`
++LDLIBS  += -ljpeg -lungif `${GTK_CONFIG} --libs`
+ 
+ # Alternatively, you can build a version of driftnet which can only be used
+ # in `adjunct' mode as the back end for some other image-processing program. To
+@@ -51,7 +51,7 @@
+ 
+ # added 20020604 edobbs
+ # On BSD systems, may need to use /usr/local/include
+-#CFLAGS += -I/usr/local/include
++CFLAGS += -I/usr/local/include
+ 
+ 
+ #
Index: files/patch-driftnet.c
===================================================================
RCS file: /usr/local/cvs/ports/driftnet/files/patch-driftnet.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- files/patch-driftnet.c	10 Jun 2002 00:39:17 -0000	1.2
+++ files/patch-driftnet.c	20 Aug 2002 01:00:40 -0000	1.3
@@ -1,30 +1,17 @@
-$FreeBSD: ports/net/driftnet/files/patch-driftnet.c,v 1.1 2002/06/09 23:51:16 petef Exp $
-
---- driftnet.c.orig	Tue Sep 11 11:34:56 2001
-+++ driftnet.c	Fri Mar  1 02:05:56 2002
-@@ -14,7 +14,9 @@
- #include <assert.h>
- #include <errno.h>
- #include <pcap.h>
--#include <linux/if_ether.h>
-+#include <sys/types.h>
-+#include <netinet/in_systm.h>
-+#include <netinet/in.h>
- #include <netinet/ip.h>
- #include <netinet/tcp.h>
- #include <stdlib.h>
-@@ -261,8 +263,8 @@
- "Synopsis: driftnet -h | [-i interface] [-p] [-v] [filter code]\n"
+--- driftnet.c.orig	Tue Jul  9 21:26:41 2002
++++ driftnet.c	Tue Aug 20 02:30:35 2002
+@@ -254,8 +254,8 @@
  "\n"
  "  -h               Display this help message.\n"
+ "  -v               Verbose operation.\n"
 -"  -i interface     Select the interface on which to listen (default: all\n"
 -"                   interfaces).\n"
 +"  -i interface     Select the interface on which to listen (default: first\n"
 +"                   available interface).\n"
- "  -p               Do not put the listening interface into promiscuous mode.\n"
- "  -v               Verbose operation.\n"
- "\n"
-@@ -293,7 +295,7 @@
+ "  -p               Do not put the listening interface into promiscuous mode.\n""  -a               Adjunct mode: do not display images on screen, but save\n"
+ "                   them to a temporary directory and announce their names on\n"
+ "                   standard output.\n"
+@@ -313,7 +313,7 @@
  void setup_signals(void) {
      int *p;
      /* Signals to ignore. */
@@ -32,124 +19,4 @@
 +    int ignore_signals[] = {SIGPIPE, SIGCONT, SIGHUP, 0};
      /* Signals which mean we should quit, killing the display child if
       * applicable. */
-     int terminate_signals[] = {SIGTERM, SIGINT, SIGSEGV, SIGBUS, SIGCHLD, 0};
-@@ -393,6 +395,15 @@
-         }
-     }
-     
-+    if (!interface) {
-+	interface = pcap_lookupdev(ebuf);
-+
-+	if (!interface) {
-+	    fprintf(stderr, PROGNAME": pcap_lookupdev: %s\n", ebuf);
-+	    return -1;
-+	}
-+    }
-+
-     
-     if (verbose)
-         fprintf(stderr, PROGNAME": listening on %s%s\n", interface ? interface : "all interfaces", promisc ? " in promiscuous mode" : "");
-@@ -468,7 +479,7 @@
-         fprintf(stderr, PROGNAME": link-level header length is %d bytes\n", pkt_offset);
- 
-     while (!foad) {
--        struct iphdr ip;
-+        struct ip ip;
-         struct tcphdr tcp;
-         struct in_addr s, d;
-         int off, len;
-@@ -485,32 +496,32 @@
-         fprintf(stderr, "packet len = %d captured = %d!\n", hdr.len, hdr.caplen);
- */
-         memcpy(&ip, pkt + pkt_offset, sizeof(ip));
--        memcpy(&s, &ip.saddr, sizeof(ip.saddr));
--        memcpy(&d, &ip.daddr, sizeof(ip.daddr));
-+        memcpy(&s, &ip.ip_src, sizeof(ip.ip_src));
-+        memcpy(&d, &ip.ip_dst, sizeof(ip.ip_dst));
- 
--        memcpy(&tcp, pkt + pkt_offset + (ip.ihl << 2), sizeof(tcp));
--        off = pkt_offset + (ip.ihl << 2) + (tcp.doff << 2);
-+        memcpy(&tcp, pkt + pkt_offset + (ip.ip_hl << 2), sizeof(tcp));
-+        off = pkt_offset + (ip.ip_hl << 2) + (tcp.th_off << 2);
-         len = hdr.caplen - off;
- 
-         /*
-         if (verbose)
--            fprintf(stderr, PROGNAME": captured packet: %s:%d -> %s:%d\n", inet_ntoa(s), ntohs(tcp.source), inet_ntoa(d), ntohs(tcp.dest));
-+            fprintf(stderr, PROGNAME": captured packet: %s:%d -> %s:%d\n", inet_ntoa(s), ntohs(tcp.th_sport), inet_ntoa(d), ntohs(tcp.th_dport));
-         */
-         
-         /* XXX fragmented packets and other nasties. */
-         
-         /* try to find the connection slot associated with this. */
--        C = find_connection(&s, &d, ntohs(tcp.source), ntohs(tcp.dest));
-+        C = find_connection(&s, &d, ntohs(tcp.th_sport), ntohs(tcp.th_dport));
- 
-         /* no connection at all, so we need to allocate one. */
-         if (!C) {
-             if (verbose)
--                fprintf(stderr, PROGNAME": new connection: %s\n", connection_string(s, ntohs(tcp.source), d, ntohs(tcp.dest)));
-+                fprintf(stderr, PROGNAME": new connection: %s\n", connection_string(s, ntohs(tcp.th_sport), d, ntohs(tcp.th_dport)));
-             C = alloc_connection();
--            *C = connection_new(&s, &d, ntohs(tcp.source), ntohs(tcp.dest));
-+            *C = connection_new(&s, &d, ntohs(tcp.th_sport), ntohs(tcp.th_dport));
-             /* This might or might not be an entirely new connection (SYN flag
-              * set). Either way we need a sequence number to start at. */
--            (*C)->isn = ntohl(tcp.seq);
-+            (*C)->isn = ntohl(tcp.th_seq);
-         }
- 
-         /* Now we need to process this segment. */
-@@ -526,16 +537,16 @@
-             c->isn = htonl(tcp.seq);
- #endif
- 
--        if (tcp.rst) {
-+        if (tcp.th_flags & TH_RST) {
-             /* Looks like this connection is bogus, and so might be a
-              * connection going the other way. */
-             if (verbose)
--                fprintf(stderr, PROGNAME": connection reset: %s\n", connection_string(s, ntohs(tcp.source), d, ntohs(tcp.dest)));
-+                fprintf(stderr, PROGNAME": connection reset: %s\n", connection_string(s, ntohs(tcp.th_sport), d, ntohs(tcp.th_dport)));
-             
-             connection_delete(c);
-             *C = NULL;
- 
--            if ((C = find_connection(&d, &s, ntohs(tcp.dest), ntohs(tcp.source)))) {
-+            if ((C = find_connection(&d, &s, ntohs(tcp.th_dport), ntohs(tcp.th_sport)))) {
-                 connection_delete(*C);
-                 *C = NULL;
-             }
-@@ -547,7 +558,7 @@
-             /* We have some data in the packet. If this data occurred after
-              * the first data we collected for this connection, then save it
-              * so that we can look for images. Otherwise, discard it. */
--            unsigned int offset = ntohl(tcp.seq);
-+            unsigned int offset = ntohl(tcp.th_seq);
- 
-             /* Modulo 2**32 arithmetic; offset = seq - isn + delta. */
-             if (offset < (c->isn + delta))
-@@ -558,19 +569,19 @@
-             if (offset > c->len + 262144) {
-                 /* Out-of-order packet. */
-                 if (verbose) 
--                    fprintf(stderr, PROGNAME": out of order packet: %s\n", connection_string(s, ntohs(tcp.source), d, ntohs(tcp.dest)));
-+                    fprintf(stderr, PROGNAME": out of order packet: %s\n", connection_string(s, ntohs(tcp.th_sport), d, ntohs(tcp.th_dport)));
-             } else {
- /*                if (verbose)
--                    fprintf(stderr, PROGNAME": captured %d bytes: %s:%d -> %s:%d\n", (int)len, inet_ntoa(s), ntohs(tcp.source), inet_ntoa(d), ntohs(tcp.dest));*/
-+                    fprintf(stderr, PROGNAME": captured %d bytes: %s:%d -> %s:%d\n", (int)len, inet_ntoa(s), ntohs(tcp.th_sport), inet_ntoa(d), ntohs(tcp.th_dport));*/
-                 connection_push(c, pkt + off, offset, len);
-                 connection_harvest_images(c);
-             }
-         }
- 
--        if (tcp.fin) {
-+        if (tcp.th_flags & TH_FIN) {
-             /* Connection closing. */
-             if (verbose)
--                fprintf(stderr, PROGNAME": connection closing: %s, %d bytes transferred\n", connection_string(s, ntohs(tcp.source), d, ntohs(tcp.dest)), c->len);
-+                fprintf(stderr, PROGNAME": connection closing: %s, %d bytes transferred\n", connection_string(s, ntohs(tcp.th_sport), d, ntohs(tcp.th_dport)), c->len);
-             connection_harvest_images(c);
-             connection_delete(c);
-             *C = NULL;
+     int terminate_signals[] = {SIGTERM, SIGINT, /*SIGSEGV,*/ SIGBUS, SIGCHLD, 0};
Index: files/patch-img.h
===================================================================
RCS file: files/patch-img.h
diff -N files/patch-img.h
--- files/patch-img.h	10 Jun 2002 00:39:17 -0000	1.2
+++ /dev/null	1 Jan 1970 00:00:00 -0000
@@ -1,13 +0,0 @@
-$FreeBSD: ports/net/driftnet/files/patch-img.h,v 1.1 2002/06/09 23:51:16 petef Exp $
-
---- img.h.orig	Tue Sep 11 11:34:56 2001
-+++ img.h	Fri Mar  1 00:01:34 2002
-@@ -12,7 +12,7 @@
- #ifndef __IMG_H_ /* include guard */
- #define __IMG_H_
- 
--#include <stdint.h>
-+#include <sys/types.h>
- #include <stdio.h>
- 
- typedef uint8_t chan;
	


>Release-Note:
>Audit-Trail:
>Unformatted:

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-ports" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200208200100.g7K10n7t028285>