Update to 2.4b2.

IPv6 support gained.
Master site moved.
Add WWW URL.
This commit is contained in:
Anders Nordby 2002-07-07 22:08:19 +00:00
parent a15cfb764a
commit 7172e8372d
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=62614
5 changed files with 160 additions and 149 deletions

View file

@ -7,10 +7,10 @@
# #
PORTNAME= fping PORTNAME= fping
PORTVERSION= 2.2b1 PORTVERSION= 2.4b2
CATEGORIES= net CATEGORIES= net ipv6
MASTER_SITES= ftp://ftp.stanford.edu/dept/networking/pub/fping/ \ MASTER_SITES= http://www.fping.com/download/
ftp://sntop.sourceforge.net/pub/sntop/ DISTNAME= ${PORTNAME}-${PORTVERSION}_to-ipv6
MAINTAINER= ports@FreeBSD.org MAINTAINER= ports@FreeBSD.org
@ -19,6 +19,11 @@ GNU_CONFIGURE= yes
CONFIGURE_ARGS= --bindir="${PREFIX}/sbin" CONFIGURE_ARGS= --bindir="${PREFIX}/sbin"
MAN8= fping.8 MAN8= fping.8
.if defined(WITH_IPV6)
# IPv6 not enabled by default, as it does not work together with IPv4.
CFLAGS+= -DIPV6
.endif
post-patch: post-patch:
@${REINPLACE_CMD} -e 's/fping@/${MAINTAINER:S/@/\\@/g} or fping@/g' \ @${REINPLACE_CMD} -e 's/fping@/${MAINTAINER:S/@/\\@/g} or fping@/g' \
${WRKSRC}/fping.c ${WRKSRC}/fping.c

View file

@ -1 +1 @@
MD5 (fping-2.2b1.tar.gz) = 76b398a9b97ee4f801a2e7ed37bc29a3 MD5 (fping-2.4b2_to-ipv6.tar.gz) = 3ad516765514249a40d3c5b6caab812a

View file

