summaryrefslogtreecommitdiff
path: root/net-analyzer/netperf/files
diff options
context:
space:
mode:
Diffstat (limited to 'net-analyzer/netperf/files')
-rw-r--r--net-analyzer/netperf/files/netperf-2.2-conf4
-rw-r--r--net-analyzer/netperf/files/netperf-2.2-init21
-rw-r--r--net-analyzer/netperf/files/netperf-2.6.0-log-dir.patch11
-rw-r--r--net-analyzer/netperf/files/netperf-2.7.0-includes.patch22
-rw-r--r--net-analyzer/netperf/files/netperf-2.7.0-init23
-rw-r--r--net-analyzer/netperf/files/netperf-2.7.0-inline.patch32
-rw-r--r--net-analyzer/netperf/files/netperf-2.7.0-space.patch17
-rw-r--r--net-analyzer/netperf/files/netperf-fix-scripts.patch34
8 files changed, 164 insertions, 0 deletions
diff --git a/net-analyzer/netperf/files/netperf-2.2-conf b/net-analyzer/netperf/files/netperf-2.2-conf
new file mode 100644
index 000000000000..f61f483a83ea
--- /dev/null
+++ b/net-analyzer/netperf/files/netperf-2.2-conf
@@ -0,0 +1,4 @@
+# Config file for /etc/init.d/netperf
+
+# Add your preferred netserver args here
+#NETSERVER_ARGS="-n 4"
diff --git a/net-analyzer/netperf/files/netperf-2.2-init b/net-analyzer/netperf/files/netperf-2.2-init
new file mode 100644
index 000000000000..cd2fb35cdd27
--- /dev/null
+++ b/net-analyzer/netperf/files/netperf-2.2-init
@@ -0,0 +1,21 @@
+#!/sbin/openrc-run
+#
+# init.d script for net-analyzer/netperf's netserver
+#
+
+depend() {
+ use net
+}
+
+start() {
+ ebegin 'Starting netperf server (netserver)'
+ start-stop-daemon --start --quiet --user nobody \
+ --exec /usr/sbin/netserver -- ${NETSERVER_ARGS} >/dev/null
+ eend $?
+}
+
+stop() {
+ ebegin 'Stopping netperf server (netserver)'
+ start-stop-daemon --stop --quiet --exec /usr/sbin/netserver
+ eend $?
+}
diff --git a/net-analyzer/netperf/files/netperf-2.6.0-log-dir.patch b/net-analyzer/netperf/files/netperf-2.6.0-log-dir.patch
new file mode 100644
index 000000000000..00554cc0b5c2
--- /dev/null
+++ b/net-analyzer/netperf/files/netperf-2.6.0-log-dir.patch
@@ -0,0 +1,11 @@
+--- a/src/netserver.c
++++ b/src/netserver.c
+@@ -165,7 +165,7 @@
+ #elif defined(ANDROID)
+ #define DEBUG_LOG_FILE_DIR "/data/local/tmp/"
+ #else
+-#define DEBUG_LOG_FILE_DIR "/tmp/"
++#define DEBUG_LOG_FILE_DIR "/var/log/"
+ #endif
+ #endif /* DEBUG_LOG_FILE_DIR */
+
diff --git a/net-analyzer/netperf/files/netperf-2.7.0-includes.patch b/net-analyzer/netperf/files/netperf-2.7.0-includes.patch
new file mode 100644
index 000000000000..63c3cea40f4e
--- /dev/null
+++ b/net-analyzer/netperf/files/netperf-2.7.0-includes.patch
@@ -0,0 +1,22 @@
+--- a/src/net_uuid.c
++++ b/src/net_uuid.c
+@@ -28,6 +28,7 @@
+ #include <stdlib.h>
+ #include <string.h>
+ #include <fcntl.h>
++#include <unistd.h> /* read(), close() */
+
+ #if defined(HAVE_INTTYPES_H)
+ #include <inttypes.h>
+--- a/src/netlib.c
++++ b/src/netlib.c
+@@ -81,6 +81,9 @@
+ #include <endian.h>
+ #endif
+
++#if defined(HAVE_SENDFILE)
++#include <sys/sendfile.h> /* sendfile() */
++#endif
+
+ #ifndef WIN32
+ /* at some point, I would like to get rid of all these "sys/"
diff --git a/net-analyzer/netperf/files/netperf-2.7.0-init b/net-analyzer/netperf/files/netperf-2.7.0-init
new file mode 100644
index 000000000000..3d1bb0c15973
--- /dev/null
+++ b/net-analyzer/netperf/files/netperf-2.7.0-init
@@ -0,0 +1,23 @@
+#!/sbin/openrc-run
+#
+# init.d script for net-analyzer/netperf's netserver
+#
+
+depend() {
+ use net
+}
+
+start() {
+ checkpath -o netperf:netperf -d /var/log/netperf
+
+ ebegin 'Starting netperf server (netserver)'
+ start-stop-daemon --start --user netperf \
+ --exec /usr/sbin/netserver -- ${NETSERVER_ARGS}
+ eend $?
+}
+
+stop() {
+ ebegin 'Stopping netperf server (netserver)'
+ start-stop-daemon --stop --quiet --exec /usr/sbin/netserver
+ eend $?
+}
diff --git a/net-analyzer/netperf/files/netperf-2.7.0-inline.patch b/net-analyzer/netperf/files/netperf-2.7.0-inline.patch
new file mode 100644
index 000000000000..eb8c09b84695
--- /dev/null
+++ b/net-analyzer/netperf/files/netperf-2.7.0-inline.patch
@@ -0,0 +1,32 @@
+# Copyright Seblu 2015
+--- a/src/netlib.c 2015-08-04 20:30:43.449468815 +0200
++++ b/src/netlib.c 2015-08-04 20:31:40.317792002 +0200
+@@ -3997,11 +3997,7 @@
+ }
+ }
+
+-#ifdef WIN32
+-__forceinline void demo_interval_display(double actual_interval)
+-#else
+- inline void demo_interval_display(double actual_interval)
+-#endif
++void demo_interval_display(double actual_interval)
+ {
+ static int count = 0;
+ struct timeval now;
+@@ -4060,15 +4056,7 @@
+ important compilers have supported such a construct so it should
+ not be a big deal. raj 2012-01-23 */
+
+-#ifdef WIN32
+-/* It would seem that the Microsoft compiler will not inline across
+- source files. So there is little point in having an inline
+- directive in that situation. Of course that makes me wonder if an
+- inline directive has to appear in netlib.h... */
+ void demo_interval_tick(uint32_t units)
+-#else
+- inline void demo_interval_tick(uint32_t units)
+-#endif
+ {
+ double actual_interval = 0.0;
+
diff --git a/net-analyzer/netperf/files/netperf-2.7.0-space.patch b/net-analyzer/netperf/files/netperf-2.7.0-space.patch
new file mode 100644
index 000000000000..9ad43270b166
--- /dev/null
+++ b/net-analyzer/netperf/files/netperf-2.7.0-space.patch
@@ -0,0 +1,17 @@
+--- a/src/netserver.c
++++ b/src/netserver.c
+@@ -165,12 +165,12 @@
+ #elif defined(ANDROID)
+ #define DEBUG_LOG_FILE_DIR "/data/local/tmp/"
+ #else
+-#define DEBUG_LOG_FILE_DIR "/var/log/"
++#define DEBUG_LOG_FILE_DIR "/var/log/netperf/"
+ #endif
+ #endif /* DEBUG_LOG_FILE_DIR */
+
+ #ifndef DEBUG_LOG_FILE
+-#define DEBUG_LOG_FILE DEBUG_LOG_FILE_DIR"netserver.debug"
++#define DEBUG_LOG_FILE DEBUG_LOG_FILE_DIR "/netserver.debug"
+ #endif
+
+ #if !defined(PATH_MAX)
diff --git a/net-analyzer/netperf/files/netperf-fix-scripts.patch b/net-analyzer/netperf/files/netperf-fix-scripts.patch
new file mode 100644
index 000000000000..27e041fd7a32
--- /dev/null
+++ b/net-analyzer/netperf/files/netperf-fix-scripts.patch
@@ -0,0 +1,34 @@
+--- a/doc/examples/arr_script
++++ b/doc/examples/arr_script
+@@ -12,8 +12,7 @@
+ TOLERANCE=15
+ MAX_RETRIES=3
+
+- NETPERF="/usr/local/netperf/netperf"
+- NETPERF="./netperf"
++ NETPERF="/usr/bin/netperf"
+
+ NPROC_LIST=""
+ RR_SIZES=""
+--- a/doc/examples/packet_byte_script
++++ b/doc/examples/packet_byte_script
+@@ -25,7 +25,7 @@
+ fi
+
+ # where is netperf
+-NETPERF_DIR=${NETPERF_DIR:=/opt/netperf2/bin}
++NETPERF_DIR=${NETPERF_DIR:=/usr/bin}
+
+
+ # at what port will netserver be waiting? If you decide to run
+--- a/doc/examples/snapshot_script
++++ b/doc/examples/snapshot_script
+@@ -37,7 +37,7 @@
+ #
+ # where is netperf installed, there are a few possible places:
+
+-NETPERF_CMD=${NETPERF_CMD:=/opt/netperf/netperf}
++NETPERF_CMD=${NETPERF_CMD:=/usr/bin/netperf}
+
+
+ # there should be no more than two parms passed