*DECK NVFTRCN
USETEXT TEXTNVF
USETEXT TXSMNVF
USETEXT TXTANVF
USETEXT TXTAPSS
USETEXT TXTSUSS
PROC NVFTRCN;
# TITLE NVFTRCN - RECONNECT TO NVF REQUEST (CR/RCN SM) #
BEGIN # NVFTRCN #
#
** NVFTRCN - RECONNECT TO NVF REQUEST (CR/RCN SM).
*
* E. THAVIKULWAT 81/11/09
* A. LIM 82/08/04
* C. BRION 83/04/11. 83/05/10.
*
* THIS PROCEDURE'S MAIN FUNCTION IS TO RECONNECT TERMINAL TO NVF IN
* RESPONSE TO A CR/RCN REQUEST. IT IS CALLED INTO EXECUTION BY
* PROCEDURE *NVFTDQE*.
*
* PROC NVFTRCN
*
* ENTRY:
* CR/RCN SM IN *MSGBUF*
*
* EXIT:
* ONE OF THE FOLLOWING:
* 1) CONNECTION TERMINATED.
* 2) APPLICATION PROMPT REISSUED.
* 3) CONNECTION SWITCHED TO ANOTHER APPLICATION.
*
* NOTES:
* A CR/RCN REQUEST IS SENT TO NVF FOR 2 REASONS:
* 1) THE SWITCH REQUEST WAS SUCCESSUFL BUT EITHER SOMETHING IS
* WRONG WITH THE APPLICATION OR USER REQUESTED A RECONNECT.
* IN THIS CASE, A *PTAC* ENTRY FOR THE CONNECTION NO LONGER
* EXIST, BUT A VCB ENTRY FOR THE CONNECTION DOES EXIST OUT
* ON THE VCB FILE. A *PTAC* ENTRY HAS TO BE CREATED AND
* INFORMATION FROM THE CR/RCN SM SAVED.
* 2) THE SWITCH REQUEST WAS NOT SUCCESSFUL. IN THIS CASE, A
* *PTAC* ENTRY FOR THE CONNECTION STILL EXIST. IF DEVICE IS
* AN INTERACTIVE DEVICE, APPROPRIATE MESSAGE IS ISSUED TO
* THE TERMINAL AND APPLICATION PROMPT MAY BE REISSUED. IF
* DEVICE IS A BATCH DEVICE, THE DEVICE REMAIN CONNECTED TO
* NVF UNTIL IT'S OWNING CONSOLE HAS COME BACK AND HAS MADE
* ANOTHER SUCCESSFUL APPLICATION SELECTION OR UNTIL THE NPU
* TERMINATES THE CONNECTION.
*
* REASON CODE FROM CR/RCN REQUEST DETERMINES REASON FOR THE
* RECONNECT. REASON CODE 1-4 IMPLIES 1 ABOVE AND REASON CODE
* OF 5-7 IMPLIES 2 ABOVE.
* A BIAS OF 15 IS ADDED TO THE REASON CODE FROM CR/RCN WHEN THE
* CODE IS TO BE STORED IN THE CR/TRM.
*
* METHOD:
* SEND CR/RCN/N RESPONSE. DETERMINE REASON FOR RECONNECT. IF FOR
* AN UNSUCCESSFUL SWITCH, GET *PTAC* ENTRY, UPDATE WITH NEW ACN,
* AND DECREMENT T-A CONNECTION COUNT. IF FOR A SUCCESSFUL SWITCH,
* CREATE A NEW *PTAC*, UPDATE WITH INFORMATION FROM THE CR/RCN
* REQUEST, AND ISSUE VCB READ REQUEST.
#
#
**** PROC NVFTRCN - XREF LIST.
#
XREF
BEGIN
PROC MOVE; # MACREL - MOVE CM WORDS #
PROC NVFSCAD; # COMPLETE APPLICATION DEPARTURE #
PROC NVFTDAD; # DETERMINE ADDITIONAL DIALOGUE #
PROC NVFTILP; # ISSUE LOGIN PROMPT #
PROC NVFTPVD; # PREPARE TO RECEIVE VALIDATION DATA #
PROC NVFTRLC; # RECONNECT TO PRIMARY APPLICATION #
PROC NVFTURT; # UPDATE *RAU* TABLE #
PROC NVFUMQE; # TRANSFER SM OR TEXT TO QUEUE #
PROC SSTETS; # SS - ENLARGE TABLE SPACE #
FUNC XSFW C(10); # SPACE FILL WORD #
END
#
****
#
#
* TEMPORARY BASED ARRAYS FOR USE WHEN CALLING THE *MOVE* ROUTINE.
#
BASED ARRAY TEMPFROM [00:00] S(1);
BEGIN
ITEM FROMWRD U(00,00,60);
END
BASED ARRAY TEMPTO [00:00] S(1);
BEGIN
ITEM TOWRD U(00,00,60);
END
DEF RCNRC$ #15#; # NUMBER TO ADD TO CR/RCN REASON CODE #
ITEM ADDR I; # ADDRESSING INFORMATION FOR ABH #
ITEM AS I; # SUBSCRIPT FOR ARRAY AST #
ITEM ASENTRY I; # NUMBER AST ENTRIES #
ITEM ERRCOD I; # ERROR CODE #
ITEM I I; # LOOP VARIABLE #
ITEM MATCH B; # MATCH FOUND FLAG #
ITEM OPTWRDSZ I; # SIZE OF OPTIONAL DATA IN CM WORDS #
ITEM PD I; # SUBSCRIPT FOR ARRAY PDCT #
ITEM PORD I; # PRIMARY AST ORDINAL #
ITEM PRIAPP B; # PRIMARY APPL INDICATOR #
ITEM PT I; # SUBSCRIPT FOR ARRAY PTAC #
ITEM SAVETLC I; # TEMP PLACE TO STORE THE ABHTLC #
ITEM SMOUT B; # SM TYPE FOR CALL TO NVFTRLC #
ITEM SPSIZ I; # SIZE OF SPTAC ENTRY IN CM WORDS #
#
* DETERMINE NUMBER OF AST ENTRIES.
#
ASENTRY = ASTLNGTH/ASTSIZ$;
#
* BUILD CR/RCN/N RESPONSE.
#
SPMSG0[1] = 0; # CLEAR RESPONSE AREA #
PFCSFC[1] = CRRCNN;
CRACN[1] = CRACN[0];
CRNXP[1] = TRUE;
CRICT[1] = ICT$;
CRALN[1] = ALN$;
ADDR = ABHADR[0];
SAVETLC = ABHTLC[0]; # SAVE TLC FOR LATER USE #
#
* ONLY IF NOT A RECONNECT TO LOAN CONNECTION TO SECONDARY DO
* WE NEED TO RESPOND IMMEDIATELY WITH A NORMAL RESPONSE.
#
IF CRRRCN[0] NQ RCRC"LSA"
THEN
NVFUMQE(P<CTQ>,APSM[1],APPPR$,ADDR,LCRRCNN);
#
* DETERMINE IF CR/RCN IS FOR AN ABNORMAL RECONNECT (UNSUCCESSFUL
* SWITCH) OR FOR A NORMAL RECONNECT.
#
ERRCOD = CRRRCN[0]; # REASON CODE #
IF CRLIMBO[0]
THEN # CR/RCN FOR UNSUCCESSFUL SWITCH #
BEGIN
#
* CR/RCN IS FOR AN ABNORMAL RECONNECT (I.E., CR/ACC HAS NOT BEEN
* RECEIVED). CALL *NVFTURT* TO FIND THE *PTAC* ENTRY AND UPDATE
* *RAU* TABLE ACCORDINGLY. SAVE NEW ACN, DECREMENT T-A CONNECTION
* COUNT. IF INTERACTIVE DEVICE, CALL *NVFTDAD* TO DETERMINE
* ADDITIONAL DIALOGUE POSSIBILITY. OTHERWISE, JUST EXIT.
#
PRIAPP = FALSE;
NVFTURT(CRVCB[0],PT,PRIAPP); # UPDATE *RAU* TABLE #
PTA$ACN[PT] = CRACN[0]; # SAVE NEW ACN #
PTA$RC[PT] = ERRCOD + RCNRC$; # SAVE RC FOR USE IN CR/TRM #
PTA$LRC[PT] = ERRCOD;
#
* SET THE NEXT APPLICATION NAME IF SPECIFIED.
#
IF CRANAME[0] NQ 0
THEN # NEW APPLICATION SPECIFIED #
BEGIN
PTA$VLTAPP[PT] = XSFW(CRANAME[0]); # SAVE NEW APPL NAME #
PTA$VAF[PT] = TRUE; # SET VOLUNTEERED APPL FLAG #
END
#
* LOCATE AST ENTRY FOR THIS PTAC ENTRY.
#
FOR AS = 0 STEP 1 WHILE
(AS LS ASENTRY AND
AST$PANAM[AS] NQ PTA$SWTAPP[PT])
DO
BEGIN
END
AST$TACN[AS] = AST$TACN[AS] - 1; # DECREMENT NUMBER OF CONN #
AST$ICCN[AS] = AST$ICCN[AS] - 1; #DECREMENT NO OF INCMG CONN #
NVFSCAD(AS); # COMPLETE APPL DEPARTURE #
IF (PTA$DT[PT] EQ DT$CONS)
OR (PTA$DT[PT] EQ DT$CLP)
OR (PTA$DT[PT] EQ DT$USER)
THEN # INTERACTIVE DEVICE TYPE #
BEGIN
#
* CHECK IF LOANED CONNECTION.
* IF SO, CALL NVFTRLC TO RETURN CONNECTION TO PRIMARY APPL.
* OTHERWISE, CALL NVFTDAD TO DETERMINE IF ADDITIONAL DIALOGUE
* IS OK. IF SO, THEN CALL NVFTILP TO ISSUE NEXT PROMPT.
#
IF PTA$LRC[PT] LS RCRC"LSA"
THEN
BEGIN
NVFTDAD(PT,ERRCOD);
IF PTA$STATE[PT] EQ PTACST"AWTPRMT"
THEN
NVFTILP(PT);
END
ELSE
BEGIN
#
* LOCATE THE *AST* ENTRY OF THE PRIMARY APPL. DECREMENT THE
* NUMBER OF RESERVED CONNECTIONS AND INCREMENT THE NUMBER OF T-A
* CONNECTIONS.
#
FOR AS = 0 STEP 1 WHILE
(AS LS ASENTRY) AND
(AST$AN[AS] NQ PTA$PRIAN[PT])
DO
BEGIN
END
IF AS LS ASENTRY
THEN
BEGIN
AST$RACN[AS] = AST$RACN[AS] - 1;
AST$TACN[AS] = AST$TACN[AS] + 1;
AST$ICCN[AS] = AST$ICCN[AS] + 1;
END
#
* SWITCH THE CONNECTION BACK TO THE PRIMARY APPLICATION.
#
PTA$SWTAPP[PT] = AST$PANAM[AS];
SMOUT = FALSE;
NVFTRLC(PT,SMOUT,PTA$LRC[PT]);
END
END
END
ELSE
BEGIN
#
* CR/RCN IS FOR A NORMAL RECONNECT. CALL *NVFTPVD* TO ALLOCATE
* SPACE FOR A *PTAC* ENTRY AND MAKE VCB READ REQUEST ENTRY IN
* *VRQ* QUEUE. UPDATE *PTAC* WITH INFORMATION RECEIVED IN THE
* CR/RCN SM.
#
NVFTPVD(CRVCB[0],CRAN[0],PT);
PTA$ACN[PT] = CRACN[0]; # SAVE NEW ACN #
PTA$VCB[PT] = CRVCB[0];
PTA$ABL[PT] = CRABL[0];
PTA$DT[PT] = CRDT[0];
PTA$TC[PT] = CRRCTC[0];
PTA$PW[PT] = CRRCPW[0];
PTA$PL[PT] = CRRCPL[0];
PTA$LRC[PT] = CRRRCN[0];
PTA$RC[PT] = ERRCOD + RCNRC$;
#
* SET THE NEXT APPLICATION NAME IF SPECIFIED.
#
IF CRANAME[0] NQ 0
THEN # NEW APPLICATION SPECIFIED #
BEGIN
PTA$VLTAPP[PT] = XSFW(CRANAME[0]); # SAVE NEW APPL NAME #
PTA$VAF[PT] = TRUE; # SET VOLUNTEERED APPL FLAG #
END
#
* IF REASON FOR RECONNECT IS APPLICATION FAILURE/NETOFF, THEN
* SET APPLICATION FAILED FLAG IN THE *PTAC* ENTRY SO THAT USER
* IS GIVEN 25 TRIES VERSUS 4 TO ENTER A LEGAL APPLICATION NAME
* (TO TAKE CARE OF TYPE AHEAD DATA), AND ALSO SET APPLICATION
* DOWN FLAG IN THE *AST* TABLE.
#
IF ERRCOD EQ RCRC"N" OR
ERRCOD EQ RCRC"ANO" OR
ERRCOD EQ RCRC"AF" OR
ERRCOD EQ RCRC"SAN" OR
ERRCOD EQ RCRC"SAF"
THEN
BEGIN
PTA$AFF[PT] = TRUE;
#
* LOCATE AST ENTRY FOR PTAC ENTRY.
#
FOR AS = 0 STEP 1 WHILE
(AS LS ASENTRY AND
AST$PANAM[AS] NQ PTA$SWTAPP[PT])
DO
BEGIN
END
AST$DNF[AS] = TRUE; # SET APPLICATION DOWN FLAG #
END
#
* SET *PTAC* STATE ACCORDING TO LOAN CONNECTION FLAG STATUS OF
* THE PTAC ENTRY.
#
IF PTA$LRC[PT] LS RCRC"LSA"
THEN
PTA$STATE[PT] = PTACST"AWTVCBR";
ELSE
BEGIN
PTA$STATE[PT] = PTACST"AWTVCBL";
#
* IF THIS IS AN INTIAL LOAN REQUEST, SAVE THE PRIMARY
* APPLICATION NUMBER IN THE PTAC ENTRY.
#
IF PTA$LRC[PT] EQ RCRC"LSA"
THEN
BEGIN
PTA$PRIAN[PT] = CRAN[0];
END
END
#
* CHECK IF EXTENDED OPTIONAL WORDS ARE APPENDED TO THE CR/RCN/R SM.
* IF SO, ALLOCATE SPTAC SPACE AND MOVE THE OPTIONAL WORDS INTO THE
* SPTAC, MARK THE PTAC AND LABEL THE SPTAC SO IT CAN BE LOCATED
* LATER.
#
IF SAVETLC GR LCRRCN
THEN
BEGIN
SPSIZ = SAVETLC - LCRRCN + 1;
SSTETS(P<SPTAC>,0,SPSIZ);
SPT$VCB[0] = PTA$VCB[PT];
SPT$ESIZE[0] = SPSIZ;
P<TEMPFROM> = LOC(CRROPW[0]);
P<TEMPTO> = LOC(SPT$WRD2[0]);
OPTWRDSZ = SPT$ESIZE[0] - 1;
FOR I = 0 STEP 1 WHILE
I LS OPTWRDSZ
DO
BEGIN
TOWRD[I] = FROMWRD[I];
END
PTA$SPTAC[PT] = TRUE;
END
#
* IF A CONSOLE DEVICE, SEARCH THE PDCT TO SEE IF THERE IS
* AN ENTRY FOR THIS DEVICE. IF AN ENTRY IS FOUND, THEN SET THE
* STATE TO AWAITING CONSOLE VALIDATION.
#
IF PTA$DT[PT] EQ DT$CONS
THEN
BEGIN
MATCH = FALSE;
FOR PD=0 STEP PDT$WC[PD] WHILE (NOT MATCH AND PD LS PDTLNGTH)
DO
BEGIN
IF PTA$VCB[PT] EQ PDT$CVCB[PD+1]
THEN
BEGIN
PDT$CSTAT[PD+1] = PDCTST"AWTCVAL";
MATCH = TRUE;
END
END
END
END
END # END NVFTRCN #
TERM