Update to 1.33
This commit is contained in:
parent
a95a656beb
commit
e04ee370e2
Notes:
svn2git
2021-03-31 03:12:20 +00:00
svn path=/head/; revision=496921
3 changed files with 39 additions and 42 deletions
|
@ -2,10 +2,11 @@
|
||||||
# $FreeBSD$
|
# $FreeBSD$
|
||||||
|
|
||||||
PORTNAME= netio
|
PORTNAME= netio
|
||||||
PORTVERSION= 1.32
|
PORTVERSION= 1.33
|
||||||
CATEGORIES= benchmarks net ipv6
|
CATEGORIES= benchmarks net ipv6
|
||||||
MASTER_SITES= LOCAL/arved
|
MASTER_SITES= http://www.ars.de/ \
|
||||||
DISTNAME= netio132
|
LOCAL/arved
|
||||||
|
DISTNAME= netio133
|
||||||
|
|
||||||
MAINTAINER= arved@FreeBSD.org
|
MAINTAINER= arved@FreeBSD.org
|
||||||
COMMENT= Network benchmark
|
COMMENT= Network benchmark
|
||||||
|
|
|
@ -1,2 +1,3 @@
|
||||||
SHA256 (netio132.zip) = c21550dfac6634558a7a79957eed28c46c62e0543017ef9d5c97c49f3cd41ddd
|
TIMESTAMP = 1553627772
|
||||||
SIZE (netio132.zip) = 162484
|
SHA256 (netio133.zip) = dc9599862f7a5aa7052a5d28ecd598f9be826f11d54d8a3b136a8d1f5d9a96c6
|
||||||
|
SIZE (netio133.zip) = 235931
|
||||||
|
|
|
@ -1,14 +1,14 @@
|
||||||
--- netio.c.orig 2016-07-27 15:01:12 UTC
|
--- netio.c.orig 2019-03-26 20:22:31.238439000 +0100
|
||||||
+++ netio.c
|
+++ netio.c 2019-03-26 20:25:57.485700000 +0100
|
||||||
@@ -136,6 +136,7 @@ static char *rcsrev = "$Revision: 1.32 $
|
@@ -142,6 +142,7 @@
|
||||||
#include <ctype.h>
|
|
||||||
#include <signal.h>
|
#include <signal.h>
|
||||||
|
#include <time.h>
|
||||||
#if defined(UNIX) || defined(DJGPP)
|
#if defined(UNIX) || defined(DJGPP)
|
||||||
+#include <arpa/inet.h>
|
+#include <arpa/inet.h>
|
||||||
#include <sys/time.h>
|
#include <sys/time.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
@@ -546,7 +547,7 @@ int send_data(int socket, void *buffer,
|
@@ -559,7 +560,7 @@
|
||||||
|
|
||||||
int recv_data(int socket, void *buffer, size_t size, int flags)
|
int recv_data(int socket, void *buffer, size_t size, int flags)
|
||||||
{
|
{
|
||||||
|
@ -17,7 +17,7 @@
|
||||||
|
|
||||||
if (rc < 0)
|
if (rc < 0)
|
||||||
{
|
{
|
||||||
@@ -563,8 +564,13 @@ int recv_data(int socket, void *buffer,
|
@@ -576,8 +577,13 @@
|
||||||
const int sobufsize = 131072;
|
const int sobufsize = 131072;
|
||||||
int nPort = DEFAULTPORT;
|
int nPort = DEFAULTPORT;
|
||||||
int nAuxPort = DEFAULTPORT + 1;
|
int nAuxPort = DEFAULTPORT + 1;
|
||||||
|
@ -31,7 +31,7 @@
|
||||||
|
|
||||||
int udpsocket, udpd;
|
int udpsocket, udpd;
|
||||||
unsigned long nUDPCount;
|
unsigned long nUDPCount;
|
||||||
@@ -577,7 +583,11 @@ THREAD TCP_Server(void *arg)
|
@@ -590,7 +596,11 @@
|
||||||
TIMER nTimer;
|
TIMER nTimer;
|
||||||
long nTime;
|
long nTime;
|
||||||
long long nData;
|
long long nData;
|
||||||
|
@ -43,7 +43,7 @@
|
||||||
int server, client;
|
int server, client;
|
||||||
socklen_type length;
|
socklen_type length;
|
||||||
struct timeval tv;
|
struct timeval tv;
|
||||||
@@ -591,7 +601,11 @@ THREAD TCP_Server(void *arg)
|
@@ -605,7 +615,11 @@
|
||||||
return THREADRESULT;
|
return THREADRESULT;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -55,9 +55,9 @@
|
||||||
{
|
{
|
||||||
psock_errno("socket()");
|
psock_errno("socket()");
|
||||||
free(cBuffer);
|
free(cBuffer);
|
||||||
@@ -601,9 +615,15 @@ THREAD TCP_Server(void *arg)
|
@@ -616,9 +630,15 @@
|
||||||
setsockopt(server, SOL_SOCKET, SO_RCVBUF, (char *) &sobufsize, sizeof(sobufsize));
|
|
||||||
setsockopt(server, SOL_SOCKET, SO_SNDBUF, (char *) &sobufsize, sizeof(sobufsize));
|
setsockopt(server, SOL_SOCKET, SO_SNDBUF, (char *) &sobufsize, sizeof(sobufsize));
|
||||||
|
setsockopt(server, IPPROTO_TCP, TCP_NODELAY, (char *) &flag, sizeof(int));
|
||||||
|
|
||||||
+#ifdef USE_IPV6
|
+#ifdef USE_IPV6
|
||||||
+ sa_server.sin6_family = AF_INET6;
|
+ sa_server.sin6_family = AF_INET6;
|
||||||
|
@ -71,7 +71,7 @@
|
||||||
|
|
||||||
if (bind(server, (struct sockaddr *) &sa_server, sizeof(sa_server)) < 0)
|
if (bind(server, (struct sockaddr *) &sa_server, sizeof(sa_server)) < 0)
|
||||||
{
|
{
|
||||||
@@ -753,7 +773,11 @@ void TCP_Bench(void *arg)
|
@@ -768,7 +788,11 @@
|
||||||
long nTime;
|
long nTime;
|
||||||
long long nData;
|
long long nData;
|
||||||
int i;
|
int i;
|
||||||
|
@ -83,7 +83,7 @@
|
||||||
int server;
|
int server;
|
||||||
int rc;
|
int rc;
|
||||||
int nByte;
|
int nByte;
|
||||||
@@ -764,7 +788,11 @@ void TCP_Bench(void *arg)
|
@@ -780,7 +804,11 @@
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -95,9 +95,9 @@
|
||||||
{
|
{
|
||||||
psock_errno("socket()");
|
psock_errno("socket()");
|
||||||
free(cBuffer);
|
free(cBuffer);
|
||||||
@@ -774,21 +802,33 @@ void TCP_Bench(void *arg)
|
@@ -791,9 +819,15 @@
|
||||||
setsockopt(server, SOL_SOCKET, SO_RCVBUF, (char *) &sobufsize, sizeof(sobufsize));
|
|
||||||
setsockopt(server, SOL_SOCKET, SO_SNDBUF, (char *) &sobufsize, sizeof(sobufsize));
|
setsockopt(server, SOL_SOCKET, SO_SNDBUF, (char *) &sobufsize, sizeof(sobufsize));
|
||||||
|
setsockopt(server, IPPROTO_TCP, TCP_NODELAY, (char *) &flag, sizeof(int));
|
||||||
|
|
||||||
+#ifdef USE_IPV6
|
+#ifdef USE_IPV6
|
||||||
+ sa_client.sin6_family = AF_INET6;
|
+ sa_client.sin6_family = AF_INET6;
|
||||||
|
@ -111,11 +111,8 @@
|
||||||
|
|
||||||
if (bind(server, (struct sockaddr *) &sa_client, sizeof(sa_client)) < 0)
|
if (bind(server, (struct sockaddr *) &sa_client, sizeof(sa_client)) < 0)
|
||||||
{
|
{
|
||||||
psock_errno("bind()");
|
@@ -803,9 +837,15 @@
|
||||||
soclose(server);
|
return;
|
||||||
free(cBuffer);
|
|
||||||
- return THREADRESULT;
|
|
||||||
+ return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
+#ifdef USE_IPV6
|
+#ifdef USE_IPV6
|
||||||
|
@ -130,7 +127,7 @@
|
||||||
|
|
||||||
if (connect(server, (struct sockaddr *) &sa_server, sizeof(sa_server)) < 0)
|
if (connect(server, (struct sockaddr *) &sa_server, sizeof(sa_server)) < 0)
|
||||||
{
|
{
|
||||||
@@ -911,7 +951,11 @@ void TCP_Bench(void *arg)
|
@@ -928,7 +968,11 @@
|
||||||
THREAD UDP_Receiver(void *arg)
|
THREAD UDP_Receiver(void *arg)
|
||||||
{
|
{
|
||||||
char *cBuffer;
|
char *cBuffer;
|
||||||
|
@ -142,7 +139,7 @@
|
||||||
int rc;
|
int rc;
|
||||||
socklen_type nBytes;
|
socklen_type nBytes;
|
||||||
|
|
||||||
@@ -921,7 +965,11 @@ THREAD UDP_Receiver(void *arg)
|
@@ -938,7 +982,11 @@
|
||||||
return THREADRESULT;
|
return THREADRESULT;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -154,7 +151,7 @@
|
||||||
{
|
{
|
||||||
psock_errno("socket(DGRAM)");
|
psock_errno("socket(DGRAM)");
|
||||||
free(cBuffer);
|
free(cBuffer);
|
||||||
@@ -931,9 +979,15 @@ THREAD UDP_Receiver(void *arg)
|
@@ -948,9 +996,15 @@
|
||||||
setsockopt(udpsocket, SOL_SOCKET, SO_RCVBUF, (char *) &sobufsize, sizeof(sobufsize));
|
setsockopt(udpsocket, SOL_SOCKET, SO_RCVBUF, (char *) &sobufsize, sizeof(sobufsize));
|
||||||
setsockopt(udpsocket, SOL_SOCKET, SO_SNDBUF, (char *) &sobufsize, sizeof(sobufsize));
|
setsockopt(udpsocket, SOL_SOCKET, SO_SNDBUF, (char *) &sobufsize, sizeof(sobufsize));
|
||||||
|
|
||||||
|
@ -170,7 +167,7 @@
|
||||||
|
|
||||||
if (bind(udpsocket, (struct sockaddr *) &sa_server, sizeof(sa_server)) < 0)
|
if (bind(udpsocket, (struct sockaddr *) &sa_server, sizeof(sa_server)) < 0)
|
||||||
{
|
{
|
||||||
@@ -973,7 +1027,11 @@ THREAD UDP_Server(void *arg)
|
@@ -990,7 +1044,11 @@
|
||||||
TIMER nTimer;
|
TIMER nTimer;
|
||||||
long nTime;
|
long nTime;
|
||||||
long long nData;
|
long long nData;
|
||||||
|
@ -182,7 +179,7 @@
|
||||||
int server, client;
|
int server, client;
|
||||||
struct timeval tv;
|
struct timeval tv;
|
||||||
fd_set fds;
|
fd_set fds;
|
||||||
@@ -986,7 +1044,11 @@ THREAD UDP_Server(void *arg)
|
@@ -1003,7 +1061,11 @@
|
||||||
return THREADRESULT;
|
return THREADRESULT;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -194,7 +191,7 @@
|
||||||
{
|
{
|
||||||
psock_errno("socket(STREAM)");
|
psock_errno("socket(STREAM)");
|
||||||
free(cBuffer);
|
free(cBuffer);
|
||||||
@@ -996,9 +1058,15 @@ THREAD UDP_Server(void *arg)
|
@@ -1013,9 +1075,15 @@
|
||||||
setsockopt(server, SOL_SOCKET, SO_RCVBUF, (char *) &sobufsize, sizeof(sobufsize));
|
setsockopt(server, SOL_SOCKET, SO_RCVBUF, (char *) &sobufsize, sizeof(sobufsize));
|
||||||
setsockopt(server, SOL_SOCKET, SO_SNDBUF, (char *) &sobufsize, sizeof(sobufsize));
|
setsockopt(server, SOL_SOCKET, SO_SNDBUF, (char *) &sobufsize, sizeof(sobufsize));
|
||||||
|
|
||||||
|
@ -210,7 +207,7 @@
|
||||||
|
|
||||||
if (bind(server, (struct sockaddr *) &sa_server, sizeof(sa_server)) < 0)
|
if (bind(server, (struct sockaddr *) &sa_server, sizeof(sa_server)) < 0)
|
||||||
{
|
{
|
||||||
@@ -1044,7 +1112,11 @@ THREAD UDP_Server(void *arg)
|
@@ -1061,7 +1129,11 @@
|
||||||
printf("UDP connection established ... ");
|
printf("UDP connection established ... ");
|
||||||
fflush(stdout);
|
fflush(stdout);
|
||||||
|
|
||||||
|
@ -222,7 +219,7 @@
|
||||||
|
|
||||||
for (;;)
|
for (;;)
|
||||||
{
|
{
|
||||||
@@ -1160,7 +1232,11 @@ void UDP_Bench(void *arg)
|
@@ -1177,7 +1249,11 @@
|
||||||
long nResult;
|
long nResult;
|
||||||
long long nData;
|
long long nData;
|
||||||
int i;
|
int i;
|
||||||
|
@ -234,7 +231,7 @@
|
||||||
int server;
|
int server;
|
||||||
int rc, nByte;
|
int rc, nByte;
|
||||||
|
|
||||||
@@ -1170,7 +1246,11 @@ void UDP_Bench(void *arg)
|
@@ -1187,7 +1263,11 @@
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -246,7 +243,7 @@
|
||||||
{
|
{
|
||||||
psock_errno("socket()");
|
psock_errno("socket()");
|
||||||
free(cBuffer);
|
free(cBuffer);
|
||||||
@@ -1180,21 +1260,33 @@ void UDP_Bench(void *arg)
|
@@ -1197,9 +1277,15 @@
|
||||||
setsockopt(server, SOL_SOCKET, SO_RCVBUF, (char *) &sobufsize, sizeof(sobufsize));
|
setsockopt(server, SOL_SOCKET, SO_RCVBUF, (char *) &sobufsize, sizeof(sobufsize));
|
||||||
setsockopt(server, SOL_SOCKET, SO_SNDBUF, (char *) &sobufsize, sizeof(sobufsize));
|
setsockopt(server, SOL_SOCKET, SO_SNDBUF, (char *) &sobufsize, sizeof(sobufsize));
|
||||||
|
|
||||||
|
@ -256,17 +253,15 @@
|
||||||
+ sa_client.sin6_addr = addr_local;
|
+ sa_client.sin6_addr = addr_local;
|
||||||
+#else
|
+#else
|
||||||
sa_client.sin_family = AF_INET;
|
sa_client.sin_family = AF_INET;
|
||||||
sa_client.sin_port = htons(0);
|
- sa_client.sin_port = htons(0);
|
||||||
|
+ sa_client.sin_port = htons(0);
|
||||||
sa_client.sin_addr = addr_local;
|
sa_client.sin_addr = addr_local;
|
||||||
+#endif
|
+#endif
|
||||||
|
|
||||||
if (bind(server, (struct sockaddr *) &sa_client, sizeof(sa_client)) < 0)
|
if (bind(server, (struct sockaddr *) &sa_client, sizeof(sa_client)) < 0)
|
||||||
{
|
{
|
||||||
psock_errno("bind(STREAM)");
|
@@ -1209,9 +1295,15 @@
|
||||||
soclose(server);
|
return;
|
||||||
free(cBuffer);
|
|
||||||
- return THREADRESULT;
|
|
||||||
+ return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
+#ifdef USE_IPV6
|
+#ifdef USE_IPV6
|
||||||
|
@ -281,7 +276,7 @@
|
||||||
|
|
||||||
if (connect(server, (struct sockaddr *) &sa_server, sizeof(sa_server)) < 0)
|
if (connect(server, (struct sockaddr *) &sa_server, sizeof(sa_server)) < 0)
|
||||||
{
|
{
|
||||||
@@ -1425,17 +1517,29 @@ int main(int argc, char **argv)
|
@@ -1442,17 +1534,29 @@
|
||||||
return psock_errno("sock_init()"), 1;
|
return psock_errno("sock_init()"), 1;
|
||||||
|
|
||||||
if (szLocal == 0)
|
if (szLocal == 0)
|
||||||
|
@ -311,7 +306,7 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1445,13 +1549,21 @@ int main(int argc, char **argv)
|
@@ -1462,13 +1566,21 @@
|
||||||
usage();
|
usage();
|
||||||
|
|
||||||
if (isdigit(*argv[optind]))
|
if (isdigit(*argv[optind]))
|
||||||
|
|
Loading…
Reference in a new issue