pkgsrc-WIP-changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

wip/uperf: import uperf-1.0.6



Module Name:	pkgsrc-wip
Committed By:	Kamil Rytarowski <n54%gmx.com@localhost>
Pushed By:	kamil
Date:		Fri Mar 30 00:52:46 2018 +0200
Changeset:	b4ec4d82c32e2add7550167bb86e0083667c2d05

Added Files:
	uperf/DESCR
	uperf/Makefile
	uperf/PLIST
	uperf/distinfo
	uperf/patches/patch-configure.ac
	uperf/patches/patch-src_sctp.c
	uperf/patches/patch-src_sendfilev.c
	uperf/patches/patch-src_ssl.c

Log Message:
wip/uperf: import uperf-1.0.6

uperf is a network performance tool that supports modelling and replay of
various networking patterns. uperf was initially developed by the Performance
Applications Engineering group at Sun Microsystems. Since 2008, it is being
developed by the community.

This is a scratch package I kept around.

To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=b4ec4d82c32e2add7550167bb86e0083667c2d05

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

diffstat:
 uperf/DESCR                         |  4 +++
 uperf/Makefile                      | 20 ++++++++++++
 uperf/PLIST                         | 13 ++++++++
 uperf/distinfo                      | 10 ++++++
 uperf/patches/patch-configure.ac    | 26 +++++++++++++++
 uperf/patches/patch-src_sctp.c      | 63 +++++++++++++++++++++++++++++++++++++
 uperf/patches/patch-src_sendfilev.c | 43 +++++++++++++++++++++++++
 uperf/patches/patch-src_ssl.c       | 14 +++++++++
 8 files changed, 193 insertions(+)

