diff options
author | rafan <rafan@FreeBSD.org> | 2006-07-16 01:14:45 +0800 |
---|---|---|
committer | rafan <rafan@FreeBSD.org> | 2006-07-16 01:14:45 +0800 |
commit | 756b2d12b0fbd1746a4547832649acc3bcae533b (patch) | |
tree | 8879cea584aacb8580ac1ebececf8775a5110f94 /net | |
parent | 1256d510a4a708dad0dbd95f727b55b6c4017953 (diff) | |
download | freebsd-ports-gnome-756b2d12b0fbd1746a4547832649acc3bcae533b.tar.gz freebsd-ports-gnome-756b2d12b0fbd1746a4547832649acc3bcae533b.tar.zst freebsd-ports-gnome-756b2d12b0fbd1746a4547832649acc3bcae533b.zip |
Add netselect 0.3, ultrafast implementation of ping.
PR: ports/100338
Submitted by: Timothy Redaelli <drizzt at gufi.org>
Diffstat (limited to 'net')
-rw-r--r-- | net/Makefile | 1 | ||||
-rw-r--r-- | net/netselect/Makefile | 38 | ||||
-rw-r--r-- | net/netselect/distinfo | 3 | ||||
-rw-r--r-- | net/netselect/files/patch-netselect.c | 55 | ||||
-rw-r--r-- | net/netselect/pkg-descr | 14 |
5 files changed, 111 insertions, 0 deletions
diff --git a/net/Makefile b/net/Makefile index c48ce4e0641f..40af220c3223 100644 --- a/net/Makefile +++ b/net/Makefile @@ -329,6 +329,7 @@ SUBDIR += netpipes SUBDIR += netscript SUBDIR += netsed + SUBDIR += netselect SUBDIR += netspeed_applet SUBDIR += netstrain SUBDIR += nettest diff --git a/net/netselect/Makefile b/net/netselect/Makefile new file mode 100644 index 000000000000..7df0c9be64f4 --- /dev/null +++ b/net/netselect/Makefile @@ -0,0 +1,38 @@ +# New ports collection makefile for: netselect +# Date created: 15 July 2006 +# Whom: Timothy Redaelli <drizzt@gufi.org> +# +# $FreeBSD$ +# + +PORTNAME= netselect +PORTVERSION= 0.3 +CATEGORIES= net +MASTER_SITES= ${MASTER_SITE_GENTOO} \ + http://www.worldvisions.ca/~apenwarr/netselect/ +MASTER_SITE_SUBDIR= distfiles + +MAINTAINER= drizzt@gufi.org +COMMENT= Ultrafast implementation of ping + +PLIST_FILES= bin/${PORTNAME} + +WRKSRC= ${WRKDIR}/${PORTNAME} + +OPTIONS= SUID "Install with the sticky bit (mode 4110)" off + +.include <bsd.port.pre.mk> + +.if defined(WITH_SUID) +BINMODE= 4110 +.else +BINMODE= 0100 +.endif + +do-build: + ${CC} ${CFLAGS} -o ${WRKSRC}/${PORTNAME} ${WRKSRC}/${PORTNAME}.c + +do-install: + ${INSTALL_PROGRAM} ${WRKSRC}/${PORTNAME} ${PREFIX}/bin + +.include <bsd.port.post.mk> diff --git a/net/netselect/distinfo b/net/netselect/distinfo new file mode 100644 index 000000000000..8fd47f31b500 --- /dev/null +++ b/net/netselect/distinfo @@ -0,0 +1,3 @@ +MD5 (netselect-0.3.tar.gz) = 3a3714946db2458e5db3d55373057ef2 +SHA256 (netselect-0.3.tar.gz) = fe81942589d5219d030e5cecfb12787fb6d3613416cb326dea4952bf53f9c978 +SIZE (netselect-0.3.tar.gz) = 22047 diff --git a/net/netselect/files/patch-netselect.c b/net/netselect/files/patch-netselect.c new file mode 100644 index 000000000000..6e7f1cacca48 --- /dev/null +++ b/net/netselect/files/patch-netselect.c @@ -0,0 +1,55 @@ +--- netselect.c.orig 2006-07-14 22:59:18.000000000 +0200 ++++ netselect.c 2006-07-14 22:57:22.000000000 +0200 +@@ -39,14 +39,13 @@ + * hey, great! Let me know. -- apenwarr + */ + +-#ifdef __EMX__ +-# include <io.h> +-# include <fcntl.h> +-# include <sys/types.h> +-# include <sys/select.h> +-# include <machine/endian.h> +-#else +-# include <endian.h> ++#ifdef __linux__ ++#include <endian.h> ++#elif defined(__OpenBSD__) || defined(__FreeBSD__) || defined(__NetBSD__) || defined(__APPLE__) ++#if defined(__OpenBSD__) ++#include <machine/types.h> ++#endif ++#include <machine/endian.h> + #endif + + #include <sys/param.h> +@@ -152,6 +151,7 @@ + extern int optind; + int hostcount, startcount, endcount = 0, sent_one, lag, min_lag = 100; + int ch, seq, ttl, max_ttl = 30, min_tries = 10, num_score = 1; ++ int on = 1; + struct timeval now; + struct timezone tz; + OPacket outpacket; /* last output (udp) packet */ +@@ -234,7 +234,12 @@ + if (verbose >= 1) + fprintf(stderr, "Running netselect to choose %d out of %d address%s.\n", + num_score, numhosts, numhosts==1 ? "" : "es"); +- ++ ++ if (setsockopt(sndsock, IPPROTO_IP, IP_HDRINCL, &on, sizeof(on)) < 0) { ++ perror("IP_HDRINCL"); ++ _exit(EXIT_FAILURE); ++ } ++ + /* keep going until most of the hosts have been finished */ + must_continue = numhosts; + while (must_continue && must_continue >= numhosts/2) +@@ -712,7 +717,7 @@ + ip->ip_off = 0; + ip->ip_hl = sizeof(*ip) >> 2; + ip->ip_p = IPPROTO_UDP; +- ip->ip_len = 0; /* kernel fills this in */ ++ ip->ip_len = sizeof(OPacket); + ip->ip_ttl = ttl; + ip->ip_v = IPVERSION; + ip->ip_id = htons(ident + seq); diff --git a/net/netselect/pkg-descr b/net/netselect/pkg-descr new file mode 100644 index 000000000000..4a03329dd416 --- /dev/null +++ b/net/netselect/pkg-descr @@ -0,0 +1,14 @@ +netselect is an ultrafast intelligent parallelizing binary-search +implementation of "ping." + +netselect determines several facts about all of the hosts given on the command +line, much faster than you would if you tried to use ping and traceroute. +For example, if I type: + + netselect -v ftp.fceia.unr.edu.ar \ + ftp.kulnet.kuleuven.ac.be \ + ftp.cdrom.com ftp.debian.org \ + ftp.de.debian.org + +It tells me statistics about each of the hostnames I provided, +in much less time than doing a whole bunch of traceroutes. |