From:	SMTP%"DSJ@WKUVX1.WKU.EDU"  7-FEB-1995 12:27:24.75
To:	EVERHART
CC:	
Subj:	OCTOBER94.PING

X-FileServer: Digital Systems Journal File Server <DSJ@WKUVX1.WKU.EDU>
Date: Tue, 07 Feb 1995 11:24:52 CST
Sender: DSJ-Mgr@WKUVX1.WKU.EDU
Errors-To: DSJ-Mgr@WKUVX1.WKU.EDU
Warnings-To: <>
From: DSJ-Mgr@WKUVX1.WKU.EDU
Reply-To: DSJ@WKUVX1.WKU.EDU
Subject: OCTOBER94.PING
To: EVERHART@arisia.gce.com

$! ------------------ CUT HERE -----------------------
$ v='f$verify(f$trnlnm("SHARE_UNPACK_VERIFY"))'
$!
$! This archive created:
$!  Name : PING
$!  By   : Hunter Goatley <goathunter@ALPHA.WKU.EDU>
$!  Date :  7-NOV-1994 09:58:36.92
$!  Using: VMS_SHARE 8.5-1, (C) 1993 Andy Harper, Kings College London UK
$!
$! Credit is due to these people for their original ideas:
$!    James Gray, Michael Bednarek 
$!
$! To unpack this archive:
$!    Minimum of VMS 4.4 (VAX) / OpenVMS 1.0 (Alpha) is required.
$!    Remove the headers of the first part, up to `cut here' line.
$!    Execute file as a command procedure.
$!
$! The following file(s) will be created after unpacking:
$!       1. PING.DSJ;1
$!
$ set="set"
$ set symbol/scope=(nolocal,noglobal)
$ f="SYS$SCRATCH:."+f$getjpi("","PID")+";"
$ if f$trnlnm("SHARE_UNPACK") .nes. "" then $ -
 f=f$parse("SHARE_UNPACK_TEMP",f)
$ e="write sys$error  ""%UNPACK"", "
$ w="write sys$output ""%UNPACK"", "
$ if .not. f$trnlnm("SHARE_UNPACK_LOG") then $ w = "!"
$ if f$getsyi("CPU") .gt. 127 then $ goto start
$ ve=f$getsyi("version")
$ if ve-f$extract(0,1,ve) .ges. "4.4" then $ goto start
$ e "-E-OLDVER, Must run at least VMS 4.4"
$ v=f$verify(v)
$ exit 44
$unpack:subroutine!P1=file,P2=chksum,P3=attrib,P4=size,P5=fileno,P6=filetotal
$ if f$parse(P1) .nes. "" then $ goto dirok
$ dn=f$parse(P1,,,"DIRECTORY")
$ w "-I-CREDIR, Creating directory ''dn'"
$ create/dir 'dn'
$ if $status then $ goto dirok
$ e "-E-CREDIRFAIL, Unable to create ''dn' File skipped"
$ delete 'f'*
$ exit
$dirok:
$ x=f$search(P1)
$ if x .eqs. "" then $ goto file_absent
$ e "-W-EXISTS, File ''P1' exists. Skipped"
$ delete 'f'*
$ exit
$file_absent:
$ w "-I-UNPACK, Unpacking ", P5, " of ", P6, " - ", P1, " - ", P4, " Blocks"
$ n=P1
$ if P3 .nes. "" then $ n=f
$ if .not. f$verify() then $ define/user sys$output nl:
$ EDIT/TPU/NOSEC/NODIS/COM=SYS$INPUT/NOJOURNAL 'f'/OUT='n'
PROCEDURE GetHex(s,p)LOCAL x1,x2;x1:=INDEX(t,SUBSTR(s,p,1))-1;x2:=INDEX(t,
SUBSTR(s,p+1,1))-1;RETURN 16*x1+x2;ENDPROCEDURE;PROCEDURE SkipPartsep LOCAL m;
LOOP m:=MARK(NONE);EXITIF m=END_OF(CURRENT_BUFFER);DELETE(m);EXITIF INDEX(
ERASE_LINE,"-+-+-+-+-+-+-+-+")=1;ENDLOOP;ENDPROCEDURE;
PROCEDURE ProcessLine LOCAL c,s,l,b,n,p;s := ERASE_LINE;c := SUBSTR(s,1,1);s :=
 s-c;IF c = "X" THEN SPLIT_LINE; ENDIF;MOVE_HORIZONTAL(-1);l := LENGTH(s);p :=
 1;LOOP EXITIF p > l;c := SUBSTR(s,p,1);p := p+1;CASE c FROM ' ' TO '`' ['`']
: COPY_TEXT(ASCII(GetHex(s,p))); p:=p+2;[' ']: p:=p+1;[INRANGE,OUTRANGE]
: COPY_TEXT(c);ENDCASE;ENDLOOP;ENDPROCEDURE;PROCEDURE Decode(b)LOCAL m;
POSITION(BEGINNING_OF(b));LOOP m:=MARK(NONE);EXITIF m=END_OF(b);DELETE(m);
IF INDEX(CURRENT_LINE,"+-+-+-+-+-+-+-+-")=1 THEN SkipPartSep;ELSE ProcessLine;
MOVE_HORIZONTAL(1);ENDIF;ENDLOOP;ENDPROCEDURE;SET(FACILITY_NAME,"UNPACK");SET(
SUCCESS,OFF);SET(INFORMATIONAL,OFF);t:="0123456789ABCDEF";f:=GET_INFO(
COMMAND_LINE,"file_name");o:=CREATE_BUFFER(f,f);Decode(o);WRITE_FILE(o,
GET_INFO(COMMAND_LINE,"output_file"));QUIT;
$ if p3 .eqs. "" then $ goto dl
$ open/write fdl &f
$ write fdl "RECORD"
$ write fdl P3
$ close fdl
$ w "-I-CONVRFM, Converting record format to ", P3
$ convert/fdl='f' 'f'-1 'f'
$ fa=f$getdvi(f$parse(f),"ALLDEVNAM")
$ Pa=f$getdvi(f$parse(P1),"ALLDEVNAM")
$ if fa .eqs. Pa then $ rename &f 'f$parse(P1)'
$ if fa .nes. Pa then $ copy &f 'f$parse(P1)'
$dl: delete 'f'*
$ checksum 'P1'
$ if checksum$checksum .nes. P2 then $ -
  e "-E-CHKSMFAIL, Checksum of ''P1' failed."
$ exit
$ endsubroutine
$start:
$!
$ create 'f'
X$!
X$!`09SYS$MANAGER:PING.COM`20
X$!
X$!`09********************************
X$!`09*This`20is`20the`20DECNET`20PING`20Object*
X$!`09********************************
X$!
X$!`09Purpose:`20Time`20a`20DECNET`20PING`20looping`20thru`20the`20PING`20objec
Vt`20
X$!`09`20`20`20`20`20`20`20`20`20on`20a`20remote`20node.
X$!
X$!`09Usage:`20"@SYS$MANAGER:ping`20nodename`20`5B"user`20text`20to`20loopback"
V`5D
X$!
X$!`09`20`20`20`20`20`20`20to`20get`20loopback`20Time`20sending`20a`20message
V`20to`20nodename,
X$!`09`20`20`20`20`20`20`20having`20nodename`20echo`20the`20message`20to`20the
V`20originator.
X$!
X$!`09`20`20`20`20`20`20`20A`20default`20text`20string`20of`2025`20bytes`20is
V`20supplied`20if
X$!`09`20`20`20`20`20`20`20p2`20is`20not`20specified.
X$!
X$!`09`20or`20`20`20`20"@SYS$MANAGER:ping`20NCP"`20to`20define`20the`20PING`20o
Vbject`20in`20NCP:
X$!
X$!`09`20or`20`20`20`20"@SYS$MANAGER:ping`20?"`20`20`20for`20help.
X$!
X$!`09NOTE:`20`20The`20PING`20object`20is`20an`20example`20of`20how`20parameter
Vs`20can`20be
X$!`09`20`20`20`20`20`20`20passed`20to`20a`20remote`20node's`20object`20and`20d
Vata`20returned`20to
X$!`09`20`20`20`20`20`20`20the`20invoker`20of`20an`20object`20from`20the`20DECN
VET`20object`20itself.
X$!
X$!`09`20`20`20`20`20`20`20The`20PING`20object`20is`20written`20entirely`20in
V`20DCL.
X$!
X$!`09`20`20`20`20`20`20`20The`20normal`20VMS`20documented`20way`20of`20invokin
Vg`20an`20object
X$!`09`20`20`20`20`20`20`20($`20type`20nodename::"nnn="`20where`20nnn`20is`20th
Ve`20object`20#)
X$!`09`20`20`20`20`20`20`20cannot`20pass`20any`20data`20to,`20or`20receive`20an
Vy`20data`20from,`20
X$!`09`20`20`20`20`20`20`20the`20invoked`20object.
X$!
X$!`09Version`20A00`20-`2006/15/93`20-`20TLV`20-`20Initial`20version.
X$!`09Version`20B00`20-`2006/16/93`20-`20TLV`20-`20Define`20as`20Network`20Obje
Vct.
X$!`09Version`20C00`20-`2006/16/93`20-`20TLV`20-`20Suppress`20proxy`20lookup`20
Vvia`20"".
X$!`09Version`20D00`20-`2006/16/93`20-`20TLV`20-`20Obtain`20text`20from`20objec
Vt's`20invoker
X$!`09Version`20E00`20-`2006/02/94`20-`20TLV`20-`20Build`20PING_ACCT`20automati
Vcally`20for`20user
X$!
X$`09say`20=`20"write`20sys$output"`20
X$!
X$`09IF`20p1`20.EQS.`20"NCP"`20THEN`20GOTO`20NCP_DEF
X$!
X$!`09************************************************************************
V
X$!`09*The`20next`20section`20of`20code`20executes`20as`20the`20PING`20object
V`20on`20a`20remote`20node:*
X$!`09************************************************************************
V
X$!
X$`09if`20f$mode()`20.eqs.`20"NETWORK"
X$`09`20`20then
X$!
X$`09`20`20`20`20on`20error`20goto`20close_net
X$`09`20`20`20`20open/read/write`20rem`20sys$net`09`09!`20Open`20read/write`20N
Vetwork`20Link
X$`09`20`20`20`20define/nolog`20sys$output`20rem:`09!`20Send`20sys$output`20bac
Vk`20to`20caller
X$`09`20`20`20`20define/nolog`20sys$error`20`20rem:`09!`20Send`20sys$error`20
V`20back`20to`20caller
X$!
X$`09`20`20`20`20read`20rem`20record`09`09`09!`20Read`20caller's`20nodename
X$`09`20`20`20`20write`20sys$output`20"''record'"`09!`20Echo`20PING`20text`20to
V`20invoker
X$`20close_net:close`20rem
X$`09`20`20`20`20exit
X$!
X$`09endif
X$!
X$!`09*********************************************
X$!`09*The`20next`20section`20provides`20User`20Help`20on`20PING*
X$!`09*********************************************
X$!
X$`09if`20p1`20.eqs.`20"?"
X$`09`20`20then
X$`09`20`20`20`20say`20"Purpose:`20Time`20a`20DECNET`20PING`20looping`20thru`20
Vthe`20PING`20object"
X$`09`20`20`20`20say`20"`20`20`20`20`20`20`20`20`20on`20a`20remote`20node."
X$`09`20`20`20`20say`20"`20"
X$`09`20`20`20`20say`20"Usage:`20@SYS$MANAGER:ping`20nodename`20`5B""user`20tex
Vt`20to`20loopback""`5D"
X$`09`20`20`20`20say`20"`20"
X$`09`20`20`20`20say`20"to`20get`20loopback`20Time`20sending`20a`20message`20to
V`20nodename,"
X$`09`20`20`20`20say`20"having`20nodename`20echo`20the`20message`20to`20the`20o
Vriginator."
X$`09`20`20`20`20say`20"`20"
X$`09`20`20`20`20say`20"Note:`20`20The`20first`20time`20a`20PING`20is`20done`20
Vto`20remote`20node,"
X$`09`20`20`20`20say`20"`20`20`20`20`20`20`20it`20may`20take`20longer`20than`20
Vsubsequent`20pings`20due`20to"
X$`09`20`20`20`20say`20"`20`20`20`20`20`20`20the`20initial`20NETSERVER`20login
V`20that`20must`20occur`20on"
X$`09`20`20`20`20say`20"`20`20`20`20`20`20`20remote`20PING`20object.`20`20Once
V`20the`20NETSERVER`20is`20created,"
X$`09`20`20`20`20say`20"`20`20`20`20`20`20`20subsequent`20PING''s`20will`20exec
Vute`20more`20quickly."
X$`09`20`20`20`20say`20"`20"
X$`09`20`20`20`20say`20"A`20default`20text`20string`20of`2025`20bytes`20is`20su
Vpplied`20if"
X$`09`20`20`20`20say`20"p2`20is`20not`20specified."
X$`09`20`20`20`20say`20"`20"
X$`09`20`20`20`20say`20"or`20`20`20`20`20@SYS$MANAGER:ping`20NCP`20to`20define
V`20the`20PING`20object`20in`20NCP"
X$`09`20`20`20`20say`20"`20"
X$`09`20`20`20`20say`20"or`20`20`20`20`20@SYS$MANAGER:ping`20?`20`20`20for`20he
Vlp."
X$`09`20`20`20`20exit
X$`09endif
X$!
X$!`09*************************************************
X$!`09*The`20next`20section`20of`20code`20runs`20on`20our`20local`20Node*
X$!`09*and`20starts`20the`20PING`20object`20on`20the`20remote`20node:`20*
X$!`09*************************************************
X$!
X$!`09Invoke`20PING`20on`20remote`20node:
X$!
X$`09on`20control_y`20then`20goto`20cleanup
X$`09if`20p1`20.eqs.`20""`20then`20p1=f$trnlnm("SYS$NODE")`20-`20"::"`20!`20Set
V`20default`20node
X$!`09`09`09`09`09`09`09`20`20`20!`20to`20local`20node.
X$!
X$!`09Note:`20`20If`20the`20caller`20has`20proxy`20access`20on`20the`20remote
V`20node,`20the`20""`20after`20
X$!`09`20`20`20`20`20`20`20p1`20inhibits`20using`20the`20caller's`20proxy`20acc
Vount`20directory`20as`20the`20
X$!`09`20`20`20`20`20`20`20location`20for`20object`20128's`20(ping)`20command
V`20file.`20`20
X$!
X$!`09`20`20`20`20`20`20`20The`20""`20forces`20the`20file`20spec`20in`20NCP`20o
Vbject`20definition`20for`20PING`20
X$!`09`20`20`20`20`20`20(SYS$MANAGER:ping.com)`20to`20be`20used`20instead.
X$!
X$`09if`20p2`20.eqs.`20""`20then`20p2="Default`20PING`20Text`20String"
X$!
X$`09start_time=f$cvtime(f$time(),,"TIME")`09`20!`20Log`20start`20of`20PING`20T
Vime
X$`09open/read/write`09`20`20`20`20`20link`20'p1'""::"128="`20!`20Invoke`20Remo
Vte`20Object
X$`09write`20`09`09`20`20`20`20`20link`20"''p2'`20''pid'"`20!`20Send`20nodename
V`20`26`20PID`20to`20Object
X$`20read:`09read/end=eof/err=eof`20link`20response`09`20!`20Read`20Remote`20Ob
Vject's`20Echo
X$`09if`20f$type(end_time)`20.eqs.`20""`20
X$`09`20`20then`20
X$`09`20`20`20`20end_time=f$cvtime(f$time(),,"TIME")`09`20!`20Log`20time`201st
V`20ECHO`20completed
X$`09endif
X$`09goto`20read`09`09`09`09`20!`20Read`20all`20responses
X$!
X$`20eof:`20`20close`20link`09`09`09`09`20!`20Close`20Link`20on`20EOF
X$!
X$`09time=f$cvtime("''end_time'-''start_time'",,"TIME")
X$`09textlng=f$length(response)
X$`09write`20sys$output`20"''textlng'`20byte`20Loop`20thru`20''p1'`20took`20''t
Vime'."
X$`09exit
X$!
X$`20cleanup:
X$`09set`20message/notext/nofacil/noid/nosever
X$`09close`20link
X$`09if`20f$type(org_priv)`20.nes.`20""`20then`20org_priv=F$SETPRV(org_priv)
X$`09set`20message/text/facil/id/sever
X$`09exit
X$!
X$`20ncp_def:
X$!
X$`09org_priv`09=`20F$SETPRV("ALL")
X$!
X$!`09********************************************************
X$!`09*Special,`20Infrequently`20used`20section`20used`20to`20define`20the`20*
V
X$!`09*PING`20Object`20in`20the`20NCP`20DataBase.`20`20Used`20if`20the`20NCP`20
Vdata*
X$!`09*base`20needs`20to`20be`20re-created.`20`20`20`20`20`20`20`20`20`20`20`20
V`20`20`20`20`20`20`20`20`20`20`20`20`20`20*
X$!`09********************************************************
X$!
X$`09write`20sys$output`20"Ignore`20any`20AUTHORIZE`20or`20NCP`20error`20messag
Ves..."
X$
X$`09default=f$environment("DEFAULT")
X$!
X$`09set`20def`20sys$system
X$`09mcr`20authorize
Xremove`20ping_acct
Xadd`09`20ping_acct`20-
X`09/password=ping_pswd`20-
X`09/nopwdexp`20-
X`09/flags=(nodisuser,lockpwd,restricted)`20-
X`09/lgicmd=SYS$MANAGER:PING`20-
X`09/dev=sys$sysroot`20-
X`09/dir=sysmgr`20-
X`09/uic=`5Bsystem`5D`20-
X`09/owner="PING`20object"`20-
X`09/priv=(netmbx,tmpmbx)`20-
X`09/defpri=(netmbx,tmpmbx)
Xremove/proxy`20*::ping_acct`20ping_acct
Xadd/proxy`20*::ping_acct`20ping_acct/default
Xexit
X$!
X$`09run`20sys$system:ncp
X!
Xpurge`20object`20ping`20all
Xclear`20object`20ping`20all
XDefine`20`20Object`20PING`20-
X`09Number`20128`20-
X`09File`20SYS$MANAGER:PING.COM`20-
X`09User`20PING_ACCT`20Password`20PING_PSWD`20-
X`09Alias`20INCOMING`20ENABLE`20Alias`20OUTGOING`20ENABLE`20-
X`09Proxy`20BOTH
X!
Xset`20object`20ping`20all
X$!
X$`09set`20protection=(w:re)`20sys$manager:ping.com`09!`20Set`20proper`20protec
Vtion
X$`09set`20default`20'default'`09`09`09`09!`20Restore`20directory
X$`09org_priv`09=`20F$SETPRV(org_priv)`09`09!`20Restore`20privileges
X$`09exit
X
$ call unpack PING.DSJ;1 1445301765 "" 13 1 1
$ v=f$verify(v)
$ exit
