Google
 

Trailing-Edge - PDP-10 Archives - decnet_mcb_cusps_703a - 10,7/703mon/scpar.mac
There are 22 other files named scpar.mac in the archive. Click here to see a list.
;TITLE SCPAR - Session Control Layer Parameters for DECnet-36 V031


;THIS SOFTWARE IS FURNISHED UNDER A LICENSE AND MAY  BE  USED
;OR COPIED ONLY IN ACCORDANCE WITH THE TERMS OF SUCH LICENSE.
;
;COPYRIGHT  (C)  DIGITAL  EQUIPMENT  CORPORATION  1976, 1986.
;ALL RIGHTS RESERVED.

	SUBTTL	V. Brownell	10 SEP 85

	SEARCH D36PAR
	SALL

IFN FTOPS10,<
.CPYRT<1981,1986>,.
> ;END IFN FTOPS10


XP SCPAR,031

	UNIVERAL SCPAR - Session Control Layer Parameters for DECnet-36

	SUBTTL	Table of Contents


;		Table of Contents for SCPAR
;
;
;			   Section			      Page
;   1. Table of Contents. . . . . . . . . . . . . . . . . . .    2
;   2. Definitions
;        2.1.   Internal Connect Block. . . . . . . . . . . .    3
;        2.2.   Internal String Block . . . . . . . . . . . .    4
;        2.3.   Connect Data Format . . . . . . . . . . . . .    5
;        2.4.   Node Name Block . . . . . . . . . . . . . . .    7
;        2.5.   NSP. UUO. . . . . . . . . . . . . . . . . . .    8
;        2.6.   NSP. UUO Errors . . . . . . . . . . . . . . .   12
;   3. Macros
;        3.1.   Code-Generating
;             3.1.1.     Error Processors . . . . . . . . . .   13
;             3.1.2.     EVENT. . . . . . . . . . . . . . . .   14
;             3.1.3.     Miscellaneous. . . . . . . . . . . .   15
;   4. End of SCPAR . . . . . . . . . . . . . . . . . . . . .   16
	SUBTTL  Globals

IFN FTOPS20,<
	EXT NJSBPG
>; END IFN FTOPS20

	SUBTTL	Definitions -- Internal Connect Block

;This is the SC internal representation of the NSP. UUO's process descriptor
;block.  There are two of these contained in the Connect Block, one for the
;destination name and one for the source name.

BEGSTR PB			;PROCESS DESCRIPTOR BLOCK
	HWORD SIZ		;THE LENGTH FIELD (SEE BELOW FOR LEGAL LENGTHS)
	FIELD FOR,9		;FORMAT
	FIELD OBJ,9		;OBJECT TYPE
	HWORD NCT		;NAME BYTE COUNT
	WORD NAM,<<^D16+3>/4>	;END USER NAME
	NXTWRD			;FORCE A NEW WORD, GRPCODE AND USRCODE
				; MUST BE IN ONE WORD
	HWORD GRP		;GRPCODE
	HWORD USR		;USRCODE (GRPCODE + USRCODE = PPN)
ENDSTR

;The process block length must be between the following:

	XP PBL.MN,^D3		;MINIMUM LENGTH
	XP PBL.MX,^D5		;MAXIMUM LENGTH

;The user data string associated with the CB must be no longer than:

	XP UDA.MX,^D16		;MAXIMUM VALUE

;This is the internal representation of the NSP. UUO's connect block.
;This gets passed across the SCLINK - SCxUUO interface.

BEGSTR CB			;THE INTERNAL CONNECT BLOCK
	WORD NUM		;Node number
	WORD CIR		;Loopback circuit ID
	WORD DST,PB.LEN		;DESTINATION END USER NAME
	WORD SRC,PB.LEN		;SOURCE END USER NAME
	WORD UID,<<^D39+3>/4>	;SOURCE USER IDENTIFICATION
	WORD PSW,<<^D39+3>/4>	;ACCESS VERIFICATION PASSWORD
	WORD ACC,<<^D39+3>/4>	;ACCOUNT DATA
	WORD UDA,<<UDA.MX+3>/4>	;END USER CONNECT DATA
	HWORD UCT		;USER ID BYTE COUNT
	HWORD PCT		;PASSWORD BYTE COUNT
	HWORD ACT		;ACCOUNT DATA BYTE COUNT
	HWORD CCT		;USER CONNECT DATA COUNT
