[HECnet] RSTS/E 10.1 DECnet/E 4.1 noob question

Tim Sneddon tim at sneddon.id.au
Sun Mar 10 08:35:04 PDT 2019


On Sun, Mar 10, 2019 at 11:05 PM Oleg Safiullin <form at pdp-11.online> wrote:

> BTW, there's a script I wrote for RSTS/E at BOPOHA::[.RSTS]NODES.COM
> You may find it useful to copy known nodes from another node (DECnet/E
> doesn't have this feature):
>
> $ @NODES
> Usage: @NODES ADDR NAME [LOG]
> $
> $ @NODES 1.13 MIM
> $
>

I have something similar that I use to run a nightly batch job that
downloads the node list from MIM and loads it into my local database.  It
is below in case anyone is interested.

Regards, Tim.

$ ! Procedure: UPDHEC.COM
$ set noon
$ on control_c then goto bail_out
$ on warning then goto bail_out
$ if (.not. f$environment("INTERACTIVE")) then set noverify
$ say = "write 0"
$ procedure = f$environment("PROCEDURE")
$ queue = f$edit(p1, 2+4+8+16+32+128+256)
$
$start:
$ if (f$access() .eqs. "BATCH") then goto init
$ if (queue .eqs. "") then goto no_queue
$ say "?Submitting update job to ''queue'"
$ submit/queue='queue'/parameters=("''queue'") 'procedure'
$ goto bail_out
$
$no_queue:
$ say "?No queue specified, exiting..."
$ goto bail_out
$
$init:
$ remote = "1.13""guest guest""::SY0:[DECNET]NODENAMES.DAT"
$ local = "SY:[1,2]NODNAM.DAT"
$
$run:
$ say "?Copying remote node database to local system"
$ copy/log/replace 'remote' 'local'
$
$ say "?Verifying database header"
$ open/read 2 'local'
$ read/end_of_file=end_loop 2 line
$ if (f$edit(line,2) .nes. "") then goto err_badhdr
$ read/end_of_file=end_loop 2 line
$ if (f$edit(line,2) .nes. "NODENODE") then goto err_badhdr
$ read/end_of_file=end_loop 2 line
$ if (f$edit(line,2) .nes. "ADDRESSNAME") then goto err_badhdr
$ read/end_of_file=end_loop 2 line
$ if (f$edit(line,2) .nes. "") then goto err_badhdr
$ say "?Header verified"
$
$ say "?Clearing known nodes"
$ ncp clear known nodes all
$ say "?Purging known nodes"
$ ncp purge known nodes all
$
$ i = 0
$ j = 0
$ area = 0
$ node = f$left(f$node(), f$length(f$node()) - 2)
$loop:
$ read/end_of_file=end_loop 2 line
$ line = f$edit(line, 8+16+32+128)
$ pos  = f$instr(0, line, " ")
$ addr = f$left(line, pos-1)
$ name = f$right(line, pos+1)
$
$ i = i + 1
$ if (name .eqs. node) then goto loop
$
$ say "?Adding entry for ''name' at ''addr'"
$ if (name .nes. node) then ncp define node 'addr' NAME 'name'
$ goto loop
$end_loop:
$ say "?Node database updated"
$ goto bail_out
$
$err_badhdr:
$ say "?Nodename database header is invalid"
$ goto bail_out
$
$bail_out:
$ if (f$access() .nes. "BATCH") then goto bail_out_nobatch
$ say "?Resubmitting HECnet name register procedure"
$ submit/queue='queue'/parameters=("''queue'")/after=TODAY 'procedure'
$ close 2
$
$bail_out_nobatch:
$ exit 1
$
!+==========================================================================
$ ! Procedure:  UPDHEC.COM
$ !
$ ! Purpose: Download the latest HECnet node database from MIM (1.13) and
$ ! apply it to the running system.
$ !
$ !             This procedure is expected to run under DCL on RSTS/E.
$ !
$ ! Parameters: P1 = Batch queue to submit procedure to
$ !
$ ! History:
$ ! 28-May-2014, TES; Version V1-001
$ ! 001 - Original version.
$
!+==========================================================================
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sonic.net/pipermail/hecnet-list/attachments/20190310/712e7e53/attachment-0001.html>


More information about the Hecnet-list mailing list