*DECK NPPCT USETEXT NIPDEF USETEXT AHEADER USETEXT PT USETEXT TNT USETEXT NBT USETEXT DRHDR USETEXT AT USETEXT OVERLAY USETEXT PARAMP USETEXT PARAMS USETEXT ACB USETEXT ACNT USETEXT LLCB USETEXT NCNT USETEXT PCNB USETEXT PIT USETEXT PWL USETEXT ACNB USETEXT NCNB USETEXT RELFILE USETEXT ACKHEAD USETEXT STATTAB USETEXT SUPMSG PRGM NPPCT; # PROCESS A PRU CONNECTION TERMINATION # STARTIMS; # *1DC NPPCT * * 1. PROC NAME AUTHOR DATE * NPPCT J.C. LEE 80/04/01 * A.BEN-ARTZI 82/02/18 * * 2. FUNCTIONAL DESCRIPTION. * PROCESS A PRU-CONNECTION-TERMINATED WORKLIST * * 3. METHOD USED. * GET BUFFER FOR A NCNB * FORMAT NETWORK NCNB FROM PCNB * UPDATE CONNECTION-S CONNECTION TABLE ENTRY * DELINK PCNB FROM PCNB RING * RELEASE ALL PWL-S IN ICMD AND CMD WORKLIST QUEUE * RELEASE ALL PWL-S IN PWL RING THAT BELONGS TO THE CONNECTION * RELEASE ANY QUEUE FILE ASSOCIATED WITH THE PRU CONNECTION * LINK PP REQUEST PARAMETER BLOCK TO PP CALL RING * RELEASE PCNB * RELEASE PRU-CONNECTION-TERMINATED WORKLIST SPACE * A SPECIAL CASE IS CONSIDERED: * IF WE CAME AFTER EST/OFF CASE (LLCBWOF SET) * WE RELEASE LLCB AND SEND REG/CP/U TO PIP * * 4. ENTRY PARAMETERS. * PARAMP1 PRU WORKLIST ADDRESS * PARAMP2 PRU-QCB ADDRESS * * 5. EXIT PARAMETERS. * PARAMP2 NEW NCNB ADDRESS * * 6. COMDECKS CALLED AND SYMPL TEXTS USED. * AT APPLICATION TABLE * DRHDR BUFFER HEADER WORD TEMPLATE * LLCB LOGICAL LINK CONTROL BLOCK TEMPLATE * PIT PIP INTERFACE TABLE * NBT NCNB NCNT OPSIZE * OVERLAY PARAMP PCNB PT * NIPDEF ACB ACNB * PWL RELFILE PARAMS * * 7. ROUTINES AND OVERLAYS CALLED * MCLRIL CLEAR NIP/PIP INTERLOCK * MSETIL REQUEST NIP/PIP INTERLOCK * RELNCNB OVL RELEASE NCNB * RELLLCB OVL RELEASE LLCB * NCREGCP OVL SEND REG/CP * MGETS GET BUFFER * MRELS RELEASE BUFFER * OSREQ MAKE RA+1 CALL * XTRACE TRACE CALLS * LOCLLCB LOCATE AN LLCB * LOCNCNT LOCATE THE NCNT ENTRY * OVLCALL LOAD AND EXECUTE OVERLAY * * 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 NCSTTP. # STOPIMS; # EXTERNAL VARIABLES # XREF BEGIN PROC BLINK; # LINK MESSAGE TO DATA RING # PROC ABORT ; PROC LOCLLCB; # FIND LLCB # PROC LOCNCNT; # FIND NCNT ENTRY # PROC OVLCALL; # LOAD AND EXECUTE OVERLAY # PROC MCLRIL; # CLEAR NIP/PIP INTERLOCK # PROC MGETS; # GET A BUFFER # PROC MRELS; # RELEASE BUFFER # PROC MSETIL; # REQUEST NIP/PIP INTERLOCK # PROC OSREQ; # MAKE RA+1 CALL # PROC HCSTTP ; # HOST SIDE STATE TABLE # PROC NRCSSTP ; # CALL SSTP AND PROCESS REASON CODE # PROC XTRACE; # TRACE CALLS # LABEL RJMAIN; # RETURN ADDRESS # END # LOCAL VARIABLES # ITEM BSN , HN , # HOST NODE OF CONNECTION # PCNBAD, # PCNB ADDRESS # FOUND B, # FOUND FLAG # NCNTEAD, # NCNT ENTRY ADDRESS # NBIND, ACNBAD, # ACNB ADDRESS # ACBAD, # APPLICATION ACB ADDRESS # NEXTBLK, # NEXT BLOCK IN RING # LASTBLK, # PREVIOUS BLOCK IN RING # PRUCN, # PRU CONNECTION NUMBER # PCNFNT, # QUEUE FILE-S FNT POINTER # PCNLFN C(7), # QUEUE FILE-S LFN # PITIDX, # PIT ENTRY INDEX # BUFADDR, # BUFFER ADDRESS # PWLADDR, # PWL ADDRESS # INDEX, # NPU FRONT-END INDEX # IMMOPWL , # LOC OF PCNB IMMO PWL # DVT, # DEVICE TYPE # ACKQSIZE, # SIZE OF ACK QUEUE # ACKQBUF, # BUFFER FOR ACK QUEUE # I , LLCBAD; # LLCB ADDRESS # BASED ARRAY PRUNIPWD S(1); # TEMPLATE FOR NIP WORD IN PIT # BEGIN ITEM PRUNIPMFB U(0,00,06); # MINIMUM NO OF PRU BUFS # ITEM PRUNIPMAB U(0,06,06); # MAXIMUM NO OF PRU BUFS # ITEM PRUNIPNCA U(0,12,12); # CURRENT NO OF BUFFERS ASSIGNED# ITEM PRUNIPNC U(0,24,12); # CURRENT NO OF PRU CONNECTIONS # ITEM PRUNIPFPB U(0,42,18); # ADR OF FIRST BUF IN FREE CHAIN# END # ******************************************************************** # BEGIN CONTROL IFEQ DEBUG,1; XTRACE("NPPCT") ; CONTROL FI; PWLADDR = PARAMP1; # PWL ADDRESS # PCNBAD = PARAMP2; # PCNB ADDRESS # P = PCNBAD; # PCNB ADDRESS # HN = PCNBHN[0] ; LOCLLCB(HN,PCNBTN[0],LLCBAD) ; P = LLCBAD ; LOCNCNT(LLCBAD,PCNBCN[0],NCNTEAD) ; P = NCNTEAD; ACNBAD = PCNBACNB[0]; # ACNB ADDRESS # P = ACNBAD; ACBAD = ATACBA[ATHSIZE + ACNBAN[0] - 1]; # ACB ADDRESS # P = ACBAD; # ACB ADDRESS # # GET BUFFER FOR NCNB # MGETS(NCNBSIZE, BUFADDR, TRUE); ACNBNCNB[0] = BUFADDR; # RESET NCNB ADDRESS # # FORMAT NCNB FROM PCNB # P = BUFADDR; # NCNB ADDRESS # NCNBID[0] = NCNBIDVALUE; # NCNB BLOCK ID # NCNBR0[0] = PCNBR0[0] ; # COPY REST OF WORD ZERO # NCNBR1[0] = PCNBR1[0] ; # COPY BEGINING OF WORD ONE # NCNBACNB[0] = ACNBAD; # ACNB ADDRESS # NCNBNBTE[0] = PCNBNBTE[0]; # NBT ENTRY INDEX # NCNBTNAM[0] = PCNBTNAM[0]; # TERMINAL NAME # NCNBSTS[0] = PCNBSTS[0] ; PRUCN = NCNBCN[0]; # PRU CONNECTION NUMBER # P = LLCBAD; # LLCB ADDRESS # MSETIL(LLCBAD); # REQUEST NIP/PIP INTERLOCK # # RELEASE QUEUE FILE OR LOCAL FILE ASSOCIATED WITH THIS CONNECTION, LINK PP REQUEST PARAM BLOCK TO PP CALL RING # P = 0 ; DVT = PCNBDT[0] ; NEXTBLK = PCNBPCFP[0] ; # SAVE NEXT PCNB IN CHAIN # LASTBLK = PCNBPCBP[0] ; # AND THE LAST IN CHAIN # IMMOPWL = LOC(PCNBIMMO[0]) ; # SAVE IMMO PWL FOR LATER USE # IF PCNBFILE[0] NQ 0 THEN BEGIN # THERE IS STILL FILE NEED TO BE # # RETURN TO APPLICATION OR SYSTEM QUEU# IF DVT EQ DT$INTA # INTRA-HOST A-A # OR DVT EQ DT$INTE # INTER-HOST A-A # THEN BEGIN # A TO A CONNECTION # I = 0 ; NRCSSTP(P,PWLADDR,PCNBFNTO[0],I) ; IF I NQ 0 THEN BEGIN # ERROR OR NON-ZERO RETURNED RC FROM# # SST CALL, PWL HAS BEEN RE-CHAINED # # IN PWL RING. # PARAMP4 = I ; # SET FLAG TO CALLER # MRELS(P) ; # NO NEED FOR THIS NCNB YET. # ACNBNCNB[0] = P ; # RESTORE THE PCNB IN ACNB # MCLRIL; # RELEASE NIP/PIP INTERLOCK # GOTO RJMAIN ; END END # A TO A CONNECTION # ELSE BEGIN # NOT A-A CONNECTION # PCNLFN = PCNBLFN[0]; # QUEUE FILE-S LFN # PCNFNT = PCNBFNTO[0]; # QUEUE FILE-S FNT PTR # FOR INDEX=PCNBAD+BLKHSIZE STEP 1 UNTIL PCNBAD+PARSIZE DO # CLEAR THE DSP/CIO PARAMETER BLOCK # CMWORD[INDEX] = 0; P = PCNBAD + BLKHSIZE; # PARAMETER BLOCK ADDRESS # FET$LFN[0] = PCNLFN; # LOCAL FILE NAME # REQWORD[0] = 0; # ZERO PP CALL WORD # PADDR[0] = P; IF DVT EQ DT$CR THEN # AN INPUT-QUEUE FILE ATTACHED # BEGIN # ISSUE CIO CALL TO RETURN FILE # PPNAME[0] = PP$CIO; BLKID[PCNBAD] = CPCRIDVALUE; FET$STAT[0] = CIORETURN; # CIO FUNCTION REQUEST CODE # FET$UP[0] = TRUE; # SET USER PROCESSING FLAG # FET$EP[0] = TRUE; # SET ERROR PROCESSING FLAG # FET$CIOFNT[0] = PCNFNT; # FNT POINTER # END IF DVT EQ DT$LP OR DVT EQ DT$CP OR DVT EQ DT$CLP OR # CDCNET LINE PRINTER # DVT EQ DT$PL THEN # AN OUTPUT-QUEUE FILE ATTACHED # BEGIN # ISSUE DSP CALL TO DISPOSE FILE# PPNAME[0] = PP$DSP; BLKID[PCNBAD] = DPCRIDVALUE; FET$FLAGS[0] = DSPNODAYFI; # SET NO DAYFILE MESSAGE FLAG # FET$DSPFNT[0] = PCNFNT; # FNT POINTER # END OSREQ(REQWORD[0]) ; # ISSUE CIO OR DSP CALL # NEXTPTR[PCNBAD] = LOC(PCRHEAD[0]); IF PCRHEAD[0] EQ 0 THEN # EMPTY PP-CALL-RING # BEGIN BACKPTR[PCNBAD] = LOC(PCRTAIL[0]); PCRHEAD[0] = PCNBAD; END ELSE # ADD NEW REQ-BLOCK TO PCR # BEGIN BACKPTR[PCNBAD] = PCRTAIL[0]; NEXTPTR[PCRTAIL[0]] = PCNBAD; END PCRTAIL[0] = PCNBAD; PCNBAD = 0; END # NOT A-A CONNECTION # END # THERE IS STILL FILE NEED TO BE # # BUILD AN ACKNOWLEDGE QUEUE # CONTROL IFEQ DEBUG,1; IF NCNTOOB[0] GR NCNBDBL[0] THEN ABORT(0,0) ; CONTROL FI ; ACKQSIZE = NCNBDBL[0] + ACKHSIZE; # SIZE OF ACK QUEUE # MGETS(ACKQSIZE,ACKQBUF,TRUE); # ALLOC ACK QUEUE # P = ACKQBUF; # BASE ACK QUEUE # ACKQID[0] = ACKQIDVALUE; # SET BLOCK ID # ACKNCNB[0] = P; NCNBACKQ[0] = ACKQBUF; # ADDRESS OF ACK QUEUE # NCNBAKIN[0] = 0 ; # INITIALILZE THE ACK QUEUE # NCNBAKOU[0] = 0 ; # IN = OUT, ASSUMING EMPTY # BSN = NCNTNOB[0] - 1 ; IF BSN EQ 0 THEN BSN = 7 ; NCNBDBSN[0] = BSN ; # LAST BSN WAS SENT # NCNBNBO[0] = NCNTOOB[0] ; IF NCNTOOB[0] NQ 0 THEN BEGIN # STILL OUTSTADING BACK WAITING # NCNBAKIN[0] = NCNTOOB[0] ; # SET ACKNOWLEDGE QUEUE IN PTR # IF NCNBAKIN[0] EQ NCNBDBL[0] THEN # ACKNOWLEDGE QUEUE IS FULL # BEGIN NCNBAKIN[0] = 0; # SET IN PTR FOR BUFFER FULL CASE # END FOR I = NCNTOOB[0] - 1 STEP -1 WHILE I GQ 0 DO BEGIN # BUILD ACK QUEUE ACCORDING TO OOB FROM PIP# P = P + ACKHSIZE + I ; ABHABT[0] = 0 ; # FLAG FOR BACK CHECKING # ABHADR[0] = BSN ; # FAKING THIS ENTRY WITH THIS BSN # BSN = BSN - 1 ; # NEXT BSN # IF BSN EQ 0 THEN BEGIN BSN = 7 ; END END # BUILD THE ACK QUEUE # END # STILL OUSTANDING BACK WAITING # CONTROL IFEQ STAT,1; # STATISTICS OPTION ON # ST$AQ = ST$AQ + 1; # INCREM NO OF ACK QUEUES # CONTROL FI; # UPDATE PRU CONNECTION-S ENTRY IN NCNT # NCNTBSS[0] = 0 ; # CLEAR BATCH STREAM STATE # NCNTBHS[0] = BHSIVT; NCNTNCNB[0] = BUFADDR; # UPDATE NCNB ADDRESS # # DELINK PCNB FROM PCNB-RING # FOUND = FALSE; FOR INDEX = 0 STEP NBTFETNO WHILE NOT FOUND DO # SEARCH FOR HOST NODE # BEGIN IF NBTIUF[INDEX] AND NBTHN[INDEX] EQ NCNBHN[0] THEN # NBT FOR THE HOST NODE FOUND # FOUND = TRUE; # FLAG TO STOP -FOR- LOOP # NBIND = INDEX ; END IF NEXTBLK EQ LASTBLK THEN # PCNB IS ONLY MEMBER # BEGIN NBTPCRF[NBIND] = 0; # CLEAR PCNB POINTERS IN NBT # NBTPCRB[NBIND] = 0; END ELSE BEGIN P = 0; IF LASTBLK EQ LOC(NBTFIRST[NBIND]) THEN # THIS IS THE FIRST MEMBER # NBTPCRF[NBIND] = NEXTBLK; ELSE PCNBPCFP[LASTBLK] = NEXTBLK; IF NEXTBLK EQ LOC(NBTFIRST[NBIND]) THEN # THIS IS THE LAST MEMBER # NBTPCRB[NBIND] = LASTBLK; ELSE PCNBPCBP[NEXTBLK] = LASTBLK; P = PCNBAD; # RESOTRE PCNB ADDRESS # END MCLRIL; # CLEAR NIP/PIP INTERLOCK # # RELEASE ALL PWL-S IN ICMD AND CMD WORKLIST QUEUE # FOR INDEX = ICMDQP STEP 1 UNTIL CMDQP DO BEGIN P = IMMOPWL + INDEX ; # WORKLIST QUEUE WORD # NEXTBLK = PWLNEXT[0]; # FIRST PWL IN WORKLIST WUEUE # FOR NEXTBLK = NEXTBLK WHILE NEXTBLK NQ 0 DO BEGIN P = NEXTBLK; # CURRENT PWL IN QUEUE # NEXTBLK = PWLNEXT[0]; # ADDRESS OF NEXT PWL IN QUEUE # MRELS(P); # RELEASE CURRENT PWL # END END # DECREMENT ACTIVE PRU CONNECTION CO0NT IN LOGICAL-LINK PCB AND INTERLOCK TABLE # PITIDX = LLCBPITIDX[0]; # PIT ENTRY INDEX # LLCBNPC[0] = LLCBNPC[0] - 1; # UPDATE COUNT IN LLCB # ACBNPRU[0] = ACBNPRU[0] - 1; # UPDATE COUNT OF PRU CONNEC. # # RELEASE ALL PWL-S IN PWL RING THAT BELONG TO THIS CONNECTION # NEXTBLK = ACBPWLFP[0]; # PWL RING POINTER # IF NEXTBLK EQ PWLADDR THEN # NO NEED TO DELINK FIRST ENTRY # BEGIN # IN ACB PWL RING BECAUSE # # XSACB WILL DO IT. # P = NEXTBLK; # PWL CURRENTLY BEING PROCESSED # PWLID[0] = PWLIDVALUE; # RESTORE PWL BLOCK ID IF ALTERD# NEXTBLK = PWLNPWLFP[0]; # NEXT ENTRY IN ACB PWL IF ANY # END FOR NEXTBLK = NEXTBLK WHILE NEXTBLK NQ 0 AND NEXTBLK NQ LOC(ACBPWLFP[0]) DO BEGIN P = NEXTBLK; # PWL ADDRESS # NEXTBLK = PWLNPWLFP[0]; # ADDRESS OF NEXT PWL IN RING # LASTBLK = PWLNPWLBP[0]; # ADDRESS OF PREVIOUS PWL # IF (PWLTN[0] EQ NCNBTN[0]) AND # TERMINAL NODE MATCHES # (PWLHN[0] EQ NCNBHN[0]) AND # HOST NODE MATCHES # (PWLCN[0] EQ NCNBCN[0]) # CONNECTION NUMBER MATCHES # THEN # FOUND PWL FROM THIS CONNECTION# BEGIN # DELINK PWL FROM PWL RING # MRELS(P); # RELEASE PWL SPACE # IF ACBPWLFP[0] EQ ACBPWLBP[0] THEN # ONLY PWL IN RING # BEGIN ACBPWLFP[0] = 0; # ZERO PWL RING PTR-S IN ACB # ACBPWLBP[0] = 0; END ELSE # MORE THAN ONE PWL IN RING # BEGIN # UPDATE RING POINTERS # NEXTPTR[LASTBLK] = NEXTBLK; BACKPTR[NEXTBLK] = LASTBLK; END END END # RELEASE PCNB BUFFER # IF PCNBAD NQ 0 THEN BEGIN # RELEASE PCNB AND LIMBO BUF IF NEED# INDEX = PCNBPBS[0] ; # SAVE THE TYPE OF PRU # P = LOC(PITW5[PITIDX])-1; PRUNIPNC[INDEX] = PRUNIPNC[INDEX] - 1; # DECRE NO OF PRU CONS # MRELS(PCNBAD) ; END # RELEASE # # RELEASE PRU-CONNECTION-TERMINATED WORKLIST SPACE # IF NCNTREL[0] # IF THIS NCNB IS TO BE RELEASED # THEN BEGIN # FIRST RELEASE THIS NCNB # RCBRK = RCCB"LLF" ; #RC = LOGICAL LINK FAILED # PARAMS1 = BUFADDR ; NCNTREL[0] = FALSE; # RESET THE NCNB-TO-BE-RELEASED FLAG # OVLNAME = RELNCNBP; OVLCALL ; # INFORM THE HOST SIDE THAT THIS CONNECTION IS TERMINATED, AND THE NETWORK IS IS CLEANED UP ALREADY. # HCSTTP(P,ACNBACN[0],NWTC,0) ; # NOW CHECK IF WE CAN RELEASE THE LLCB TOO # IF LLCBWOF[0] AND LLCBNPC[0] EQ 0 THEN # MAY NEED TO RELEASE LLCB # BEGIN LLCBWOF[0] = FALSE; # CLEAR WAITING FOR PIP FLG # IF LLCBNC[0] EQ 0 THEN # NO CNS LEFT IN LLCB # BEGIN PARAMS2 = LLCBAD ; OVLNAME = RELLLCBP ; OVLCALL ; IF NBTREGW[NBIND] NQ 0 # IF DELETION DUE TO REG/CP # THEN BEGIN NBTREGW[NBIND] = NBTREGW[NBIND] - 1 ; # LLCB(S) REMAINING # IF NBTREGW[NBIND] EQ 0 # IF LAST LLCB DELETED # THEN BEGIN # SEND REG/CP/R TO PIP # PARAMS1 = HN ; PARAMS2 = 1 ; # FLAG TO SET RESPONSE BIT # OVLNAME = NCREGCPP ; OVLCALL ; END END END END PARAMP2 = 0 ; # SIGNAL FOR NO NCNB # END ELSE # SEND BACK THE NEW NCNB ADDRESS # PARAMP2 = BUFADDR ; PARAMP1 = 0 ; GOTO RJMAIN; END TERM