ENDSTR

;The length of the connect block must be between:

	XP CBL.MN,^D2		;MINIMUM LENGTH
	XP CBL.MX,^D8		;MAXIMUM LENGTH

;These are the possible format types that are legal at present.  They are
;given numerical symbols as defined in the spec.

	XP FRM.0,0		;[0][OBJ-TYPE (B)]
	XP FRM.1,1		;[1][NAME (I-16)]
	XP FRM.2,2		;[2][GRPCODE (2B)][USRCOD (2B)][DESCRPT (I-12)]
	XP FRM.MX,FRM.2		;LARGEST LEGAL FORMAT TYPE
	SUBTTL	Definitions -- Internal String Block

;This is the structure to which we copy the users string-block argument.
;As it turns out, this block is only used for DATA-CTL type fields, so we
;keep the length down to 39 bytes.

	SB.MAX==^D39		;MAX BYTES IN A STRING BLOCK

;A string block length must be between the following:

	XP SBL.MN,1		;MINIMUM (WE NEED AT LEAST A COUNT)
	XP SBL.MX,SB.LEN	;MAXIMUM

BEGSTR SB			;THE INTERNAL STRING BLOCK
	HWORD CNT		;COUNT OF BYTES IN BLOCK
	HWORD WDS		;THE LENGTH IN WORDS OF STRING BLOCK
	WORD DAT,<<SB.MAX+3>/4>	;SB.MAX 8-BIT BYTES OF DATA
ENDSTR

;The SAB indirect table pointed to by PSBSAB

BEGSTR ST
	WORD NP			;Normal priority
	WORD P1			;PSI level 1
	WORD P2
	WORD P3
ENDSTR

	SUBTTL	Definitions -- Connect Data Format

;The connect data is sent whenever one requests a connect.  The data is
;fairly ambiguous.

;The following is the definitions for the MENUVER field of the connect data.
;This field specifies what other connect data will follow and what version
;of Session Control we are talking to.

BEGSTR MN			;MENUVER
	FIELD RPA,1,35		;RQSTRID, PASSWRD, ACCOUNT FIELDS ARE INCLUDED
	FIELD USR,1,34		;USRDATA INCLUDED
	FIELD RSV,3,33		;RESERVED FIELD
	FIELD VER,2,30		;VERSION OF SESSION CONTROL
ENDSTR

;Our Session Control Version

	XP SC.VER,0		;VERSION 0

;PORT TABLE ENTRY

IFN FTOPS20,<
MAXPRT==NJSBPG/2		;Maximum port table entries per job
>; END IFN FTOPS20
IFN FTOPS10,<
MAXPRT==^D50/2			;Maximum port table entries per job
>; END IFN FTOPS10

BEGSTR PT
	FIELD CON,6		;USER'S PSI CHANNEL FOR INCOMING CI OR CC
	FIELD INT,6		;USER'S PSI CHANNEL FOR INTERRUPT MESSAGES
	FIELD DAT,6		;USER'S PSI CHANNEL FOR DATA/DISCONNECT
	FIELD TYP,1		;OPEN TYPE:  0=PASSIVE  1=ACTIVE
	FIELD EMI,1		;EOM HAS ARRIVED
	FIELD PSI,1		;USER HAS BEEN "PSI"ED FOR DATA AVAILABLE
	FIELD LWC,1		;LINK WAS CONNECTED INDICATOR
	FIELD BLK,1		;THIS LINK IS BLOCKED (BLOCKING I/O)
	FIELD WAK,1		;WAKE THE NEXT PROCESS THAT TRIES TO BLOCK
	FIELD NRR,1		;NULL RECORD RECEIVED.
	HWORD JFN		;JFN ASSOCIATED WITH CHANNEL
	HWORD FRK		;FORK NUMBER
	HWORD STS		;LINK STATUS
	WORD DEV		;STORAGE FOR DEV DURING A BLOCK
ENDSTR
Repeat 0,<
	SUBTTL	Definitions -- Node Name Block

;There is one node name block for each node.  They are kept on doubly linked
;lists, with the head each list in a vector MAX-NODES long.

