*DECK NVFTACC
USETEXT TEXTNVF
USETEXT TEXTSS
USETEXT TXSMNVF
USETEXT TXTANVF
USETEXT TXTAPSS
PROC NVFTACC;
# TITLE NVFTACC - ACCEPT SWITCH CONNECTION REQUEST (CR/ACC SM) #
BEGIN # NVFTACC #
#
** NVFTACC - ACCEPT SWITCH CONNECTION REQUEST (CR/ACC SM).
*
* E. THAVIKULWAT 81/11/04
* C. BRION 83/05/10
*
* THIS PROCEDURE'S MAIN FUNCTION IS TO COMPLETE TERMINAL TO
* APPLICATION SWITCHING IN RESPONSE TO A CR/ACC REQUEST BY SAVING
* APPROPRIATE PTAC INFORMATION IN THE VCB FILE. IT IS CALLED INTO
* EXECUTION BY PROCEDURE *NVFTDQE*.
*
* PROC NVFTACC
*
* ENTRY:
* CR/ACC SM IN *MSGBUF*
*
* EXIT:
* ENTRY MADE IN VCB FILE, ABAP ACCOUNT DAYFILE MESSAGE ISSUED,
* AND PTAC ENTRY DELETED.
*
* NOTES:
* A PTAC ENTRY WILL NOT BE FOUND IF A CR/CB/R OCCURRED AFTER
* A CR/SWH HAS BEEN ISSUED BUT BEFORE A CR/ACC WAS RECEIVED.
*
* METHOD:
* SEARCH PTAC TABLE FOR ENTRY THAT MATCHES THIS TERMINAL'S VCB.
* IF NO MATCH, IGNORE SM. OTHERWISE, SAVE SWITCH TIME IN THE
* PTAC. FOR SYNCHRONOUS CONSOLE AND PASSIVE DEVICES, GET ITS
* CORRESPONDING PDCT ENTRY. IF SYNCHRONOUS CONSOLE, SAVE
* VALIDATION DATA IN THE PDCT AND SWITCH IT'S PASSIVE DEVICES,
* IF ANY, TO THE APPLICATION. IF PASSIVE DEVICE, JUST DELETE THE
* 1-WORD PASSIVE DEVICE ENTRY IN THE PDCT. COMPLETE BUILDING VCB
* DATA AND MAKE ENTRY IN *VRQ* QUEUE. ISSUE *ABAP* ACCOUNT DAYFIL
* MESSAGE AND DELETE THE PTAC ENTRY.
#
#
**** PROC NVFTACC - XREF LIST.
#
XREF
BEGIN
PROC ABORT; # ABORT JOB #
PROC MESSAGE; # SEND MESSAGE TO SYSTEM AND USER DAYFILE #
PROC NVFTDSP; # DETERMINE SWITCH POSSIBILITY #
PROC NVFTIAM; # ISSUE ACCOUNT DAYFILE MESSAGE #
PROC NVFUMQE; # TRANSFER TEXT TO QUEUE #
PROC SSTRTS; # REMOVE TABLE SPACE #
END
#
****
#
ITEM ADDR I; # VARIABLE FOR VCB ORDINAL #
ITEM DTYP I; # VARIABLE FOR DEVICE TYPE #
ITEM FIND B; # EXIT LOOP VARIABLE #
ITEM I I; # LOOP VARIABLE #
ITEM J I; # LOOP VARIABLE #
ITEM LNGTH I; # LENGTH OF MESSAGE #
ITEM MATCH B; # EXIT LOOP VARIABLE #
ITEM NENTRY I; # NUMBER OF ENTRIES IN TABLE #
ITEM NUMPAS I; # NUMBER OF PASSIVE DEVICES #
ITEM PD I; # SUBSCRIPT FOR ARRAY PDCT #
ITEM PIDX I; # SUBSCRIPT FOR 1ST PASSIVE DEVCE IN PDCT #
ITEM PT I; # SUBSCRIPT FOR ARRAY PTAC #
ITEM TNAME C(7); # VARIABLE FOR TERMINAL NAME #
#
* FOLLOWING ARRAY CONTAINS MESSAGE ISSUED TO THE DAYFILE UPON NOT
* FINDING AN EXPECTED PTAC/PDCT ENTRY.
#
ARRAY DAYMSG[00:00] S(5);
BEGIN
ITEM DAY$MSG1 C(00,00,22) = ["NVFTACC - CANNOT FIND "];
ITEM DAY$TYPE C(02,12,04); # PTAC OR PDCT #
ITEM DAY$MSG2 C(02,36,18) = [" ENTRY FOR TERMNAM"];
ITEM DAY$TNAME C(03,42,07); # TERMINAL NAME #
END
SWITCH DTYPSWT:DTSTAT
LLINT : SCON, # LABEL FOR CONSOLE DEVICE TYPE #
LLPASV : SCR, # LABEL FOR CARD READER DEVICE #
LLPASV : SLP, # LABEL FOR LINE PRINTER DEVICE #
LLPASV : SCP, # LABEL FOR CARD PUNCH DEVICE #
LLPASV : SPL, # LABEL FOR PLOTTER DEVICE #
LLINT : SCLP, # LABEL FOR CDCNET LINE PRINTER (PSU) #
LLINT : SUSER; # LABEL FOR USER DEVICE TYPE #
#
* SEARCH PTAC TABLE FOR ENTRY THAT MATCHES THIS TERMINAL'S VCB.
* IF NO MATCH, IGNORE SM.
#
MATCH = FALSE;
NENTRY = PTALNGTH / PTACSIZ$; # CALCULATE NUMBER OF ENTRIES #
FOR PT = 0 STEP 1 WHILE (NOT MATCH AND PT LS NENTRY)
DO
BEGIN
IF PTA$VCB[PT] EQ CRVCB[0]
THEN
BEGIN # PTAC ENTRY FOUND #
#
* SAVE SWITCH TIME AND POINT BASE ARRAY TO THE SECOND WORD OF
* *MSGBUF*. THIS LOCATION FOR *VCBBUF* INSURES THAT THE
* INCOMING CR/ACC/SM IS NOT OVERLAYED (I.E., CLOBBERED) AND
* THAT THE SECOND HALF OF *MSGBUF* IS AVAILABLE TO PROC
* *NVFTDSP* FOR GENERATING CR/SWH/SM'S FOR THE PASSIVE DEVICES
* (IF ANY). THIS WILL BE TRUE AS LONG AS THE SIZE OF A VCB
* NEVER HAS TO EXCEED ELEVEN WORDS (CURRENTLY, IT IS EIGHT).
#
PTA$SWTIME[PT] = CTM$PDT[0];
P<VCBBUF> = LOC(MSGBUF[LCRACC]);
#
* IF SYNCHRONOUS DEVICE TYPE, FIND ITS CORRESPONDING ENTRY IN
* THE PDCT TABLE. USE OWNING CONSOLE NAME FOR THE SEARCH IF
* A PASSIVE DEVICE.
#
DTYP = PTA$DT[PT];
IF PTA$TC[PT] GQ TC9$
THEN # SYNCHRONOUS DEVICE TYPE #
BEGIN
TNAME = PTA$TN[PT];
IF (DTYP NQ DT$CONS) AND (DTYP NQ DT$USER)
THEN # PASSIVE DEVICE #
BEGIN
TNAME = PTA$OCN[PT]; # OWNING CONSOLE NAME #
END
FIND = FALSE;
FOR I = 0 STEP PDT$WC[I] WHILE (NOT FIND AND I LS PDTLNGTH)
DO
BEGIN
IF PDT$CN[I] EQ TNAME
THEN # FOUND PDCT ENTRY #
BEGIN
PD = I; # SAVE PDCT ENTRY INDEX #
NUMPAS = PDT$WC[I] - PDCTSIZ$; # NUM OF PASSIVE DEVCE #
PIDX = PD + PDCTSIZ$; # INDEX TO 1ST PASSIVE DEVICE #
FIND = TRUE; # EXIT LOOP #
END
END
IF NOT FIND
THEN # CANNOT FIND PDCT ENTRY #
BEGIN
DAY$TYPE[0] = "PDCT";
DAY$TNAME[0] = PTA$TN[PT];
MESSAGE(DAYMSG,0); # MSG TO SYSTEM AND USR DAYFILE #
NUMPAS = 0;
END
END
GOTO DTYPSWT[DTYP];
LLINT: # INTERACTIVE DEVICE TYPE #
#
* CONSOLE OR USER DEVICE TYPE. SAVE VALIDATION DATA IN *VRQ*.
* IF SYNCHRONOUS DEVICE, ALSO SAVE VALIDATION DATA IN IT'S
* CORRESPONDING PDCT ENTRY AND CALL *NVFTDSP* TO SWITCH IT'S
* PASSIVE DEVICES.
#
VCB$CACA[0] = PTA$CACA[PT];
VCB$ALIFAM[0] = PTA$ALIFAM[PT];
VCB$FAMIND[0] = PTA$FAMIND[PT];
VCB$ALIUSR[0] = PTA$ALIUSR[PT];
VCB$USRIND[0] = PTA$USRIND[PT];
VCB$ALIAPP[0] = PTA$ALIAPP[PT];
VCB$APPIND[0] = PTA$APPIND[PT];
VCB$VDSF[0] = PTA$VDSF[PT];
VCB$PRIAN[0] = PTA$PRIAN[PT];
VCB$RCNA[0] = PTA$RCNA[PT];
VCB$LCF[0] = PTA$LCF[PT];
IF PTA$TC[PT] GQ TC9$ AND
FIND
THEN # SYNCHRONOUS INTERACTIVE DEVCE #
BEGIN
PDT$CAPP[PD+1] = PTA$SWTAPP[PT];
PDT$CSTAT[PD+1] = PDCTST"CONSWT";
PDT$FWORD[PD+2] = PTA$FWORD[PT];
PDT$UWORD[PD+3] = PTA$UWORD[PT];
PDT$AHMT[PD+4] = PTA$AHMT[PT];
PDT$AHDS[PD+5] = PTA$AHDS[PT];
PDT$AAWC[PD+6] = PTA$AAWC[PT];
PDT$ATWD[PD+7] = PTA$ATWD[PT];
PDT$AAVW[PD+8] = PTA$AAVW[PT];
FOR I = 0 STEP 1 UNTIL (NUMPAS - 1)
DO
BEGIN # GET PASSIVE DEVICE'S PTAC #
FIND = FALSE;
FOR J = 0 STEP 1 WHILE (NOT FIND AND J LS NENTRY)
DO
BEGIN
IF (PTA$TN[J] EQ PDT$PN[PIDX+I]) AND
(PTA$OCN[J] EQ PDT$CN[PD])
THEN # FOUND CORRESPONDING PTAC NTRY #
BEGIN
NVFTDSP(J,PD); # DETERMINE SWITCH POSSIBILITY #
FIND = TRUE; # EXIT LOOP #
END
END
$BEGIN
IF NOT FIND
THEN # NO CORRESPONDING PTAC ENTRY #
BEGIN
DAY$TYPE[0] = "PTAC";
DAY$TNAME[0] = PDT$PN[PIDX+I];
MESSAGE(DAYMSG,0); # MSG TO SYSTEM AND USR DAYFILE #
END
$END
END
END
GOTO ENDDTYP;
LLPASV: # PASSIVE DEVICE TYPE #
#
* PASSIVE DEVICE TYPE. DELETE ENTRY FROM PDCT.
#
FIND = FALSE;
FOR I = 0 STEP 1 WHILE (NOT FIND AND I LS NUMPAS)
DO
BEGIN
IF PDT$PN[PIDX+I] EQ PTA$TN[PT]
THEN # FOUND CORRSPNDING PASSIVE DEV #
BEGIN
SSTRTS(P<PDCT>,PIDX+I,1); # DELETE PASSIVE DEVICE ENTRY #
PDT$WC[PD] = PDT$WC[PD] - 1; # UPDATE PDCT WORD COUNT #
FIND = TRUE; # EXIT LOOP #
END
END
GOTO ENDDTYP;
ENDDTYP: # COMMON END PROCESSING #
#
* COMPLETE BUILDING *VRQ* DATA, ISSUE *ABAP* ACCOUNT DAYFILE
* MESSAGE AND CALL *SSTRTS* TO DELETE THIS DEVICE'S PTAC ENTRY.
#
VCB$TN[0] = PTA$TN[PT];
VCB$HW[0] = PTA$HW[PT];
VCB$VTP[0] = PTA$VTP[PT];
VCB$ICF[0] = PTA$ICF[PT];
VCB$ALIF[0] = PTA$ALIF[PT];
VCB$VCB[0] = PTA$VCB[PT];
VCB$CNTIME[0] = PTA$CNTIME[PT];
VCB$SWTIME[0] = PTA$SWTIME[PT];
VCB$FWORD[0] = PTA$FWORD[PT];
VCB$UWORD[0] = PTA$UWORD[PT];
VCB$DT[0] = PTA$DT[PT];
VCB$TC[0] = PTA$TC[PT];
VCB$AACN[0] = CRAACN[0];
VCB$SWAPAN[0] = PTA$SWTAN[PT];
VCB$NET[0] = PTA$NET[PT];
VCB$UBZ[0] = PTA$UBZ[PT];
VCB$XBZ[0] = PTA$XBZ[PT];
VCB$DBZ[0] = PTA$DBZ[PT];
VCB$SDT[0] = PTA$SDT[PT];
VCB$DO[0] = PTA$DO[PT];
VCB$SL[0] = PTA$SL[PT];
ADDR = PTA$VCB[PT];
LNGTH = VCBSIZ$ * 10; # NUMBER OF CHARACTERS #
NVFUMQE(P<VRQ>,VCBBUF[0],0,ADDR,LNGTH); # WRITE REQUST TO Q #
NVFTIAM(PT,ABAP$); # ISSUE *ABAP* ACCOUNT MESSAGE #
PT = PT * PTACSIZ$;
SSTRTS(P<PTAC>,PT,PTACSIZ$); # DELETE PTAC ENTRY #
MATCH = TRUE;
END
END
END # END NVFTACC #
TERM