Import DAQ 1.1.1.

DAQ, or Data Acquisition library, is a library for packet I/O.  The DAQ
replaces direct calls to PCAP functions with an abstraction layer.

This port is needed by the upcoming Snort 2.9.3.1 update.

From Markus Lude, and includes a tweak from sthen@.
OK abieber@ sthen@
This commit is contained in:
lteo 2012-09-26 01:40:32 +00:00
parent c0760c8d2a
commit ee6937f8d7
7 changed files with 121 additions and 0 deletions

38
net/daq/Makefile Normal file
View File

@ -0,0 +1,38 @@
# $OpenBSD: Makefile,v 1.1.1.1 2012/09/26 01:40:32 lteo Exp $
COMMENT = data acquisition library for snort
# Original URL http://www.snort.org/downloads/1850 redirects to a
# time-limited Amazon S3 url. This would mean a bad distfile name.
# The following hack allows it to work but XXX if updating, the
# MASTER_SITES URL will need to be adjusted, not just DISTNAME.
DISTNAME = daq-1.1.1
MASTER_SITES = http://www.snort.org/downloads/1850?/
CATEGORIES = net
HOMEPAGE = http://www.snort.org/
MAINTAINER = Markus Lude <markus.lude@gmx.de>
# GPLv2
PERMIT_PACKAGE_CDROM = Yes
PERMIT_PACKAGE_FTP = Yes
PERMIT_DISTFILES_CDROM = Yes
PERMIT_DISTFILES_FTP = Yes
SHARED_LIBS += daq 0.0 # 1.0
SHARED_LIBS += sfbpf 0.0 # 0.1
WANTLIB = pcap
USE_LIBTOOL = Yes
SEPARATE_BUILD = Yes
CONFIGURE_STYLE = gnu
CONFIGURE_ARGS += ${CONFIGURE_SHARED} \
--enable-ipv6
BUILD_DEPENDS = devel/bison
.include <bsd.port.mk>

2
net/daq/distinfo Normal file
View File

@ -0,0 +1,2 @@
SHA256 (daq-1.1.1.tar.gz) = UPA8rMq7H8oCpWyzyOCrnKJcCwEnEDQu9rJmWRAaHuU=
SIZE (daq-1.1.1.tar.gz) = 472223

View File

@ -0,0 +1,26 @@
$OpenBSD: patch-api_daq_common_h,v 1.1.1.1 2012/09/26 01:40:32 lteo Exp $
--- api/daq_common.h.orig Wed Jan 4 06:54:49 2012
+++ api/daq_common.h Sat Aug 11 14:55:42 2012
@@ -25,6 +25,10 @@
#include <unistd.h>
#ifndef WIN32
#include <sys/time.h>
+#if defined(__OpenBSD__)
+/* for struct bpf_timeval */
+#include <net/bpf.h>
+#endif
#else
/* for struct timeavl */
#include <winsock2.h>
@@ -89,7 +93,11 @@
#define DAQ_PKTHDR_FLOOD -2 /* Egress is flooding */
typedef struct _daq_pkthdr
{
+#if defined(__OpenBSD__)
+ struct bpf_timeval ts; /* Timestamp */
+#else
struct timeval ts; /* Timestamp */
+#endif
uint32_t caplen; /* Length of the portion present */
uint32_t pktlen; /* Length of this packet (off wire) */
int32_t ingress_index; /* Index of the inbound interface. */

View File

@ -0,0 +1,24 @@
$OpenBSD: patch-configure,v 1.1.1.1 2012/09/26 01:40:32 lteo Exp $
--- configure.orig Tue Jul 10 21:32:51 2012
+++ configure Sat Aug 11 17:23:56 2012
@@ -12727,12 +12727,20 @@ else
#include <pcap.h>
#include <string.h>
+#if defined(__OpenBSD__)
+ #include <sys/param.h>
+#endif
extern char pcap_version[];
int
main ()
{
+#if defined(OpenBSD)
+#if OpenBSD >= 201211
+ return 0;
+#endif
+#endif
if (strcmp(pcap_version, "1.0.0") < 0)
return 1;

2
net/daq/pkg/DESCR Normal file
View File

@ -0,0 +1,2 @@
DAQ, or Data Acquisition library, is a library for packet I/O. The DAQ
replaces direct calls to PCAP functions with an abstraction layer.

6
net/daq/pkg/PFRAG.shared Normal file
View File

@ -0,0 +1,6 @@
@comment $OpenBSD: PFRAG.shared,v 1.1.1.1 2012/09/26 01:40:32 lteo Exp $
lib/daq/daq_dump.so
lib/daq/daq_ipfw.so
lib/daq/daq_pcap.so
@lib lib/libdaq.so.${LIBdaq_VERSION}
@lib lib/libsfbpf.so.${LIBsfbpf_VERSION}

23
net/daq/pkg/PLIST Normal file
View File

@ -0,0 +1,23 @@
@comment $OpenBSD: PLIST,v 1.1.1.1 2012/09/26 01:40:32 lteo Exp $
%%SHARED%%
bin/daq-modules-config
include/daq.h
include/daq_api.h
include/daq_common.h
include/sfbpf.h
include/sfbpf_dlt.h
lib/daq/
lib/daq/daq_dump.a
lib/daq/daq_dump.la
lib/daq/daq_ipfw.a
lib/daq/daq_ipfw.la
lib/daq/daq_pcap.a
lib/daq/daq_pcap.la
lib/libdaq.a
lib/libdaq.la
lib/libdaq_static.a
lib/libdaq_static.la
lib/libdaq_static_modules.a
lib/libdaq_static_modules.la
lib/libsfbpf.a
lib/libsfbpf.la