Index: head/benchmarks/netio/Makefile =================================================================== --- head/benchmarks/netio/Makefile (revision 150314) +++ head/benchmarks/netio/Makefile (revision 150315) @@ -1,29 +1,42 @@ # New ports collection Makefile for: netio # Date created: 2005-01-09 # Whom: arved # # $FreeBSD$ PORTNAME= netio PORTVERSION= 1.14 -CATEGORIES= benchmarks net +PORTREVISION= 1 +CATEGORIES= benchmarks net ipv6 MASTER_SITES= http://www.netfuse.de/techarea/netio/ DISTNAME= netio114 MAINTAINER= arved@FreeBSD.org COMMENT= Network benchmark WRKSRC= ${WRKDIR} USE_ZIP= yes USE_REINPLACE= yes USE_GMAKE= yes -ALL_TARGET= unix PLIST_FILES= bin/netio +.if defined(WITH_IPV6) +PLIST_FILES+= bin/netio6 +.endif + post-patch: ${REINPLACE_CMD} -e "s,-lsocket,," ${WRKSRC}/Makefile +do-build: + cd ${WRKSRC} && ${GMAKE} unix +.if defined(WITH_IPV6) + cd ${WRKSRC} && ${GMAKE} unix6 +.endif + do-install: ${INSTALL_PROGRAM} ${WRKSRC}/netio ${PREFIX}/bin +.if defined(WITH_IPV6) + ${INSTALL_PROGRAM} ${WRKSRC}/netio6 ${PREFIX}/bin +.endif .include Property changes on: head/benchmarks/netio/Makefile ___________________________________________________________________ Modified: cvs2svn:cvs-rev ## -1 +1 ## -1.2 \ No newline at end of property +1.3 \ No newline at end of property Index: head/benchmarks/netio/files/patch-Makefile =================================================================== --- head/benchmarks/netio/files/patch-Makefile (nonexistent) +++ head/benchmarks/netio/files/patch-Makefile (revision 150315) @@ -0,0 +1,27 @@ +--- Makefile.orig Thu Apr 19 14:21:19 2001 ++++ Makefile Sat Dec 3 15:19:39 2005 +@@ -57,9 +57,15 @@ + unix: + $(MAKE) all CC="gcc" O=.o X= \ + CFLAGS="-DUNIX -O" LFLAGS="-s" LIBS="-lsocket" OUT=-o ++unix6: ++ $(MAKE) all CC="gcc" O=.6o X=6 \ ++ CFLAGS="-DUNIX -O -DUSE_IPV6" LFLAGS="-lsocket" LIBS="" OUT=-o + unix-debug: + $(MAKE) all CC="gcc -g" O=.o X= \ + CFLAGS="-DUNIX" LFLAGS="" LIBS="-lsocket" OUT=-o ++unix6-debug: ++ $(MAKE) all CC="gcc -g" O=.6o X=6 \ ++ CFLAGS="-DUNIX -DUSE_IPV6" LFLAGS="-lsocket" LIBS="" OUT=-o + watt32: + $(MAKE) all CC="gcc -g -O2" O=.o X=.exe OUT=-o \ + CFLAGS="-DWATT32 -I../../inc" LIBS="../../lib/libwatt.a" +@@ -73,7 +79,7 @@ + + .SUFFIXES: .c $O + .c$O: +- $(CC) $(CFLAGS) $(INC) -c $*.c ++ $(CC) $(OUT) $@ $(CFLAGS) $(INC) -c $*.c + + netio$O: netio.c netbios.h getopt.h + netbios$O: netbios.c netbios.h Property changes on: head/benchmarks/netio/files/patch-Makefile ___________________________________________________________________ Added: cvs2svn:cvs-rev ## -0,0 +1 ## +1.1 \ No newline at end of property Added: fbsd:nokeywords ## -0,0 +1 ## +yes \ No newline at end of property Index: head/benchmarks/netio/files/patch-netio.c =================================================================== --- head/benchmarks/netio/files/patch-netio.c (nonexistent) +++ head/benchmarks/netio/files/patch-netio.c (revision 150315) @@ -0,0 +1,180 @@ +--- netio.c.orig Thu Apr 19 14:21:02 2001 ++++ netio.c Sat Dec 3 16:14:21 2005 +@@ -477,14 +477,22 @@ + + /* TCP/IP code */ + +-int nPort = 0x494F; /* "IO" */ ++int nPort = 0x494F; /* "IO" */ ++#ifdef USE_IPV6 ++struct in6_addr addr_server; ++#else + struct in_addr addr_server; ++#endif + + void TcpIpServer(void *arg) + { + char *cBuffer; +- int bQuit = 0; +- struct sockaddr_in sa_server, sa_client; ++ int bQuit = 0; ++#ifdef USE_IPV6 ++ struct sockaddr_in6 sa_server, sa_client; ++#else ++ struct sockaddr_in sa_server, sa_client; ++#endif + int server, client, length; + struct timeval tv; + fd_set fds; +@@ -495,17 +503,27 @@ + perror("malloc()"); + return; + } +- +- if ((server = socket(PF_INET, SOCK_STREAM, 0)) < 0) ++ ++#ifdef USE_IPV6 ++ if ((server = socket(PF_INET6, SOCK_STREAM, 0)) < 0) ++#else ++ if ((server = socket(PF_INET, SOCK_STREAM, 0)) < 0) ++#endif + { + psock_errno("socket()"); + free(cBuffer); + return; + } +- +- sa_server.sin_family = AF_INET; ++ ++#ifdef USE_IPV6 ++ sa_server.sin6_family = AF_INET6; ++ sa_server.sin6_port = htons(nPort); ++ sa_server.sin6_addr = in6addr_any; ++#else ++ sa_server.sin_family = AF_INET; + sa_server.sin_port = htons(nPort); + sa_server.sin_addr.s_addr = INADDR_ANY; ++#endif + + if (bind(server, (struct sockaddr *) &sa_server, sizeof(sa_server)) < 0) + { +@@ -524,8 +542,12 @@ + } + + for (;;) +- { ++ { ++#ifdef USE_IPV6 ++ printf("TCP/IP server Listening (IPv6).\n"); ++#else + printf("TCP/IP server Listening.\n"); ++#endif + + FD_ZERO(&fds); + FD_SET(server, &fds); +@@ -575,8 +597,12 @@ + TIMER nTimer; + long nTime; + long nData; +- int i; +- struct sockaddr_in sa_server; ++#ifdef USE_IPV6 ++ struct sockaddr_in6 sa_client; ++#else ++ struct sockaddr_in sa_client; ++#endif ++ int i; + int server; + int rc; + +@@ -585,19 +611,28 @@ + perror("malloc()"); + return; + } +- +- sa_server.sin_family = AF_INET; +- sa_server.sin_port = htons(nPort); +- sa_server.sin_addr = addr_server; +- ++ ++#ifdef USE_IPV6 ++ sa_client.sin6_family = AF_INET6; ++ sa_client.sin6_port = htons(nPort); ++ sa_client.sin6_addr = addr_server; ++#else ++ sa_client.sin_family = AF_INET; ++ sa_client.sin_port = htons(nPort); ++ sa_client.sin_addr = addr_server; ++#endif ++ ++#ifdef USE_IPV6 ++ if ((server = socket(PF_INET6, SOCK_STREAM, 0)) < 0) ++#else + if ((server = socket(PF_INET, SOCK_STREAM, 0)) < 0) ++#endif + { + psock_errno("socket()"); + free(cBuffer); + return; +- } +- +- if (connect(server, (struct sockaddr *) &sa_server, sizeof(sa_server)) < 0) ++ } ++ if (connect(server, (struct sockaddr *) &sa_client, sizeof(sa_client)) < 0) + { + psock_errno("connect()"); + soclose(server); +@@ -664,13 +699,17 @@ + { + printf( + #ifndef USE_NETBIOS ++#ifdef USE_IPV6 ++ "\nUsage: netio6 [-s] [-p ] []\n" ++#else + "\nUsage: netio [-s] [-p ] []\n" ++#endif + "\n\t-s\t\trun server side of benchmark (otherwise run client)" + "\n\t-p \tuse this port instead of the default (%d)" + "\n\t\tif the client side of the benchmark is running," + "\n\t\t\ta server host name is required\n" +-#else +- "\nUsage: netio [-s] [-t | -n] [-p ] [-a ] []\n" ++#else ++ "\nUsage: netio [-s] [-t | -n] [-p ] [-a ] []\n" + "\n\t-s\trun server side of benchmark (otherwise run client)" + "\n\t-t\tuse TCP/IP protocol for benchmark" + "\n\t-p \tuse this port for TCP/IP (default is %d)" +@@ -766,14 +805,28 @@ + if (optind == argc) + usage(); + +- if (isdigit(*argv[optind])) +- addr_server.s_addr = inet_addr(argv[optind]); ++ if (isdigit(*argv[optind]) ++#ifdef USE_IPV6 ++ || *argv[optind] == ':') ++ inet_pton(AF_INET6, argv[optind], &addr_server); ++#else ++ ) ++ addr_server.s_addr = inet_addr(argv[optind]); ++#endif + else +- { +- if ((host = gethostbyname(argv[optind])) == NULL) ++ { ++#ifdef USE_IPV6 ++ if ((host = gethostbyname2(argv[optind], AF_INET6)) == NULL) ++#else ++ if ((host = gethostbyname(argv[optind])) == NULL) ++#endif + return psock_errno("gethostbyname()"), 1; + +- addr_server = * (struct in_addr *) (host->h_addr); ++#ifdef USE_IPV6 ++ addr_server = * (struct in6_addr *) (host->h_addr); ++#else ++ addr_server = * (struct in_addr *) (host->h_addr); ++#endif + } + } + } Property changes on: head/benchmarks/netio/files/patch-netio.c ___________________________________________________________________ Added: cvs2svn:cvs-rev ## -0,0 +1 ## +1.1 \ No newline at end of property Added: fbsd:nokeywords ## -0,0 +1 ## +yes \ No newline at end of property