diffs:
diff --git a/uperf/DESCR b/uperf/DESCR
new file mode 100644
index 0000000000..bf67987db6
--- /dev/null
+++ b/uperf/DESCR
@@ -0,0 +1,4 @@
+uperf is a network performance tool that supports modelling and replay of
+various networking patterns. uperf was initially developed by the Performance
+Applications Engineering group at Sun Microsystems. Since 2008, it is being
+developed by the community.
diff --git a/uperf/Makefile b/uperf/Makefile
new file mode 100644
index 0000000000..a69613c3f4
--- /dev/null
+++ b/uperf/Makefile
@@ -0,0 +1,20 @@
+# $NetBSD$
+
+DISTNAME=	uperf-1.0.6
+CATEGORIES=	benchmarks
+MASTER_SITES=	${MASTER_SITE_GITHUB:=uperf/}
+GITHUB_TAG=	v${PKGVERSION_NOREV}
+
+MAINTAINER=	pkgsrc-users%NetBSD.org@localhost
+HOMEPAGE=	http://www.uperf.org/
+COMMENT=	Network performance tool
+LICENSE=	gnu-gpl-v3
+
+USE_TOOLS+=	aclocal autoconf automake
+
+GNU_CONFIGURE=	yes
+
+pre-configure:
+	${RUN} cd ${WRKSRC} && ${SH} bootstrap
+
+.include "../../mk/bsd.pkg.mk"
diff --git a/uperf/PLIST b/uperf/PLIST
new file mode 100644
index 0000000000..a56800b763
--- /dev/null
+++ b/uperf/PLIST
@@ -0,0 +1,13 @@
+@comment $NetBSD$
+bin/uperf
+share/connect.xml
+share/iperf.xml
+share/ldap.xml
+share/netperf.xml
+share/oltpnet.xml
+share/oraclerac.xml
+share/sctp.xml
+share/specweb.xml
+share/ssl.xml
+share/telnet.xml
+share/two-hosts.xml
diff --git a/uperf/distinfo b/uperf/distinfo
new file mode 100644
index 0000000000..52ca46700f
--- /dev/null
+++ b/uperf/distinfo
@@ -0,0 +1,10 @@
+$NetBSD$
+
+SHA1 (uperf-1.0.6.tar.gz) = 1eeac167c0d8bfd5c10cffc746c194ae93537459
+RMD160 (uperf-1.0.6.tar.gz) = d21e6370555ea6f833ef4ee79fd95c41b6007cf3
+SHA512 (uperf-1.0.6.tar.gz) = 2fa36e4af17d7f8fd947aac940fc8ba47a1a92eeccabd85d21871e98950736854c9bd35593eaa82ae75e13d0461cdafd6550bf7db83b4599c1ccc3e93dd01a6e
+Size (uperf-1.0.6.tar.gz) = 222351 bytes
+SHA1 (patch-configure.ac) = c40c50a96ce98bf8dad54b3375fae04d03b8f174
+SHA1 (patch-src_sctp.c) = 0657cd93c8784e1fb7d70f865d5a05db579f88c8
+SHA1 (patch-src_sendfilev.c) = 96f3b232c37fc28565ee418fad0c9caa13edef29
+SHA1 (patch-src_ssl.c) = 47e84be348ded53c1154eee21b5e6b0fa4c9a278
diff --git a/uperf/patches/patch-configure.ac b/uperf/patches/patch-configure.ac
new file mode 100644
index 0000000000..42e9a3954f
--- /dev/null
+++ b/uperf/patches/patch-configure.ac
@@ -0,0 +1,26 @@
+$NetBSD$
+
+Add NetBSD support.
+
+--- configure.ac.orig	2017-09-11 12:26:20.000000000 +0000
++++ configure.ac
+@@ -45,6 +45,14 @@ case "$(uname -s)" in
+ 		UPERF_LIBS="$UPERF_LIBS -lrt -lm -pthread"
+ 		CFLAGS="-D_GNU_SOURCE $CFLAGS"
+ 		;;
++	NetBSD)
++		AC_MSG_NOTICE([*** NetBSD Machine ***])
++		AC_DEFINE([UPERF_NETBSD],[1],[Setting machine os to NetBSD])
++		good_os="no"
++		sctp_default="yes"
++		ssl_default="yes"
++		UPERF_LIBS="$UPERF_LIBS -lrt -lm -pthread"
++		;;
+ 	Linux)
+ 		AC_MSG_NOTICE([*** Linux Machine ***])
+ 		AC_DEFINE([UPERF_LINUX],[1],[Setting machine os to Linux])
+@@ -375,4 +383,3 @@ echo "+---------------------------------
+ printf "|%33s:%14s|\n" "Network stats collection enabled?" "$enable_netstat"
+ printf "|%33s:%14s|\n" "CPU Performance counters?"  "$cpc"
+ echo "+------------------------------------------------+"
+-
diff --git a/uperf/patches/patch-src_sctp.c b/uperf/patches/patch-src_sctp.c
new file mode 100644
index 0000000000..c1a12e32dc
--- /dev/null
+++ b/uperf/patches/patch-src_sctp.c
@@ -0,0 +1,63 @@
+$NetBSD$
+
+Add NetBSD support.
+
+--- src/sctp.c.orig	2017-09-11 12:26:20.000000000 +0000
++++ src/sctp.c
+@@ -109,23 +109,29 @@ set_sctp_options(int fd, int family, flo
+ #endif
+ 	}
+ 	if (f->sctp_max_burst_size > 0) {
++#ifdef SCTP_MAX_BURST
+ 		struct sctp_assoc_value maxburst;
+ 
+ 		memset(&maxburst, 0, sizeof(struct sctp_assoc_value));
+ 		maxburst.assoc_value = f->sctp_max_burst_size;
+ 		if (setsockopt(fd, IPPROTO_SCTP, SCTP_MAX_BURST,
+-		               &maxburst, (socklen_t)sizeof(struct sctp_assoc_value)) < 0) {
++		               &maxburst, (socklen_t)sizeof(*maxburst)) < 0) {
+ 			uperf_log_msg(UPERF_LOG_WARN, errno,
+ 			              "Cannot set max. burst parameter for SCTP");
+ 		}
++#endif
+ 	}
+ 	if (f->sctp_max_fragment_size > 0) {
++#if defined(UPERF_NETBSD)
++		unsigned int maxfrag = f->sctp_max_fragment_size;
++#else
+ 		struct sctp_assoc_value maxfrag;
+ 
+ 		memset(&maxfrag, 0, sizeof(struct sctp_assoc_value));
+ 		maxfrag.assoc_value = f->sctp_max_fragment_size;
++#endif
+ 		if (setsockopt(fd, IPPROTO_SCTP, SCTP_MAXSEG,
+-		               &maxfrag, (socklen_t)sizeof(struct sctp_assoc_value)) < 0) {
++		               &maxfrag, (socklen_t)sizeof(maxfrag)) < 0) {
+ 			uperf_log_msg(UPERF_LOG_WARN, errno,
+ 			              "Cannot set max. fragment size of SCTP");
+ 		}
+@@ -135,7 +141,7 @@ set_sctp_options(int fd, int family, flo
+ 
+ 		memset(&param, 0, sizeof(struct sctp_paddrparams));
+ 		param.spp_address.ss_family = family;
+-#if defined(UPERF_FREEBSD) || defined(UPERF_DARWIN)
++#if defined(UPERF_FREEBSD) || defined(UPERF_NETBSD) || defined(UPERF_DARWIN)
+ 		switch (family) {
+ 		case AF_INET:
+ 			param.spp_address.ss_len = sizeof(struct sockaddr_in);
+@@ -302,13 +308,13 @@ protocol_sctp_write(protocol_t *p, void 
+ 		stream_no = flowops->sctp_stream_id;
+ 		if (strcasecmp(flowops->sctp_pr_policy, "ttl") == 0) {
+ 			timetolive = flowops->sctp_pr_value;
+-#if defined(UPERF_FREEBSD) || defined(UPERF_DARWIN)
++#if defined(UPERF_FREEBSD) || defined(UPERF_NETBSD) || defined(UPERF_DARWIN)
+ #ifdef SCTP_PR_SCTP_TTL
+ 			flags |= SCTP_PR_SCTP_TTL;
+ #endif
+ #endif
+ 		}
+-#if defined(UPERF_FREEBSD) || defined(UPERF_DARWIN)
++#if defined(UPERF_FREEBSD) || defined(UPERF_NETBSD) || defined(UPERF_DARWIN)
+ #ifdef SCTP_PR_SCTP_RTX
+ 		if (strcasecmp(flowops->sctp_pr_policy, "rtx") == 0) {
+ 			timetolive = flowops->sctp_pr_value;
diff --git a/uperf/patches/patch-src_sendfilev.c b/uperf/patches/patch-src_sendfilev.c
new file mode 100644
index 0000000000..7aa85b4c89
--- /dev/null
+++ b/uperf/patches/patch-src_sendfilev.c
@@ -0,0 +1,43 @@
+$NetBSD$
+
+Fake NetBSD support.
+
+--- src/sendfilev.c.orig	2017-09-11 12:26:20.000000000 +0000
++++ src/sendfilev.c
+@@ -159,7 +159,13 @@ sendfile_init(char *dir)
+ 	return (0);
+ }
+ 
+-#ifdef HAVE_SENDFILEV	/* Linux does not have sendfilev */
++#if defined(UPERF_NETBSD)
++static ssize_t
++do_sendfilev_chunked(sfv_list_t *s, int sock, int csize)
++{
++	return -1;
++}
++#elif defined(HAVE_SENDFILEV)	/* Linux does not have sendfilev */
+ static ssize_t
+ do_sendfilev_chunked(sfv_list_t *s, int sock, int csize)
+ {
+@@ -212,6 +218,13 @@ do_sendfilev(int sock, char *dir, int nf
+ }
+ #endif
+ 
++#if defined(UPERF_NETBSD)
++ssize_t
++do_sendfile(int sock, char *dir, int chunk_size)
++{
++	return -1;
++}
++#else
+ ssize_t
+ do_sendfile(int sock, char *dir, int chunk_size)
+ {
+@@ -265,6 +278,7 @@ do_sendfile(int sock, char *dir, int chu
+ 		return (s->flist[r].size);
+ 	}
+ }
++#endif
+ 
+ #ifdef MAIN
+ int
diff --git a/uperf/patches/patch-src_ssl.c b/uperf/patches/patch-src_ssl.c
new file mode 100644
index 0000000000..619fad4fa8
--- /dev/null
+++ b/uperf/patches/patch-src_ssl.c
@@ -0,0 +1,14 @@
+$NetBSD$
+
+Add missing include.
+
+--- src/ssl.c.orig	2017-09-11 12:26:20.000000000 +0000
++++ src/ssl.c
+@@ -26,6 +26,7 @@
+ 
+ #include <stdio.h>
+ #include <stdlib.h>
++#include <string.h>
+ #include <sys/socket.h>		/* basic socket definitions */
+ #include <netdb.h>
+ #include <netinet/in.h>


Home | Main Index | Thread Index | Old Index