@ -1,6 +1,14 @@
--- fping.c.orig Wed Jan 8 12:29:43 1997 --- fping.c.orig Mon Jan 21 01:06:30 2002
+++ fping.c Sat Apr 14 00:43:43 2001 +++ fping.c Sun Jul 7 22:12:31 2002
@@ -208,6 +208,10 @@ @@ -42,7 +42,6 @@
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*/
-#define IPV6 1 /* This should be a compiler option, or even better be done from the Makefile... ;) */
#ifndef _NO_PROTO
#if !__STDC__ && !defined( __cplusplus ) && !defined( FUNCPROTO ) \
@@ -112,6 +111,10 @@
#include <arpa/inet.h> #include <arpa/inet.h>
#include <netdb.h> #include <netdb.h>
@ -11,17 +19,7 @@
/* RS6000 has sys/select.h */ /* RS6000 has sys/select.h */
#ifdef HAVE_SYS_SELECT_H #ifdef HAVE_SYS_SELECT_H
#include <sys/select.h> #include <sys/select.h>
@@ -219,7 +223,9 @@ @@ -246,13 +249,13 @@
extern char *optarg;
extern int optind,opterr;
+#if !(defined(BSD) && (BSD >= 199103))
extern char *sys_errlist[];
+#endif
extern int h_errno;
#ifdef __cplusplus
@@ -321,13 +327,13 @@
struct timeval last_send_time; /* time of last packet sent */ struct timeval last_send_time; /* time of last packet sent */
int num_sent; /* number of ping packets sent */ int num_sent; /* number of ping packets sent */
int num_recv; /* number of pings received */ int num_recv; /* number of pings received */
@ -38,77 +36,83 @@
+ long min_reply_i; /* shortest response time */ + long min_reply_i; /* shortest response time */
int total_time_i; /* sum of response times */ int total_time_i; /* sum of response times */
int *resp_times; /* individual response times */ int *resp_times; /* individual response times */
#ifdef DEBUG #if defined( DEBUG ) || defined( _DEBUG )
@@ -475,7 +481,7 @@ @@ -482,7 +485,7 @@
/*seteuid(getuid());*/ }/* IF */
- prog = argv[0]; - prog = argv[0];
+ prog = (prog = strrchr(argv[0], '/')) ? prog + 1 : argv[0]; + prog = (prog = strrchr(argv[0], '/')) ? prog + 1 : argv[0];
ident = getpid() & 0xFFFF; ident = getpid() & 0xFFFF;
verbose_flag = 1; verbose_flag = 1;
@@ -524,8 +530,8 @@ @@ -823,6 +826,7 @@
usage(); break;
#endif
case 'v':
- printf("%s: Version %s $Date: 1997/01/08 20:29:33 $\n",argv[0], VERSION);
- printf("%s: comments to fping@networking.Stanford.EDU\n",argv[0]);
+ printf("%s: FreeBSD port based on Version %s $Date: 1997/01/08 20:29:33 $\n",argv[0], VERSION);
+ printf("%s: comments to fping@networking.Stanford.EDU\n",argv[0]);
exit(0);
case 'f':
#ifdef ENABLE_F_OPTION
@@ -671,6 +677,7 @@
}
if (!ping_file) errno_crash_and_burn("fopen");
while(fgets(line,132,ping_file)) {
+ line[132-1] = '\0';
if (sscanf(line,"%s",host) != 1)
continue;
if ((!*host) || (host[0]=='#')) /* magic to avoid comments */
@@ -1033,7 +1040,6 @@
memset(buffer, 0, ping_pkt_size * sizeof(char));
icp = (struct icmp *) buffer;
- gettimeofday(&h->last_send_time,&tz); while( fgets( line, 132, ping_file ) )
icp->icmp_type = ICMP_ECHO; {
icp->icmp_code = 0; + line[132-1] = '\0';
icp->icmp_cksum = 0; if( sscanf( line, "%s", host ) != 1 )
@@ -1041,6 +1047,8 @@ continue;
icp->icmp_id = ident;
pdp = (PING_DATA *) (buffer + SIZE_ICMP_HDR); @@ -1503,7 +1507,6 @@
+ /* set the time at the very last possible point */ memset( buffer, 0, ping_pkt_size * sizeof( char ) );
+ gettimeofday(&h->last_send_time,&tz); icp = ( FPING_ICMPHDR* )buffer;
pdp->ping_ts = h->last_send_time;
pdp->ping_count = h->num_sent;
@@ -1099,6 +1107,10 @@ - gettimeofday( &h->last_send_time, &tz );
#ifndef IPV6
icp->icmp_type = ICMP_ECHO;
icp->icmp_code = 0;
@@ -1512,6 +1515,8 @@
icp->icmp_id = ident;
result=recvfrom_wto(s,buffer,4096, pdp = ( PING_DATA* )( buffer + SIZE_ICMP_HDR );
(struct sockaddr *)&response_addr,select_time); + /* set the time at the very last possible point */
+ gettimeofday(&h->last_send_time,&tz);
pdp->ping_ts = h->last_send_time;
pdp->ping_count = h->num_sent;
@@ -1523,6 +1528,8 @@
icp->icmp6_id = ident;
pdp = ( PING_DATA* )( buffer + SIZE_ICMP_HDR );
+ /* set the time at the very last possible point */
+ gettimeofday(&h->last_send_time,&tz);
pdp->ping_ts = h->last_send_time;
pdp->ping_count = h->num_sent;
@@ -1611,6 +1618,9 @@
result = recvfrom_wto( s, buffer, sizeof(buffer), &response_addr, select_time );
+ /* get time of receipt as close to the real time as possible */
+ gettimeofday(&current_time,&tz);
+ +
+ /* get time of receipt as close to the real time as possible */ if( result < 0 )
+ gettimeofday(&current_time,&tz); return 0; /* timeout */
+
if (result<0) { return 0; } /* timeout */
#ifdef DEBUG @@ -1625,7 +1635,7 @@
@@ -1107,7 +1119,7 @@
return 0;
#endif
ip = (struct ip *) buffer;
-#if defined(__alpha__) && __STDC__
+#if defined(__alpha__) && defined(__osf1__) && __STDC__
/* The alpha headers are decidedly broken.
* Using an ANSI compiler, it provides ip_vhl instead of ip_hl and
* ip_v. So, to get ip_hl, we mask off the bottom four bits.
@@ -1144,7 +1156,6 @@
h=table[n];
/* received ping is cool, so process it */ ip = ( struct ip* )buffer;
- gettimeofday(&current_time,&tz); #ifndef IPV6
h->waiting = 0; -#if defined( __alpha__ ) && __STDC__ && !defined( __GLIBC__ )
h->timeout = timeout; +#if defined( __alpha__ ) && defined(__osf1__) && __STDC__ && !defined( __GLIBC__ )
h->num_recv++; h->num_recv_i++; /* The alpha headers are decidedly broken.
* Using an ANSI compiler, it provides ip_vhl instead of ip_hl and
* ip_v. So, to get ip_hl, we mask off the bottom four bits.
@@ -1633,7 +1643,7 @@
hlen = ( ip->ip_vhl & 0x0F ) << 2;
#else
hlen = ip->ip_hl << 2;
-#endif /* defined(__alpha__) && __STDC__ */
+#endif /* defined(__alpha__) && defined(__osf1__) && __STDC__ */
if( result < hlen + ICMP_MINLEN )
#else
if( result < sizeof(FPING_ICMPHDR) )
@@ -1690,7 +1700,6 @@
h = table[n];
/* received ping is cool, so process it */
- gettimeofday( &current_time, &tz );
h->waiting = 0;
h->timeout = timeout;
h->num_recv++;

View file

@ -1,5 +1,5 @@
--- fping.8.orig Wed Jan 8 10:48:49 1997 --- fping.8.orig Mon Jan 21 01:05:48 2002
+++ fping.8 Sat Aug 26 19:51:19 2000 +++ fping.8 Sun Jul 7 22:03:43 2002
@@ -1,4 +1,4 @@ @@ -1,4 +1,4 @@
-.TH fping l -.TH fping l
+.TH fping 8 +.TH fping 8
@ -15,16 +15,16 @@
with the "-" indicating that no response was received to the fourth with the "-" indicating that no response was received to the fourth
request. request.
.IP \fB-d\fR 5 .IP \fB-d\fR 5
@@ -96,7 +96,7 @@ @@ -107,7 +107,7 @@
.IP \fB-h\fR 5 .IP \fB-h\fR 5
Print usage message. Print usage message.
.IP \fB-i\fIn\fR 5 .IP \fB-i\fIn\fR 5
-The minimum amount of time (in milliseconds) between sending a ping packet to any target (default is 25). -The minimum amount of time (in milliseconds) between sending a ping packet to any target (default is 25).
+ The minimum amount of time (in microseconds) between sending a ping packet to any host (default is 25). +The minimum amount of time (in microseconds) between sending a ping packet to any target (default is 25).
.IP \fB-l\fR 5 .IP \fB-l\fR 5
Loop sending packets to each target indefinitely. Can be interrupted Loop sending packets to each target indefinitely. Can be interrupted
with ctl-C; statistics about responses for each target are then displayed. with ctl-C; statistics about responses for each target are then displayed.
@@ -106,7 +106,7 @@ @@ -117,7 +117,7 @@
Same as -d. Same as -d.
.IP \fB-p\fR 5 .IP \fB-p\fR 5
In looping or counting modes (-l, -c, or -C), this parameter sets the In looping or counting modes (-l, -c, or -C), this parameter sets the
@ -33,7 +33,7 @@
.B fping .B fping
waits between successive packets to an individual target. Default is waits between successive packets to an individual target. Default is
1000. 1000.
@@ -120,7 +120,7 @@ @@ -131,7 +131,7 @@
.IP \fB-s\fR 5 .IP \fB-s\fR 5
Print cumulative statistics upon exit. Print cumulative statistics upon exit.
.IP \fB-t\fIn\fR 5 .IP \fB-t\fIn\fR 5
@ -42,7 +42,7 @@
mode, this is the amount of time that mode, this is the amount of time that
.B fping .B fping
waits for a response to its first request. Successive timeouts are waits for a response to its first request. Successive timeouts are
@@ -141,12 +141,12 @@ @@ -152,12 +152,12 @@
example none the less. example none the less.
.nf .nf
@ -57,7 +57,7 @@
@check=("slapshot","foo","foobar"); @check=("slapshot","foo","foobar");
@@ -167,7 +167,7 @@ @@ -178,7 +178,7 @@
that are currently reachable. that are currently reachable.
.nf .nf

View file

@ -12,3 +12,5 @@ without flooding the network.
Unlike ping, fping is meant to be used in scripts and its Unlike ping, fping is meant to be used in scripts and its
output is easy to parse. output is easy to parse.
WWW: http://www.fping.com/