*DECK NPREGCP
USETEXT LLCB
USETEXT NBT
USETEXT NHEADER
USETEXT NIPDEF
USETEXT OVERLAY
USETEXT PARAMP
USETEXT PARAMS
USETEXT PT
USETEXT SUPMSG
USETEXT TNT
USETEXT DUMPFLG
PRGM NPREGCP;
# PROCESS SUPERVISORY MESSAGE REG/CP FROM PIP #
STARTIMS;
#
*1DC NPREGCP
*
* 1. PROC NAME AUTHOR DATE
* NPREGCP E.T. WAN 81/05/26
*
* 2. FUNCTIONAL DESCRIPTION
* PROCESS SUPERVISORY MESSAGE REG/CP
*
* 3. METHOD USED
* VALIDATE THAT NS/CS INDICATORS AND BUFFER LEVEL ARE ZERO IN THE
* MESSAGE.
* CLEAN UP ALL LOGICAL LINKS THAT GO THROUGH THE COUPLER AND SEND
* SM REG/CP TO PIP.
* IF LLCB CANNOT BE RELEASED BECAUSE OF OUTSTANDING
* PRU CONNECTIONS THAN JUST MARK THE LLCB.
* WHEN CONNECTIONS WILL BE TERMINATED (NPPCT)
* THOSE LLCBS WILL BE DISCARDED.
*
* 4. ENTRY PARAMETERS
* PARAMP1 DATA BLOCK HEADER ADDRESS
*
* 5. EXIT PARAMETERS
* NONE
*
* 6. COMDECKS CALLED
* LLCB
* NHEADER
* NIPDEF
* OVERLAY
* PARAMP
* PARAMS
* PT
* SUPMSG
* TNT
* OPSIZE
* NBT
*
* 7. ROUTINES AND OVERLAYS CALLED
* HCSUPCB SEND SM SUP/CB TO CS
* LOCLLCB LOCATE LLCB
* NCREGCP OVL CREATE AND SEND REG/CP TO PIP
* OVLCALL LOAD OVERLAY
* RELCONN PROC RELEASE CONNECTIONS
* RELLLCB OVL RELEASE LLCB
* XTRACE TRACE CALLS
*
* 8. DAYFILE MESSAGES
* NONE
*
* THIS PROGRAM IS A PRIMARY OVERLAY LOADED BY SUBROUTINE OVLCALL.
* WHEN EXECUTION HAS COMPLETED, A JUMP IS MADE TO LOCATION RJMAIN
* TO RETURN TO THE CALLING PROGRAM.
*
* W A R N I N G - THIS PROGRAM CANNOT EXCEED THE PRIMARY
*CALL OPSIZE
* THIS OVERLAY IS CALLED BY NPNIPSM.
*
#
STOPIMS;
#
**** EXTERNAL VARIABLES
#
XREF
BEGIN
PROC LOCLLCB; # LOCATE LLCB #
PROC RELCONN ; # RELEASE ALL CONNECTIONS #
PROC MRELS; # RETURN ADDRESS IN OVLCALL #
PROC OVLCALL; # LOAD OVERLAY #
PROC XTRACE; # TRACE CALLS #
LABEL RJMAIN; # RETURN ADDRESS IN OVLCALL #
END
#
* LOCAL VARIABLES
#
ITEM I; # LOOP CONTROL VARIABLE #
ITEM SENDCPN B=TRUE ; # FLAG TO DECIDE IF TO SEND REG/CP/U #
ITEM NBIND I = 0 ; # INDEX INTO NBT TABLE #
LABEL EXIT; # EXIT FROM PROGRAM #
#*********************************************************************#
BEGIN # NPREGCP #
CONTROL IFEQ DEBUG,1;
XTRACE("NPRCP") ;
CONTROL FI;
P<NHEADER> = PARAMP1 + DBHSIZE; # NETWORK BLOCK HEADER ADDRESS #
P<SMNIP> = P<NHEADER> + NBHSIZE; # SM REG/CP ADDRESS #
PARAMP2 = 0; # INITIALIZE RETURN PARAMETER #
IF DN[0] EQ SN[0] # VALID REG/CP RECEIVED FROM PIP #
THEN
BEGIN
SENDCPN = TRUE; # INITIALIZE SEND REG/CP FLAG #
FOR I = TNTHSIZE STEP 1 UNTIL TNTBS - TNTHSIZE
DO # LOOP THROUGH ALL TN'S IN TNT #
BEGIN
# LOCATE LLCB WITH HN = SPECIFIC COUPLER NODE FOR EACH TN #
IF TNTTN[I] NQ 0 # TERMINAL NODE EXISTS #
THEN
BEGIN
LOCLLCB(DN[0],TNTTN[I],P<LLCB>);
IF P<LLCB> NQ 0 # LLCB EXISTS #
THEN
BEGIN
IF LLCBCS[0] # LINK WAS USED TO COMMUNICATE WITH CS #
AND PROCAN[CSORD] NQ 0
THEN
BEGIN
# SEND SM SUP/CB TO CS #
OVLNAME = HCSUPCBP ;
PARAMS1 = DN[0] ;
PARAMS2 = TNTTN[I] ;
OVLCALL ;
END
RCBRK = RCCB"LLF" ; # RC = 15 FOR CR/CB/U IF NEED #
IF NOT LLCBWOF[0] # FIRST TIME TO RELEASE LLINK #
THEN
RELCONN(P<LLCB>,LLFAIL) ; # RELEASE CONN #
IF LLCBNPC[0] EQ 0
THEN
BEGIN
PARAMS2 = P<LLCB> ;
OVLNAME = RELLLCBP; # RELEASE LLCB #
OVLCALL;
END
ELSE
BEGIN
LLCBWOF[0] = TRUE ;
NBIND = LLCBNBTE[0] * NBTFETNO;
NBTREGW[NBIND] = NBTREGW[NBIND] + 1 ;
SENDCPN = FALSE ;
END
END
END
END
IF SENDCPN
THEN
BEGIN
OVLNAME = NCREGCPP; # SEND REG/CP TO PIP #
PARAMS1 = DN[0]; # COUPLER NODE #
PARAMS2 = 1 ; # FLAG TO SET THE RESPONSE BIT #
OVLCALL;
END
END
EXIT:
GOTO RJMAIN; # RETURN TO CALLING PROGRAM #
END # NPREGCP #
TERM