[OpenBIOS] r528 - ofw/inetv6

svn at openbios.org svn at openbios.org
Mon Aug 6 20:26:17 CEST 2007


Author: lwalter
Date: 2007-08-06 20:26:17 +0200 (Mon, 06 Aug 2007)
New Revision: 528

Modified:
   ofw/inetv6/ping.fth
   ofw/inetv6/pingv6.fth
Log:
ping is IPv4 and IPv6 independent

Modified: ofw/inetv6/ping.fth
===================================================================
--- ofw/inetv6/ping.fth	2007-08-06 01:11:12 UTC (rev 527)
+++ ofw/inetv6/ping.fth	2007-08-06 18:26:17 UTC (rev 528)
@@ -239,13 +239,16 @@
    loop
 ;
 
-: $ping  ( ip$ -- )
-   " net//obp-tftp:last" open-net  " $set-host" $call-net
+: (ping)  ( -- )
    /ping-max " allocate-ip" $call-net to ping-packet
    try-pings
    ping-packet /ping-max " free-ip" $call-net
    close-net
 ;
+: $ping  ( ip$ -- )
+   " net//obp-tftp:last" open-net  " $set-host" $call-net
+   (ping)
+;
 
 : ping  ( "host" -- )  safe-parse-word $ping  ;
 \ LICENSE_BEGIN

Modified: ofw/inetv6/pingv6.fth
===================================================================
--- ofw/inetv6/pingv6.fth	2007-08-06 01:11:12 UTC (rev 527)
+++ ofw/inetv6/pingv6.fth	2007-08-06 18:26:17 UTC (rev 528)
@@ -129,16 +129,29 @@
    loop
 ;
 
-: $ping6  ( ip$ -- )
-   " net//obp-tftp:last" open-net  " $set-host" $call-net
+: (ping6)  ( -- )
    /ping-max " allocate-ipv6" $call-net to ping-packet
    try-pingsv6
    ping-packet /ping-max " free-ipv6" $call-net
    close-net
 ;
+: $ping6  ( ip$ -- )
+   " net//obp-tftp:last" open-net  " $set-host" $call-net
+   (ping6)
+;
 
 : ping6  ( "host" -- )  safe-parse-word $ping6  ;
 
+[ifdef] include-ipv4
+: $ping  ( ip$ -- )
+   " net//obp-tftp:last" open-net  " $set-host" $call-net
+   " use-ipv6?" $call-net  if  (ping6)  else  (ping)  then
+;
+[else]
+: $ping  ( ip$ -- )  $ping6  ;
+[then]
+: ping  ( "host" -- )  safe-parse-word $ping  ;
+
 \ LICENSE_BEGIN
 \ Copyright (c) 2006 FirmWorks
 \ 




More information about the OpenBIOS mailing list