Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Added net-analyzer/netio with IPv6 patch

  • Loading branch information...
commit 56f49f00522cecbb9e50d1aae9b51ae62d17a641 1 parent 90dc26e
Michal Zima authored
5 net-analyzer/netio/Manifest
View
@@ -0,0 +1,5 @@
+AUX netio-1.26-ipv6-1.patch 273 RMD160 0cd430acb1ee99228d2237fc50421b06ade4df39 SHA1 cf49da37df9274308b8adf677c05f1f7cb52e619 SHA256 e245c642c0267305dcad0644ce2e968d24877e4d75cd38786c9a01ecb791935b
+AUX netio-1.26-ipv6-2.patch 6911 RMD160 e48996eba43b12cd415f8aed1e69c54a179e8a7a SHA1 d68572e83e2a97fce15e180f43d834cde16b7a64 SHA256 20b88a51f72b0db69beb4b83a826a270201a31244bf76f0311d3209852bc06ef
+AUX netio-1.26-linux-include.patch 309 RMD160 e18e1c6397a471e4f16051be5862828c9560bf87 SHA1 1be313a0f2ac8494192328e05903b99fa66e7185 SHA256 77a7b6aabf43fd0f2cf46d116ea9967ef77053907eb46437a3286b94b3dc86aa
+DIST netio126.zip 140402 RMD160 bff92f25df1df87c7075432b1da3e0f7defe1e30 SHA1 ef63e9b0564445a1831b53be98a5472dbceaa922 SHA256 86c0bdee3224477b43c0cb6161ce1a20b2a2b6d59ef37f67864227096d9e8d5c
+EBUILD netio-1.26.ebuild 1598 RMD160 bd785b55920d2ae37803aeecb416a96833e03b77 SHA1 6ab15346e143d2c00cc74f07317510f726068fc7 SHA256 fdc80889fc881b5c0b4beb86d7bb332d0b2c1f6163ae36f371ba439181700708
11 net-analyzer/netio/files/netio-1.26-ipv6-1.patch
View
@@ -0,0 +1,11 @@
+--- Makefile.orig Sat Sep 2 13:27:40 2006
++++ Makefile Sat Sep 2 13:29:30 2006
+@@ -96,7 +96,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
282 net-analyzer/netio/files/netio-1.26-ipv6-2.patch
View
@@ -0,0 +1,282 @@
+--- netio.c.orig Tue Aug 30 16:47:18 2005
++++ netio.c Sat Sep 2 13:46:50 2006
+@@ -782,8 +782,13 @@
+ const int sobufsize = 131072;
+ int nPort = DEFAULTPORT;
+ int nAuxPort = DEFAULTPORT + 1;
++#ifdef USE_IPV6
++struct in6_addr addr_server;
++struct in6_addr addr_local;
++#else
+ struct in_addr addr_server;
+ struct in_addr addr_local;
++#endif
+
+ int udpsocket, udpd;
+ unsigned long nUDPCount;
+@@ -794,7 +799,11 @@
+ char *cBuffer;
+ CONTROL ctl;
+ long long nData;
++#ifdef USE_IPV6
++ struct sockaddr_in6 sa_server, sa_client;
++#else
+ struct sockaddr_in sa_server, sa_client;
++#endif
+ int server, client;
+ size_t length;
+ struct timeval tv;
+@@ -808,7 +817,11 @@
+ return THREADRESULT;
+ }
+
++#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);
+@@ -818,10 +831,15 @@
+ setsockopt(server, SOL_SOCKET, SO_RCVBUF, (char *) &sobufsize, sizeof(sobufsize));
+ setsockopt(server, SOL_SOCKET, SO_SNDBUF, (char *) &sobufsize, sizeof(sobufsize));
+
++#ifdef USE_IPV6
++ sa_server.sin6_family = AF_INET6;
++ sa_server.sin6_port = htons(nPort);
++ sa_server.sin6_addr = addr_local;
++#else
+ sa_server.sin_family = AF_INET;
+ sa_server.sin_port = htons(nPort);
+ sa_server.sin_addr = addr_local;
+-
++#endif
+ if (bind(server, (struct sockaddr *) &sa_server, sizeof(sa_server)) < 0)
+ {
+ psock_errno("bind()");
+@@ -958,7 +976,11 @@
+ long nTime, nResult;
+ long long nData;
+ int i;
++#ifdef USE_IPV6
++ struct sockaddr_in6 sa_server;
++#else
+ struct sockaddr_in sa_server;
++#endif
+ int server;
+ int rc;
+ int nByte;
+@@ -969,7 +991,11 @@
+ return;
+ }
+
++#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);
+@@ -979,9 +1005,16 @@
+ setsockopt(server, SOL_SOCKET, SO_RCVBUF, (char *) &sobufsize, sizeof(sobufsize));
+ setsockopt(server, SOL_SOCKET, SO_SNDBUF, (char *) &sobufsize, sizeof(sobufsize));
+
++#ifdef USE_IPV6
++ sa_server.sin6_family = AF_INET6;
++ sa_server.sin6_port = htons(nPort);
++ sa_server.sin6_addr = addr_server;
++
++#else
+ sa_server.sin_family = AF_INET;
+ sa_server.sin_port = htons(nPort);
+ sa_server.sin_addr = addr_server;
++#endif
+
+ if (connect(server, (struct sockaddr *) &sa_server, sizeof(sa_server)) < 0)
+ {
+@@ -1121,7 +1154,11 @@
+ THREAD UDP_Receiver(void *arg)
+ {
+ char *cBuffer;
++#ifdef USE_IPV6
++ struct sockaddr_in6 sa_server, sa_client;
++#else
+ struct sockaddr_in sa_server, sa_client;
++#endif
+ int rc;
+ size_t nBytes;
+
+@@ -1131,7 +1168,11 @@
+ return THREADRESULT;
+ }
+
++#ifdef USE_IPV6
++ if ((udpsocket = socket(PF_INET6, SOCK_DGRAM, 0)) < 0)
++#else
+ if ((udpsocket = socket(PF_INET, SOCK_DGRAM, 0)) < 0)
++#endif
+ {
+ psock_errno("socket(DGRAM)");
+ free(cBuffer);
+@@ -1141,9 +1182,15 @@
+ setsockopt(udpsocket, SOL_SOCKET, SO_RCVBUF, (char *) &sobufsize, sizeof(sobufsize));
+ setsockopt(udpsocket, SOL_SOCKET, SO_SNDBUF, (char *) &sobufsize, sizeof(sobufsize));
+
++#ifdef USE_IPV6
++ sa_server.sin6_family = AF_INET6;
++ sa_server.sin6_port = htons(nAuxPort);
++ sa_server.sin6_addr = addr_local;
++#else
+ sa_server.sin_family = AF_INET;
+ sa_server.sin_port = htons(nAuxPort);
+ sa_server.sin_addr = addr_local;
++#endif
+
+ if (bind(udpsocket, (struct sockaddr *) &sa_server, sizeof(sa_server)) < 0)
+ {
+@@ -1181,7 +1228,11 @@
+ char *cBuffer;
+ CONTROL ctl;
+ long long nData;
++#ifdef USE_IPV6
++ struct sockaddr_in6 sa_server, sa_client;
++#else
+ struct sockaddr_in sa_server, sa_client;
++#endif
+ int server, client;
+ struct timeval tv;
+ fd_set fds;
+@@ -1194,7 +1245,11 @@
+ return THREADRESULT;
+ }
+
++#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(STREAM)");
+ free(cBuffer);
+@@ -1204,9 +1259,15 @@
+ setsockopt(server, SOL_SOCKET, SO_RCVBUF, (char *) &sobufsize, sizeof(sobufsize));
+ setsockopt(server, SOL_SOCKET, SO_SNDBUF, (char *) &sobufsize, sizeof(sobufsize));
+
++#ifdef USE_IPV6
++ sa_server.sin6_family = AF_INET6;
++ sa_server.sin6_port = htons(nAuxPort);
++ sa_server.sin6_addr = addr_local;
++#else
+ sa_server.sin_family = AF_INET;
+ sa_server.sin_port = htons(nAuxPort);
+ sa_server.sin_addr = addr_local;
++#endif
+
+ if (bind(server, (struct sockaddr *) &sa_server, sizeof(sa_server)) < 0)
+ {
+@@ -1252,7 +1313,11 @@
+ printf("UDP connection established ... ");
+ fflush(stdout);
+
++#ifdef USE_IPV6
++ sa_client.sin6_port = htons(nAuxPort);
++#else
+ sa_client.sin_port = htons(nAuxPort);
++#endif
+
+ for (;;)
+ {
+@@ -1345,7 +1410,11 @@
+ long nTime, nResult, nCount;
+ long long nData;
+ int i;
++#ifdef USE_IPV6
++ struct sockaddr_in6 sa_server;
++#else
+ struct sockaddr_in sa_server;
++#endif
+ int server;
+ int rc, nByte;
+
+@@ -1355,7 +1424,11 @@
+ return;
+ }
+
++#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);
+@@ -1365,9 +1438,15 @@
+ setsockopt(server, SOL_SOCKET, SO_RCVBUF, (char *) &sobufsize, sizeof(sobufsize));
+ setsockopt(server, SOL_SOCKET, SO_SNDBUF, (char *) &sobufsize, sizeof(sobufsize));
+
++#ifdef USE_IPV6
++ sa_server.sin6_family = AF_INET6;
++ sa_server.sin6_port = htons(nAuxPort);
++ sa_server.sin6_addr = addr_server;
++#else
+ sa_server.sin_family = AF_INET;
+ sa_server.sin_port = htons(nAuxPort);
+ sa_server.sin_addr = addr_server;
++#endif
+
+ if (connect(server, (struct sockaddr *) &sa_server, sizeof(sa_server)) < 0)
+ {
+@@ -1669,17 +1748,29 @@
+ return psock_errno("sock_init()"), 1;
+
+ if (szLocal == 0)
++#ifdef USE_IPV6
++ addr_local = in6addr_any;
++#else
+ addr_local.s_addr = INADDR_ANY;
++#endif
+ else
+ {
+ if (isdigit(*szLocal))
++#ifdef USE_IPV6
++ inet_pton(AF_INET6, szLocal, &addr_local);
++#else
+ addr_local.s_addr = inet_addr(szLocal);
++#endif
+ else
+ {
+ if ((host = gethostbyname(szLocal)) == NULL)
+ return psock_errno("gethostbyname()"), 1;
+
++#ifdef USE_IPV6
++ addr_local = * (struct in6_addr *) (host->h_addr);
++#else
+ addr_local = * (struct in_addr *) (host->h_addr);
++#endif
+ }
+ }
+
+@@ -1689,13 +1780,21 @@
+ usage();
+
+ if (isdigit(*argv[optind]))
++#ifdef USE_IPV6
++ 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)
+ return psock_errno("gethostbyname()"), 1;
+
++#ifdef USE_IPV6
++ addr_server = * (struct in6_addr *) (host->h_addr);
++#else
+ addr_server = * (struct in_addr *) (host->h_addr);
++#endif
+ }
+ }
+ }
13 net-analyzer/netio/files/netio-1.26-linux-include.patch
View
@@ -0,0 +1,13 @@
+Add missing include (see inet(3)) - JeR
+
+
+--- a/netio.c 2005-08-30 16:47:18.000000000 +0200
++++ b/netio.c 2010-08-09 19:31:51.000000000 +0200
+@@ -199,6 +199,7 @@
+ #include <sys/time.h>
+ #include <time.h>
+ #include <netinet/in.h>
++#include <arpa/inet.h>
+ #include <netdb.h>
+
+ #define psock_errno(x) perror(x)
63 net-analyzer/netio/netio-1.26.ebuild
View
@@ -0,0 +1,63 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: $
+
+inherit toolchain-funcs versionator
+
+MY_P="${PN}$(get_version_component_range 1)$(get_version_component_range 2)"
+DESCRIPTION="a network benchmark for DOS, OS/2, Windows NT and Unix that measures net througput with NetBIOS and TCP/IP protocols."
+HOMEPAGE="http://www.ars.de/ars/ars.nsf/docs/netio"
+SRC_URI="mirror://gentoo/${MY_P}.zip"
+
+LICENSE="free-noncomm"
+SLOT="0"
+KEYWORDS="amd64 ppc sparc x86 ~amd64-linux ~x86-linux ~ppc-macos ~x86-macos"
+IUSE="ipv6"
+
+DEPEND="app-arch/unzip
+ >=sys-apps/sed-4"
+RDEPEND=""
+
+S="${WORKDIR}"
+
+src_unpack() {
+ unpack ${A}
+ cd "${S}"
+
+ use ipv6 && {
+ epatch ${FILESDIR}/netio-1.26-ipv6-1.patch
+ epatch ${FILESDIR}/netio-1.26-ipv6-2.patch
+ }
+
+ sed -i -e 's|\(CFLAGS\)=|\1?=|g' \
+ -e 's|\(CC\)=|\1?=|g' Makefile || die "sed Makefile failed"
+}
+
+src_compile() {
+ use ipv6 && CFLAGS="${CFLAGS} -DUSE_IPV6"
+
+ emake linux \
+ CC="$(tc-getCC)" \
+ CFLAGS="-DUNIX ${CFLAGS}" \
+ || die "emake failed"
+}
+
+src_install() {
+ dobin netio || die "dobin failed"
+
+ # to be sure to comply with the license statement in netio.doc,
+ # just install everything included in the package to doc
+ dodoc netio.doc FILE_ID.DIZ getopt.h netb_1_c.h netbios.h netio.c \
+ netb_2_c.h netio.doc getopt.c Makefile netbios.c
+
+ # also install binaries
+ dodoc bin/os2-i386.exe bin/win32-i386.exe
+}
+
+pkg_postinst() {
+ echo
+ elog "NOTE: all files included in the upstream zip file have"
+ elog "been installed to /usr/share/doc/${PF}, as required by"
+ elog "the license."
+ echo
+}
Please sign in to comment.
Something went wrong with that request. Please try again.