From aadedd149bee83933f7931cd2c23f214189e4bac Mon Sep 17 00:00:00 2001 From: dugsong Date: Sat, 13 Nov 1999 20:22:17 +0000 Subject: [PATCH] libnids port - network monitoring lib with TCP/IP reassembly. ok turans@ --- net/libnids/Makefile | 28 ++++++++++++++++++++++++++++ net/libnids/files/md5 | 3 +++ net/libnids/patches/patch-aa | 8 ++++++++ net/libnids/patches/patch-ab | 32 ++++++++++++++++++++++++++++++++ net/libnids/patches/patch-ac | 11 +++++++++++ net/libnids/pkg/COMMENT | 1 + net/libnids/pkg/DESCR | 12 ++++++++++++ net/libnids/pkg/PLIST | 6 ++++++ net/libnids/pkg/SECURITY | 5 +++++ 9 files changed, 106 insertions(+) create mode 100644 net/libnids/Makefile create mode 100644 net/libnids/files/md5 create mode 100644 net/libnids/patches/patch-aa create mode 100644 net/libnids/patches/patch-ab create mode 100644 net/libnids/patches/patch-ac create mode 100644 net/libnids/pkg/COMMENT create mode 100644 net/libnids/pkg/DESCR create mode 100644 net/libnids/pkg/PLIST create mode 100644 net/libnids/pkg/SECURITY diff --git a/net/libnids/Makefile b/net/libnids/Makefile new file mode 100644 index 00000000000..b7334fa77ed --- /dev/null +++ b/net/libnids/Makefile @@ -0,0 +1,28 @@ +# Makefile for: libnids +# Version required: 1.12 +# Date created: Halloween 1999 +# Whom: dugsong@monkey.org +# +# $OpenBSD: Makefile,v 1.1.1.1 1999/11/13 20:22:17 dugsong Exp $ + +DISTNAME= libnids-1.12 + +CATEGORIES= net + +MASTER_SITES= http://www.packetfactory.net/libnids/dist/ + +MAINTAINER= dugsong@monkey.org + +BUILD_DEPENDS= ${PREFIX}/lib/libnet.a:${PORTSDIR}/net/libnet + +NO_CONFIGURE= yes + +do-install: + ${INSTALL_DATA} ${WRKSRC}/src/libnids.a ${PREFIX}/lib + ${INSTALL_DATA_DIR} ${PREFIX}/share/doc/libnids + ${INSTALL_DATA} ${WRKSRC}/README ${PREFIX}/share/doc/libnids + ${INSTALL_DATA} ${WRKSRC}/MISC ${PREFIX}/share/doc/libnids + ${INSTALL_DATA} ${WRKSRC}/doc/API ${PREFIX}/share/doc/libnids + ${INSTALL_DATA} ${WRKSRC}/doc/TESTS ${PREFIX}/share/doc/libnids + +.include diff --git a/net/libnids/files/md5 b/net/libnids/files/md5 new file mode 100644 index 00000000000..337b993bf52 --- /dev/null +++ b/net/libnids/files/md5 @@ -0,0 +1,3 @@ +MD5 (libnids-1.12.tar.gz) = 1d5eb8ef14c2729ab1871599ac05734f +RMD160 (libnids-1.12.tar.gz) = dd20d7b8965997dd4a0d4a942704911d826d149f +SHA1 (libnids-1.12.tar.gz) = 109bde08035af32d495560944d50d4fc7a823a53 diff --git a/net/libnids/patches/patch-aa b/net/libnids/patches/patch-aa new file mode 100644 index 00000000000..a4572bb72e2 --- /dev/null +++ b/net/libnids/patches/patch-aa @@ -0,0 +1,8 @@ +--- Makefile.orig Thu Nov 4 12:04:33 1999 ++++ Makefile Thu Nov 4 12:04:45 1999 +@@ -1,4 +1,4 @@ +-all: libpcap libnet libnids ++all: libnids + + libpcap: + (cd libpcap-0.4; ./configure; make) diff --git a/net/libnids/patches/patch-ab b/net/libnids/patches/patch-ab new file mode 100644 index 00000000000..c48e05ca91a --- /dev/null +++ b/net/libnids/patches/patch-ab @@ -0,0 +1,32 @@ +--- src/Makefile.orig Thu Nov 4 12:06:14 1999 ++++ src/Makefile Thu Nov 4 12:18:24 1999 +@@ -1,23 +1,14 @@ +-PCAP_INCLUDE_DIR=../libpcap-0.4 +-LIBNET_INCLUDE_DIR=../Libnet-0.99/include +-PCAP_LIB_DIR=../libpcap-0.4 +-LIBNET_LIB_DIR=../Libnet-0.99/lib +-LIBNET_DIR=../Libnet-0.99 ++PREFIX?=/usr/local + CC=gcc +-CFLAGS= -I$(PCAP_INCLUDE_DIR) -I$(LIBNET_INCLUDE_DIR) -g -D_BSD_SOURCE -O2 -Wall -DCOMPILING_LIBNIDS ++CFLAGS+= -I$(PREFIX)/include -D_BSD_SOURCE -DCOMPILING_LIBNIDS `libnet-config --defines` + SRCS= util.c libnids.c tcp.c killtcp.c ip_fragment.c ip_options.c checksum.c scan.c + OBJS = util.o libnids.o tcp.o killtcp.o ip_fragment.o ip_options.o checksum.o scan.o + +-all: libnids.so libnids.a +-libnids.so: $(OBJS) +- gcc -shared -g -L$(PCAP_LIB_DIR) -L$(LIBNET_LIB_DIR) -o libnids.so $(OBJS) -lpcap -lnet +-# strip -x libnids.so ++all: libnids.a ++ + libnids.a: $(OBJS) + ar -cr $@ $(OBJS) + ranlib $@ +-#*bsd's make lacks $(shell ...) +-killtcp.o: killtcp.c +- sh -c '$(CC) `$(LIBNET_DIR)/libnet-config --cflags --defines|tr -d "\n"` \ +-$(CFLAGS) -c killtcp.c' ++ + clean: +- rm -f *.o libnids.a libnids.so *~ ++ rm -f *.o libnids.a libnids.so *~ diff --git a/net/libnids/patches/patch-ac b/net/libnids/patches/patch-ac new file mode 100644 index 00000000000..93598bde59a --- /dev/null +++ b/net/libnids/patches/patch-ac @@ -0,0 +1,11 @@ +--- src/checksum.c.orig Fri Sep 10 09:43:37 1999 ++++ src/checksum.c Thu Nov 4 12:19:30 1999 +@@ -222,7 +222,7 @@ + + unsigned short ip_compute_csum(unsigned short * addr,int len) + { +-return ip_check_ext(adr,len,0); ++return ip_check_ext(addr,len,0); + } + + struct psuedo_hdr diff --git a/net/libnids/pkg/COMMENT b/net/libnids/pkg/COMMENT new file mode 100644 index 00000000000..b24b59aa527 --- /dev/null +++ b/net/libnids/pkg/COMMENT @@ -0,0 +1 @@ +network monitoring library with TCP/IP reassembly diff --git a/net/libnids/pkg/DESCR b/net/libnids/pkg/DESCR new file mode 100644 index 00000000000..b9b37aa8ed1 --- /dev/null +++ b/net/libnids/pkg/DESCR @@ -0,0 +1,12 @@ +from Nergal's README: + + Libnids is a library that provides a functionality of one of NIDS +(Network Intrusion Detection System) components, namely E-component. It means +that libnids code watches all local network traffic, cooks received datagrams +a bit (quite a bit ;)), and provides convinient information on them to +analyzing modules of NIDS. Libnids performs: +a) assembly of TCP segments into TCP streams +b) IP defragmentation +c) TCP port scan detection + +-d. diff --git a/net/libnids/pkg/PLIST b/net/libnids/pkg/PLIST new file mode 100644 index 00000000000..744780bf2f9 --- /dev/null +++ b/net/libnids/pkg/PLIST @@ -0,0 +1,6 @@ +lib/libnids.a +share/doc/libnids/API +share/doc/libnids/MISC +share/doc/libnids/README +share/doc/libnids/TESTS +@dirrm share/doc/libnids diff --git a/net/libnids/pkg/SECURITY b/net/libnids/pkg/SECURITY new file mode 100644 index 00000000000..d6fc2fe36f3 --- /dev/null +++ b/net/libnids/pkg/SECURITY @@ -0,0 +1,5 @@ + +this code has not been audited for buffer overflows, etc. +any more than the Linux kernel has. caveat user. + +-d.