From 88233c44c1b3ffd0932d5129d12234de09b6e953 Mon Sep 17 00:00:00 2001 From: brad Date: Wed, 30 Aug 2000 23:50:29 +0000 Subject: [PATCH] upgrade to sniffit 0.3.7beta + Debian patches --- net/sniffit/Makefile | 26 +++-- net/sniffit/files/md5 | 9 +- net/sniffit/patches/patch-Makefile.in | 18 ++++ net/sniffit/patches/patch-aa | 27 ----- net/sniffit/patches/patch-ab | 46 --------- net/sniffit/patches/patch-ac | 10 -- net/sniffit/patches/patch-ad | 99 ------------------- net/sniffit/patches/patch-ae | 12 --- net/sniffit/patches/patch-ag | 30 ------ .../patches/{patch-af => patch-configure} | 48 +++++---- net/sniffit/patches/patch-sn_data.h | 35 +++++++ net/sniffit/patches/patch-sn_resolv.c | 11 +++ net/sniffit/pkg/DESCR | 3 +- 13 files changed, 111 insertions(+), 263 deletions(-) create mode 100644 net/sniffit/patches/patch-Makefile.in delete mode 100644 net/sniffit/patches/patch-aa delete mode 100644 net/sniffit/patches/patch-ab delete mode 100644 net/sniffit/patches/patch-ac delete mode 100644 net/sniffit/patches/patch-ad delete mode 100644 net/sniffit/patches/patch-ae delete mode 100644 net/sniffit/patches/patch-ag rename net/sniffit/patches/{patch-af => patch-configure} (65%) create mode 100644 net/sniffit/patches/patch-sn_data.h create mode 100644 net/sniffit/patches/patch-sn_resolv.c diff --git a/net/sniffit/Makefile b/net/sniffit/Makefile index df272813431..5253a4b9c13 100644 --- a/net/sniffit/Makefile +++ b/net/sniffit/Makefile @@ -1,17 +1,17 @@ -# $OpenBSD: Makefile,v 1.8 2000/03/26 00:31:49 brad Exp $ +# $OpenBSD: Makefile,v 1.9 2000/08/30 23:50:29 brad Exp $ # $FreeBSD: Makefile,v 1.1.1.1 1998/04/04 04:58:25 obrien Exp $ -DISTNAME= sniffit.0.3.5 -PKGNAME= sniffit-0.3.5 +DISTNAME= sniffit.0.3.7.beta +PKGNAME= sniffit-0.3.7b CATEGORIES= net security -NEED_VERSION= 1.234 -MASTER_SITES= http://reptile.rug.ac.be/~coder/sniffit/files/ \ - ftp://ftphost.manawatu.gen.nz/pub/unix/net/security/sniffers/sniffit/ \ - ftp://ftp.netbsd.org/pub/NetBSD/packages/distfiles/ +NEED_VERSION= 1.320 +MASTER_SITES= http://reptile.rug.ac.be/~coder/sniffit/files/ +MASTER_SITES0= http://ftp.debian.org/debian/dists/stable/main/source/net/ -.if ${MACHINE_ARCH} == "alpha" -BROKEN= "Currently does not build on Alpha" -.endif +PATCHFILES= sniffit_0.3.7.beta-6.1.diff.gz:0 +PATCH_DIST_STRIP= -p1 + +HOMEPAGE= http://reptile.rug.ac.be/~coder/sniffit/sniffit.html MAINTAINER= ports@openbsd.org @@ -20,12 +20,10 @@ PERMIT_PACKAGE_FTP= Yes PERMIT_DISTFILES_CDROM= "no obvious license" PERMIT_DISTFILES_FTP= Yes -FAKE= Yes - -GNU_CONFIGURE= Yes - MAKE_FLAGS= OBJ_FLAG="-w ${CFLAGS} -c" EXE_FLAG="-w ${CFLAGS} -o sniffit" +CONFIGURE_STYLE= gnu + ALL_TARGET= do-install: diff --git a/net/sniffit/files/md5 b/net/sniffit/files/md5 index 64ea38d39bc..0bac2546fc2 100644 --- a/net/sniffit/files/md5 +++ b/net/sniffit/files/md5 @@ -1,3 +1,6 @@ -MD5 (sniffit.0.3.5.tar.gz) = bd116c62669372d7ea7f59c337f6822a -RMD160 (sniffit.0.3.5.tar.gz) = 9508f357c6fe74a9147a735fd0eb419b9a1124eb -SHA1 (sniffit.0.3.5.tar.gz) = df9183fca2eec29a56bcfdc68a983c4e7d57bf9d +MD5 (sniffit.0.3.7.beta.tar.gz) = 2697cc18878480199fe6db1e61134d5a +MD5 (sniffit_0.3.7.beta-6.1.diff.gz) = 8c4f4f589635cb424fe230ca981d9150 +RMD160 (sniffit.0.3.7.beta.tar.gz) = 9ff6b3b2aca3c27222f3fb5ad0d85adb5e44c356 +RMD160 (sniffit_0.3.7.beta-6.1.diff.gz) = 38d37e5cf3ca924c0ad33416edd269e07ed92981 +SHA1 (sniffit.0.3.7.beta.tar.gz) = fbb897d5e9ec51744a155d4ba090df144e9dfaf9 +SHA1 (sniffit_0.3.7.beta-6.1.diff.gz) = 3170b55e00fd6f701cef65a9f0747eb872c1d0d1 diff --git a/net/sniffit/patches/patch-Makefile.in b/net/sniffit/patches/patch-Makefile.in new file mode 100644 index 00000000000..b59cfba196b --- /dev/null +++ b/net/sniffit/patches/patch-Makefile.in @@ -0,0 +1,18 @@ +--- Makefile.in.orig Sun Aug 27 02:26:50 2000 ++++ Makefile.in Sun Aug 27 02:36:46 2000 +@@ -8,12 +8,12 @@ + SNIFFIT = sniffit.0.3.7.c + CC = @CC@ + LIBS = @LIBS@ +-DEFS = @DEFS@ ++DEFS = @DEFS@ -DHAVE_LIBNCURSES + OS_OPT = @OS_OPT@ + OBJ_FLAG = -w -O2 -c +-OBJ_OPT = -I./libpcap -L./libpcap ++#OBJ_OPT = -I./libpcap -L./libpcap + EXE_FLAG = -w -O2 -o sniffit +-EXE_OPT = -I./libpcap -L./libpcap -lpcap ++EXE_OPT = -lpcap + EXE_OBJ = sn_packets.o sn_generation.o sn_interface.o sn_cfgfile.o \ + sn_logfile.o sn_resolv.o + DEP_FILES = sn_config.h ./libpcap/pcap.h sn_data.h sn_defines.h sn_plugins.h \ diff --git a/net/sniffit/patches/patch-aa b/net/sniffit/patches/patch-aa deleted file mode 100644 index fa960b21ef3..00000000000 --- a/net/sniffit/patches/patch-aa +++ /dev/null @@ -1,27 +0,0 @@ ---- Makefile.in.orig Fri Apr 18 05:33:57 1997 -+++ Makefile.in Sat Mar 25 18:28:00 2000 -@@ -8,12 +8,12 @@ - SNIFFIT = sniffit.0.3.5.c - CC = @CC@ - LIBS = @LIBS@ --DEFS = @DEFS@ -+DEFS = @DEFS@ -DHAVE_LIBNCURSES - OS_OPT = @OS_OPT@ - OBJ_FLAG = -w -O2 -c --OBJ_OPT = -I./libpcap-0.3 -L./libpcap-0.3 -+#OBJ_OPT = -I./libpcap-0.3 -L./libpcap-0.3 - EXE_FLAG = -w -O2 -o sniffit --EXE_OPT = -I./libpcap-0.3 -L./libpcap-0.3 -lpcap -+EXE_OPT = -lpcap - EXE_OBJ = sn_packets.o sn_generation.o sn_interface.o sn_cfgfile.o \ - sn_logfile.o - DEP_FILES = sn_config.h pcap.h sn_data.h sn_defines.h sn_plugins.h \ -@@ -21,7 +21,7 @@ - sn_generation.o sn_interface.o sn_cfgfile.o sn_logfile.o - - sniffit: $(SNIFFIT) $(DEP_FILES) -- cd libpcap-0.3; make; cd .. -+ #cd libpcap-0.3; make; cd .. - $(CC) $(EXE_FLAG) $(SNIFFIT) $(EXE_OBJ) $(EXE_OPT) $(LIBS) $(DEFS) $(OS_OPT) - strip sniffit - diff --git a/net/sniffit/patches/patch-ab b/net/sniffit/patches/patch-ab deleted file mode 100644 index c386d80ad2c..00000000000 --- a/net/sniffit/patches/patch-ab +++ /dev/null @@ -1,46 +0,0 @@ ---- sniffit.0.3.5.c.orig Fri Apr 18 05:33:58 1997 -+++ sniffit.0.3.5.c Wed May 26 09:42:33 1999 -@@ -93,7 +93,9 @@ - exit(0); - } - --void my_exit (void) { exit(0);}; -+void my_exit (void) { -+ if(LOGGING=1) stop_logging(); -+ exit(0);}; - - /* DEBUGGING INFO */ - #ifdef DEBUG -@@ -411,11 +413,22 @@ - proto=unwrap_packet(sp, info); - if(proto == NO_IP) return DONT_EXAMINE; /* no use in trying */ - if(proto == NO_IP_4) return DONT_EXAMINE; /* no use in trying */ -+ if(proto == CORRUPT_IP) -+ { -+ printf("Suspicious Packet detected... (Split header)\n"); -+ return DONT_EXAMINE; -+ } - - memcpy(&iphead,(sp+PROTO_HEAD),sizeof(struct IP_header)); - so=(unsigned char *)&(iphead.source); - dest=(unsigned char *)&(iphead.destination); - -+ if(info->FRAG_nf!=0) -+ { -+ printf("Fragment Skipped...\n"); -+ return DONT_EXAMINE; -+ } -+ - if((proto==TCP)&&(PROTOCOLS&F_TCP)) - { - #ifdef DEBUG_ONSCREEN -@@ -1220,6 +1233,9 @@ - proto=unwrap_packet(sp, info); - if(proto == NO_IP) return DONT_EXAMINE; /* no use in trying */ - if(proto == NO_IP_4) return DONT_EXAMINE; /* no use in trying */ -+ if(proto == CORRUPT_IP) return DONT_EXAMINE; /* no use in trying */ -+ -+ if(info->FRAG_nf!=0) return DONT_EXAMINE; - - (*IP_nr_of_packets)++; - if(proto==ICMP) diff --git a/net/sniffit/patches/patch-ac b/net/sniffit/patches/patch-ac deleted file mode 100644 index 8120d8c01a9..00000000000 --- a/net/sniffit/patches/patch-ac +++ /dev/null @@ -1,10 +0,0 @@ -*** sn_packetstructs.h.orig Fri Apr 18 16:33:58 1997 ---- sn_packetstructs.h Thu May 7 15:02:13 1998 -*************** -*** 48,51 **** ---- 48,52 ---- - { - int IP_len, TCP_len, ICMP_len, UDP_len; /* header lengths */ - int DATA_len; -+ char FRAG_nf; /* not the first fragment */ - }; diff --git a/net/sniffit/patches/patch-ad b/net/sniffit/patches/patch-ad deleted file mode 100644 index 164362bda1a..00000000000 --- a/net/sniffit/patches/patch-ad +++ /dev/null @@ -1,99 +0,0 @@ -*** sn_packets.c.orig Fri Apr 18 16:33:58 1997 ---- sn_packets.c Thu May 7 15:02:14 1998 -*************** -*** 43,48 **** ---- 43,49 ---- - struct UDP_header UDPhead; - - int i; -+ short int dummy; /* 2 bytes, important */ - - memcpy(&IPhead,(sp+PROTO_HEAD),sizeof(struct IP_header)); - /* IP header Conversion */ -*************** -*** 51,56 **** ---- 52,58 ---- - unwrapped->TCP_len = 0; /* Reset structure NEEDED!!! */ - unwrapped->UDP_len = 0; - unwrapped->DATA_len = 0; -+ unwrapped->FRAG_nf = 0; - - if(NO_CHKSUM == 0) - { -*************** -*** 75,106 **** ---- 77,150 ---- - /* restore orig buffer */ - /* general programming rule */ - } -+ -+ #ifdef DEBUG_ONSCREEN -+ printf("IPheadlen: %d total length: %d\n", unwrapped->IP_len, -+ ntohs(IPhead.length)); -+ #endif -+ -+ dummy=ntohs(IPhead.flag_offset); dummy<<=3; -+ if( dummy!=0 ) /* we have offset */ -+ { -+ unwrapped->FRAG_nf = 1; -+ } -+ - if(IPhead.protocol == TCP ) /* TCP */ - { -+ if(unwrapped->FRAG_nf == 0) -+ { -+ if( (ntohs(IPhead.length)-(unwrapped->IP_len))<20 ) -+ return CORRUPT_IP; -+ - memcpy(&TCPhead,(sp+PROTO_HEAD+(unwrapped->IP_len)), - sizeof(struct TCP_header)); - unwrapped->TCP_len = ntohs(TCPhead.offset_flag) & 0xF000; - unwrapped->TCP_len >>= 10; - unwrapped->DATA_len = ntohs(IPhead.length) - - (unwrapped->IP_len) - (unwrapped->TCP_len); -+ } -+ else -+ { -+ unwrapped->DATA_len = ntohs(IPhead.length) -+ - (unwrapped->IP_len); -+ } - return TCP; - } - if(IPhead.protocol == ICMP ) /* ICMP */ - { -+ if(unwrapped->FRAG_nf == 0) -+ { -+ if( (ntohs(IPhead.length)-(unwrapped->IP_len))<4 ) -+ return CORRUPT_IP; - memcpy(&ICMPhead,(sp+PROTO_HEAD+(unwrapped->IP_len)), - sizeof(struct ICMP_header)); - unwrapped->ICMP_len = ICMP_HEADLENGTH; - unwrapped->DATA_len = ntohs(IPhead.length) - - (unwrapped->IP_len) - (unwrapped->ICMP_len); - return ICMP; -+ } -+ else -+ { -+ return -1; /* don't handle fragmented ICMP */ -+ } - } - if(IPhead.protocol == UDP ) /* UDP */ - { -+ if(unwrapped->FRAG_nf == 0) -+ { -+ if( (ntohs(IPhead.length)-(unwrapped->IP_len))<8 ) -+ return CORRUPT_IP; - memcpy(&UDPhead,(sp+PROTO_HEAD+(unwrapped->IP_len)), - sizeof(struct UDP_header)); - unwrapped->UDP_len = UDP_HEADLENGTH; - unwrapped->DATA_len = ntohs(IPhead.length) - - (unwrapped->IP_len) - (unwrapped->UDP_len); -+ } -+ else -+ { -+ unwrapped->DATA_len = ntohs(IPhead.length) -+ - (unwrapped->IP_len); -+ } - return UDP; - } - return -1; diff --git a/net/sniffit/patches/patch-ae b/net/sniffit/patches/patch-ae deleted file mode 100644 index dfa47927159..00000000000 --- a/net/sniffit/patches/patch-ae +++ /dev/null @@ -1,12 +0,0 @@ -*** sn_defines.h.orig Fri Apr 18 16:33:58 1997 ---- sn_defines.h Thu May 7 15:02:14 1998 -*************** -*** 82,87 **** ---- 82,88 ---- - - #define NO_IP 0 - #define NO_IP_4 1000 -+ #define CORRUPT_IP 1001 - #define ICMP 1 /* Protocol Numbers */ - #define TCP 6 - #define UDP 17 diff --git a/net/sniffit/patches/patch-ag b/net/sniffit/patches/patch-ag deleted file mode 100644 index 75582b780eb..00000000000 --- a/net/sniffit/patches/patch-ag +++ /dev/null @@ -1,30 +0,0 @@ ---- sn_data.h.orig Fri Apr 18 05:33:58 1997 -+++ sn_data.h Sat Mar 25 20:34:10 2000 -@@ -25,6 +25,27 @@ - char *ETH_DEV[]={"ed"}; - #endif - -+#ifdef OPENBSD -+#ifdef __i386__ -+#define ETH_DEV_NR 32 -+char *ETH_DEV[]={"cnw","dc","de","ec","ef","eg","el","ep","ex","fea","fpa","fxp","ie","le","ne","ray","rl","sf","sis","sk","sm","ste","ti","tl","tx","vr","wb","we","wi","wx","xe","xl"}; -+#elif defined(__sparc__) -+#define ETH_DEV_NR 5 -+char *ETH_DEV[]={"be","hme","ie","le","qe"}; -+#elif defined(__m68k__) -+#defined ETH_DEV_NR 8 -+char *ETH_DEV[]={"ae","ed","es","le","mc","ne","qn","sn"}; -+#elif defined(__mips__) -+#define ETH_DEV_NR 5 -+char *ETH_DEV[]={"ec","ep","le","ne","we"}; -+#elif defined(__powerpc__) -+#defined ETH_DEV_NR 3 -+char *ETH_DEV[]={"bm","de","gm"}; -+#else -+#error Unknown network devices for this OpenBSD architecture. -+#endif -+#endif -+ - #ifdef BSDI - #define ETH_DEV_NR 1 - char *ETH_DEV[]={"ef"}; diff --git a/net/sniffit/patches/patch-af b/net/sniffit/patches/patch-configure similarity index 65% rename from net/sniffit/patches/patch-af rename to net/sniffit/patches/patch-configure index 6c35a894090..318ee04519d 100644 --- a/net/sniffit/patches/patch-af +++ b/net/sniffit/patches/patch-configure @@ -1,16 +1,14 @@ ---- configure.orig Fri Apr 18 05:33:57 1997 -+++ configure Sat Mar 25 18:28:00 2000 -@@ -712,15 +712,15 @@ - fi +--- configure.orig Thu Jul 16 12:17:10 1998 ++++ configure Sun Aug 27 02:44:17 2000 +@@ -714,14 +714,14 @@ - --NCURSES_PATH=/usr/include:/usr/include/ncurses:/usr/include/curses:/usr/local/include:/usr/local/include/ncurses:/usr/local/include/curses + NCURSES_PATH=/usr/include:/usr/include/ncurses:/usr/include/curses:/usr/local/include:/usr/local/include/ncurses:/usr/local/include/curses:./:./ncurses.h + ncurses_warn=0 -echo $ac_n "checking for main in -lncurses""... $ac_c" 1>&6 --echo "configure:718: checking for main in -lncurses" >&5 +-echo "configure:719: checking for main in -lncurses" >&5 -ac_lib_var=`echo ncurses'_'main | sed 'y%./+-%__p_%'` -+NCURSES_PATH=/usr/include:/usr/include/curses:/usr/include/curses:/usr/local/include:/usr/local/include/curses:/usr/local/include/curses +echo $ac_n "checking for main in -lcurses""... $ac_c" 1>&6 -+echo "configure:718: checking for main in -lcurses" >&5 ++echo "configure:719: checking for main in -lcurses" >&5 +ac_lib_var=`echo curses'_'main | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -19,9 +17,9 @@ -LIBS="-lncurses $LIBS" +LIBS="-lcurses $LIBS" cat > conftest.$ac_ext <&6 @@ -37,6 +35,7 @@ else echo "$ac_t""no" 1>&6 +@@ -759,7 +759,7 @@ fi @@ -45,18 +44,27 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -@@ -1299,6 +1299,14 @@ - freebsd*) - cat >> confdefs.h <<\EOF - #define FREEBSD 1 +@@ -1374,6 +1374,14 @@ + OS_OPT= + + ;; ++openbsd*) ++ cat >> confdefs.h <<\EOF ++#define OPENBSD 1 +EOF + + OS_OPT= + + ;; -+openbsd*) -+ cat >> confdefs.h <<\EOF -+#define OPENBSD 1 - EOF + netbsd*) + cat >> confdefs.h <<\EOF + #define NETBSD 1 +@@ -1682,7 +1690,7 @@ + esac + done - OS_OPT= +- for ac_config_dir in libpcap; do ++ for ac_config_dir in ; do + + # Do not complain, so a configure script can configure whichever + # parts of a large source tree are present. diff --git a/net/sniffit/patches/patch-sn_data.h b/net/sniffit/patches/patch-sn_data.h new file mode 100644 index 00000000000..115044ae801 --- /dev/null +++ b/net/sniffit/patches/patch-sn_data.h @@ -0,0 +1,35 @@ +--- sn_data.h.orig Thu Jul 16 12:17:10 1998 ++++ sn_data.h Wed Aug 30 19:34:57 2000 +@@ -43,6 +43,32 @@ + int HEADSIZE[]={14}; + #endif + ++#ifdef OPENBSD ++#ifdef __i386__ ++#define NETDEV_NR 33 ++char *NETDEV[]={"ppp","cnw","dc","de","ec","ef","eg","el","ep","ex","fea","fpa","fx","ie","le","ne","ray","rl","sf","sis","sk","sm","ste","ti","tl","tx","vr","wb","we","wi","wx","xe","xl"}; ++int HEADSIZE[]={4,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14}; ++#elif defined(__sparc__) ++#define NETDEV_NR 6 ++char *NETDEV[]={"ppp","be","hme","ie","le","qe"}; ++int HEADSIZE[]={4,14,14,14,14,14}; ++#elif defined(__m68k__) ++#defined NETDEV_NR 9 ++char *NETDEV[]={"ppp","ae","ed","es","le","mc","ne","qn","sn"}; ++int HEADSIZE[]={4,14,14,14,14,14,14,14,14}; ++#elif defined(__mips__) ++#define NETDEV_NR 6 ++char *NETDEV[]={"ppp","ec","ep","le","ne","we"}; ++int HEADSIZE[]={4,14,14,14,14,14}; ++#elif defined(__powerpc__) ++#defined NETDEV_NR 5 ++char *NETDEV[]={"ppp","bm","de","fxp","gm"}; ++int HEADSIZE[]={4,14,14,14,14}; ++#else ++#error Unknown network devices for this OpenBSD architecture. ++#endif ++#endif ++ + #ifdef BSDI /* ppp: 4 or 0 ? */ + /* + #define NETDEV_NR 2 diff --git a/net/sniffit/patches/patch-sn_resolv.c b/net/sniffit/patches/patch-sn_resolv.c new file mode 100644 index 00000000000..81a1e5746ee --- /dev/null +++ b/net/sniffit/patches/patch-sn_resolv.c @@ -0,0 +1,11 @@ +--- sn_resolv.c.orig Sun Aug 27 02:47:58 2000 ++++ sn_resolv.c Sun Aug 27 02:48:28 2000 +@@ -2,6 +2,8 @@ + /* - getaddrbyname: Godmar Back / Shudoh Kazuyuki */ + + #include "sn_defines.h" ++#include ++#include + #include + #include + diff --git a/net/sniffit/pkg/DESCR b/net/sniffit/pkg/DESCR index fab61134337..0e7e1d403cf 100644 --- a/net/sniffit/pkg/DESCR +++ b/net/sniffit/pkg/DESCR @@ -4,5 +4,4 @@ Sniffit produces very detailed technical details about the packets flowing through your network (SEQ, ACK, TTL, Window, ...) and also packet contence in different formats (hex or plain text, ...) -- Adam McDougall -mcdouga9@egr.msu.edu +WWW: ${HOMEPAGE}