summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin H. Johnson <robbat2@gentoo.org>2015-08-08 13:49:04 -0700
committerRobin H. Johnson <robbat2@gentoo.org>2015-08-08 17:38:18 -0700
commit56bd759df1d0c750a065b8c845e93d5dfa6b549d (patch)
tree3f91093cdb475e565ae857f1c5a7fd339e2d781e /net-analyzer/tptest
downloadgentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.tar.gz
gentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.tar.bz2
gentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.zip
proj/gentoo: Initial commit
This commit represents a new era for Gentoo: Storing the gentoo-x86 tree in Git, as converted from CVS. This commit is the start of the NEW history. Any historical data is intended to be grafted onto this point. Creation process: 1. Take final CVS checkout snapshot 2. Remove ALL ChangeLog* files 3. Transform all Manifests to thin 4. Remove empty Manifests 5. Convert all stale $Header$/$Id$ CVS keywords to non-expanded Git $Id$ 5.1. Do not touch files with -kb/-ko keyword flags. Signed-off-by: Robin H. Johnson <robbat2@gentoo.org> X-Thanks: Alec Warner <antarus@gentoo.org> - did the GSoC 2006 migration tests X-Thanks: Robin H. Johnson <robbat2@gentoo.org> - infra guy, herding this project X-Thanks: Nguyen Thai Ngoc Duy <pclouds@gentoo.org> - Former Gentoo developer, wrote Git features for the migration X-Thanks: Brian Harring <ferringb@gentoo.org> - wrote much python to improve cvs2svn X-Thanks: Rich Freeman <rich0@gentoo.org> - validation scripts X-Thanks: Patrick Lauer <patrick@gentoo.org> - Gentoo dev, running new 2014 work in migration X-Thanks: Michał Górny <mgorny@gentoo.org> - scripts, QA, nagging X-Thanks: All of other Gentoo developers - many ideas and lots of paint on the bikeshed
Diffstat (limited to 'net-analyzer/tptest')
-rw-r--r--net-analyzer/tptest/Manifest1
-rw-r--r--net-analyzer/tptest/files/tptest-3.1.7-getstatsfromlinevuln.patch150
-rw-r--r--net-analyzer/tptest/metadata.xml8
-rw-r--r--net-analyzer/tptest/tptest-3.1.7-r2.ebuild44
4 files changed, 203 insertions, 0 deletions
diff --git a/net-analyzer/tptest/Manifest b/net-analyzer/tptest/Manifest
new file mode 100644
index 000000000000..69329a746bc4
--- /dev/null
+++ b/net-analyzer/tptest/Manifest
@@ -0,0 +1 @@
+DIST tptest-3.1.7.tar.gz 313801 SHA256 db39257b3ee6408a575e16804975df1e68f52270537cc3e7505897b777f7994d SHA512 c78fdbc561adbe109be9fc45a2dbd5c452235525ac4d5f24e39fd8824825fd02c35853411c3f4ae1870f98b576df37f3f1f1266de7c40edcb8f35c69b9063c59 WHIRLPOOL f19631cc2e9d8ed3272cfb81da3c003e26ef6d80b35de57eb793157b2acadf65eb85179afa3138ec83722b9b5b70b0b4f800381ef43d3d56072018be3838ac15
diff --git a/net-analyzer/tptest/files/tptest-3.1.7-getstatsfromlinevuln.patch b/net-analyzer/tptest/files/tptest-3.1.7-getstatsfromlinevuln.patch
new file mode 100644
index 000000000000..4b7fd209f9e4
--- /dev/null
+++ b/net-analyzer/tptest/files/tptest-3.1.7-getstatsfromlinevuln.patch
@@ -0,0 +1,150 @@
+--- a/engine/tpcommon.c
++++ b/engine/tpcommon.c
+@@ -37,6 +37,8 @@
+ #include <stdio.h>
+ #include <string.h>
+ #include <stdarg.h>
++#include <stdlib.h>
++#include <stddef.h>
+
+ #ifdef UNIX
+ #include <sys/time.h>
+@@ -194,68 +196,76 @@ done:
+
+
+ // Fill a tpStats structure with the contents from a STATS line
+-int GetStatsFromLine(char *line, TPStats *s)
++int GetStatsFromLine(const char *line, TPStats *s)
+ {
+ char valBuf[30];
++ char * stats_ptr = NULL;
+
+ if (strncmp(line, "STATS ", 6) != 0)
+ return -1;
+- memset(valBuf, 0, 30);
++ memset(valBuf, 0, sizeof(valBuf));
++ stats_ptr = ((char *)line)+6;
+
+- if (CopyTagField(valBuf, 29, line+6, "majorv"))
+- s->MajorVersion = atoi(valBuf);
+- if (CopyTagField(valBuf, 29, line+6, "minorv"))
+- s->MinorVersion = atoi(valBuf);
+- if (CopyTagField(valBuf, 29, line+6, "pktssent"))
+- s->PktsSent = atoi(valBuf);
+- if (CopyTagField(valBuf, 29, line+6, "pktsunsent"))
+- s->PktsUnSent = atoi(valBuf);
+- if (CopyTagField(valBuf, 29, line+6, "pktsrcvd"))
+- s->PktsRecvd = atoi(valBuf);
+- if (CopyTagField(valBuf, 29, line+6, "bytessent"))
++ if (CopyTagField(valBuf, sizeof(valBuf)-1, stats_ptr, "majorv"))
++ s->MajorVersion = (USHORT) strtoul(valBuf,NULL,10);
++ if (CopyTagField(valBuf, sizeof(valBuf)-1, stats_ptr, "minorv"))
++ s->MinorVersion = (USHORT) strtoul(valBuf,NULL,10);
++ if (CopyTagField(valBuf, sizeof(valBuf)-1, stats_ptr, "pktssent"))
++ s->PktsSent = (UINT32) strtoul(valBuf,NULL,10);
++ if (CopyTagField(valBuf, sizeof(valBuf)-1, stats_ptr, "pktsunsent"))
++ s->PktsUnSent = (UINT32) strtoul(valBuf,NULL,10);
++ if (CopyTagField(valBuf, sizeof(valBuf)-1, stats_ptr, "pktsrcvd"))
++ s->PktsRecvd = (UINT32) strtoul(valBuf,NULL,10);
++ if (CopyTagField(valBuf, sizeof(valBuf)-1, stats_ptr, "bytessent"))
+ sscanf(valBuf, "%" LONG_LONG_PREFIX "d", &(s->BytesSent));
+- if (CopyTagField(valBuf, 29, line+6, "bytesrcvd"))
++ if (CopyTagField(valBuf, sizeof(valBuf)-1, stats_ptr, "bytesrcvd"))
+ sscanf(valBuf, "%" LONG_LONG_PREFIX "d", &(s->BytesRecvd));
+- if (CopyTagField(valBuf, 29, line+6, "maxrtt"))
+- s->MaxRoundtrip = atoi(valBuf);
+- if (CopyTagField(valBuf, 29, line+6, "minrtt"))
+- s->MinRoundtrip = atoi(valBuf);
+- if (CopyTagField(valBuf, 29, line+6, "oocount"))
+- s->ooCount = atoi(valBuf);
+-
+- if (CopyTagField(valBuf, 29, line+6, "txstart_s"))
+- s->StartSend.tv_sec = atoi(valBuf);
+- if (CopyTagField(valBuf, 29, line+6, "txstart_us"))
+- s->StartSend.tv_usec = atoi(valBuf);
+-
+- if (CopyTagField(valBuf, 29, line+6, "txstop_s"))
+- s->StopSend.tv_sec = atoi(valBuf);
+- if (CopyTagField(valBuf, 29, line+6, "txstop_us"))
+- s->StopSend.tv_usec = atoi(valBuf);
+-
+- if (CopyTagField(valBuf, 29, line+6, "rxstart_s"))
+- s->StartRecv.tv_sec = atoi(valBuf);
+- if (CopyTagField(valBuf, 29, line+6, "rxstart_us"))
+- s->StartRecv.tv_usec = atoi(valBuf);
+-
+- if (CopyTagField(valBuf, 29, line+6, "rxstop_s"))
+- s->StopRecv.tv_sec = atoi(valBuf);
+- if (CopyTagField(valBuf, 29, line+6, "rxstop_us"))
+- s->StopRecv.tv_usec = atoi(valBuf);
+-
+- if (CopyTagField(valBuf, 29, line+6, "totrtt"))
+- s->TotalRoundtrip = atoi(valBuf);
+- if (CopyTagField(valBuf, 29, line+6, "nortt"))
+- s->nRoundtrips = atoi(valBuf);
+-
+- if (CopyTagField(valBuf, 101, line + 6, "email"))
+- strcpy(s->email, valBuf);
++ if (CopyTagField(valBuf, sizeof(valBuf)-1, stats_ptr, "maxrtt"))
++ s->MaxRoundtrip = (UINT32) strtoul(valBuf,NULL,10);
++ if (CopyTagField(valBuf, sizeof(valBuf)-1, stats_ptr, "minrtt"))
++ s->MinRoundtrip = (UINT32) strtoul(valBuf,NULL,10);
++ if (CopyTagField(valBuf, sizeof(valBuf)-1, stats_ptr, "oocount"))
++ s->ooCount = (UINT32) strtoul(valBuf,NULL,10);
++
++ if (CopyTagField(valBuf, sizeof(valBuf)-1, stats_ptr, "txstart_s"))
++ s->StartSend.tv_sec = strtol(valBuf,NULL,10);
++ if (CopyTagField(valBuf, sizeof(valBuf)-1, stats_ptr, "txstart_us"))
++ s->StartSend.tv_usec = strtol(valBuf,NULL,10);
++
++ if (CopyTagField(valBuf, sizeof(valBuf)-1, stats_ptr, "txstop_s"))
++ s->StopSend.tv_sec = strtol(valBuf,NULL,10);
++ if (CopyTagField(valBuf, sizeof(valBuf)-1, stats_ptr, "txstop_us"))
++ s->StopSend.tv_usec = strtol(valBuf,NULL,10);
++
++ if (CopyTagField(valBuf, sizeof(valBuf)-1, stats_ptr, "rxstart_s"))
++ s->StartRecv.tv_sec = strtol(valBuf,NULL,10);
++ if (CopyTagField(valBuf, sizeof(valBuf)-1, stats_ptr, "rxstart_us"))
++ s->StartRecv.tv_usec = strtol(valBuf,NULL,10);
++
++ if (CopyTagField(valBuf, sizeof(valBuf)-1, stats_ptr, "rxstop_s"))
++ s->StopRecv.tv_sec = strtol(valBuf,NULL,10);
++ if (CopyTagField(valBuf, sizeof(valBuf)-1, stats_ptr, "rxstop_us"))
++ s->StopRecv.tv_usec = strtol(valBuf,NULL,10);
++
++ if (CopyTagField(valBuf, sizeof(valBuf)-1, stats_ptr, "totrtt"))
++ s->TotalRoundtrip = (UINT32) strtoul(valBuf,NULL,10);
++ if (CopyTagField(valBuf, sizeof(valBuf)-1, stats_ptr, "nortt"))
++ s->nRoundtrips = (UINT32) strtoul(valBuf,NULL,10);
++
++ if (CopyTagField(valBuf, sizeof(valBuf)-1, stats_ptr, "email"))
++ {
++ strncpy(s->email, valBuf, sizeof(s->email));
++ s->email[sizeof(s->email)-1] = '\0';
++ }
+
+- if (CopyTagField(valBuf, 101, line + 6, "pwd"))
+- strcpy(s->pwd, valBuf);
++ if (CopyTagField(valBuf, sizeof(valBuf)-1, stats_ptr, "pwd"))
++ {
++ strncpy(s->pwd, valBuf, sizeof(s->pwd));
++ s->pwd[sizeof(s->pwd)-1] = '\0';
++ }
+
++ stats_ptr = NULL;
+ return 0;
+-
+ }
+
+
+--- a/engine/tpcommon.h
++++ b/engine/tpcommon.h
+@@ -43,7 +43,7 @@ int SameTag(char *s1, char *s2);
+ int CopyTagField(char *destp, int destSize, char *srcp, char *pname);
+ int GetSessionFromLine(char *, TPEngine *);
+ char * CreateSessionLine(TPEngine *, char *);
+-int GetStatsFromLine(char *, TPStats *);
++int GetStatsFromLine(const char *, TPStats *);
+ char * CreateLineFromStats(TPStats *, char *);
+ int ReplyCode(char *);
+ void TVAddUSec(struct timeval *, int);
diff --git a/net-analyzer/tptest/metadata.xml b/net-analyzer/tptest/metadata.xml
new file mode 100644
index 000000000000..496929f4d0d2
--- /dev/null
+++ b/net-analyzer/tptest/metadata.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>netmon</herd>
+ <upstream>
+ <remote-id type="sourceforge">tptest</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/net-analyzer/tptest/tptest-3.1.7-r2.ebuild b/net-analyzer/tptest/tptest-3.1.7-r2.ebuild
new file mode 100644
index 000000000000..e7135687839a
--- /dev/null
+++ b/net-analyzer/tptest/tptest-3.1.7-r2.ebuild
@@ -0,0 +1,44 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+inherit toolchain-funcs eutils
+
+MY_PV="${PV/./_}"
+
+DESCRIPTION="Internet bandwidth tester"
+HOMEPAGE="http://tptest.sourceforge.net/"
+SRC_URI="mirror://sourceforge/${PN}/${P}.tar.gz"
+LICENSE="GPL-2"
+SLOT="0"
+
+KEYWORDS="amd64 ppc sparc x86"
+
+src_prepare() {
+ sed -i apps/unix/{client,server}/Makefile \
+ -e "s:^CFLAGS[[:space:]]*=:CFLAGS+=:" \
+ || die
+ epatch "${FILESDIR}/${PN}-3.1.7-getstatsfromlinevuln.patch"
+ cp -f os-dep/unix/* .
+ cp -f engine/* .
+}
+
+src_compile() {
+ emake -C apps/unix/client \
+ CC=$(tc-getCC) \
+ LDFLAGS="${LDFLAGS}" \
+ || die
+ emake -C apps/unix/server \
+ CC=$(tc-getCC) \
+ LDFLAGS="${LDFLAGS}" \
+ || die
+}
+
+src_install() {
+ dobin apps/unix/client/tptestclient
+ dosbin apps/unix/server/tptestserver
+
+ insinto /etc
+ doins apps/unix/server/tptest.conf
+}