Thread View: vmsnet.sysmgt
1 messages
1 total messages
Started by Shawn A. Clifford
Mon, 14 Dec 1992 17:08
ADDR_CVT.COM - Internet address conversion program
Author: Shawn A. Clifford
Date: Mon, 14 Dec 1992 17:08
Date: Mon, 14 Dec 1992 17:08
59 lines
2531 bytes
2531 bytes
Here is a program that might be useful for tracing security messages concerning
internet access. The security message gives the address as a longword, and
maybe shows part of the dotted decimal address. This program will convert the
unsigned longword to dotted decimal (and hex), and vice-versa.
$! Title: ADDR_CVT.COM
$! Author: Shawn A. Clifford
$! Date: 09-DEC-1992
$! Purpose: Convert longword network addresses (as they appear in SECURITY
$! intrusion messages) into an internet dotted address, or
$! vice-versa.
$! Usage: @ADDR_CVT [longword_address|dotted_address]
$! ----------------------------------------------------------------------------
$! 'f$verify(0)
$ w := write sys$output
$ w ""
$ if (p1.nes."")
$ then
$ $addr$ = p1
$ if (f$type($addr$).eqs."INTEGER") then -
w "Longword: ''$addr$'" ! Print the longword before it gets signed
$ else
$ read/prompt="Enter a dotted or longword internet address: " sys$command $addr$
$ endif
$ if (f$type($addr$).nes."INTEGER") then goto to_longword
$!
$to_dotted:
$ $addr$=f$integer($addr$) ! Convert to signed integer
$ hex$=f$fao("!XL",$addr$) ! Convert the longword to a hex string
$ q1_hex=f$extract(0,2,hex$) ! Extract the hex quartet
$ q2_hex=f$extract(2,2,hex$)
$ q3_hex=f$extract(4,2,hex$)
$ q4_hex=f$extract(6,2,hex$)
$ q1=%x'q1_hex ! Convert quartet to integers
$ q2=%x'q2_hex
$ q3=%x'q3_hex
$ q4=%x'q4_hex
$!
$! Print results
$ w "Internet Address: ''q1'.''q2'.''q3'.''q4' or ''q1_hex'.''q2_hex'.''q3_hex'.''q4_hex'"
$ w ""
$ exit
$!
$to_longword:
$ x=1
$ temp=$addr$
$ loop:
$ q'x'=f$extract(0, f$locate(".",$addr$), $addr$)
$ $addr$=f$extract( f$locate(".",$addr$) + 1, f$length($addr$), $addr$ )
$ x=x+1
$ if (x.le.4) then goto loop
$ $long$=('q1'*256*256*256)+('q2'*256*256)+('q3'*256)+'q4'
$ $long$:='f$fao("!ZL",$long$)
$!
$! Print results
$ w "Longword form of internet address ''temp' is ''$long$'"
$ w ""
$ exit
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads