Google
 

Trailing-Edge - PDP-10 Archives - BB-KL11K-BM_1990 - t20src/nett20.b36
There are 12 other files named nett20.b36 in the archive. Click here to see a list.
!	COPYRIGHT (c) DIGITAL EQUIPMENT CORPORATION 1985, 1989.
!	ALL RIGHTS RESERVED.
!
!	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 THAT IS NOT SUPPLIED BY DIGITAL.
%routine ('LOCAL_NODE_NUMBER', P_NODE_PTR) : novalue =
!++
! FUNCTIONAL DESCRIPTION:
!
!    Returns the local node number. It puts it into a byte string
! pointed to by the supplied byte pointer. 
!
! FORMAL PARAMETERS:
!
!    P_NODE_PTR  is the address of a byte pointer that is
!                updated when done.
!
! IMPLICIT INPUTS:
!
!	NONE
!
! IMPLICIT OUTPUTS:
!
!	The byte string pointed to by the byte pointer will
!       contain the local node number. The byte pointer is updated.
!
! ROUTINE VALUE:
!
!	NONE
!
! SIDE EFFECTS:
!
!	NONE
!
!--

    begin

    bind
        NODE_PTR = (.P_NODE_PTR);

    local
         NODE_NUMBER;

    DECLARE_JSYS (NODE)

    $$NODE ($NDGNM, NODE_NUMBER);
    ch$wchar_a (.NODE_NUMBER<0,8,0>, NODE_PTR);
    ch$wchar_a (.NODE_NUMBER<8,8,0>, NODE_PTR);

    end;			!End of LOCAL_NODE_NUMBER
%routine ('LOCAL_NODE_NAME', P_NODE_PTR) : novalue =

!++
! FUNCTIONAL DESCRIPTION:
!       
!       Returns the local node name in a counted ASCII string.  The node name
!       is written into the string pointed to by the supplied byte pointer and
!       the first byte is the number of characters in the node name.
!
! FORMAL PARAMETERS:
!
!       P_NODE_PTR  Address of a byte pointer
!
! IMPLICIT INPUTS:
!
!	NONE
!
! IMPLICIT OUTPUTS:
!
!	The byte string pointed to by the byte pointer will
!       contain the local node name. The byte pointer is updated.
!
! ROUTINE VALUE:
!
!	NONE
!
! SIDE EFFECTS:
!
!	NONE
!
!--

    begin

    bind
        NODE_PTR = (.P_NODE_PTR);

    local
         NAME_PTR;

    DECLARE_JSYS (NODE)

    NAME_PTR = ch$plus (.NODE_PTR, 1);
    $$NODE ($NDGLN, NAME_PTR);
    ch$wchar_a (ch$len (ch$plus (.NODE_PTR, 1)), NODE_PTR);

    end;			!End of LOCAL_NODE_NAME
%routine ('BUILD_LINK_INFO_BLOCK', CB : ref CONNECT_BLOCK,
            LI : ref LINK_INFO_BLOCK) : novalue =

!++
! FUNCTIONAL DESCRIPTION:
!
!       Fills in the system specific portions of the link info block. The
!       source of information that it uses is the connect block passed to
!       NMU$NETWORK_OPEN
!
! FORMAL PARAMETERS:
!
!       CB    Address of connect block
!       LI    Address of link info block
!
! IMPLICIT INPUTS:
!
!	NONE
!
! IMPLICIT OUTPUTS:
!
!	NONE
!
! ROUTINE VALUE:
!
!	NONE
!
! SIDE EFFECTS:
!
!	NONE
!
!--

    begin

    external routine
             USER_NAME;

    local FILE_PTR;

    LI [LINK_JFN] = 0;
    FILE_PTR = ch$ptr (LI [LINK_FILE]);
    if .LI [LINK_TYPE] eql SOURCE_LINK
    then begin
!
! Create DCN:HOST-OBJECT
!
         begin
!         local NAME_PTR, LENGTH, NODE_ADDRESS;
         own NAME_PTR, LENGTH, NODE_ADDRESS;

         NAME_PTR = .CB [CB_HOST];
         NODE_ADDRESS = GETW (NAME_PTR);
         LENGTH = GETB (NAME_PTR);

         if .LENGTH gtr 0
         then $NMU$TEXT (FILE_PTR,
                         14,
                         '%NDCN:%#A-',
                         .LENGTH,
                         .NAME_PTR)
         else $NMU$TEXT (FILE_PTR,
                         14,
                         '%NDCN:%D-',
                         .NODE_ADDRESS);
         end;

!		    	
! Add in object type
!
         $NMU$TEXT (FILE_PTR,
                    3,
                    '%N%D',
                    .CB [CB_OBJECT]);
!
! Add in optional descriptor name
!
	IF (.CB[CB_DESCRIPTOR_LENGTH] gtr 0) and (.CB[CB_OBJECT] eql 0)
	then $NMU$TEXT (FILE_PTR,
			16,
			'%N-%#A',
			.CB[CB_DESCRIPTOR_LENGTH],
			.CB[CB_DESCRIPTOR]);

! Add optional task name 
!
         if .CB [CB_TASK_LENGTH] gtr 0
         then $NMU$TEXT (FILE_PTR,
                         17,
                         '%N.%#A',
                         .CB [CB_TASK_LENGTH],
                         .CB [CB_TASK]);

!
! Add optional userid attribute
!
         if .CB [CB_USERID_LENGTH] gtr 0
         then $NMU$TEXT (FILE_PTR,
                         24,
                         '%N;USERID:%#A',
                         .CB [CB_USERID_LENGTH],
                         .CB [CB_USERID]);
!
! Add optional password attribute
!
         if .CB [CB_PASSWORD_LENGTH] gtr 0
         then $NMU$TEXT (FILE_PTR,
                         18,
                         '%N;PASSWORD:%#A',
                         .CB [CB_PASSWORD_LENGTH],
                         .CB [CB_PASSWORD]);
!
! Add optional account attribute
!
         if .CB [CB_ACCOUNT_LENGTH] gtr 0
         then $NMU$TEXT (FILE_PTR,
                         24,
                         '%N;CHARGE:%#A',
                         .CB [CB_ACCOUNT_LENGTH],
                         .CB [CB_ACCOUNT]);
!
! Add optional data attribute
!
         if .CB [CB_DATA_LENGTH] gtr 0
         then begin
              if ch$size (.CB [CB_DATA]) eql 7
              then $NMU$TEXT (FILE_PTR,
                              24,
                              '%N;DATA:%#A',
                              .CB [CB_DATA_LENGTH],
                              .CB [CB_DATA])
              else $NMU$TEXT (FILE_PTR,
                              48,
                              '%N;BDATA:%#B',
                              -.CB [CB_DATA_LENGTH],
                              0,
                              .CB [CB_DATA]);
              end;
         end
    else begin
!
! Create SRV:OBJECT or SRV:.OBJECTDESCRIPTOR (if object is 0)
!
         $NMU$TEXT (FILE_PTR,
                         150,
                         '%NSRV:%D',
                         .CB [CB_OBJECT]);

!
! Add optional task name (not possible if debugging)
!
         if (.CB [CB_DESCRIPTOR_LENGTH] gtr 0)
         then $NMU$TEXT (FILE_PTR,
                         17,
                         '%N.%#A',
                         .CB [CB_DESCRIPTOR_LENGTH],
                         .CB [CB_DESCRIPTOR]);
         end;
!
! Make into an ASCIZ string.
!
    ch$wchar_a (0, FILE_PTR);

    end;			!End of BUILD_LINK_INFO_BLOCK
!
! [End of NETT20]
! Local Modes:
! Mode:BLISS
! Auto Save Mode:0
! Comment Column:40
! Comment Rounding:+1
! End: