*DECK NVFCCPA
USETEXT TEXTSS
USETEXT TXCMDNV
USETEXT TXSMNVF
USETEXT TXTAPSS
USETEXT TXTSUSS
USETEXT TXTANVF
USETEXT TEXTNVF
PROC NVFCCPA;
# TITLE NVFCCPA - COMPLETE PROTOCOL ACTION. #
BEGIN # NCFCCPA #
#
** NVFCCPA - COMPLETE PROTOCOL ACTION.
*
* S. H. FISCHER. 81/12/03.
* D. G. DEPEW. 81/12/21.
* C. B. BRION 82/06/02, 84/01/09.
*
* THIS PROCEDURE PERFORMS ALL THE CONNECTION(C) LAYER PROCESSING
* REQUIRED FOR ALL HOP AND CONNECTION/USER RELATED ASYNCHRONOUS
* SUPERVISORY MESSAGES THAT EMANATE FROM THE INNER(I) LAYER
* (TERMED PROTOCOL RESPONSES).
*
* PROC NVFCCPA
*
* ENTRY WCBUF[0] = WORD COUNT WORD FROM ORIGINAL CONNECTION
* TRAFFIC QUEUE (*CTQ*) ENTRY.
* ABHBUF[0] = APPLICATION BLOCK HEADER FOR THE SM (BASED
* ARRAY *ABH* IN *TXTAPSS* POINTS HERE).
* MSGBUF[0] = BODY OF THE SM (BASED ARRAY *APSM* IN
* *TXTAPSS* POINTS HERE). THE POSSIBLE PFC/SFC
* VALUES ARE: HOP/START/N, HOP/END/N, FC/RST,
* CR/ITE/N, CR/ITE/A, CR/IAP/N, CR/IAP/A,
* CR/RAP/N, CR/RAP/A, CR/RCN/N, CR/SWH/R, AND
* CR/TRM/R.
*
* EXIT ANY OF THE FOLLOWING IN VARIOUS COMBINATIONS ACCORDING TO
* THE SM (PROTOCOL RESPONSE) RECEIVED AND THE STATE OF THE
* ACN LIST ENTRY FOR THE HOP OR USER IN QUESTION:
* - THE STATE OF THE ACN LIST ENTRY HAS BEEN UPDATED.
* - AN ENTRY FOR THE SM HAS BEEN PLACED IN THE OUTGOING
* TRAFFIC QUEUE (*OTQ*).
* - IF THE PROTOCOL RESPONSE IS A CR/SWH/R OR A CR/TRM/R,
* AND THE CONNECTION HAS NOT YET BEEN INITIALIZED (NO
* FC/INIT RECEIVED) OR UNACKNOWLEDGED SYNCHRONOUS BLOCKS
* ARE EXTANT FOR THE CONNECTION, AN ENTRY FOR THE SM HAS
* BEEN MADE IN THE WAITING BLOCK QUEUE (*WBQ*). (THE SM
* WILL BE ISSUED WHEN THE CONNECTION HAS BEEN INITIALIZED
* AND ALL BLOCKS ARE ACKNOWLEDGED.)
* - A HOP/START SM (ESSENTIALLY) HAS BEEN PLACED IN THE
* PROTOCOL EVENT QUEUE (*PEQ*).
*
* NOTES 1. THERE ARE NO REAL HOP/START/N AND HOP/END/N SMS.
* THESE ARE STRICTLY NVF INTERNAL CODES THAT INDICATE
* THAT THE I-LAYER HAS COMPLETED ITS PROCESSING OF THE
* CORRESPONDING INBOUND SUPERVISORY MESSAGES.
* 2. THE PROCESSING IS DEFINED BY THE NVF/HOP AND NVF/USER
* C-LAYER STATE DIAGRAMS.
#
#
**** PROC NVFCCPA - XREF LIST.
#
XREF
BEGIN
PROC ABORT; # ABORT PROGRAM #
PROC MESSAGE; # SEND MESSAGE TO DAYFILE #
PROC NVFCFCE; # FIND CONNECTION ENTRY #
PROC NVFCTRM; # PROCESS CR/TRM SUPERVISORY MESSAGE #
PROC SSTAQE; # ACCEPT QUEUE ENTRY #
PROC SSTRTS; # REMOVE TABLE SPACE #
END
#
****
#
ITEM NEWACN B; # TRUE IF ACN NOT FOUND IN ACN LIST #
ITEM NORMTRM B; # SET TRUE, SINCE CR/TRM IS FROM C-LAYER #
ITEM AE I; # ORD OF MATCHER (OR NEW) ACN LIST ENTRY #
ITEM ACNN I; # ACN FROM ENTRY WE ARE LOOKING FOR #
ITEM SMID I; # INTERNAL SM IDENTIFIER #
#
* NOACN - NO ACN ENTRY WAS FOUND.
#
ARRAY NOACN [00:00] S(4);
BEGIN
ITEM NO$MSG C(00,00,31) =
[" NVFCCPA - ACN ENTRY NOT FOUND."];
ITEM NO$ZERO U(03,06,54) = [0];
END
#
* FOLLOWING STATUS LIST ORDER AND NUMBER OF ENTRIES MUST MATCH
* ORDER OF ARRAY PRPFCSFC IN NVFUMQE.
*
#
STATUS CTQSTAT1
SITEA, # CR/ITE/A #
SITEN, # CR/ITE/N #
SIAPN, # CR/IAP/A #
SIAPA, # CR/IAP/N #
SRAPN, # CR/RAP/A #
SRAPA, # CR/RAP/N #
SRCNN, # CR/RCN/N #
SRCNA, # CR/RCN/A #
SSWH, # CR/SWH/R #
STRM, # CR/TRM/R #
SRST, # FC/RST #
HPSTN, # HOP/START/N P.R. #
HPENN, # HOP/END/N P.R. #
;
SWITCH CPSWT:CTQSTAT1
LLCRITEA: SITEA, # CR/ITE/A #
LLCRITEN: SITEN, # CR/ITE/N #
LLCRIAPA: SIAPA, # CR/IAP/A #
LLCRIAPN: SIAPN, # CR/IAP/N #
LLCRRAPA: SRAPA, # CR/RAP/A #
LLCRRAPN: SRAPN, # CR/RAP/N #
LLCRSWH: SSWH, # CR/SWH #
LLFCRST: SRST, # FC/RST #
LLFCRTRM: STRM, # CR/TRM/R #
LLCRRCNN: SRCNN, # CR/RCN/N #
LLCRRCNA: SRCNA, # CR/RCN/A #
LLHPSRTN: HPSTN, # HOP/START/N P.R. #
LLHPENDN: HPENN; # HOP/END/N P.R. #
ABHABT[0] = APPCMD;
ACNN = CRACN[0];
IF ACNN NQ 0
THEN # SEARCH ONLY IF TERMINAL USER (NOT HOP) #
BEGIN
NVFCFCE (ACNN, AE, NEWACN);
IF NEWACN # ABORT IF THE ACN ENTRY CANNOT BE FOUND #
THEN
BEGIN
MESSAGE(NOACN[0],0);
ABORT;
END
END
SMID = WCB$SMID[0]; # GET INTERNAL SM IDENTIFIER #
GOTO CPSWT[SMID];
LLCRITEN:
LLCRIAPN:
LLCRRAPN:
ACN$STATE[AE] = ACNST"ACTIVE";
SSTAQE( P<OTQ>, WCBUF, ABHBUF, MSGBUF );
GOTO ENDTAS;
LLCRITEA:
LLCRIAPA:
LLCRRAPA:
LLCRRCNA:
#
* PROCESS THESE ABNORMAL RESPONSES ONLY IF A CR/TRM/R HAS NOT
* YET BEEN SENT OUT FOR THE CONNECTION.
#
IF ACN$STATE[AE] NQ ACNST"ENDED"
THEN
BEGIN
SSTRTS( P<ACN>, AE*ACNLSIZ$, ACNLSIZ$ );
SSTAQE( P<OTQ>, WCBUF, ABHBUF, MSGBUF );
END
GOTO ENDTAS;
LLFCRTRM:
#
* CALL NVFCTRM TO PERFORM ALL CR/TRM PROCESSING. PASS A PARAMETER
* OF "TRUE" TO INDICATE THAT THIS CR/TRM IS COMING FROM THE C-LAYER
* INSTEAD OF FROM THE INNER LAYER. THE RETURN PARAMETER (NEWACN) IS
* JUST A DUMMY PARAMETER AS IT IS OF NO INTEREST TO THE C-LAYER.
#
NORMTRM = TRUE;
NVFCTRM(NORMTRM, NEWACN);
GOTO ENDTAS;
LLCRSWH:
IF ACN$STATE[AE] EQ ACNST"ACTIVE"
OR ACN$STATE[AE] EQ ACNST"CLEARI"
OR ACN$STATE[AE] EQ ACNST"BRKCMD"
THEN
BEGIN
IF ACN$INIT[AE] AND ACN$BLCNT[AE] EQ 0
THEN
BEGIN
SSTAQE( P<OTQ>, WCBUF, ABHBUF, MSGBUF );
ACN$STATE[AE] = ACNST"SWSTART";
END
ELSE
BEGIN
SSTAQE( P<WBQ>, WCBUF, ABHBUF, MSGBUF );
ACN$STATE[AE] = ACNST"SWTPEND";
END
END
ELSE IF ACN$STATE[AE] EQ ACNST"BRKOUT"
THEN
BEGIN
SSTAQE( P<OTQ>, WCBUF, ABHBUF, MSGBUF );
ACN$STATE[AE] = ACNST"SWSTART";
END
GOTO ENDTAS;
LLCRRCNN:
ACN$STATE[AE] = ACNST"ACTIVE";
SSTAQE( P<OTQ>, WCBUF, ABHBUF, MSGBUF );
GOTO ENDTAS;
LLFCRST:
IF ACN$STATE[AE] EQ ACNST"BRKOUT" OR
ACN$STATE[AE] EQ ACNST"BRKCMD"
THEN
BEGIN
# SEND RO/MARK SM TO RESUME OUTPUT #
WCB$WORD[1] = 3;
ABHWORD[1] = LROMARK;
ABHABT[1] = APPCMD;
ABHADR[1] = ACNN;
ABHACT[1] = CT8ASCII;
SPMSG0[1] = 0;
PFCSFC[1] = ROMARK;
IF ACN$BLCNT[AE] LS ACN$ABL[AE]
THEN
BEGIN
ABHABN[1] = ACN$ABN[AE];
ACN$ABN[AE] = ACN$ABN[AE] + 1;
ACN$BLCNT[AE] = ACN$BLCNT[AE] + 1;
SSTAQE(P<OTQ>, WCBUF[1], ABH[1], APSM[1]);
END
ELSE # MUST ENQUEUE THE SM #
BEGIN
SSTAQE(P<WBQ>, WCBUF[1], ABH[1], APSM[1]);
ACN$WBCNT[AE] = ACN$WBCNT[AE] + 1;
END
IF ACN$STATE[AE] EQ ACNST"BRKOUT"
THEN
BEGIN
IF ACN$BKCNT[AE] EQ 0
THEN
BEGIN
ACN$STATE[AE] = ACNST"ACTIVE";
WCB$WORD[1] = LINTR + 2;
ABHWORD[1] = LINTR;
ABHABT[1] = APPCMD;
ABHACT[1] = CT60TRANS;
SPMSG0[1] = 0;
PFCSFC[1] = INTRRSP;
INTRACN[1] = ACNN;
SSTAQE( P<OTQ>, WCBUF[1], ABH[1], APSM[1] );
END
ELSE
BEGIN
ACN$STATE[AE] = ACNST"CLEARI";
END
END
ELSE IF ACN$STATE[AE] EQ ACNST"BRKCMD"
THEN
BEGIN
WCB$WORD[1] = LINTR + 2;
ABHWORD[1] = LINTR;
ABHABT[1] = APPCMD;
ABHACT[1] = CT60TRANS;
SPMSG0[1] = 0;
PFCSFC[1] = INTRRSP;
INTRACN[1] = ACNN;
SSTAQE(P<OTQ>, WCBUF[1], ABH[1], APSM[1]);
END
END
GOTO ENDTAS;
LLHPSRTN:
#
* SIMPLY UPDATE THE STATE OF THE HOP PSEUDO ACN IN ACCORDANCE
* WITH ITS EXISTING STATE.
#
IF ACN$HOPST[HOPORD$] EQ S"CREATE"
THEN # MOST USUAL CIRCUMSTANCE #
ACN$HOPST[HOPORD$] = S"COMMAND"; # HISTORY BUFFER TO FOLLOW #
ELSE IF ACN$HOPST[HOPORD$] EQ S"STARTEND"
THEN
ACN$HOPST[HOPORD$] = S"ENDED"; # WILL END AFTER HIST BUFF #
ELSE # MUST BE HOP/BRK AFT HOP/START #
ACN$HOPST[HOPORD$] = S"BREAK"; # WILL DISCARD HIST BUFFER #
GOTO ENDTAS;
LLHPENDN:
#
* THE HOP/END/N PROTOCOL RESPONSE ALWAYS RESULTS FROM A HOP/END SM
* HAVING BEEN PROCESSED. THERE IS NO DEFINED RESPONSE TO A HOP/END
* SM. THE HOP/END/N PROTOCOL RESPONSE IS AN NVF INTERNAL SIGNAL
* FROM THE I-LAYER TO THE C-LAYER INDICATING ALL CLEANUP FOR THE
* HOP IS COMPLETE. IF A SUBSEQUENT HOP/START SM HAS ALREADY BEEN
* ENCOUNTERED, IT CAN NOW BE SENT TO THE I-LAYER (AS A PROTOCOL
* EVENT). UPDATE THE STATE OF THE HOP PSEUDO ACN.
#
IF ACN$HOPST[HOPORD$] EQ S"ENDED"
THEN # MOST USUAL CIRCUMSTANCE #
ACN$HOPST[HOPORD$] = S"INACT";
ELSE # MUST SND HOP/START TO I-LAYER #
BEGIN
WCB$WORD[0] = 3; # MIN QUEUE ENTRY SIZE #
WCB$SMID[0] = HPESTAT"HOPSRT";
HOPLPL[0] = LEFTPL; # SET RIGHT AND LEFT PAGE #
HOPRPL[0] = RIGHTPL; # SIZE FOR K-DISPLAY #
SSTAQE (P<PEQ>, WCBUF[0], ABH[0], APSM[0]); # TO I-LAYER #
IF ACN$HOPST[HOPORD$] EQ S"RESTART"
THEN
ACN$HOPST[HOPORD$] = S"CREATE";
ELSE
ACN$HOPST[HOPORD$] = S"STARTBRK";
END
ENDTAS:
END # NVFCCPA #
TERM