summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Ing-Simmons <nik@tiuk.ti.com>2002-07-17 06:32:10 +0000
committerNick Ing-Simmons <nik@tiuk.ti.com>2002-07-17 06:32:10 +0000
commitb2e048cb60f0b05b8dbbf6d77b5c8c080db24e8c (patch)
tree34aa4923eabcca5b9f2bcf49b008d458fd7be2b1
parent8e93eb227d6a2e75d395bc74dbcd4957180a1a72 (diff)
parent5d20095f2ea76fe4a137473b5027adb54c562036 (diff)
downloadperl-b2e048cb60f0b05b8dbbf6d77b5c8c080db24e8c.tar.gz
Integrate mainline
p4raw-id: //depot/perlio@17586
-rw-r--r--ext/Encode/encoding.pm5
-rw-r--r--hints/mpeix.sh7
-rw-r--r--lib/Net/Ping.pm84
-rw-r--r--lib/Net/Ping/Changes14
-rw-r--r--lib/Net/Ping/README69
-rw-r--r--lib/Net/Ping/t/200_ping_tcp.t4
-rwxr-xr-xmpeix/nm2
-rw-r--r--sv.c17
8 files changed, 152 insertions, 50 deletions
diff --git a/ext/Encode/encoding.pm b/ext/Encode/encoding.pm
index 0aa5f0f635..efb018752a 100644
--- a/ext/Encode/encoding.pm
+++ b/ext/Encode/encoding.pm
@@ -106,11 +106,6 @@ encoding - allows you to write your script in non-ascii or non-utf8
perl -Mencoding=latin2 -e '...' # Feeling centrally European?
perl -Mencoding=euc-kr -e '...' # Or Korean?
- # or from the shebang line
-
- #!/your/path/to/perl -Mencoding="8859-6" # Arabian Nights
- #!/your/path/to/perl -Mencoding=big5 # Taiwanese
-
# more control
# A simple euc-cn => utf-8 converter
diff --git a/hints/mpeix.sh b/hints/mpeix.sh
index f01b979fd2..5126bcf3b8 100644
--- a/hints/mpeix.sh
+++ b/hints/mpeix.sh
@@ -12,6 +12,7 @@
# Revised again for 5.004_69 by Mark Bixby, markb@cccd.edu.
# Revised for 5.6.0 by Mark Bixby, mbixby@power.net.
# Revised for 5.7.3 by Mark Bixby, mark@bixby.org.
+# Revised for 5.8.0 by Mark Bixby, mark@bixby.org.
#
osname='mpeix'
osvers=`uname -r | sed -e 's/.[A-Z]\.\([0-9]\)\([0-9]\)\.[0-9][0-9]/\1.\2/'`
@@ -93,6 +94,12 @@ d_difftime='define'
d_dlerror='undef'
d_dlopen='undef'
d_Gconvert='gcvt((x),(n),(b))'
+d_getnbyaddr='define'
+d_getnbyname='define'
+d_getpbyname='define'
+d_getpbynumber='define'
+d_getsbyname='define'
+d_getsbyport='define'
d_gettimeod='undef'
d_inetaton='undef'
d_link='undef'
diff --git a/lib/Net/Ping.pm b/lib/Net/Ping.pm
index babe2b0b53..815bb75843 100644
--- a/lib/Net/Ping.pm
+++ b/lib/Net/Ping.pm
@@ -1,13 +1,13 @@
package Net::Ping;
-# $Id: Ping.pm,v 1.1 2002/06/04 00:41:52 rob Exp $
+# $Id: Ping.pm,v 1.6 2002/06/19 15:23:48 rob Exp $
require 5.002;
require Exporter;
use strict;
use vars qw(@ISA @EXPORT $VERSION
- $def_timeout $def_proto $max_datasize $pingstring $hires $udp_source_verify);
+ $def_timeout $def_proto $max_datasize $pingstring $hires $source_verify);
use FileHandle;
use Socket qw( SOCK_DGRAM SOCK_STREAM SOCK_RAW PF_INET
inet_aton inet_ntoa sockaddr_in );
@@ -16,7 +16,7 @@ use POSIX qw(ECONNREFUSED);
@ISA = qw(Exporter);
@EXPORT = qw(pingecho);
-$VERSION = "2.19";
+$VERSION = "2.20";
# Constants
@@ -25,7 +25,7 @@ $def_proto = "tcp"; # Default protocol to use for pinging
$max_datasize = 1024; # Maximum data bytes in a packet
# The data we exchange with the server for the stream protocol
$pingstring = "pingschwingping!\n";
-$udp_source_verify = 1; # Default is to verify source endpoint
+$source_verify = 1; # Default is to verify source endpoint
if ($^O =~ /Win32/i) {
# Hack to avoid this Win32 spewage:
@@ -171,8 +171,8 @@ sub bind
sub source_verify
{
my $self = shift;
- $udp_source_verify = 1 unless defined
- ($udp_source_verify = ((defined $self) && (ref $self)) ? shift() : $self);
+ $source_verify = 1 unless defined
+ ($source_verify = ((defined $self) && (ref $self)) ? shift() : $self);
}
# Description: allows the module to use milliseconds as returned by
@@ -321,7 +321,7 @@ sub ping_icmp
substr($recv_msg, length($recv_msg) - $len_msg,
$len_msg));
if (($from_type == ICMP_ECHOREPLY) &&
- ($from_ip eq $ip) &&
+ (!$source_verify || $from_ip eq $ip) &&
($from_pid == $self->{"pid"}) && # Does the packet check out?
($from_seq == $self->{"seq"}))
{
@@ -650,7 +650,7 @@ sub ping_udp
$from_saddr = recv($self->{"fh"}, $from_msg, 1500, UDP_FLAGS)
or last; # For example an unreachable host will make recv() fail.
($from_port, $from_ip) = sockaddr_in($from_saddr);
- if (!$udp_source_verify ||
+ if (!$source_verify ||
(($from_ip eq $ip) && # Does the packet check out?
($from_port == $self->{"port_num"}) &&
($from_msg eq $msg)))
@@ -685,7 +685,7 @@ __END__
Net::Ping - check a remote host for reachability
-$Id: Ping.pm,v 1.1 2002/06/04 00:41:52 rob Exp $
+$Id: Ping.pm,v 1.6 2002/06/19 15:23:48 rob Exp $
=head1 SYNOPSIS
@@ -791,12 +791,27 @@ default) number of data bytes is 1 if the protocol is "udp" and 0
otherwise. The maximum number of data bytes that can be specified is
1024.
+=item $p->ping($host [, $timeout]);
+
+Ping the remote host and wait for a response. $host can be either the
+hostname or the IP number of the remote host. The optional timeout
+must be greater than 0 seconds and defaults to whatever was specified
+when the ping object was created. Returns a success flag. If the
+hostname cannot be found or there is a problem with the IP number, the
+success flag returned will be undef. Otherwise, the success flag will
+be 1 if the host is reachable and 0 if it is not. For most practical
+purposes, undef and 0 and can be treated as the same case. In array
+context, the elapsed time is also returned. The elapsed time value will
+be a float, as retuned by the Time::HiRes::time() function, if hires()
+has been previously called, otherwise it is returned as an integer.
+
=item $p->source_verify( { 0 | 1 } );
Allows source endpoint verification to be enabled or disabled.
This is useful for those remote destinations with multiples
interfaces where the response may not originate from the same
endpoint that the original destination endpoint was sent to.
+This only affects udp and icmp protocol pings.
This is enabled by default.
@@ -821,20 +836,6 @@ then bind() must be called at most once per object, and (if it is
called at all) must be called before the first call to ping() for that
object.
-=item $p->ping($host [, $timeout]);
-
-Ping the remote host and wait for a response. $host can be either the
-hostname or the IP number of the remote host. The optional timeout
-must be greater than 0 seconds and defaults to whatever was specified
-when the ping object was created. Returns a success flag. If the
-hostname cannot be found or there is a problem with the IP number, the
-success flag returned will be undef. Otherwise, the success flag will
-be 1 if the host is reachable and 0 if it is not. For most practical
-purposes, undef and 0 and can be treated as the same case. In array
-context, the elapsed time is also returned. The elapsed time value will
-be a float, as retuned by the Time::HiRes::time() function, if hires()
-has been previously called, otherwise it is returned as an integer.
-
=item $p->open($host);
When you are using the stream protocol, this call pre-opens the
@@ -900,6 +901,43 @@ routines to pack and unpack ICMP packets. It would be better for a
separate module to be written which understands all of the different
kinds of ICMP packets.
+=head1 INSTALL
+
+The latest source tree is available via cvs:
+
+ cvs -z3 -q -d :pserver:anonymous@cvs.roobik.com.:/usr/local/cvsroot/freeware co Net-Ping
+ cd Net-Ping
+
+The tarball can be created as follows:
+
+ perl Makefile.PL ; make ; make dist
+
+The latest Net::Ping release can be found at CPAN:
+
+ $CPAN/modules/by-module/Net/
+
+1) Extract the tarball
+
+ gtar -zxvf Net-Ping-xxxx.tar.gz
+ cd Net-Ping-xxxx
+
+2) Build:
+
+ make realclean
+ perl Makefile.PL
+ make
+ make test
+
+3) Install
+
+ make install
+
+Or install it RPM Style:
+
+ rpm -ta SOURCES/Net-Ping-xxxx.tar.gz
+
+ rpm -ih RPMS/noarch/perl-Net-Ping-xxxx.rpm
+
=head1 AUTHORS
Current maintainer:
diff --git a/lib/Net/Ping/Changes b/lib/Net/Ping/Changes
index 6677b527e0..d8dad1625b 100644
--- a/lib/Net/Ping/Changes
+++ b/lib/Net/Ping/Changes
@@ -1,12 +1,24 @@
CHANGES
-------
+2.20 Jun 20 10:00 2002
+ - Perl 5.8.0 compatibility stuff.
+ Spot by dcd@tc.fluke.com (David Dyck).
+ And patch by jhi@iki.fi (Jarkko Hietaniemi).
+ - Move INSTALL doc into perldoc.
+ - Allow source_verify method to work
+ for icmp protocol as well as udp.
+ Spot by taner@taner.net (Taner Halicioglu)
+
2.19 Jun 03 19:00 2002
- - Add $p->udp_source_verify method to skip source
+ - Add $p->source_verify method to skip source
endpoint verification of udp protocol pings for
those remote destinations with multiple interfaces
that may have the "reverse telnet" bug.
+ Spot by dcd@tc.fluke.com (David Dyck)
- Moved files to more standard locations.
+ - Less common martian used for ping test
+ to reduce conflicts
2.18 May 06 12:00 2002
- More RPM spec generalizations.
diff --git a/lib/Net/Ping/README b/lib/Net/Ping/README
index b3665cec6e..2dc4b95280 100644
--- a/lib/Net/Ping/README
+++ b/lib/Net/Ping/README
@@ -1,7 +1,7 @@
NAME
Net::Ping - check a remote host for reachability
- $Id: Ping.pm,v 1.1 2002/06/04 00:41:52 rob Exp $
+ $Id: Ping.pm,v 1.6 2002/06/19 15:23:48 rob Exp $
SYNOPSIS
use Net::Ping;
@@ -102,11 +102,26 @@ DESCRIPTION
otherwise. The maximum number of data bytes that can be specified is
1024.
+ $p->ping($host [, $timeout]);
+ Ping the remote host and wait for a response. $host can be either
+ the hostname or the IP number of the remote host. The optional
+ timeout must be greater than 0 seconds and defaults to whatever was
+ specified when the ping object was created. Returns a success flag.
+ If the hostname cannot be found or there is a problem with the IP
+ number, the success flag returned will be undef. Otherwise, the
+ success flag will be 1 if the host is reachable and 0 if it is not.
+ For most practical purposes, undef and 0 and can be treated as the
+ same case. In array context, the elapsed time is also returned. The
+ elapsed time value will be a float, as retuned by the
+ Time::HiRes::time() function, if hires() has been previously called,
+ otherwise it is returned as an integer.
+
$p->source_verify( { 0 | 1 } );
Allows source endpoint verification to be enabled or disabled. This
is useful for those remote destinations with multiples interfaces
where the response may not originate from the same endpoint that the
- original destination endpoint was sent to.
+ original destination endpoint was sent to. This only affects udp and
+ icmp protocol pings.
This is enabled by default.
@@ -129,20 +144,6 @@ DESCRIPTION
called at all) must be called before the first call to ping() for
that object.
- $p->ping($host [, $timeout]);
- Ping the remote host and wait for a response. $host can be either
- the hostname or the IP number of the remote host. The optional
- timeout must be greater than 0 seconds and defaults to whatever was
- specified when the ping object was created. Returns a success flag.
- If the hostname cannot be found or there is a problem with the IP
- number, the success flag returned will be undef. Otherwise, the
- success flag will be 1 if the host is reachable and 0 if it is not.
- For most practical purposes, undef and 0 and can be treated as the
- same case. In array context, the elapsed time is also returned. The
- elapsed time value will be a float, as retuned by the
- Time::HiRes::time() function, if hires() has been previously called,
- otherwise it is returned as an integer.
-
$p->open($host);
When you are using the stream protocol, this call pre-opens the tcp
socket. It's only necessary to do this if you want to provide a
@@ -200,6 +201,42 @@ NOTES
module to be written which understands all of the different kinds of
ICMP packets.
+INSTALL
+ The latest source tree is available via cvs:
+
+ cvs -z3 -q -d :pserver:anonymous@cvs.roobik.com.:/usr/local/cvsroot/freeware co Net-Ping
+ cd Net-Ping
+
+ The tarball can be created as follows:
+
+ perl Makefile.PL ; make ; make dist
+
+ The latest Net::Ping release can be found at CPAN:
+
+ $CPAN/modules/by-module/Net/
+
+ 1) Extract the tarball
+
+ gtar -zxvf Net-Ping-xxxx.tar.gz
+ cd Net-Ping-xxxx
+
+ 2) Build:
+
+ make realclean
+ perl Makefile.PL
+ make
+ make test
+
+ 3) Install
+
+ make install
+
+ Or install it RPM Style:
+
+ rpm -ta SOURCES/Net-Ping-xxxx.tar.gz
+
+ rpm -ih RPMS/noarch/perl-Net-Ping-xxxx.rpm
+
AUTHORS
Current maintainer:
bbb@cpan.org (Rob Brown)
diff --git a/lib/Net/Ping/t/200_ping_tcp.t b/lib/Net/Ping/t/200_ping_tcp.t
index c417fcb91c..591c25166f 100644
--- a/lib/Net/Ping/t/200_ping_tcp.t
+++ b/lib/Net/Ping/t/200_ping_tcp.t
@@ -51,8 +51,8 @@ ok ($p -> {port_num} = (getservbyname("http", "tcp") || 80));
# Test localhost on the web port
ok $p -> ping("localhost");
-# Hopefully this is not a routeable host
-ok !$p -> ping("10.12.14.16");
+# Hopefully this is never a routeable host
+ok !$p -> ping("172.29.249.249");
# Test a few remote servers
# Hopefully they are up when the tests are run.
diff --git a/mpeix/nm b/mpeix/nm
index b2eb58d9d6..e2a5d27c25 100755
--- a/mpeix/nm
+++ b/mpeix/nm
@@ -24,7 +24,7 @@ esac
callci xeq linkedit.pub.sys \"$LIST\" >/tmp/nm.$$
-awk '\
+/bin/awk '\
/ data univ / { printf "%-20s|%10s|%-6s|%-7s|%s\n",$1,$5,"extern","data","?"} \
/ entry univ / { printf "%-20s|%10s|%-6s|%-7s|%s\n",$1,$7,"extern","entry","?"}' /tmp/nm.$$
diff --git a/sv.c b/sv.c
index b62955883f..9e3d2a0d20 100644
--- a/sv.c
+++ b/sv.c
@@ -5884,10 +5884,23 @@ screamer2:
/* Accomodate broken VAXC compiler, which applies U8 cast to
* both args of ?: operator, causing EOF to change into 255
*/
- if (cnt > 0) { i = (U8)buf[cnt - 1]; } else { i = EOF; }
+#ifdef DJGPP /* This is basically undoing #17270 for DJGPP. See below. */
+ if (cnt)
+#else
+ if (cnt > 0)
+#endif
+ {
+ i = (U8)buf[cnt - 1];
+ }
+ else {
+ i = EOF;
+ }
}
- if (cnt > 0) {
+#ifndef DJGPP /* This is basically undoing #17270 for DJGPP. See above.*/
+ if (cnt > 0)
+#endif
+ {
if (append)
sv_catpvn(sv, (char *) buf, cnt);
else