Trailing-Edge
-
PDP-10 Archives
-
BB-P363B-SM_1985
-
mcb/nml/nmlmrr.bli
There are 2 other files named nmlmrr.bli in the archive. Click here to see a list.
! <BRANDT.DEVELOPMENT>NMLMRR.BLI.1 28-Jul-82 16:30:47, Edit by BRANDT
!
! Ident 05.
! In WAIT_FOR_CONNECT, do not do access checking.
!
!NET:<PECKHAM.DEVELOPMENT>NMLMRR.BLI.4 26-Mar-82 17:00:47, Edit by PECKHAM
!
! Ident 04.
! Fix dot bug in WAIT_FOR_CONNECT.
! Error buffer no longer needed for NMU$NETWORK_OPEN.
! Optimize WAIT_FOR_CONNECT.
!
!NET:<DECNET20-V3P1.BASELEVEL-2.SOURCES>NMLMRR.BLI.12 20-Nov-81 13:32:46, Edit by WEBBER
!
! Ident 03.
! Fix get and return of the response buffer so that they use addresses only,
! instead of pointers.
!
!NET:<DECNET20-V3P1.NML>NMLMRR.BLI.3 21-Oct-81 09:32:00, Edit by WEBBER
!
! Ident 02.
! Add error response buffer and length as parameters to NETWORK_OPEN.
!
!NET:<DECNET20-V3P1.BASELEVEL-2.SOURCES>NMLMRR.BLI.10 9-Feb-81 12:42:42, Edit by GUNN
!
! Remove check for version skew.
!
!NET:<DECNET20-V3P1.NMU>NMLMRR.BLI.5 3-Feb-81 09:58:30, Edit by JENNESS
! Remove MIRROR_OBJECT literal definition ... now in NMARCH.
! Change connect routine to properly reset connect block on reopen.
! Rework access validation.
! Add error code on reject for 'ACCESS NOT PERMITTED' (SC$_ANP).
! Change so that disconnect is done only on unrecoverable errors.
module NMLMRR ( ! Loop back mirror task
ident = 'X00.05'
) =
begin
!
! COPYRIGHT (c) 1980, 1981, 1982
! DIGITAL EQUIPMENT CORPORATION
! Maynard, Massachusetts
!
! This software is furnished under a license and may be used
! and copied only in accordance with the terms of such license
! and with the inclusion of the above copyright notice. This
! software or any other copies thereof may not be provided or
! otherwise made available to any other person. No title to
! and ownership of the software is hereby transferred.
!
! The information in this software is subject to change
! without notice and should not be construed as a commitment
! by DIGITAL EQUIPMENT CORPORATION.
!
! DIGITAL assumes no responsibility for the use or reliability
! of its software on equipment which is not supplied by
! DIGITAL.
!
!++
! Facility: LSG DECnet Network Management
!
! Abstract:
!
! This task performs the Loopback Mirror function for
! network management. This mirror is used for loopback
! testing through all layers of the architecture (SC, NSP, XPT,
! DLL).
!
! Environment: TOPS-10/20 User mode, RSX task mode
!
! Author: Dale C. Gunn, Steven M. Jenness, Creation date: 23-Oct-80
!
!--
!
!<BLF/SYNONYM %unquote=>
!<BLF/SYNONYM $FIELD=FIELD>
!<BLF/PAGE>
!
! Include files
!
library 'NMLLIB'; ! All required definitions
!
! Global routines
!
forward routine
NML$MIRROR : novalue; ! Mirror task code
!
! Local routines
!
forward routine
WAIT_FOR_CONNECT, ! Wait for connection to target task
CHECK_VERSION, ! Validate network management version
LOOP_DATA : novalue; ! Loop data on a connected link
!
! Equated symbols
!
literal
LOOP_BUFFER_LENGTH = 500; ! Length of loop back buffer in bytes
!
! External references
!
external routine
NMU$MEMORY_GET, ! Routines for getting
NMU$MEMORY_RELEASE, ! and giving back memory
NMU$NETWORK_UTILITIES; ! Network task-to-task interface
external
NMLVER, ! Network Managment version number
DECECO, ! Digital ECO number
USRECO; ! User ECO number
global routine %unquote NML$MIRROR (TASK, RESOURCE) : novalue =
!++
! Functional description:
!
! This routine is the top level of the Network Management
! loopback mirror. This mirror provides a task to task
! loop back. By doing the loopback at network task level
! all the lower layers can be checked for operability.
!
! Formal parameters:
!
! .TASK Address of task block for this task
! .RESOURCE Address of cell for this task to use as
! a resource variable.
!
! Routine value: none
! Side effects: none
!
!--
begin
local
BUFFER_PTR, ! Pointer to acceptance data buffer
BUFFER : ch$sequence (2, 8), ! Acceptance data buffer
LINK_ID; ! Open logical link identifier
!
! Put the loopback buffer length (in bytes) into the buffer
! to send as the optional data on a link connect acceptance.
!
BUFFER_PTR = ch$ptr (BUFFER,, 8);
PUTW (uplit (LOOP_BUFFER_LENGTH - 1), BUFFER_PTR);
!
! Loop forever, wait for link connected, loop data until disconnected.
!
while $true do
begin
LINK_ID = WAIT_FOR_CONNECT (MIRROR_OBJECT, 2, ch$ptr (BUFFER,, 8));
LOOP_DATA (.LINK_ID);
NMU$NETWORK_CLOSE (.LINK_ID, 0, 0);
end;
end; ! End of NML$MIRROR
routine WAIT_FOR_CONNECT (OBJECT, DATA_LENGTH, DATA_PTR) =
!++
! Functional description:
!
! This routine opens a target link for connection by
! another task. When a connect is attempted the user
! access rights are check and the source task's version
! number is checked. If all checks are ok, then the
! link is accepted (sending the optional acceptance data)
! and the LINK_ID is returned. If any check fails,
! a reject is sent with the appropriate error code.
!
! Formal parameters:
!
! .OBJECT DECnet object code
! .DATA_LENGTH Number of bytes in optional accept data
! .DATA_PTR Pointer to optional acceptance data
!
! Routine value:
!
! The LINK_ID of the opened link.
!
! Side effects: none
!
!--
begin
local
CBLK : CONNECT_BLOCK; ! Link connection block
!
! Set the object code and clear the task name and descriptor.
!
CBLK [CB_OBJECT] = .OBJECT;
CBLK [CB_TASK_LENGTH] = 0;
CBLK [CB_DESCRIPTOR_LENGTH] = 0;
!
! Loop until the link is connected
!
while $true do
begin
local
LINK_HANDLE, ! Handle of link
REASON; ! Link rejection reason
!
! Wait for a connect to this target task
!
LINK_HANDLE = NMU$NETWORK_OPEN (TARGET_LINK, CBLK, 0, 0, 0);
!
! Check for user access and version number ok
!
REASON = 0;
if ((.LINK_HANDLE gtr 0)
%( N.B. - Don't try to validate
and NMU$NETWORK_VALIDATE (CBLK)
)%
%( N.B. - Nope! Guess we don't have to check for version skew here.
and
((REASON = CHECK_VERSION (CBLK)) eql 0)
)%)
then
begin
NMU$NETWORK_ACCEPT (.LINK_HANDLE, .DATA_LENGTH, .DATA_PTR);
return .LINK_HANDLE;
end
else
begin
local REJECT_BUFFER, REJECT_PTR;
REJECT_PTR = ch$ptr (REJECT_BUFFER,, 8);
ch$wchar_a (.REASON, REJECT_PTR);
NMU$NETWORK_REJECT (.LINK_HANDLE, SC$_ANP, 1, ch$ptr (REJECT_BUFFER,, 8));
NMU$NETWORK_CLOSE (.LINK_HANDLE, 0, 0);
end;
end;
!
! We will never get here, as a success returns within the loop.
!
0
end; ! End of WAIT_FOR_CONNECT
routine CHECK_VERSION (CBLK) =
!++
! Functional description:
!
! This routine checks to see if the Network Management
! version match. If they don't, an error code is returned.
!
! Formal parameters:
!
! .CBLK Address of connect block
!
! Routine value:
!
! Zero if ok, a non-zero error code if failed test
!
! Side effects: none
!
!--
begin
map
CBLK : ref CONNECT_BLOCK;
local
DATA_PTR,
VERSION;
!
! Create pointer to data supplied with connect request
!
DATA_PTR = .CBLK [CB_DATA];
!
! Check for enough data available. If not, return
! Invalid Identification error.
!
if (.CBLK [CB_DATA_LENGTH] lss 3)
then
NICE$_IID
else
begin
!
! Check version number against ours, if it is older
! it is incompatible with us.
!
VERSION = GETB (DATA_PTR);
if .VERSION lss .NMLVER
then
NICE$_IMV
else
begin
!
! Check the Digital ECO number, if it is non-zero,
! it is incompatible with us.
!
! VERSION = GETB (DATA_PTR);
!
! if .VERSION gtr 0 then NICE$_IMV else 0
!
! For now accept any 2.x.y version of Network Management
!
0
end
end
end; ! End of CHECK_VERSION
routine LOOP_DATA (LINK_ID) : novalue =
!++
! Functional description:
!
! This routine performs the loop back function on a logical
! link that has already been opened. The looping continues
! until the task at the other end of the link closes it (or
! some other nefarious glitch takes it down).
!
! Formal parameters:
!
! .LINK_ID Identifier for logical link to do looping on
!
! Routine value: none
! Side effects: none
!
!--
begin
literal
LOOP_OK = 1, ! Loop back message received ok
LOOP_FAILED = -1; ! Error during loop back
local
CONNECTED,
CHAR_COUNT,
LOOP_BUFFER : ch$sequence (LOOP_BUFFER_LENGTH),
BUFFER_PTR,
FUNC_CODE;
CONNECTED = $true;
while .CONNECTED do
begin
BUFFER_PTR = ch$ptr (LOOP_BUFFER,, 8);
if (CHAR_COUNT = NMU$NETWORK_READ (.LINK_ID, LOOP_BUFFER_LENGTH, ch$ptr (LOOP_BUFFER,, 8))) gtr 0
then
begin
FUNC_CODE = GETB (BUFFER_PTR);
BUFFER_PTR = ch$ptr (LOOP_BUFFER,, 8);
if .FUNC_CODE eql 0
then PUTB (LOOP_OK, BUFFER_PTR)
else
begin
PUTB (LOOP_FAILED, BUFFER_PTR);
CHAR_COUNT = 1;
end
end
else
begin
PUTB (LOOP_FAILED, BUFFER_PTR);
CHAR_COUNT = 1;
CONNECTED = $false;
end;
NMU$NETWORK_WRITE (.LINK_ID, $true, .CHAR_COUNT, ch$ptr (LOOP_BUFFER,, 8));
end;
end; ! End of LOOP_DATA
end ! End of module NMLMRR
eludom
! Local Modes:
! Mode:Bliss
! Comment Start:!
! Comment Column:40
! Comment Rounding:+1
! Auto Save Mode:2
! End: