aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorhrs <hrs@FreeBSD.org>2013-07-21 05:37:46 +0800
committerhrs <hrs@FreeBSD.org>2013-07-21 05:37:46 +0800
commit2208425f84e4de319055ea907f04dd2808a707fd (patch)
tree9b69a6f648468735c5eea811dfa71a22ffe2bec1
parent017ee0baa70b6d243515f78d246c8c607ba8f5a7 (diff)
downloadfreebsd-ports-gnome-2208425f84e4de319055ea907f04dd2808a707fd.tar.gz
freebsd-ports-gnome-2208425f84e4de319055ea907f04dd2808a707fd.tar.zst
freebsd-ports-gnome-2208425f84e4de319055ea907f04dd2808a707fd.zip
Add net/packetdrill, a network stack testing tool.
The packetdrill scripting tool enables quick, precise tests for entire TCP/UDP/IPv4/IPv6 network stacks, from the system call layer down to the NIC hardware. packetdrill currently works on Linux, FreeBSD, OpenBSD, and NetBSD. It can test network stack behavior over physical NICs on a LAN, or on a single machine using a tun virtual network device.
-rw-r--r--net/Makefile1
-rw-r--r--net/packetdrill/Makefile43
-rw-r--r--net/packetdrill/distinfo2
-rw-r--r--net/packetdrill/files/Makefile5
-rw-r--r--net/packetdrill/files/Makefile.checksum_test5
-rw-r--r--net/packetdrill/files/Makefile.inc12
-rw-r--r--net/packetdrill/files/Makefile.libpd28
-rw-r--r--net/packetdrill/files/Makefile.packet_parser_test5
-rw-r--r--net/packetdrill/files/Makefile.packet_to_string_test5
-rw-r--r--net/packetdrill/files/Makefile.packetdrill5
-rw-r--r--net/packetdrill/pkg-descr8
-rw-r--r--net/packetdrill/pkg-plist5
12 files changed, 124 insertions, 0 deletions
diff --git a/net/Makefile b/net/Makefile
index 95663b24c98c..b69c2dc9ca01 100644
--- a/net/Makefile
+++ b/net/Makefile
@@ -789,6 +789,7 @@
SUBDIR += p5-ZConf-Bookmarks
SUBDIR += p5-ZeroMQ
SUBDIR += p5-perl-ldap
+ SUBDIR += packetdrill
SUBDIR += packter-agent
SUBDIR += panoptis
SUBDIR += paris-traceroute
diff --git a/net/packetdrill/Makefile b/net/packetdrill/Makefile
new file mode 100644
index 000000000000..3d2544893f8c
--- /dev/null
+++ b/net/packetdrill/Makefile
@@ -0,0 +1,43 @@
+# $FreeBSD$
+
+PORTNAME= packetdrill
+PORTVERSION= 0.0.20130626
+CATEGORIES= net ipv6
+MASTER_SITES= LOCAL/hrs
+DISTNAME= ${PORTNAME}-77954df72a78
+
+MAINTAINER= hrs@FreeBSD.org
+COMMENT= Network stack testing tool
+
+LICENSE= GPLv2
+
+USES= bison
+MAKE_ENV+= PTHREAD_CFLAGS="${PTHREAD_CFLAGS}" \
+ PTHREAD_LIBS="${PTHREAD_LIBS}"
+MAKE_JOBS_SAFE= yes
+PORTDOCS= README
+PORTEXAMPLES= fr-4pkt-sack-bsd.pkt fr-4pkt-sack-linux.pkt
+
+OPTIONS_DEFINE= DOCS EXAMPLES
+OPTIONS_DEFAULT=DOCS EXAMPLES
+
+.include <bsd.port.options.mk>
+
+pre-build:
+ ${INSTALL_DATA} ${FILESDIR}/Makefile ${FILESDIR}/Makefile.inc ${WRKSRC}
+.for F in libpd packetdrill checksum_test packet_parser_test packet_to_string_test
+ ${MKDIR} ${WRKSRC}/${F}
+ ${INSTALL_DATA} ${FILESDIR}/Makefile.${F} ${WRKSRC}/${F}/Makefile
+.endfor
+
+post-install:
+.if ${PORT_OPTIONS:MEXAMPLES}
+ @${MKDIR} ${EXAMPLESDIR}
+ cd ${WRKSRC}/examples && ${INSTALL_DATA} ${PORTEXAMPLES} ${EXAMPLESDIR}
+.endif
+.if ${PORT_OPTIONS:MDOCS}
+ @${MKDIR} ${DOCSDIR}
+ cd ${WRKSRC} && ${INSTALL_DATA} ${PORTDOCS} ${DOCSDIR}
+.endif
+
+.include <bsd.port.mk>
diff --git a/net/packetdrill/distinfo b/net/packetdrill/distinfo
new file mode 100644
index 000000000000..945d62ec5d28
--- /dev/null
+++ b/net/packetdrill/distinfo
@@ -0,0 +1,2 @@
+SHA256 (packetdrill-77954df72a78.tar.gz) = 0a022fb2a0c02f6f01f52e05380ddb47aef8580727330f11f8eeed60e94d50e5
+SIZE (packetdrill-77954df72a78.tar.gz) = 130523
diff --git a/net/packetdrill/files/Makefile b/net/packetdrill/files/Makefile
new file mode 100644
index 000000000000..2ec9f58c2a19
--- /dev/null
+++ b/net/packetdrill/files/Makefile
@@ -0,0 +1,5 @@
+# $FreeBSD$
+
+SUBDIR= libpd packetdrill checksum_test packet_parser_test packet_to_string_test
+
+.include <bsd.subdir.mk>
diff --git a/net/packetdrill/files/Makefile.checksum_test b/net/packetdrill/files/Makefile.checksum_test
new file mode 100644
index 000000000000..6d9c60a408e4
--- /dev/null
+++ b/net/packetdrill/files/Makefile.checksum_test
@@ -0,0 +1,5 @@
+# $FreeBSD$
+
+PROG= checksum_test
+
+.include <bsd.prog.mk>
diff --git a/net/packetdrill/files/Makefile.inc b/net/packetdrill/files/Makefile.inc
new file mode 100644
index 000000000000..6232b1ffb035
--- /dev/null
+++ b/net/packetdrill/files/Makefile.inc
@@ -0,0 +1,12 @@
+# $FreeBSD$
+
+PREFIX?= /usr/local
+BINDIR?= ${PREFIX}/bin
+
+NO_MAN=
+
+.PATH: ${.CURDIR}/..
+
+CFLAGS+= -I${.CURDIR}/.. -I${.CURDIR} ${PTHREAD_CFLAGS}
+PTHREAD_LIBS?= -pthread
+LDADD= ${.CURDIR}/../libpd/libpd.a ${PTHREAD_LIBS} -lpcap
diff --git a/net/packetdrill/files/Makefile.libpd b/net/packetdrill/files/Makefile.libpd
new file mode 100644
index 000000000000..13912cd44f5c
--- /dev/null
+++ b/net/packetdrill/files/Makefile.libpd
@@ -0,0 +1,28 @@
+# $FreeBSD$
+
+LIB= pd
+SRCS= checksum.c code.c config.c hash.c hash_map.c \
+ ip_address.c netdev.c net_utils.c packet.c \
+ packet_socket_linux.c packet_socket_pcap.c packet_checksum.c \
+ packet_parser.c packet_to_string.c symbols_linux.c \
+ symbols_freebsd.c symbols_openbsd.c symbols_netbsd.c \
+ icmp_packet.c ip_packet.c tcp_packet.c udp_packet.c run.c \
+ run_command.c run_packet.c run_system_call.c script.c \
+ socket.c system.c tcp_options.c tcp_options_iterator.c \
+ tcp_options_to_string.c logging.c types.c lexer.c parser.c \
+ fmemopen.c open_memstream.c link_layer.c wire_conn.c \
+ wire_protocol.c wire_client.c wire_client_netdev.c \
+ wire_server.c wire_server_netdev.c
+
+.PATH: ${.CURDIR}/..
+
+parser.c: parser.y
+ bison --output=${.TARGET} --defines=parser.h --report=state ${.IMPSRC}
+
+lexer.c: parser.c
+
+CLEANFILES= parser.h parser.c parser.output lexer.c
+
+install:
+
+.include <bsd.lib.mk>
diff --git a/net/packetdrill/files/Makefile.packet_parser_test b/net/packetdrill/files/Makefile.packet_parser_test
new file mode 100644
index 000000000000..d3968ca77304
--- /dev/null
+++ b/net/packetdrill/files/Makefile.packet_parser_test
@@ -0,0 +1,5 @@
+# $FreeBSD$
+
+PROG= packet_parser_test
+
+.include <bsd.prog.mk>
diff --git a/net/packetdrill/files/Makefile.packet_to_string_test b/net/packetdrill/files/Makefile.packet_to_string_test
new file mode 100644
index 000000000000..69fdf10da53a
--- /dev/null
+++ b/net/packetdrill/files/Makefile.packet_to_string_test
@@ -0,0 +1,5 @@
+# $FreeBSD$
+
+PROG= packet_to_string_test
+
+.include <bsd.prog.mk>
diff --git a/net/packetdrill/files/Makefile.packetdrill b/net/packetdrill/files/Makefile.packetdrill
new file mode 100644
index 000000000000..54b57cf82b61
--- /dev/null
+++ b/net/packetdrill/files/Makefile.packetdrill
@@ -0,0 +1,5 @@
+# $FreeBSD$
+
+PROG= packetdrill
+
+.include <bsd.prog.mk>
diff --git a/net/packetdrill/pkg-descr b/net/packetdrill/pkg-descr
new file mode 100644
index 000000000000..9f53ad3fb32c
--- /dev/null
+++ b/net/packetdrill/pkg-descr
@@ -0,0 +1,8 @@
+The packetdrill scripting tool enables quick, precise tests for entire
+TCP/UDP/IPv4/IPv6 network stacks, from the system call layer down to
+the NIC hardware. packetdrill currently works on Linux, FreeBSD,
+OpenBSD, and NetBSD. It can test network stack behavior over physical
+NICs on a LAN, or on a single machine using a tun virtual network
+device.
+
+WWW: https://code.google.com/p/packetdrill/
diff --git a/net/packetdrill/pkg-plist b/net/packetdrill/pkg-plist
new file mode 100644
index 000000000000..227c5fdae360
--- /dev/null
+++ b/net/packetdrill/pkg-plist
@@ -0,0 +1,5 @@
+@comment $FreeBSD$
+bin/packetdrill
+bin/checksum_test
+bin/packet_parser_test
+bin/packet_to_string_test