BEGSTR NO			;NOde name
	WORD NXT		;POINTER TO NEXT GUY
	WORD LST		;POINTER TO LAST GUY
	WORD CID		;CIRCUIT ID USED ONLY FOR LOOPBACK
	WORD CNT		;COUNT OF BYTES IN NODE NAME
				; (DOESN'T NEED FULL WORD, REST IS FREE)
	WORD NAM,<<^D6+3>/4>	;NODE NAME TEXT
ENDSTR
>
	SUBTTL	Definitions -- NSP. UUO

;All of these definitions should eventually be in UUOSYM, so we should
;be able to search UUOSYM and REPEAT 0 these definitions.

DEFINE INIOFF(PREFIX,START<0>),<
	%%%CTR==START-1

DEFINE OFFSET(ITEM),<%%%CTR==%%%CTR+1
	PREFIX''ITEM==%%%CTR>

DEFINE ENDOFF(MAXSYM<MX>),<
	PREFIX''MAXSYM==%%%CTR>
>

;Connection states

INIOFF .NSS,1
	OFFSET CW		;CONNECT WAIT
	OFFSET CR		;CONNECT RECEIVED
	OFFSET CS		;CONNECT SENT
	OFFSET RJ		;REMOTE REJECTED CONNECT INIT
	OFFSET RN		;LINK IS UP AND RUNNING
	OFFSET DR		;DISCONNECT RECEIVED
	OFFSET DS		;DISCONNECT SENT
	OFFSET DC		;DISCONNECT CONFIRMED
	OFFSET CF		;NO CONFIDENCE
	OFFSET LK		;NO LINK
	OFFSET CM		;NO COMMUNICATION
	OFFSET NR		;NO RESOURCES
ENDOFF

;DECnet-10 State variable fields

BEGSTR NS
	FIELD FLG,6		;FLAG FIELD
	  BIT WAI		; WAIT FOR CONDITION
	  BIT EOM		; END OF MESSAGE
	FILLER 12		;SPACE FOR FUTURE FLAGS
	FIELD STS,4		;STATUS BITS BITS 18-22
	  BIT IDA		;INTERRUPT DATA AVAILABLE
	  BIT IDR		;INTERRUPT DATA MAY BE SENT
	  BIT NDA		;NORMAL DATA AVAILABLE
	  BIT NDR		;NORMAL DATA MAY BE SENT
	FIELD STA,6,35		;THE CONNECTION STATE
ENDSTR
;Argument block offsets

INIOFF .NSA
	OFFSET FN		;FUNCTION CODE
	OFFSET CH		;STATUS,,CHANNEL ID
	OFFSET A1		;FIRST ARGUMENT
	OFFSET A2		;SECOND
	OFFSET A3		;THIRD
ENDOFF

;Function code word definitions

BEGSTR NF
	FIELD FLG,6		;Warning: Flags must be in the same order as
				; the NSFLG and SAFLG flags.  NFFLG must
				; be same size as SAFLG for LOAD SAFLG then
				; STOR NFFLG and vice versa.
	  BIT WAI		; WAIT FOR CONDITION
	  BIT EOM		; END OF MESSAGE
	FIELD FNC,6,17		;FUNCTION CODE
	HWORD SIZ		;SIZE OF BLOCK IN WORDS
ENDSTR

;String block offsets

INIOFF .NSA
	OFFSET SL		;STRING BLOCK LENGTH (BYTE COUNT)
	OFFSET ST		;START OF THE STRING
ENDOFF

;Process descriptor blocks

INIOFF .NSD
	OFFSET FM		;FORMAT TYPE (EITHER 0, 1, OR 2)
	OFFSET OB		;OBJECT TYPE
	OFFSET PP		;XWD PROJECT,PROGRAMMER
	OFFSET PN		;S-BLOCK POINTER TO TASK NAME
ENDOFF SZ

;Connect blocks

INIOFF .NSC
	OFFSET ND		;S-POINTER TO NODE NAME
	OFFSET SD		;PD-POINTER TO SOURCE PROCESS
	OFFSET DD		;PD-POINTER TO DESTINATION
	OFFSET US		;PD-POINTER TO USER ID
	OFFSET PW		;S-POINTER TO PASSWORD
	OFFSET AC		;S-POINTER TO ACCOUNT
	OFFSET UD		;S-POINTER TO USER DATA
ENDOFF SZ
;Argument block passed back from SCLINK on a call to SCTPSQ

BEGSTR PS			;PASSED IN T1 AND T2
	FIELD FLG,18		;FLAGS
	  BIT MOR		;SET IF MORE PSIs QUEUED
	HWORD PSM		;THE PSI MASK FOR THIS LINK
	NXTWRD			;NOW IN T1
	HWORD STS		;THE STATUS HALF-WORD
	HWORD CHN		;THE CHANNEL NUMBER
ENDSTR
;DECnet-10 Functions

INIOFF .NSF
	OFFSET RE		;RESET ALL LINKS
	OFFSET EA		;ENTER ACTIVE STATE
	OFFSET EP		;ENTER PASSIVE STATE
	OFFSET RI		;READ CONNECT INFORMATION
	OFFSET AC		;ACCEPT THE CONNECT
	OFFSET RJ		;REJECT THE CONNECT
	OFFSET RC		;READ CONNECT CONFIRM INFORMATION
	OFFSET SD		;SYNCHRONOUS DISCONNECT
	OFFSET AB		;ABORT
	OFFSET RD		;READ DISCONNECT DATA
	OFFSET RL		;RELEASE THE CHANNEL
	OFFSET RS		;READ THE CHANNEL STATUS
	OFFSET IS		;SEND INTERRUPT DATA
	OFFSET IR		;RECEIVE INTERRUPT DATA
	OFFSET DS		;SEND NORMAL DATA
	OFFSET DR		;RECEIVE NORMAL DATA
	OFFSET SQ		;SET QUOTAS AND GOALS
	OFFSET RQ		;READ QUOTAS AND GOALS
	OFFSET JS		;SET JOB QUOTAS AND GOALS
	OFFSET JR		;READ JOB QUOTAS AND GOALS
	OFFSET PI		;SET PSI REASON MASK
ENDOFF

;Flow control modes.

INIOFF NSF.,1
	OFFSET C0		;NO FLOW CONTROL
	OFFSET CS		;SEGMENT FLOW CONTROL
	OFFSET CM		;MESSAGE FLOW CONTROL
ENDOFF
	SUBTTL	Definitions -- NSP. UUO Errors

;The following are the values that we return to the user on NSP. error
;returns.  The errors are reported with the SCERR macro.

INIOFF %NE,1
	OFFSET ABE		;Argument Block Format Error
	OFFSET ALF		;Allocation failure
	OFFSET BCN		;Bad channel number
	OFFSET BFT		;Bad format type in process block
	OFFSET CFE		;Connect Block format error
	OFFSET IDL		;Interrupt data too long
	OFFSET IFM		;Illegal flow control mode
	OFFSET ILF		;Illegal function
	OFFSET JQX		;Job quota exhausted
	OFFSET LQX		;Link quota exhausted
	OFFSET NCD		;No connect data to read
	OFFSET PIO		;Percentage input out of bounds
	OFFSET PRV		;No Privileges to Perform Function
	OFFSET STB		;*** OBSOLETE ***
	OFFSET UKN		;Unknown node name
	OFFSET UXS		;Unexpected State: Unspecified
	OFFSET WNA		;Wrong number of arguments
	OFFSET WRS		;Function called in wrong state

;New error codes (to be re-ordered):

	OFFSET CBL		;Connect block length error
	OFFSET PBL		;Process block length error
	OFFSET SBL		;String block length error

	OFFSET UDS		;Unexpected State: Disconnect Sent
	OFFSET UDC		;Unexpected State: Disconnect Confirmed
	OFFSET UCF		;Unexpected State: No Confidence
	OFFSET ULK		;Unexpected State: No Link
	OFFSET UCM		;Unexpected State: No Communication
	OFFSET UNR		;Unexpected State: No Resources

;Error codes which correspond to DECnet disconnect codes.
;We do not intend any mapping other than table-lookup between
;the error code numbers and our error codes.

	OFFSET RBO		;REJECTED BY OBJECT
	OFFSET DBO		;DISCONNECTED BY OBJECT (WHEN RUNNING)
	OFFSET RES		;NO RESOURCES
	OFFSET UNN		;UNRECOGNIZED NODE NAME
	OFFSET RNS		;REMOTE NODE SHUT DOWN
	OFFSET URO		;UNRECOGNIZED OBJECT
	OFFSET IOF		;INVALID OBJECT NAME FORMAT
	OFFSET OTB		;OBJECT TOO BUSY
	OFFSET ABM		;ABORT BY MANAGEMENT
	OFFSET ABO		;ABORT BY OBJECT
	OFFSET INF		;INVALID NODE NAME FORMAT
	OFFSET LNS		;LOCAL NODE SHUT DOWN
	OFFSET ACR		;ACCESS CONTROL REJECTION
	OFFSET RNO		;NO RESPONSE FROM OBJECT
	OFFSET NUR		;NODE UNREACHABLE
	OFFSET NLK		;NO LINK
	OFFSET DSC		;DISCONNECT COMPLETE
	OFFSET IMG		;IMAGE FIELD TOO LONG
	OFFSET REJ		;UNSPECIFIED REJECT REASON

	OFFSET BCF		;BAD COMBINATION OF NS.EOM & NS.WAI FLAGS
	OFFSET ADE		;ADDRESS ERROR IN USER ARGS
	OFFSET IMF		;ILLEGAL MESSAGE FORMAT DETECTED

;Second-order reordering required:

	OFFSET UCW		;UNEXPECTED STATE: CONNECT WAIT
	OFFSET UCR		;UNEXPECTED STATE: CONNECT RECEIVED
	OFFSET UCS		;UNEXPECTED STATE: CONNECT SENT
	OFFSET URJ		;UNEXPECTED STATE: REJECT
	OFFSET URN		;UNEXPECTED STATE: RUN
ENDOFF
	SUBTTL	Macros -- Code-Generating -- Error Processors

;SCERR is called from SCSER and SCUUO to report a user error (NSP. error
;code).

DEFINE SCERR(errcod,return,text),<
..RTN==0
	JSP CX,[MOVX T1,errcod
IFB <return>,<RET>
IFNB <return>,<
    IFDIF <return><CPOPJ>,<
     IFDIF <return><CPOPJ##>,<
      IFDIF <return><RTN>,<
       IFDIF <return><RTN##>,<..RTN==1>>>>

	IFE ..RTN,<RET>
	IFN ..RTN,<JRST return>
IF2,<PURGE ..RTN>
   >
		]
>
	SUBTTL	Macros -- Code-Generating -- EVENT

;This macro used by LLINKS and SCLINK to call NSP's event routine.
;Note that MB & MS are assumed to be set up the same by both modules.

DEFINE EVENT(layer,type,text,glabel),<
  IFB <glabel>,<
	CALL [	SETEVT(layer,type,text)
		CALLRET NSPEVT]		;;PASSING T1,MB,MS
  >
  IFNB <glabel>,<
	JRST [	SETEVT(layer,type,text)
		CALL NSPEVT		;;PASSING T1,MB,MS
		JRST glabel]
  >
>

DEFINE SETEVT(layer,type,text),<
	SAVEAC <T1,T2,T3,T4,T5,T6,P1,P2>
IFN FTTRACE,<
	XMOVEI T1,.		;;ALL THE WAY TO TOP LITERAL LEVEL
IFNB <text>,<XMOVEI T2,[ASCIZ /text/]>
IFB <text>,<SETZ T2,>
	MOVX T3,EVT'type
	CALL EVTTRC		;;EVENT TRACER
>
	MOVX T1,.NC'layer
	MOVX T2,EVT'type
>;END OF DEFINE SETEVT


;The class 3 (NSP) event types:

	EVTMSG==0		;TYPE 0 IS INVALID MESSAGE
	EVTFLO==1		;TYPE 1 IS INVALID FLOW CONTROL
	EVTDAT==2		;TYPE 2 IS DATA BASE REUSED

;The class 96 (LCG( event types
	EVTCSE==0		;Type 0 is 'close-link' event for CSSE

	SUBTTL	Macros -- Code-Generating -- Miscellaneous

;BYTES(size,<byte1,byte2,...,byten>) will place the n bytes in bytes
;size wide.

DEFINE BYTES(SIZE,ARGS,%1,%2),<
	%1==0
	%2==0
	IRP ARGS,<
		%2==<%2_^D'SIZE>+<ARGS_<^D36/^D'SIZE>>
		%1==%1+1
		IFE %1-<^D36/^D'SIZE>,<
			EXP %2
			%1==0
			%2==0
		>>

	IFN %1,<
		%2==%2_<<<^D36/^D'SIZE>-%1>*^D'SIZE>
		EXP %2
	>
>

	SUBTTL	End of SCPAR

IFN FTOPS10,.XCMSY

	END