From 1a638f333ab86cf1908109b696bda4e4a549da9b Mon Sep 17 00:00:00 2001 From: Alex Kozlov Date: Wed, 30 Dec 2015 14:07:42 +0000 Subject: - Rename nonstandard src directory to files - Modernize ports --- benchmarks/tcpblast/src/Makefile | 6 -- benchmarks/tcpblast/src/tcpblast.c | 127 ------------------------------------- 2 files changed, 133 deletions(-) delete mode 100644 benchmarks/tcpblast/src/Makefile delete mode 100644 benchmarks/tcpblast/src/tcpblast.c (limited to 'benchmarks/tcpblast/src') diff --git a/benchmarks/tcpblast/src/Makefile b/benchmarks/tcpblast/src/Makefile deleted file mode 100644 index 068ad35579f8..000000000000 --- a/benchmarks/tcpblast/src/Makefile +++ /dev/null @@ -1,6 +0,0 @@ -PROG= tcpblast -SRCS= tcpblast.c -NO_MAN= yes -BINDIR= ${PREFIX}/bin - -.include diff --git a/benchmarks/tcpblast/src/tcpblast.c b/benchmarks/tcpblast/src/tcpblast.c deleted file mode 100644 index 5a191701dc89..000000000000 --- a/benchmarks/tcpblast/src/tcpblast.c +++ /dev/null @@ -1,127 +0,0 @@ -/* - * tcpblast - test and estimate TCP thruput - * - * Daniel Karrenberg - */ - -#include -#include -#include -#include -#include - -#include - -#include -#include -#include -#include -#include -#include - -#define BLKSIZE 1024 - -struct sockaddr_in sock_in; -struct servent *sp; -struct hostent *host; - -long starts, startms, stops, stopms, expms; -struct timeval ti; -struct timezone tiz; - -char greet[BLKSIZE] = "Hi!"; -int nblocks; -int f; - -int main(argc, argv) -int argc; char **argv; -{ - struct addrinfo hints, *res, *res0; - char *cause = NULL; - int ch, proto, error; - register int i; - - memset(&hints, 0, sizeof(hints)); - hints.ai_family = PF_UNSPEC; - hints.ai_socktype = SOCK_STREAM; - - while ((ch = getopt(argc, argv, "46")) != -1) { - switch (ch) { - case '4': - hints.ai_family = PF_INET; - break; - case '6': - hints.ai_family = PF_INET6; - break; - } - } - argc -= optind; - argv += optind; - if (argc != 2) { - fprintf(stderr, - "usage: tcpblast [-4] [-6] destination nblkocks\n" - "blocksize: %d bytes %d\n", BLKSIZE, argc); - exit(1); - } - - nblocks = atoi(argv[1]); - if (nblocks<=1 || nblocks>10000) { - fprintf(stderr, "tcpblast: 1 < nblocks <= 10000 \n"); - exit(1); - } - - error = getaddrinfo(argv[0], "discard", &hints, &res0); - if (error) - errx(1, "%s", gai_strerror(error)); - f = -1; - cause = "no addresses"; - errno = EADDRNOTAVAIL; - for (res = res0; res; res = res->ai_next) { - f = socket(res->ai_family, res->ai_socktype, res->ai_protocol); - if (f < 0) { - cause = "socket"; - continue; - } - if (connect(f, res->ai_addr, res->ai_addrlen) < 0) { - cause = "connect"; - close(f); - f = -1; - continue; - } - break; - } - if (f < 0) - err(1, cause); - freeaddrinfo(res); - - if (gettimeofday(&ti, &tiz) < 0) - { - perror("tcpblast time:"); - exit(1); - } - starts = ti.tv_sec; - startms = ti.tv_usec / 1000L; - - - for (i=0; i