*DECK NVFARVD
USETEXT TEXTNVF
USETEXT TEXTSS
USETEXT TXTSUSS
USETEXT TXTANVF
USETEXT TXSMNVF
USETEXT TXTAPSS
PROC NVFARVD;
# TITLE NVFARVD - RECEIVE A-A VCB DATA #
BEGIN # NVFARVD #
#
** NVFARVD - RECEIVE A-A VCB DATA.
*
* C. BRION 83/01/03, 83/02/18, 83/05/10, 83/12/12.
*
* THIS PROCEDURE PROCESSES THE VCB DATA RETURNED FROM A VCB READ
* REQUEST FOR A-A CONNECTIONS.
*
* PROC NVFARVD
*
* ENTRY:
* THE VCB DATA RESIDES IN MSGBUF.
*
* EXIT:
* TWO DIFFERENT POSSIBLE EXIT CONDITIONS EXIST BASED ON THE
* STATE OF THE PAAC AND VCB ENTRIES.
*
* IN BOTH CASES:
* AN AEAA ACCOUNTING MESSAGE IS ISSUED.
* APPLICATION DEPARTURE PROCESSING IS PERFORMED.
* THE NUMBER OF A-A CONNECTIONS FOR THE APPLICATION IS
* DECREMENTED.
*
* IF THE TERMINATION IS DUE TO A RECONNECT, THEN A CR/TRM/R SM
* IS ISSUED. THE PAAC ENTRY, VCB ORDINAL AND ACTIVE PID TABLE
* SPACE ARE RELEASED VIA A CALL TO NVFACTC.
#
CONTROL EJECT;
#
**** PROC NVFARVD - XREF LIST.
#
XREF
BEGIN
PROC NVFUMQE; # MAKE QUEUE ENTRY #
PROC SSTRTS; # SS-RELEASE TABLE SPACE #
PROC NVFAIAM; # ISSUE A-A ACCOUNT MSG #
PROC NVFSCAD; # COMPLETE APPL DEPARTURE #
PROC NVFUFVO; # FREE VCB ORDINAL #
PROC NVFACTC; # CLEANUP TERMINATING CONN #
PROC MESSAGE; # MESSAGE TO DAYFILE #
PROC ABORT;
END
#
****
#
ITEM ASENTRY I; # NUMBER AST ENTRIES #
ITEM NENTRY I; # NUMBER VARIABLE #
ITEM PAC I; # PAAC ENTRY INDEX #
ITEM SAVESTATE I; # PAAC STATE #
ITEM VCBSTATE I; # VCB STATE #
ITEM AORD I; # APPL AST ORDINAL #
ITEM MTYP I; # ACCOUNT MSG TYPE #
ITEM SAVEACN I; # LOCAL ACN SAVE VARIABLE #
ITEM SAVERC I; # REASON CODE LOCAL #
ITEM PORD I; # PRIMARY AST ORDINAL #
ITEM VCBREL B; # VCB RELEASE FLAG #
CONTROL EJECT;
#
* NVFARVD PROCEDURE START
#
#
* SET VCB RELEASE FLAG TRUE.
* SET VCB BUFFER TEMPLATE.
* LOCATE PAAC ENTRY USING VCB ORDINAL AS KEY.
#
VCBREL = TRUE;
P<VCBBUF> = LOC(MSGBUF[0]);
NENTRY = PACLNGTH / PAACSIZ$;
FOR PAC = 0 STEP 1 WHILE (PA$VCB[PAC] NQ VCB$VCB[0]
AND PAC LS NENTRY)
DO
BEGIN
END
#
* LOCATE THE AST ENTRY OF THIS PAAC ENTRY.
#
ASENTRY = ASTLNGTH/ASTSIZ$;
FOR AORD = 0 STEP 1 WHILE
(AORD LS ASENTRY AND
AST$PANAM[AORD] NQ PA$SWAP[PAC])
DO
BEGIN
END
#
* CHECK FOR PRIMARY AST ENTRY IF SECONDARY AST ORDINAL.
#
PORD = AORD;
IF AST$PANAM[AORD] NQ AST$SANAM[AORD]
THEN
BEGIN
FOR PORD = 0 STEP 1 WHILE
(PORD LS ASENTRY) AND
(AST$SANAM[AORD] NQ AST$PANAM[PORD])
DO
BEGIN
END
IF PORD EQ ASENTRY
THEN
PORD = AORD;
END
#
* SAVE THE PAAC STATE LOCALLY.
#
SAVESTATE = PA$STATE[PAC];
SAVEACN = PA$NACN[PAC];
SAVERC = PA$IAPRC[PAC];
#
* MOVE THE VCB INFO INTO THE PAAC ENTRY.
#
PA$TIMWRD[PAC] = VCB$WRD1[0];
PA$FWORD[PAC] = VCB$WRD2[0];
PA$UWORD[PAC] = VCB$WRD4[0];
PA$RHWRD[PAC] = VCB$WRD3[0];
PA$VCB[PAC] = VCB$VCB[0];
PA$PORT[PAC] = VCB$APORT[0];
PA$SWAPAN[PAC] = VCB$ASWAPAN[0];
PA$SWAP[PAC] = VCB$ASWAP[0];
PA$SL[PAC] = VCB$ASL[0];
PA$STATE[PAC] = VCB$ASTATE[0];
PA$IAPRC[PAC] = VCB$AIAPRC[0];
PA$NUMOUT[PAC] = VCB$ANUMOUT[0];
PA$SNODE[PAC] = VCB$ASNODE[0];
PA$DNOD[PAC] = VCB$ADNOD[0];
PA$DT[PAC] = VCB$ADT[0];
PA$ICMCN[PAC] = VCB$ICMCN[0];
#
* RESTORE THE PAAC STATE.
#
PA$STATE[PAC] = SAVESTATE;
#
* ISSUE AEAA ACCOUNT MESSAGE.
#
MTYP = AEAA$;
NVFAIAM(PAC,MTYP);
#
* DECREMENT NUMBER OF CONNECTIONS TO SEC AST ENTRY.
* COMPLETE APPL DEPARTURE FOR SEC AST ENTRY.
#
AST$AACN[AORD] = AST$AACN[AORD] - 1;
IF PA$ICMCN[PAC]
THEN
BEGIN
AST$ICCN[AORD] = AST$ICCN[AORD] - 1;
END
NVFSCAD(AORD);
#
* CHECK IF SECONDARY AST ENTRY. IF SO, DECREMENT NUMBER OF
* CONNECTIONS FOR PRIMARY AND COMPLETE APPLICATION DEPARTURE.
#
IF AORD NQ PORD
THEN
BEGIN
AST$AACN[PORD] = AST$AACN[PORD] - 1;
IF PA$ICMCN[PAC]
THEN
BEGIN
AST$AACN[PORD] = AST$AACN[PORD] - 1;
END
NVFSCAD(PORD);
END
#
* FOR RECONNECT STATES, A CR/TRM/R SM MUST BE ISSUED.
#
IF SAVESTATE EQ PAACST"PARCN"
THEN
BEGIN
SPMSG0[1] = 0;
CRACN[1] = SAVEACN;
RC[1] = SAVERC;
PFCSFC[1] = CRTRM;
NVFUMQE(P<CTQ>,APSM[1],APPPR$,0,LCRTRM);
END
#
* RELEASE PAC ENTRY, ACPID TABLE ENTRY AND VCB VIA NVFACTC CALL.
#
NVFACTC(PAC,VCBREL);
END # NVFARVD #
TERM