Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 24 Apr 2007 04:51:18 +0200 (CEST)
From:      Janos Mohacsi <janos.mohacsi@bsd.hu>
To:        FreeBSD-gnats-submit@FreeBSD.org
Cc:        jharris@widomaker.com
Subject:   ports/112185: [NEW PORT] net/fping+ipv6: Quickly ping N hosts w/o flooding the network - IPv6 version
Message-ID:  <200704240251.l3O2pIDt002697@scone.ki.iif.hu>
Resent-Message-ID: <200704271620.l3RGK56e053599@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         112185
>Category:       ports
>Synopsis:       [NEW PORT] net/fping+ipv6: Quickly ping N hosts w/o flooding the network - IPv6 version
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Fri Apr 27 16:20:04 GMT 2007
>Closed-Date:
>Last-Modified:
>Originator:     Janos Mohacsi
>Release:        FreeBSD 6.2-STABLE i386
>Organization:
NIIF/HUNGARNET
>Environment:
System: FreeBSD scone 6.2-STABLE FreeBSD 6.2-STABLE #22: Sun Apr 22 17:58:38 CEST 2007
>Description:
This is an IPv6 only version of fping. The fping with IPv6 patch cannot handle 
IPv4 ping, therefore I think it is better to have two distinct port:
fping - IPv4 only
fping+ipv6 - IPv6 only

Maintainer of fping also copied. He can maintain both port if he agrees.
-------------------------------------------------

A tool to quickly ping N number of hosts to determine their reachability
without flooding the network.

     fping is different from ping in that you can specify any number of
	 hosts on the command line, or specify a file containing the lists
	 of hosts to ping. Instead of trying one host until it timeouts or
	 replies, fping will send out a ping packet and move on to the next
	 host in a round-robin fashion. If a host replies, it is noted and
	 removed from the list of hosts to check. If a host does not respond
	 within a certain time limit and/or retry limit it will be considered
	 unreachable. 

     Unlike ping, fping is meant to be used in scripts and its
     output is easy to parse.
     This is an IPv6 only version.

WWW: http://www.fping.com/

Generated with FreeBSD Port Tools 0.77
>How-To-Repeat:
>Fix:

--- fping+ipv6-2.4b2.shar begins here ---
# This is a shell archive.  Save it in a file, remove anything before
# this line, and then unpack it by entering "sh file".  Note, it may
# create directories; files and directories will be owned by you and
# have default permissions.
#
# This archive contains:
#
#	fping+ipv6
#	fping+ipv6/files
#	fping+ipv6/files/patch-02
#	fping+ipv6/files/patch-03
#	fping+ipv6/Makefile
#	fping+ipv6/distinfo
#	fping+ipv6/pkg-descr
#
echo c - fping+ipv6
mkdir -p fping+ipv6 > /dev/null 2>&1
echo c - fping+ipv6/files
mkdir -p fping+ipv6/files > /dev/null 2>&1
echo x - fping+ipv6/files/patch-02
sed 's/^X//' >fping+ipv6/files/patch-02 << 'END-of-fping+ipv6/files/patch-02'
X--- fping.c.orig	Mon Jan 21 02:06:30 2002
X+++ fping.c	Tue Jul 12 18:11:30 2005
X@@ -42,7 +42,6 @@
X  * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
X  * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
X  */
X-#define IPV6 1						/* This should be a compiler option, or even better be done from the Makefile... ;) */
X 
X #ifndef _NO_PROTO
X #if !__STDC__ && !defined( __cplusplus ) && !defined( FUNCPROTO ) \
X@@ -67,7 +66,7 @@
X 
X /*** autoconf includes ***/
X 
X-
X+#include <sys/types.h>
X #include <stdio.h>
X #include <errno.h>
X #include <time.h>
X@@ -88,7 +87,6 @@
X #include <string.h>
X #include <stddef.h>
X 
X-#include <sys/types.h>
X #include <sys/time.h>
X #include <sys/socket.h>
X 
X@@ -112,6 +110,10 @@
X #include <arpa/inet.h>
X #include <netdb.h>
X 
X+#if (defined(__unix__) || defined(unix)) && !defined(USG)
X+#include <sys/param.h>
X+#endif
X+
X /* RS6000 has sys/select.h */
X #ifdef HAVE_SYS_SELECT_H
X #include <sys/select.h>
X@@ -246,13 +248,13 @@
X      struct timeval       last_send_time;     /* time of last packet sent */
X      int                  num_sent;           /* number of ping packets sent */
X      int                  num_recv;           /* number of pings received */
X-     int                  max_reply;          /* longest response time */
X-     int                  min_reply;          /* shortest response time */
X+     long                 max_reply;          /* longest response time */
X+     long                 min_reply;          /* shortest response time */
X      int                  total_time;         /* sum of response times */
X      int                  num_sent_i;         /* number of ping packets sent */
X      int                  num_recv_i;         /* number of pings received */
X-     int                  max_reply_i;        /* longest response time */
X-     int                  min_reply_i;        /* shortest response time */
X+     long                 max_reply_i;        /* longest response time */
X+     long                 min_reply_i;        /* shortest response time */
X      int                  total_time_i;       /* sum of response times */
X      int                  *resp_times;        /* individual response times */
X #if defined( DEBUG ) || defined( _DEBUG )
X@@ -482,7 +484,7 @@
X 
X 	}/* IF */
X 
X-	prog = argv[0];
X+	prog = (prog = strrchr(argv[0], '/')) ? prog + 1 : argv[0];
X 	ident = getpid() & 0xFFFF;
X 
X 	verbose_flag = 1;
X@@ -502,8 +504,8 @@
X 			break;
X 		
X 		case 'r':
X-			if( !( retry = ( u_int )atoi( optarg ) ) )
X-				usage();
X+			retry = ( u_int )atoi( optarg );
X+
X 
X 			break;
X 		
X@@ -823,6 +825,7 @@
X 
X 		while( fgets( line, 132, ping_file ) )
X 		{
X+			line[132-1] = '\0';
X 			if( sscanf( line, "%s", host ) != 1 )
X 				continue;
X 			
X@@ -1503,7 +1506,6 @@
X 	memset( buffer, 0, ping_pkt_size * sizeof( char ) );
X 	icp = ( FPING_ICMPHDR* )buffer;
X 
X-	gettimeofday( &h->last_send_time, &tz );
X #ifndef IPV6
X 	icp->icmp_type = ICMP_ECHO;
X 	icp->icmp_code = 0;
X@@ -1512,6 +1514,8 @@
X 	icp->icmp_id = ident;
X 
X 	pdp = ( PING_DATA* )( buffer + SIZE_ICMP_HDR );
X+	/* set the time at the very last possible point */
X+	gettimeofday(&h->last_send_time,&tz);
X 	pdp->ping_ts = h->last_send_time;
X 	pdp->ping_count = h->num_sent;
X 
X@@ -1523,6 +1527,8 @@
X 	icp->icmp6_id = ident;
X 
X 	pdp = ( PING_DATA* )( buffer + SIZE_ICMP_HDR );
X+	/* set the time at the very last possible point */
X+	gettimeofday(&h->last_send_time,&tz);
X 	pdp->ping_ts = h->last_send_time;
X 	pdp->ping_count = h->num_sent;
X 
X@@ -1611,6 +1617,9 @@
X 
X 	result = recvfrom_wto( s, buffer, sizeof(buffer), &response_addr, select_time );
X 
X+	/* get time of receipt as close to the real time as possible */
X+	gettimeofday(&current_time,&tz);
X+
X 	if( result < 0 )
X 		return 0;	/* timeout */
X   
X@@ -1625,7 +1634,7 @@
X 
X 	ip = ( struct ip* )buffer;
X #ifndef IPV6
X-#if defined( __alpha__ ) && __STDC__ && !defined( __GLIBC__ )
X+#if defined( __alpha__ ) && defined(__osf1__) && __STDC__ && !defined( __GLIBC__ )
X 	/* The alpha headers are decidedly broken.
X 	 * Using an ANSI compiler, it provides ip_vhl instead of ip_hl and
X 	 * ip_v.  So, to get ip_hl, we mask off the bottom four bits.
X@@ -1633,7 +1642,7 @@
X 	hlen = ( ip->ip_vhl & 0x0F ) << 2;
X #else
X 	hlen = ip->ip_hl << 2;
X-#endif /* defined(__alpha__) && __STDC__ */
X+#endif /* defined(__alpha__) && defined(__osf1__) && __STDC__ */
X 	if( result < hlen + ICMP_MINLEN )
X #else
X 	if( result < sizeof(FPING_ICMPHDR) )
X@@ -1690,7 +1699,6 @@
X 	h = table[n];
X 
X 	/* received ping is cool, so process it */
X-	gettimeofday( &current_time, &tz );
X 	h->waiting = 0;
X 	h->timeout = timeout;
X 	h->num_recv++;
END-of-fping+ipv6/files/patch-02
echo x - fping+ipv6/files/patch-03
sed 's/^X//' >fping+ipv6/files/patch-03 << 'END-of-fping+ipv6/files/patch-03'
X--- fping.8.orig	Mon Jan 21 01:05:48 2002
X+++ fping.8	Sun Jul  7 22:03:43 2002
X@@ -1,4 +1,4 @@
X-.TH fping l
X+.TH fping 8
X .SH NAME
X fping \- send ICMP ECHO_REQUEST packets to network hosts
X .SH SYNOPSIS
X@@ -152,12 +152,12 @@
X example none the less. 
X .nf
X 
X-#!/usr/local/bin/perl
X+#!/usr/bin/perl
X require 'open2.pl';
X 
X $MAILTO = "root";
X 
X-$pid = &open2("OUTPUT","INPUT","/usr/local/bin/fping -u");
X+$pid = &open2("OUTPUT","INPUT","/usr/local/sbin/fping -u");
X 
X @check=("slapshot","foo","foobar");
X 
X@@ -178,7 +178,7 @@
X that are currently reachable.
X .nf
X 
X-#!/usr/local/bin/perl
X+#!/usr/bin/perl
X 
X $hosts_to_backup = `cat /etc/hosts.backup | fping -a`;
X 
END-of-fping+ipv6/files/patch-03
echo x - fping+ipv6/Makefile
sed 's/^X//' >fping+ipv6/Makefile << 'END-of-fping+ipv6/Makefile'
X# ex:ts=8
X# Ports collection makefile for:  fping
X# Date created:			  Tue Mar 25, 1997
X# Whom:				  David O'Brien (obrien@NUXI.com)
X#
X# $FreeBSD$
X#
X
XPORTNAME=	fping
XPORTVERSION=	2.4b2
XCATEGORIES=	net ipv6
XMASTER_SITES=	http://keyserver.kjsl.com/~jharris/distfiles/
X#MASTER_SITES=	http://www.fping.com/download/
XPKGNAMESUFFIX=	+ipv6
XDISTNAME=	${PORTNAME}-${PORTVERSION}_to-ipv6
X
XMAINTAINER=	jharris@widomaker.com
XCOMMENT=	Quickly ping N hosts w/o flooding the network - IPv6 version
X
XPLIST_FILES=	sbin/fping6
X
XGNU_CONFIGURE=	yes
XCONFIGURE_ARGS=	--bindir="${PREFIX}/sbin"
XMAN8=		fping.8
X
X# IPv6 enabled since it is a IPv6 only version
XCFLAGS+=	-DIPV6
X
Xpost-patch:
X	@${REINPLACE_CMD} -e 's/fping@/${MAINTAINER:S/@/\\@/g} or fping@/g' \
X		${WRKSRC}/fping.c
X
Xdo-install:
X	${INSTALL_PROGRAM} ${WRKSRC}/fping ${PREFIX}/sbin/fping6
X	@${CHMOD} 4555 ${PREFIX}/sbin/fping6
X	${INSTALL_MAN} ${WRKSRC}/fping.8 ${PREFIX}/man/man8
X
X.include <bsd.port.mk>
END-of-fping+ipv6/Makefile
echo x - fping+ipv6/distinfo
sed 's/^X//' >fping+ipv6/distinfo << 'END-of-fping+ipv6/distinfo'
XMD5 (fping-2.4b2_to-ipv6.tar.gz) = 3ad516765514249a40d3c5b6caab812a
XSHA1 (fping-2.4b2_to-ipv6.tar.gz) = d310c6fe951f64660d4c0a5f2bd1c5379c1e5bde
XRMD160 (fping-2.4b2_to-ipv6.tar.gz) = cff101a53baec9cc23063ff2004db69a3510c51f
XSHA256 (fping-2.4b2_to-ipv6.tar.gz) = 77e1a90af4fff4a5ffc4b70542c6ff44130558357e7d549f99a9eff23108d172
XSIZE (fping-2.4b2_to-ipv6.tar.gz) = 63333
END-of-fping+ipv6/distinfo
echo x - fping+ipv6/pkg-descr
sed 's/^X//' >fping+ipv6/pkg-descr << 'END-of-fping+ipv6/pkg-descr'
XA tool to quickly ping N number of hosts to determine their reachability
Xwithout flooding the network.
X
X     fping is different from ping in that you can specify any number of
X	 hosts on the command line, or specify a file containing the lists
X	 of hosts to ping. Instead of trying one host until it timeouts or
X	 replies, fping will send out a ping packet and move on to the next
X	 host in a round-robin fashion. If a host replies, it is noted and
X	 removed from the list of hosts to check. If a host does not respond
X	 within a certain time limit and/or retry limit it will be considered
X	 unreachable. 
X
X     Unlike ping, fping is meant to be used in scripts and its
X     output is easy to parse.
X     This is an IPv6 only version.
X
XWWW: http://www.fping.com/
END-of-fping+ipv6/pkg-descr
exit
--- fping+ipv6-2.4b2.shar ends here ---

>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200704240251.l3O2pIDt002697>