Patch to Net_Ping
| From: | Mika Tuupola | Date: | Thu, 08 Aug 2002 10:12:52 +0000 |
| Subject: | Patch to Net_Ping | ||
| Groups: | php.pear.dev | ||
| Request: | Send a blank email to pear-dev+get-8238@lists.php.net to get a copy of this message | ||
I have a patch waiting for commit to Net_Ping. It adds support
for sunos. Probably the biggest change is done to _createArgList()
which now returns an array insted of string. This is because
calling native SunOS ping is a bit sketchy.
/usr/sbin/ping host [timeout]
returns "host is alive".
/usr/sbin/ping -s [-t ttl] host [size] [count]
returns
PING mail: 56 data bytes
64 bytes from host (xxx.xx.xxx.xxx): icmp_seq=0. time=0. ms
64 bytes from host (xxx.xx.xxx.xxx): icmp_seq=1. time=0. ms
64 bytes from host (xxx.xx.xxx.xxx): icmp_seq=2. time=0. ms
----mail PING Statistics----
3 packets transmitted, 3 packets received, 0% packet loss
round-trip (ms) min/avg/max = 0/0/0
The reason why _createArgList() now returns an array is
that with -s option some of the arguments are before host
and some of them are after host.
I've left the timeout option away from the patch and added
defaults for size and count if only one of them is defined.
Tested the patched class with Solaris 8 and bc with a Linux.
If no-one objects I'll commit this one later.
--
Mika Tuupola http://www.appelsiini.net/~tuupola/