Another update from ingydotnet^djgoku

This commit is contained in:
Ingy döt Net 2015-11-18 06:14:39 +00:00
parent 91df62d461
commit 948b86eafa
7604 changed files with 108452 additions and 22726 deletions

View file

@ -0,0 +1,17 @@
/*REXX program displays IPv4 and IPv6 addresses for a supplied domain name.*/
trace off /*don't show PING none─zero return code*/
parse arg tar . /*obtain optional domain name from C.L.*/
if tar=='' then tar='www.kame.net' /*Not specified? Then use the default.*/
tempFID='\TEMP\DNSQUERY.$$$.' /*define temp file to store the IPv4. */
pingOpts='-l 0 -n 1 -w 1' tar /*define options for the PING command. */
do j=4 to 6 by 2 /*handle IPv4 and IPv6 addresses. */
'PING' (-j) pingOpts ">" tempFID /*restrict PING's output to a minimum. */
q=charin(tempFID,1,999) /*read the output file from PING cmd.*/
parse var q '[' IPA ']' /*parse IP address from the output. */
say 'IPv'j 'for domain name ' tar " is " IPA /*IPv4 or IPv6 address.*/
call lineout tempFID /* ◄──┬─◄ needed by some REXXes to */
end /*j*/ /* └─◄ force file integrity.*/
'ERASE' tempFID /*clean up (delete) the temporary file.*/
/*stick a fork in it, we're all done. */

View file

@ -0,0 +1,5 @@
irb(main):001:0> require 'socket'
=> true
irb(main):002:0> Addrinfo.getaddrinfo("www.kame.net", nil, nil, :DGRAM) \
irb(main):003:0* .map! { |ai| ai.ip_address }
=> ["203.178.141.194", "2001:200:dff:fff1:216:3eff:feb1:44d7"]

View file

@ -1,16 +0,0 @@
/*REXX pgm displays IPv4 and IPv6 addresses for a supplied domain name.*/
trace off /*don't show the PING return code*/
parse arg dn . /*get the optional domain name. */
if dn=='' then dn = 'www.kame.net' /*Not specified? Then use default*/
tmp = '\TEMP\TEMP.PING' /*define temp file to store IPv4.*/
do j=4 to 6 by 2 /*handle IPv4 and IPv6 addresses.*/
'PING' (-j) '-l 0 -n 1' dn ">" tmp /*restrict PING's output to min. */
q=charin(tmp,1,999) /*read output file from PING cmd.*/
parse var q '[' IPA ']' /*parse IP a ddress from output.*/
say 'IPv'j 'for domain name ' dn " is " IPA /*IPv4 | IPv6 addr.*/
call lineout tmp /*needed by most REXXes to ··· */
end /*j*/ /* [↑] ··· force file integrity.*/
'ERASE' tmp /*clean up the temporary file. */
/*stick a fork in it, we're done.*/