*DECK NVFCAUT
USETEXT TEXTSS
USETEXT TEXTNVF
USETEXT TXINNVF
USETEXT TXTANVF
USETEXT TXTAPSS
PROC NVFCAUT;
# TITLE NVFCAUT - ACCEPT USER TEXT. #
BEGIN # NVFCAUT #
#
** NVFCAUT - ACCEPT USER TEXT.
*
* S. H. FISCHER. 81/12/04.
*
* THIS PROCEDURE HANDLES INBOUND DATA (SYNCHRONOUS) BLOCKS FROM THE
* NETWORK. ITS FUNCTION IS TO FORWARD THE TYPEIN TO THE I-LAYER
* (FOR LOGIN PROCESSING) OR DISCARD IT, AS APPROPRIATE.
*
* PROC NVFCAUT
*
* ENTRY WCBUF[0] = WORD COUNT WORD FROM ORIGINAL CONNECTION
* TRAFFIC QUEUE (*CTQ*) ENTRY.
* ABHBUF[0] = APPLICATION BLOCK (EVENT) HEADER FOR THE DATA
* (BASED ARRAY *ABH* IN *TXTAPSS* POINTS HERE).
* MSGBUF[0] = DISPLAY CODED TEXT LINE (BASED ARRAY *APSM*
* IN *TXTAPSS* POINTS HERE).
*
* EXIT ONE OR MORE OF THE FOLLOWING ACCORDING TO THE BLOCK TYPE
* OF THE INPUT DATA AND THE STATE OF THE ACN LIST ENTRY FOR
* THE USER IN QUESTION.
* - AN ENTRY FOR THE TYPEIN HAS BEEN PLACED IN THE TERMINAL-
* TO-APPLICATION CONNECTION INPUT QUEUE (*TAINPQ*).
* - THE TYPEIN HAS BEEN DISCARDED.
* - A TERMINAL TEXT ENTRY CONTAINING THE MESSAGE
* *INPUT IGNORED* HAS BEEN PLACED IN THE CONNECTION
* TRAFFIC QUEUE (*CTQ*).
* - A TERMINAL TEXT ENTRY FOR A ZERO LENGTH *MSG* TYPE
* NETWORK BLOCK HAS BEEN PLACED IN THE *CTQ* (TO TURN
* AROUND THE HALF DUPLEX OPERATION).
* - THE STATE OF THE ACN LIST ENTRY HAS BEEN UPDATED.
* - IF THIS IS A BLK BLOCKS, CHECK TO IF WE HAVE RECEIVED
* UP TO 20 BLK BLOCKS. IF WE HAVE, TERMINATE THE
* CONNECTION BECAUSE SOMETHING HAS GONE WRONG AT THE
* TERMINAL TO CAUSE IT TO SEND THAT MANY BLK BLOCKS
* UPLINE.
*
* NOTES 1. NVF ONLY PROCESSES *MSG* TYPE NETWORK BLOCKS, THE
* CTRL/TCD SYNCHRONOUS SM AND NULL BLOCKS. ANY
* OTHER TYPE OF SYNCHRONOUS INBOUND DATA (*BLK* BLOCKS
* AND TRANSPARENT MODE INPUT) IS IGNORED AND THE MESSAGE
* *INPUT IGNORED* IS SENT TO THE TERMINAL.
* 2. NVF DISCARDS ALL SYNCHRONOUS INBOUND BLOCKS THAT WERE
* TYPED AHEAD OF A USER BREAK.
* 3. THE PROCESSING IS DEFINED BY THE NVF/USER C-LAYER
* STATE DIAGRAM.
#
#
**** PROC NVFCAUT - XREF LIST.
#
XREF
BEGIN
PROC ABORT; # ABORT PROGRAM #
PROC MESSAGE; # SEND MESSAGE TO DAYFILE #
PROC MOVE; # MOVE CM WORDS #
PROC NVFCFCE; # FIND CONNECTION ENTRY #
PROC SSSAWR; # ACCEPT WORKLIST REQUEST #
PROC SSTAQE; # ACCEPT QUEUE ENTRY #
PROC SSTATS; # ALLOCATE TABLE SPACE #
PROC SSTRTS; # REMOVE TABLE SPACE #
PROC NVFTETC; # END TERMINAL CONNECTION #
END
#
****
#
ITEM ACNN I; # ACN TO SEARCH FOR #
ITEM AE I; # ORD OF MATCHED (OR NEW) LIST ENTRY #
ITEM NEWACN B; # TRUE IF ACN NOT FOUND IN ACN LIST #
ITEM RORD I; # INBOUND WAITING BLOCK QUEUE ORDINAL #
ITEM TAINDX I; # INDEX INTO THE T-A INPUT QUEUE #
ITEM PT I; # INDEX TO THE PTAC TABLE #
ITEM NENTRY I; # NUMBER OF ENTRIES IN PTAC TABLE #
ARRAY BLKIGH[00:00] S(1);
BEGIN
ITEM BLKH$ABT U(00,00,06) = [APPTTX$];
ITEM BLKH$ADR U(00,06,12);
ITEM BLKH$ACT U(00,36,04) = [CT6DISPLAY];
ITEM BLKH$TLC U(00,48,12) = [20];
END
ARRAY BLKIGM[00:00] S(2);
BEGIN
ITEM BLKM C(00,00,14) = [".INPUT IGNORED"];
END
ACNN = ABHADR[0];
NVFCFCE( ACNN, AE, NEWACN ); # LOCATE ACN LIST ENTRY #
IF NEWACN
THEN
BEGIN
$BEGIN
MESSAGE( " ACN LOST NVFCAUT", 0 );
ABORT;
$END
RETURN; # DISCARD INBOUND DATA BLOCK #
END
#
* PROCESS INPUT ACCORDING TO BLOCK TYPE MSG, BLK AND NULL INBOUND
* DATA BLOCKS PLUS SYNCHRONOUS SUPERVISORY MESSAGES INBOUND.
#
#
* MSG BLOCKS ARE TEXT INPUT FROM THE USER AT THE TERMINAL.
* THE MSG BLOCK IS PASSED TO THE PROGRAM IF THE CONNECTION IS IN
* THE ACTIVE OR BRKOUT STATE AND THE MSG BLOCK HAS NOT BEEN
* CANCELED BY THE USER. IF THE BLOCK HAS BEEN CANCELLED THEN A
* EMPTY MSG BLOCK IS OUTPUT TO ALLOW THE NEXT BLOCK TO BE DELIVERED.
#
IF ABHABT[0] EQ APMSG
THEN
BEGIN
IF ACN$STATE[AE] EQ ACNST"ACTIVE"
OR ACN$STATE[AE] EQ ACNST"CLEARI"
THEN
BEGIN
IF ACN$STATE[AE] EQ ACNST"CLEARI"
OR ABHCAN[0] NQ 0
THEN # MUST TURN AROUND HALF DUPLEX #
BEGIN
WCB$WORD[1] = LLST + 2; # SEND LST/ON TO GET NEXT MSG BK#
ABHWORD[1] = LLST;
ABHABT[1] = APPCMD;
ABHACT[1] = ACLST;
SPMSG0[1] = 0;
PFCSFC[1] = LSTON;
LSTACN[1] = ACNN;
SSTAQE( P<OTQ>,WCBUF[1],ABHBUF[1],APSM[1]); # PASS OUTBOUND#
IF ACN$BLKF[AE]
THEN
BEGIN
ACN$BLKF[AE] = FALSE;
FOR RORD=0 STEP IWQ$WC[RORD] WHILE IWQ$ACN[RORD+1] NQ ACNN
DO
BEGIN
END
SSTRTS(P<IWBQ>,RORD,IWQ$WC[RORD]);
END
END
ELSE
BEGIN
IF ACN$BLKF[AE]
THEN
BEGIN
ACN$BLKF[AE] = FALSE;
FOR RORD=0 STEP IWQ$WC[RORD] WHILE ACNN NQ IWQ$ACN[RORD+1]
DO
BEGIN
END
TAINDX = TAQLNGTH;
SSTATS(P<TAINPQ>,IWQ$WC[RORD]);
MOVE(IWQ$WC[RORD],IWBQ[RORD],TAINPQ[TAINDX]);
SSTRTS(P<IWBQ>,RORD,IWQ$WC[RORD]);
SSSAWR(WWDF"NTDQE");
END
ELSE
BEGIN
SSTAQE( P<TAINPQ>, WCBUF, ABHBUF, MSGBUF );
END
END
END
ELSE IF ACN$STATE[AE] EQ ACNST"BRKOUT"
THEN
BEGIN
IF ACN$BKCNT[AE] EQ 0
AND ABHCAN[0] EQ 0
THEN
BEGIN
SSTAQE( P<TAINPQ>, WCBUF, ABHBUF, MSGBUF );
ACN$STATE[AE] = ACNST"BRKCMD";
END
END
END
#
* COUNT THE NUMBER OF UPLINE BLK BLOCKS. IF THE NUMBER REACH
* 20, TERMINATE THE CONNECTION BECAUSE SOMETHING MUST HAVE
* GONE WRONG AT THE TERMINAL TO CAUSE THAT MANY BLK BLOCKS
* COME UPLINE.
* ONLY THE FIRST BLK BLOCK IS QUEUE. THE REST IS DISCARDED.
#
ELSE IF ABHABT[0] EQ APPBLK
THEN
BEGIN
ACN$BLKCNT[AE] = ACN$BLKCNT[AE] + 1; # INCRMT BLK COUNT#
IF ACN$BLKCNT[AE] GQ 20
THEN
BEGIN
NENTRY = PTALNGTH / PTACSIZ$; # CALCULATE NUMBER OF ENTRIES#
FOR PT = 0 STEP 1 WHILE ( PT LS NENTRY) AND
(PTA$ACN[PT] NQ ACNN)
DO
BEGIN
END
IF PT LS NENTRY # ENTRY FOUND, TERMINATE CONNECTION #
THEN
BEGIN
NVFTETC (PT);
RETURN;
END
END
IF ACN$STATE[AE] EQ ACNST"ACTIVE"
THEN
BEGIN
IF NOT ACN$BLKF[AE]
THEN
BEGIN
ACN$BLKF[AE] = TRUE;
SSTAQE(P<IWBQ>,WCBUF,ABHBUF,MSGBUF);
END
END
END
#
* NULL BLOCKS SERVE TWO PURPOSES, MARKING THE POINT IN THE INPUT
* STREAM WHERE A USER BREAK OCCURED SO TEXT CAN BE DISCARDED UP TO
* THAT POINT AND INDICATING TO NVF THAT DISCARDED UPLINE ASCII
* TEXT DESTINED TO A FAILED APPLICATION THAT CANNOT BE DELIVERED
* TO NVF. NVF ALERTS THE USER TO THE IGNORED TEXT ONLY IN THE
* ACTIVE STATE.
#
ELSE IF ABHABT[0] EQ APPNULL
THEN
BEGIN
IF ABHXPT[0] EQ 1
THEN
BEGIN
IF ACN$STATE[AE] EQ ACNST"ACTIVE"
THEN
BEGIN
WCB$WORD[0] = 4;
BLKH$ADR[0] = ACNN;
SSTAQE( P<CTQ>, WCBUF, BLKIGH, BLKIGM ); # PASS TO OUTBOUND#
END
END
END
END # NVFCAUT #
TERM