*DECK RELNCNB
USETEXT NIPDEF
USETEXT ACNB
USETEXT PARAMS
USETEXT PT
USETEXT NCNB
USETEXT DUMPFLG
USETEXT DRHDR
USETEXT LLCB
USETEXT MSGIDX
USETEXT NCNT
USETEXT KDIS
USETEXT KHDRX
USETEXT STATTAB
PRGM RELNCNB; # RELEASE NETWORK CONNECTION BLOCK #
STARTIMS;
#
*1DC RELNCNB
*
* 1. PROC NAME AUTHOR DATE
* RELNCNB C. BITTNER 81/04/07
*
* 2. FUNCTIONAL DESCRIPTION
* RELEASE THE NETWORK CONTROL BLOCK
*
* 3. METHOD USED
* CHECK IF THERE ARE ANY CONNECTIONS ON NCNT.
* IF NOT, THEN RELEASE NCNT. RELEASE DATA RING AND
* ACKNOWLEDGE QUEUE. RELEASE NCNB AND UPDATE INFORMATION
* IN THE LLCB.
*
* 4. ENTRY PARAMETERS
* PARAMS1 - ADDRESS OF NCNB TO RELEASE
*
* 5. EXIT PARAMETERS
* NONE
*
* 6. COMDECKS CALLED AND SYMPL TEXTS USED
* ACNB PARAMS
* NIPDEF DRHDR
* STATTAB NCNB
* LLCB MSGIDX
* NCNT KDIS
* OSSIZE
*
* 7. ROUTINES AND OVERLAYS CALLED
* OMSG - ISSUE DAYFILE MESSAGE
* XTRACE - RECORD PROCEDURE CALLS
* KPUT - UPDATE K-DISPLAY STATUS
* LOCLLCB - LOCATE LLCB
* MRELS - RETURN BUFFER
*
* 8. DAYFILE MESSAGES AND OTHER IMPORTANT INFORMATION
* THIS PROGRAM IS CALLED BY NCSTTP.
* W A R N I N G - THIS PROGRAM CANNOT EXCEED THE SECONDARY
*CALL OSSIZE
*
#
STOPIMS;
#
EXTERNAL VARIABLES
#
XREF
BEGIN
PROC KPUT ;
PROC LOCLLCB; # LOCATE LLCB #
PROC MRELS; # RETURN BUFFER #
PROC MCLRIL ; # CLEAR INTERLOCK ROUTINE #
PROC MSETIL ; # REQUEST INTERLOCK ROUTINE #
PROC OMSG; # DAYFILE MESSAGE #
PROC ABORT ;
PROC XTRACE; # RECORD PROCEDURE CALLS #
LABEL RJMAIN; # RETURN ADDRESS IN OVLCALL #
END
#
INTERNAL VARIABLES
#
ITEM LLCBAD; # LLCB ADDRESS #
ITEM LLCBINDX; # INDEX INTO LLCB #
ITEM CURR; # INDUCTION LOOP VARIABLE #
ITEM NEXT; # NEXT ENTRY IN DATA RING #
ITEM NCNTINDX; # INDEX INTO NCNT #
ITEM KN U;
ARRAY CNX;
BEGIN
ITEM CNE U(00,00,60); # NETWORK CONNECTION NUMBER #
ITEM CN1 U(00,52,04); # CONNECTION INDEX #
ITEM CN2 U(00,56,04); # INDEX INTO NCNT #
END
#**********************************************************************#
BEGIN
CONTROL IFEQ DEBUG,1;
XTRACE("RNCNB") ;
CONTROL FI;
P<NCNB> = PARAMS1; # BASE NETWORK CONNECTION BLOCK #
# RELEASE DATA RING #
P<DRHDRWD> = 0;
CURR = NCNBDRFP[0]; # FIRST ENTRY IN DATA RING #
FOR CURR = CURR WHILE CURR NQ LOC(NCNBDRFP[0]) AND CURR NQ 0 DO
BEGIN
NEXT = NEXTPTR[CURR]; # NEXT ENTRY IN DATA RING #
MRELS(CURR); # RELEASE DATA RING ENTRY #
CURR = NEXT;
END
# RELEASE ACKNOWLEDGE QUEUE #
IF NCNBACKQ[0] NQ 0
THEN
MRELS(NCNBACKQ[0]); # RELEASE ACKNOWLEDGE QUEUE #
CONTROL IFEQ STAT,1; # STATISTICS ON #
ST$AQX = ST$AQX + 1; # INCREMENT NO. ACKQ-S RELEASED #
CONTROL FI;
#
CHECK IF THERE ARE ANY CONNECTIONS ON NCNT.
IF NOT, THEN RELEASE NCNT
#
P<NCNT> = NCNBCTAD; # BASE NETWORK CONNECTION TABLE #
CNE[0] = NCNBCN[0]; # NETWORK CONNECTION NUMBER #
LLCBINDX = CN1 + LLCBHSIZE; # INDEX INTO LLCB #
NCNTINDX = CN2 + NCNTHSIZE; # INDEX INTO NCNT #
LOCLLCB(NCNBHN[0],NCNBTN[0],LLCBAD); # LOCATE LLCB #
P<LLCB> = LLCBAD; # BASE LLCB #
CONTROL IFEQ DEBUG,1;
IF P<LLCB> EQ 0
THEN
BEGIN
D27M2[0] = "RELNCNB";
OMSG(DFMSG27,0); # NIP INTERNAL ERROR #
ABORT(0,0) ;
END
CONTROL FI;
MSETIL(P<LLCB>) ; # REQUEST INTERLOCK WITH THIS LLCB #
NCNTNCN[0] = NCNTNCN[0] - 1; # DECREMENT NO. ACTIVE CONN #
CONCOUNT = CONCOUNT -1 ;
IF CONCOUNT LS MAXSWIT
THEN
BEGIN
TBUF = 10000;
NFSIZE = 1536;
END
IF NCNTNCN[0] EQ 0
THEN # LAST ENTRY DELETED #
BEGIN
MRELS(P<NCNT>); # RELEASE NCNT #
LLCBNCNT[LLCBINDX] = 0; # CLEAR NCNT ADDRESS IN LLCB #
END
ELSE
BEGIN
NCNTWD[NCNTINDX] = 0; # DELETE NCNT ENTRY #
END
LLCBNC[0] = LLCBNC[0] - 1; # DECREMENT NO. CONN ON LOG LINK #
MCLRIL ;
IF KDIS$RT # REAL TIME UPDATE MODE IN EFFECT #
AND NCNBDT[0] NQ DT$INTA # NOT AN INTRA-HOST A-A CONN #
AND LLCBKNDX[0] NQ 0 # LLCB ENTRY EXISTS IN ST #
AND LLCBKNDX[0] GQ KDLGLST[0]
AND LLCBKNDX[0] LQ KDLGLND[0]
THEN
BEGIN
IF KDESTST[0] EQ 0 THEN
KN=LLCBKNDX[0]-KDLGLST[0];
ELSE
IF KDAPPST[0] EQ 0 THEN
KN=LLCBKNDX[0]+KDESTND[0]-KDESTST[0];
ELSE
KN=LLCBKNDX[0]+KDESTND[0]+KDAPPND[0]-KDAPPST[0];
KPUT(KHDRNP[0],KN,KPLGNCN,LLCBNC[0]) ;
END
IF NCNBACNB[0] NQ 0
THEN
BEGIN # ACNB EXISTS #
P<ACNB> = NCNBACNB[0];
ACNBNCNB[0] = 0; # CLEAR NCNB TWIN POINTERS #
END
MRELS(P<NCNB>); # RELEASE NCNB #
GOTO RJMAIN; # RETURN TO CALLING PROGRAM #
END
TERM