*DECK QTGET
USETEXT AIPDEF
USETEXT QTRMBUF
USETEXT QTRMNIT
PROC QTGET(WSA);
*IF,DEF,IMS
#
*1DC QTGET
*
* 1. PROC NAME AUTHOR DATE
* QTGET D. P. OCONNELL 78/12/12
*
* 2. FUNCTION DESCRIPTION
* GET DATA MESSAGE FROM NETWORK AND PLACE IN
* USERS MESSAGE BUFFER UNLESS A CONDITION ARISES
* THAT THE USER SHOULD BE INFORMED OF. IN ANY
* CASE INFORM THE USER OF WHAT WAS ACCOMPLISHED
* BY PROVIDING A RETURN CODE.
*
* 3. METHOD USED
* IF NETON NOT SUCCESSFUL YET,
* CALL NP$ERR TO ISSUE DAYFILE MSG AND ABORT APP.
* ELSE (NETON COMPLETED),
* CALCULATE SIZE OF APPLICATION BUFFER.
* LOOP UNTIL NECESSARY TO SEND RETURN CODE TO APP.
* IF CONNECTION POLLING IS IN EFFECT AND CONNECTION NUMBER
* IS NONZERO,
* SET NULL BLOCK IN APP BLOCK HEADER WORD.
* ELSE (NEED TO GET ASYNCH SUPERVISORY MESSAGES IF ANY),
* CALL NETGET WITH ACN = 0 TO PICK UP ASYNC SUP MSGS.
* IF VALID BLOCK TYPE IN APP BLOCK HEADER WORD,
* IF RECEIVED ASYNCHRONOUS SUP MSG,
* LOOP CHECKING FOR PFC RECOGNIZED BY QTRM.
* IF RECOGNIZED PFC,
* JUMP ACCORDING TO TYPE OF PFC:
*
* CON: IF CON/REQ SUP MSG,
* IF DEVICE TYPE FOR NEW CONNECTION SUPPORTED,
* SET UP NIT CONNECTION ENTRY.
* IF APP WANTS TO BE INFORMED ABOUT CON/REQ,
* SET FLAG TO STOP LOOPING AND INFORM APP.
* IF DATA FROM PREVIOUS APP WHICH HAD CON,
* COPY DATA TO APPLICATION BUFFER.
* ELSE (APP DOES NOT SUPPORT THIS DEVICE TYPE),
* REJECT CONNECTION.
* ELSE (NOT CON/REQ SUP MSG),
* IF CON/CB SUP MSG,
* IF OKAY TO SEND CON/END SUP MSG,
* CALL QTENDT TO TERMINATE CONNECTION.
* IF APP KNOWS ABOUT CONNECTION,
* SET FLAG TO STOP LOOPING AND INFORM AP.
* ELSE (APP NO LONGER HAS CONNECTION),
* IF NOT TERMINATED CONNECTION,
* SET FLAG TO STOP LOOPING AND INFORM AP.
* ELSE (NOT CON/CB OR CON/REQ SUP MSG),
* IF CON/ACRQ/A SUP MSG,
* SET FLAG TO STOP LOOPING AND INFORM APP.
* ELSE (MUST BE CON/END/N SUP MSG),
* INIT NIT CONNECTION ENTRY.
*
* ERR: SET FLAG TO STOP LOOPING AND INFORM APP.
*
* FC: JUMP ACCORDING TO TYPE OF SFC:
*
* ACK: UPDATE NIT CONNECTION ENTRY.
* IF RO/MARK NEEDS TO BE SENT DOWNLINE,
* BUILD RO/MARK SYNC SUP MSG.
* CALL QTTIP TO SEND RO/MARK SUP MSG.
* ELSE (DO NOT NEED TO SEND RO/MARK),
* IF TO/MARK NEEDS TO BE SENT DOWNLINE,
* BUILD TO/MARK SYNC SUP MSG.
* CALL QTTIP TO SEND TO/MARK SUP MSG.
*
* BRK: IF CONNECTION HAS NOT BEEN TERMINATED,
* UPDATE NIT CONNECTION ENTRY.
* BUILD FC/RST SUP MSG.
* CALL NETPUT TO SEND FC/RST SUP MSG TO NAM.
* SET FLAG TO STOP LOOPING AND INFORM APP.
*
* INACT: IF APPLICATION STILL HAS CONNECTION,
* IF APPLICATION KNOWS ABOUT CONNECTION,
* IF APPLICATION WANTS TO BE INFORMED,
* SET FLAG TO STOP LOOPING AND INFORM AP.
* ELSE (APP DOES NOT KNOW ABOUT CONNECTION),
* CALL QTENDT TO TERMINATE CONNECTION.
*
* INIT: IF WAITING FOR FC/INIT/R SUP MSG,
* BUILD FC/INIT/N FROM FC/INIT/R.
* CALL NETPUT TO SEND FC/INIT/N TO NAM.
* UPDATE NIT CONNECTION ENTRY.
* IF PRU/ON PROCESSING,
* BUILD PRU/ON/R SUP MSG.
* CALL NETPUT TO SEND PRU/ON/R TO NAM.
* ELSE (NO PRU/ON SUP MSG PROCESSING),
* SET FLAG TO STOP LOOPING AND INFORM APP.
*
* NAK: IF CONNECTION HAS NOT BEEN TERMINATED,
* CALL QTENDT TO TERMINATE CONNECTION.
* SET FLAG TO STOP LOOPING AND INFORM APP.
*
* RST: IF EXPECTING FC/RST SUP MSG,
* UPDATE NIT CONNECTION ENTRY.
* SET FLAG TO STOP LOOPING AND INFORM APP.
*
* SHUT: IF FORCED SHUTDOWN,
* CALL NETOFF TO TERMINATE LINK TO NAM.
* SET FLAG TO STOP LOOPING AND INFORM APP.
*
* TCH: UPDATE NIT CONNECTION ENTRY.
*
* INTR: IF INTR/RSP SUP MSG,
* SET FLAG TO STOP LOOPING AND INFORM APP.
* ELSE (MUST BE INTR/USR RECEIVED),
* IF CONNECTION HAS NOT BEEN TERMINATED,
* IF USER BREAK FROM TERMINAL,
* SET FLAG TO STOP LOOPING AND INFORM APP.
* UPDATE NIT CONNECTION ENTRY.
* IF QTRM NEEDS TO SEND RO/MARK SUP MSG,
* BUILD RO/MARK SYNC SUP MSG.
* CALL QTTIP TO SEND RO/MARK SUP MSG.
* ELSE (NOT USER BREAK FROM TERMINAL),
* UPDATE NIT CONNECTION ENTRY.
* BUILD INTR/RSP SUP MSG.
* CALL NETPUT TO SEND SUP MSG TO NAM.
*
* HOP: SET FLAG TO STOP LOOPING.
* JUMP ACCORDING TO TYPE OF SFC:
*
* BRK: IF APPLICATION SUPPORTS K-DISPLAY,
* SET RETURN CODE TO INFORM APP.
* ELSE (APP DOES NOT SUPPORT K-DISPLAY,
* CLEAR FLAG TO CONTINUE LOOPING.
*
* CMD: IF APPLICATION SUPPORTS K-DISPLAY,
* SET RETURN CODE TO INFORM APP.
* UPDATE NIT.
* COPY OPERATOR TYPEIN TO APP BUFFER.
* ELSE (APP DOES NOT SUPPORT K-DISPLAY,
* CLEAR FLAG TO CONTINUE LOOPING.
*
* TRCE: CALL NETDBG TO TURN ON AIP TRACING.
* CLEAR FLAG TO CONTINUE LOOPING.
*
* DU: SET RETURN CODE TO INFORM APP.
*
* IG: SET INTERNAL FLAG TO NOT SEND HOP/ALT.
* CLEAR FLAG TO CONTINUE LOOPING.
*
* STRT: CLEAR INTERNAL FLAG TO NOT SEND HOP/ALT.
* IF APPLICATION SUPPORTS K-DISPLAY,
* SET RETURN CODE TO INFORM APP.
* COPY SCREEN SIZES TO APP BUFFER.
* ELSE (APP DOES NOT SUPPORT K-DISPLAY),
* CLEAR FLAG TO CONTINUE LOOPING.
*
* END: IF APPLICATION SUPPORTS K-DISPLAY,
* SET RETURN CODE TO INFORM APP.
* ELSE (APP DOES NOT SUPPORT K-DISPLAY),
* CLEAR FLAG TO CONTINUE LOOPING.
*
* NOTR: CALL NETDBG TO TURN OFF AIP TRACING.
* CLEAR FLAG TO CONTINUE LOOPING.
*
* RS: SET RETURN CODE TO INFORM APP.
*
* PAGE: IF APPLICATION SUPPORTS K-DISPLAY,
* SET RETURN CODE TO INFORM APP.
* ELSE (APP DOES NOT SUPPORT K-DISPLAY),
* CLEAR FLAG TO CONTINUE LOOPING.
*
* REL: SET RETURN CODE TO INFORM APP.
*
* DB: SET RETURN CODE TO INFORM APP.
*
* DE: SET RETURN CODE TO INFORM APP.
*
* OFC: IF CONNECTION STILL ESTABLISHED,
* SET FLAG TO STOP LOOPING.
* IF OFC/ABORT/N RECEIVED,
* UPDATE CONNECTION STATE IN NIT.
* SET RETURN CODE TO INFORM APP.
* RETURN ACCTNG AND LFN INFO TO APP.
* ELSE (NOT OFC/ABORT/N),
* IF OFC/DATA/N RECEIVED,
* IF WAITING FOR END OF OUTPUT JOB,
* UPDATE CONNECTION STATE IN NIT.
* SET RETURN CODE TO INFORM APP.
* ELSE (INFORM APP ABOUT OFC/DATA/N),
* SET RETURN CODE TO INFORM APP.
* ELSE (IF NOT OFC/ABORT/N NOR OFC/DATA/N),
* IF OFC/EOO RECEIVED,
* IF WAITING FOR END OF OUTPUT JOB,
* UPDATE CONNECTION STATE IN NIT.
* SET RETURN CODE TO INFORM APP.
* ELSE (INFORM APP ABOUT END OF OUTPUT),
* UPDATE CONNECTION STATE IN NIT.
* SET RETURN CODE TO INFORM APP.
* RETURN ACCTNG AND LFN INFO TO APP.
* ELSE (EITHER OFC/STPD OR OFC/STP/N),
* RETURN CURRENT PRU POSITION TO APP.
* IF OFC/STPD RECEIVED,
* UPDATE CONNECTION STATE IN NIT.
* SET RETURN CODE TO INFORM APP.
* IF PM MESSAGE,
* IF APP WANTS PM MSG IN DISPLAY CD,
* IF PM MSG IS TOO LARGE FOR BUF,
* SET TRUCATION FLAG IN NIT.
* REDUCE NO OF CHARS TO CONVERT.
* EXTRACT EACH CHAR IN PM MSG.
* CONVERT EACH CHAR TO DISPLAY CD.
* STORE DISPLAY CODE CHAR IN BUF.
* ELSE (APP WANTS PM MSG AS IS),
* IF PM MSG IS TOO LARGE FOR BUF,
* SET TRUCATION FLAG IN NIT.
* REDUCE NO OF WORDS TO COPY.
* COPY PM MSG TO APP BUFFER.
* STORE SIZE OF PM MSG IN NIT.
* ELSE (MUST BE OFC/STP/N RECEIVED),
* UPDATE CONNECTION STATE IN NIT.
* SET RETURN CODE TO INFORM APP.
*
* PRU: SET FLAG TO STOP LOOPING.
* IF ABNORMAL RESPONSE RECEIVED,
* IF PRU/ON PROCESSING ON,
* CALL QTENDT TO TERMINATE CONNECTION.
* SET FLAG TO RESUME LOOPING.
* ELSE (APP SENT PRU/ON SUP MSG),
* UPDATE CONNECTION STATE IN NIT.
* SET RETURN CODE TO INFORM APP.
* ELSE (PRU CONNECTION ESTABLISHED),
* UPDATE CONNECTION STATE IN NIT.
* SET RETURN CODE TO INFORM APP.
*
* ELSE (NO SUPERVISORY MESSAGE RECEIVED),
* IF CONNECTION POLLING IS IN EFFECT,
* IF CONNECTION NUMBER IS NOT VALID,
* SKIP TO END AND REJECT QTGET CALL.
* ELSE (VALID CONNECTION NUMBER WAS SPECIFIED),
* CALL NETGET WITH SPECIFIED ACN TO PICK UP DATA.
* ELSE (LIST PROCESSING IS IN EFFECT),
* CALL NETGETL TO PICK UP DATA.
* JUMP ACCORDING TO BLOCK TYPE IN ABH:
*
* NULL: IF SLEEP IS ZERO,
* SET FLAG TO STOP LOOPING AND INFORM APP.
* ELSE (CALL NETWAIT IF NOTHING TO DO),
* IF SLEEP IS NEGATIVE,
* CALL NETWAIT FOR MAXIMUM TIME INTERVAL.
* ELSE (SLEEP IS POSITIVE DIGIT),
* IF NETWAIT HAS ALREADY BEEN CALLED,
* SET FLAG TO STOP LOOPING AND INFORM APP.
* ELSE (NETWAIT HAS NOT BEEN CALLED YET),
* CALL NETWAIT FOR SLEEP TIME INTERVAL.
*
* CMD: IF BI/MARK SYNC SUP MSG RECEIVED,
* IF CONNECTION HAS NOT BEEN TERMINATED
* AND APP WANTS TO BE INFORMED,
* SET FLAG TO STOP LOOPING AND INFORM APP.
* ELSE (SYNC SUP MSG NOT BI/MARK),
* CONTINUE PROCESSING AS DATA BLOCK.
*
* BLK:
* MSG:
* QBLK:
* QMSG: IF CANCEL BIT NOT SET IN ABH,
* UPDATE NIT CONNECTION ENTRY.
* IF IBU BIT SET IN ABH,
* CALL QTENDT TO TERMINATE CONNECTION.
* SET FLAG TO STOP LOOPING AND INFORM APP.
* IF QTRM IS IN MIDDLE OF AUTO BREAK PROCESSING,
* IGNORE BLOCK.
* ELSE (OKAY TO INFORM APP ABOUT DATA BLOCK),
* IF DATA IS IN DISPLAY CODE,
* BLANK FILL LAST WORD OF DATA.
* IF ASCII DATA ON A-A DISPLAY CODE CONNECTION,
* IF DATA BLOCK IS WRONG SIZE,
* CALL QTENDT TO TERMINATE CONNECTION.
* ELSE (DATA BLOCK IS RIGHT SIZE),
* CONVERT COUNT OF CHARS TO DISPLAY CODE VAL.
* SET FLAG TO STOP LOOPING AND INFORM APP.
*
* 4. ENTRY CONDITIONS
* WSA STARTING ADDRESS OF BUFFER AREA IN APPLICATION
* WHERE DATA IS TO BE DELIVERED TO.
*
* 5. EXIT CONDITIONS
* NIT FIELDS UPDATED DEPENDING ON THE RETURN CODE.
* NIT$RC RESPONSE RETURN CODE.
*
* 6. COMDECKS CALLED AND SYMPL TEXTS USED.
* AIPDEF NP$CRT QTRMBUF QTRMCOM
* QTRMNIT
*
* 7. ROUTINES CALLED
* NETDBG AIP TURN AIP TRACE ON/OFF.
* NETGET AIP INPUT FROM NETWORK.
* NETGETL AIP INPUT (LIST) FROM NETWORK.
* NETOFF AIP DISCONNECT FROM NETWORK.
* NETPUT AIP OUTPUT TO NETWORK.
* NETWAIT AIP SUSPEND PROCESSING.
* NP$ERR AIP ERROR DAYFILE ROUTINE.
* QTENDT QTRM END CONNECTION.
* QTTIP QTRM ROUTINE TO SEND SYNC SUP MSG
*
* 8. DAYFILE MESSAGES
* NETWORK APPLICATION ABORTED, RC = 71.
* QTGET: REQUEST INVALID BEFORE QTOPEN.
*
* NETWORK APPLICATION ABORTED, RC = 99.
* QTGET: NETWORK LOGICAL ERROR.
*
*
#
*ENDIF
#
CONTROL DEFINITIONS
#
CONTROL PRESET;
CONTROL PACK;
CONTROL DISJOINT;
CONTROL INERT;
CONTROL FASTLOOP;
#
ROUTINES CALLED
#
XREF
BEGIN
PROC NP$ERR; # AIP ROUTINE TO DAYFILE ERROR MESSAGE #
PROC NETDBG; # AIP ROUTINE TO TURN ON/OFF AIP TRACING #
PROC NETGET; # AIP PROCEDURE TO GET A BLOCK #
PROC NETGETL; # AIP PROCEDURE TO GET A BLOCK ON LIST #
PROC NETPUT; # AIP PROCEDURE TO OUTPUT A BLOCK #
PROC NETOFF; # AIP PROCEDURE TO TERMINATE NAM ACCESS #
PROC NETWAIT; # AIP PROCEDURE TO SUSPEND PROCESSING #
PROC QTENDT; # END A CONNECTION #
PROC QTTIP; # QTRM ROUTINE TO ISSUE SYNC SUP MSG #
END
#
STANDARD DEFS
#
*CALL CRCOM
*CALL QTRMCOM
#
INPUT VARIABLES.
#
ARRAY WSA [0:0] S(1);
# STARTING ADDRESS OF BUFFER IN #
# USER AREA WHERE DATA BLOCK SHOULD #
# BE RETURNED #
BEGIN
ITEM WSA$WORD U(00,00,60); # WHOLE WORD #
ITEM WSA$FC U(00,00,16); # PFC/SFC FOR SYNCHRONOUS COMMANDS #
ITEM WSA$PC U(00,00,08); # PFC FOR SYN COMMAND IN ACT=2 #
ITEM WSA$SC U(00,10,06); # SFC FOR SYN COMMAND IN ACT=2 #
ITEM WSA$P1 U(00,00,12); # PFC FOR SYN COMMAND IN ACT=3 #
ITEM WSA$S1 U(00,14,10); # SFC FOR SYN COMMAND IN ACT=3 #
END
#
LOCAL VARIABLES
#
ARRAY PFC$ARRAY [0:8];
BEGIN
ITEM PFC$VALUE U(0,0,60) = [CON,ERR,FC,SHUT,TCH,INTR,HOP,OFC,
PRU];
END
ITEM RESPONSE B; # EXIT CONTROL VARIABLE #
ITEM NOSLEEP B; # POSITIVE SLEEP CONTROL VARIABLE#
ITEM SLEEP I; #INTERMEDIATE SLEEP VARIABLE#
ITEM MAXWORDS U; # LENGTH USER BUFFER AREA (WORDS)#
ITEM TEMP1 I; # TEMPORARY VARIABLES #
ITEM TEMP2 I; # REASON FOR BREAK #
ITEM TEMP3 I; # TEMPORARY VARIABLE #
ITEM WORDS I; # NUMBER OF FULL WORDS IN BLOCK #
ITEM CHARS I; # NUMBER OF CHARACTORS IN LAST WORD #
ITEM CHARSET I; # CURRENT INPUT CHARACTER SET #
ITEM ACN U; # APPLICATION CONNECTION NUMBER #
ITEM FOUNDMATCH B; # FLAG FOR FINDING MATCH ON PFC SCAN #
ITEM I I; # INDUCTION VARIABLE #
ITEM J I; # INDUCTION VARIABLE #
ITEM NEWCHAR I; # DISPLAY CODE CHAR FROM PM MESSAGE #
ITEM NEWCP I; # CHAR POSITION INDEX FOR PM MESSAGE #
ITEM NEWWP I; # WORD POSITION INDEX FOR PM MESSAGE #
ITEM OLDCP I; # CHAR POSITION INDEX FOR WSA BUFFER #
ITEM OLDWP I; # WORD POSITION INDEX FOR WSA BUFFER #
BASED ARRAY MEM [0:0] S(1); # BASED ARRAY FOR COPYING MEMORY #
BEGIN
ITEM MEM$WORD U(0,0,60); # ONE CENTRAL MEMORY WORD #
END
#
SWITCH DEFINITIONS
#
SWITCH SWTCH$ABT$L ABT$L$NULL, ABT$L$BLK, ABT$L$MSG, ABT$L$CMD,,,
ABT$L$QBLK,ABT$L$QMSG;
SWITCH SWTCH$PFC A$PFC$CON, A$PFC$ERR, A$PFC$FC,
A$PFC$SHUT,A$PFC$TCH,A$PFC$INTR,
A$PFC$HOP,A$PFC$OFC,A$PFC$PRU;
SWITCH SWTCH$FC FC$BRK,FC$RST,FC$ACK,FC$NAK,FC$INACT,,,FC$INIT;
SWITCH SWTCH$HOP HOP$BRK,HOP$CMD,HOP$TRCE,HOP$DU,HOP$IG,
HOP$STRT,HOP$END,HOP$NOTR,HOP$RS,,,,
HOP$PAGE,HOP$REL,HOP$DB,HOP$DE;
CONTROL EJECT;
#
BEGIN QTGET PROCEDURE
#
BEGIN
IF NOT NETON$STATUS # CHECK IF NETON WAS COMPLETED #
THEN
NP$ERR("71"); # REQUEST INVALID BEFORE QTOPEN.#
RESPONSE = FALSE; # INITIALIZE RESPONSE FLAG #
NOSLEEP = FALSE; # PRESET POSITIVE SLEEP OK. #
P<NIT> = NIT$ADDR; # ADDRESS OF NIT TABLE #
NIT$CTLC[0] = 0; # INIT TEXT LENGTH RECEIVED FIELD #
NIT$TRUNC[0] = 0; # INIT TRUNCATION FLAG TO FALSE #
#
DETERMINE APPLICATION BUFFER LENGTH IN WORDS
#
MAXWORDS = NIT$MTLC[0]; # MAX BUF LENGTH IN CHARACTER SET LENGTH#
IF ICTD[0] EQ CT8ASCII
THEN # CHARACTER SET IS 8 BIT ASCII #
BEGIN
MAXWORDS = (NIT$MTLC[0] * 2) / 15; # NO OF CM WORDS #
END
ELSE # NOT 8 BIT ASCII CHARACTER SET #
BEGIN
IF ICTD[0] EQ CT12ASCII
THEN # CHARACTER SET IS 12 BIT ASCII #
BEGIN
MAXWORDS = NIT$MTLC[0] / 5; # NO OF CM WORDS #
END
ELSE # NOT 12 BIT ASCII CHARACTER SET EITHER #
BEGIN
IF ICTD[0] EQ CT6DISPLAY
THEN # CHARACTER SET IS 6 BIT DISPLAY CODE #
BEGIN
MAXWORDS = NIT$MTLC[0] / 10; # NO OF CM WORDS #
END
END
END
#
LOOP UNTIL SOME RESPONSE IS AVAILABLE FOR USER
#
FOR TEMP1=TEMP1 WHILE NOT RESPONSE DO
BEGIN # BEGIN RESPONSE CONTROLLED LOOP #
#
IF CONNECTION POLLING IS IN EFFECT AND THE CONNECTION NUMBER
SPECIFIED WAS NONZERO, THEN WE DO NOT WANT TO GET ANY
ASYNCHRONOUS SUPERVISORY MESSAGES. OTHERWISE, GET ASYNCHRONOUS
SUPERVISORY MESSAGES.
#
IF (CONPOLL ) AND # CONNECTION POLLING IN EFFECT #
(NIT$CON[0] NQ 0) # CONNECTION NUMBER IS NONZERO #
THEN
BEGIN
ABHABT[0] = APPNULL; # ASSUME NO SUP MSG WAS FOUND #
END
ELSE # NEED TO GET ASYNC SUP MSGS #
BEGIN
NETGET(0,HEADER,SUP$MES,63); # GET ASYNC SUP MSGS #
END
# CHECK FOR VALID BLOCK TYPE #
IF ABHABT[0] EQ APPNULL OR ABHABT[0] EQ APPCMD
THEN
BEGIN
# CHECK IF BLOCK TYPE IS SUP OR NULL #
IF ABHABT[0] EQ APPCMD
THEN
#
ASYNC SUPERVISORY MESSAGE BLOCK PROCESSING.
#
BEGIN
FOUNDMATCH = FALSE; # INIT TO NO MATCH ON PFC SCAN #
FOR I = 0 STEP 1 WHILE (I LQ 8 ) AND
(NOT FOUNDMATCH)
DO # CHECK FOR VALID PFC-S #
BEGIN
IF PFC[0] EQ PFC$VALUE[I]
THEN # VALID PFC #
BEGIN
GOTO SWTCH$PFC[I];
A$PFC$CON:
#
SUPERVISORY CONNECTION MESSAGE RECIEVED
#
BEGIN
ACN = CONACN[0]; # APPLICATION CONNECTION NUMBER #
NIT$CON[0] = ACN;
# CHECK IF CON/REQ OR OTHER CON #
IF SFC[0] EQ REQ
THEN
BEGIN
#
CHECK IF DEVICE TYPE OF THIS CONNECTION IS SUPPORTED
#
IF ((SUPDTW[0] LAN 2**(COND[0])) NQ 0)
THEN # THIS DEVICE TYPE IS SUPPORTED #
BEGIN # SET UP NIT ENTRY FOR NEW CON #
NIT$WD0[ACN] = 0;
NIT$WD1[ACN] = 0;
NIT$WD2[ACN] = 0;
NIT$WD3[ACN] = 0;
NIT$WD4[ACN] = 0;
NIT$WD5[ACN] = 0;
NIT$WD6[ACN] = 0;
NIT$WD7[ACN] = 0;
NIT$WD8[ACN] = 0;
NIT$WD9[ACN] = 0;
NIT$STATE[ACN] = S"LIMBO";
NIT$RC[0] = S"CON$REQ"; # SET NIT RETURN CODE #
NIT$DEVTYP[ACN] = COND[0];
NIT$SL[ACN] = CONSL[0]; # SECURITY LEVEL #
NIT$ICT[ACN] = ICTD[0]; # ICT FOR DATA #
NIT$SICT[ACN] = CT8ASCII; # ICT FOR SYNC SUP MSG#
NIT$CDCNT[ACN] = CONNET[0];# CDCNET FLAG #
NIT$UPS[ACN] = CONUPS[0]; # UPLINE BLOCK SIZE #
NIT$DPS[ACN] = CONDPS[0]; # DOWNLINE BLOCK SIZE #
IF ( (COND[0] NQ DT$INTA) AND # INTRAHOST A-A #
(COND[0] NQ DT$INTE) ) # INTERHOST A-A #
THEN
BEGIN
NIT$TNAME[ACN] = CONTNM[0];
NIT$TC[ACN] = CONT[0];
NIT$PW[ACN] = CONPW[0];
NIT$PL[ACN] = CONPL[0];
NIT$FAMNAME[ACN]=CONFAM[0]; # FAMILY NAME #
NIT$USERNAME[ACN]=CONUSE[0]; # USER NAME #
IF CONLST[0] EQ 8
THEN # THIS IS A LOANED CONNECTION #
BEGIN
NIT$LOAN[ACN] = 1; # SET LOAN FLAG #
END
ELSE # NOT SEC APP RECEIVING LOANED CONNECTION#
BEGIN
IF (CONLST[0] GQ 16) AND
(CONLST[0] LQ 23)
THEN # RECONNECTION OF LOANED CONNECTION #
BEGIN
NIT$STATE[ACN] = S"LENDRET"; # SET CON ST #
NIT$RC[0] = S"LEND$RET"; # SET RETURN CODE#
NIT$SB$RC[0] = CONLST[0]; # SET SEC RC #
END
END
CONACT[0] = ICTD[0]; # INPUT CHARACTER TYPE #
END
ELSE # APPL TO APPL CONNECTION #
BEGIN
IF CONABN[0] NQ 0
THEN
BEGIN
NIT$STATE[ACN] = S"POSE";
REQAA = FALSE;
END
NIT$HOSTID[ACN] = CONHID[0]; # APP NAME #
CONACT[0] = ICTD[0]; # INPUT CHARACTER TYPE #
IF ICTD[0] EQ CT6DISPLAY
THEN # INPUT CHAR TYPE IS DISPLAY CODE #
BEGIN
CONACT[0] = CT8ASCII; # ICT IS 8 BIT ASCII #
END
END
CONNXP[0] = NOT ICTX[0]; # REJECT TRANS INPUT #
NIT$ABL[ACN] = CONABL[0];
NIT$BSZ[ACN] = CONDBZ[0] ;
CONALN[0] = 1; # PUT TERMINAL ON LIST = 1 #
RB[0] = TRUE;
IF CONINIT
THEN # APP WANTS TO BE INFORMED ABOUT CON/REQ #
BEGIN
RESPONSE = TRUE;
TEMP2 = ABHTLC[0] - LCONREQ; # LENGTH OF DATA #
IF TEMP2 NQ 0
THEN # DATA WAS PASSED FROM PREVIOUS APP #
BEGIN
IF MAXWORDS GR TEMP2
THEN # WSA BUFFER IS BIG ENOUGH FOR DATA #
BEGIN
NIT$CTLC[0] = TEMP2; # LENGTH OF DATA #
END
ELSE # WSA BUFFER WAS NOT BIG ENOUGH #
BEGIN
NIT$CTLC[0] = MAXWORDS; # LENGTH OF BUF #
NIT$TRUNC[0] = 1; # DATA TRUNCATED FLAG #
TEMP2 = MAXWORDS; # NO OF WORDS TO COPY #
END
P<MEM> = LOC(SUP$MES); # ADDR OF SUP MSG #
FOR J = 0 STEP 1 UNTIL TEMP2 - 1
DO # COPY PASSED DATA TO WSA BUFFER #
BEGIN
WSA$WORD[J] = MEM$WORD[J + LCONREQ];
END
END
END
END
ELSE # REJECT BATCH OR A-A CONNECTION #
BEGIN
EB[0] = TRUE;
CONRRA[0] = S"REJ";
END
CONSCT[0] = FALSE; # SET SYNC SUP MSG ACT = 2 #
ABHTLC[0] = LCORQR;
NETPUT(HEADER,SUP$MES);
END
ELSE # NOT CON/REQ SUPERVISORY MESSAGE #
BEGIN
# CHECK FOR CON/END, CON/CB OR CON/ACRQ/A #
IF SFC[0] EQ CB
THEN # CLEAN UP TABLES FOR BROKEN CONNECTION #
BEGIN
# CHECK IF USER SHOULD BE INFORMED #
TEMP1 = NIT$STATE[ACN];
TEMP3 = RC[0];
IF (TEMP1 NQ STATE"LEND") AND
(TEMP1 NQ STATE"LENT") AND
(TEMP1 NQ STATE"WCONENDN")
THEN # OKAY TO ISSUE CON/END SUP MSG #
BEGIN
NIT$PARMADR[0] = 0; # INIT DATA ADDR #
QTENDT; # END A BROKEN CONNECTION #
IF (CONINIT ) OR
( (TEMP1 NQ STATE"LIMBO" ) AND
(TEMP1 NQ STATE"WAITPRU") )
THEN # INFORM APP ABOUT CONNECTION BROKEN #
BEGIN
RESPONSE = TRUE;
END
IF TEMP1 EQ STATE"POSE"
THEN # BAD CON/REQ RESPONSE CAUSED CON/CB #
BEGIN
NIT$RC[0] = S"ACRQ$ERR";
NIT$S$RC[0] = TEMP3 + 32; # ADJUST SEC RC #
END
ELSE # NORMAL CONNECTION BROKEN #
BEGIN
NIT$RC[0] = S"CON$BROKEN";
NIT$S$RC[0] = S"NORMRET"; # SET SEC-RC FIELD#
NIT$SB$RC[0] = TEMP3; # RC FROM CON/CB #
END
END
ELSE # APP DOES NOT HAVE CONNECTION #
BEGIN
IF TEMP1 NQ STATE"WCONENDN"
THEN # NEED TO INFORM APP AND INIT NIT ENTRY #
BEGIN
RESPONSE = TRUE;
NIT$RC[0] = S"LEND$CB";
NIT$S$RC[0] = S"NORMRET"; # SET SEC-RC FIELD#
NIT$SB$RC[0] = TEMP3; # RC FROM CON/CB #
NIT$STATE[ACN] = S"NULL"; # INIT NIT ENTRY #
END
END
END
ELSE
IF SFC[0] EQ ACRQ
THEN # RECEIVED CON/ACRQ/A SUPERVISORY MESSAGE #
BEGIN
NIT$RC[0] = S"ACRQ$ERR";
NIT$SB$RC = CONRAC[0]; # CON/ACRQ/A RC #
NIT$SEC$RC = CONRAC2[0]; # CON/ACRQ/A SUB RC #
REQAA = FALSE;
NIT$CON[0] = 0;
RESPONSE = TRUE;
END
ELSE # MUST BE CON/END/N SUPERVISORY MESSAGE #
BEGIN
IF NIT$STATE[ACN] EQ S"WCONENDN"
THEN # TERMINATED CONNECTION #
BEGIN
NIT$STATE[ACN] = S"NULL";
END
ELSE # LOANED CONNECTION #
BEGIN
NIT$STATE[ACN] = S"LENT";
END
END
END
GOTO END$A$PFC;
END
A$PFC$ERR:
#
SUPERVISORY ERR MESSAGE BLOCK PROCESSING.
#
BEGIN
#ERROR NETWORK LOGICAL ERROR ENCOUNTERED#
NIT$RC[0] = S"LOGICERR"; # SET RETURN CODE #
NIT$SEC$RC[0] = ERRRLG[0]; # SET SECONDARY RC #
IF NOABTERRLGL
THEN # DO NOT ABORT ON ERR/LGL SUP MSG #
BEGIN
RESPONSE = TRUE;
END
ELSE # ABORT APP WHEN WE RECEIVE ERR/LGL S M #
BEGIN
NP$ERR("99");
END
GOTO END$A$PFC;
END
A$PFC$FC:
#
SUPERVISORY FLOW OF CONTROL
MESSAGE BLOCK PROCESSING.
#
BEGIN
ACN = FCACN[0];
GOTO SWTCH$FC [SFC[0]];
FC$ACK:
#
PROCESS AN ACKNOWLEDGEMENT.
#
BEGIN
NIT$ACK$ABN[ACN] = FCABN[0];
NIT$C$ABL[ACN] = NIT$C$ABL[ACN] + 1;
NOSLEEP = TRUE; # POSITIVE SLEEP NOT OK. #
IF (NIT$STATE[ACN] EQ S"WROMARK") OR
(NIT$STATE[ACN] EQ S"WBIROMK") OR
(NIT$STATE[ACN] EQ S"WTOMARK")
THEN # WAITING FOR FC/ACK TO SEND SYNC SUP MSG #
BEGIN
CHARSET = NIT$CHAR$SET[0]; # SAVE OLD CHAR SET #
NIT$CHAR$SET[0] = CT8ASCII; # APPL CHAR TYPE #
NIT$CON[0] = ACN; # CONNECTION NUMBER #
SPMSG0[0] = 0;
IF NIT$STATE[ACN] EQ S"WTOMARK"
THEN # WAITING TO SEND TO/MARK SUP MSG #
BEGIN
PFCSFC[0] = TOMARK; # PFC/SFC VALUE #
NIT$CTLC[0] = LTOMARK; # LENGTH OF SUP MSG #
END
ELSE # WAITING TO SEND RO/MARK SUP MSG #
BEGIN
PFCSFC[0] = ROMARK; # PFC/SFC VALUE #
NIT$CTLC[0] = LROMARK; # LENGTH OF SUP MSG #
END
QTTIP(SUP$MES); # SEND SYNC SUP MSG #
NIT$CHAR$SET[0] = CHARSET; # RESTORE CHAR SET #
IF (NIT$STATE[ACN] EQ S"WROMARK") OR
(NIT$STATE[ACN] EQ S"WTOMARK")
THEN # ONLY WAITING TO SEND SYNC SUP MSG #
BEGIN
NIT$STATE[ACN] = S"OK"; # SET STATE TO NORMAL #
END
ELSE # STILL WAITING FOR BI/MARK SUP MSG #
BEGIN
NIT$STATE[ACN] = S"USRBRK"; # CHANGE STATE #
END
END
GOTO END$FC;
END
FC$BRK:
#
PROCESS AN UPLINE BREAK ( FOR A-A CONNECTION ONLY )
#
BEGIN
# CHECK IF TERMINAL IS KNOWN TO USER. #
# BRK CAN NOT OCCUR IN LIMBO STATE. #
IF NIT$STATE[ACN] NQ S"WCONENDN"
THEN
BEGIN
RESPONSE = TRUE;
NIT$CON[0] = ACN;
NIT$ABN[ACN] = NIT$ACK$ABN[ACN];
NIT$C$ABL[ACN] = NIT$ABL[ACN];
NIT$RC[0] = S"FC$BRK"; # NIT RETURN CODE #
NIT$SB$RC[0] = FCRBR[0]; # BREAK REASON CODE #
ABHWORD[0] = 0;
ABHABT[0] = APPCMD;
ABHACT[0] = ACFC;
ABHTLC[0] = LFCRST;
SPMSG0[0] = 0;
PFCSFC[0] = FCRST;
FCACN[0] = ACN;
NETPUT(HEADER,SUP$MES); # SEND FC/RST #
END
GOTO END$FC;
END
FC$INACT:
#
PROCESS AN FC/INACT SUPERVISORY MESSAGE
#
BEGIN
IF (NIT$STATE[ACN] NQ S"WCONENDN") AND
(NIT$STATE[ACN] NQ S"LEND")
THEN # CONNECTION HAS NOT BEEN TERMINATED #
BEGIN
NIT$CON[0] = ACN; # APPL CONNECTION NUMBER #
IF (CONINIT) OR
( (NIT$STATE[ACN] NQ S"LIMBO") AND
(NIT$STATE[ACN] NQ S"POSE") AND
(NIT$STATE[ACN] NQ STATE"WAITPRU") AND
(NIT$STATE[ACN] NQ S"LENDRET") )
THEN # APP KNOWS ABOUT CONNECTION #
BEGIN
IF INACTIVE
THEN # APP WANTS TO BE INFORMED ABOUT FC/INACT #
BEGIN
NIT$RC[0] = S"FC$INACT"; # SET RC FIELD #
NIT$SB$RCB[0] = FCATF[0]; # APP SPECIFIED #
# TIMEOUT FLAG #
RESPONSE = TRUE;
END
END
ELSE # APP DOES NOT KNOW ABOUT CONNECTION #
BEGIN
NIT$PARMADR[0] = 0;
QTENDT; # END CN THAT DID NOT RECEIVE FC/INIT #
END
END
GOTO END$FC;
END
FC$INIT:
#
PROCESS AN INITIALIZE.
#
BEGIN
IF (NIT$STATE[ACN] EQ S"LIMBO") OR
(NIT$STATE[ACN] EQ S"POSE") OR
(NIT$STATE[ACN] EQ S"LENDRET")
THEN # EXPECTING FC/INIT/R SUP MSG #
BEGIN
RB[0] = TRUE;
NETPUT(HEADER,SUP$MES); #NORMAL RESP TO FC INIT#
NIT$C$ABL[ACN] = NIT$ABL[ACN];
IF NIT$STATE[ACN] EQ S"POSE"
THEN # A-A CONNECTION REQUEST RESPONSE FC/INIT #
BEGIN
NIT$RC[0] = S"ACRQ$COMPL";
END
ELSE # RECONNECT OR NEW CONNECTION #
BEGIN
IF NIT$STATE[ACN] EQ S"LIMBO"
THEN # NEW CONNECTION #
BEGIN
NIT$RC[0] = S"NEW$CON";
END
ELSE # RECONNECT OF LOANED CONNECTION #
BEGIN
NIT$RC[0] = S"NEW$RECON";
END
END
IF ((PRUDTW[0] LAN 2**(NIT$DEVTYP[ACN])) NQ 0)
THEN # QTRM IS TO SEND PRU/ON SUP MSG #
BEGIN
ABHWORD[0] = 0; # INITIALIZE ABH WORD #
ABHABT[0] = APPCMD; # APPLICATION BLOCK TYPE #
ABHACT[0] = ACPRU; # APPLICATION CHAR TYPE #
ABHTLC[0] = LPRU; # LENGTH OF PRU/ON SUP MSG#
SPMSG0[0] = 0; # INITIALIZE SUP MSG WORD #
PFCSFC[0] = PRUON; # PFC/SFC FOR PRU/ON S M #
PRUACN[0] = ACN; # CN FOR PRU/ON SUP MSG #
IF NIT$DEVTYP[ACN] EQ DT$CR
THEN # UPLINE (INPUT) DEVICE #
BEGIN
PRUUPS[0] = NIT$UPS[ACN]; # UPLINE PRU SIZE #
END
ELSE # DOWNLINE (OUTPUT) DEVICE#
BEGIN
PRUDPS[0] = NIT$DPS[ACN]; # DOWNLINE PRU SIZ#
END
NETPUT(HEADER,SUP$MES); # SEND PRU/ON SUP MSG #
NIT$STATE[ACN] = STATE"WAITPRU"; #CHANGE STATE#
END
ELSE # INFORM APP ABOUT NEW CONNECTION NOW #
BEGIN
RESPONSE = TRUE; # TERMINATE LOOP #
NIT$STATE[ACN] = STATE"OK"; # CHANGE STATE #
NIT$CON[0] = ACN; # APP CONNECTION NUMBER #
END
END
GOTO END$FC;
END
FC$NAK:
#
PROCESS A NAK.
#
BEGIN
IF NIT$STATE[ACN] NQ S"WCONENDN"
THEN
BEGIN
RESPONSE = TRUE;
NIT$CON[0] = ACN;
NIT$PARMADR[0] = 0;
QTENDT; # END CONNECTION WHICH HAD THE NAK #
NIT$RC[0] = S"CON$BROKEN";
NIT$S$RC[0] = S"RECNAK"; # SET SEC-RC FIELD #
END
GOTO END$FC;
END
FC$RST:
#
PROCESS AN RESET RESPONSE
#
BEGIN
IF NIT$STATE[ACN] EQ S"FCBRK"
THEN # CONNECTION HAS NOT BEEN ENDED #
BEGIN
NIT$STATE[ACN] = S"OK"; # BACK TO NORMAL STATE #
NIT$RC[0] = S"FC$RST"; # SET RETURN CODE FIELD #
NIT$CON[0] = ACN; # CONNECTION NUMBER #
NIT$C$ABL[ACN] = NIT$ABL[ACN];
RESPONSE = TRUE;
END
GOTO END$FC; # GO TO END OF FC CASE STATEMENT #
END
END$FC:
GOTO END$A$PFC;
END
A$PFC$SHUT:
#
SUPERVISORY SHUTDOWN MESSAGE BLOCK PROCESSING.
#
BEGIN
IF SFC[0] EQ INSD
THEN
BEGIN
IF SHUTF[0]
# IF A FORCED SHUTDOWN #
THEN
BEGIN
NETOFF;
NIT$RC[0] = S"SHUTDOWN";
RESPONSE = TRUE;
END
ELSE
BEGIN
NIT$RC[0] = S"IDLEDOWN";
RESPONSE = TRUE;
END
END
GOTO END$A$PFC;
END
A$PFC$TCH:
#
SUPERVISORY CHANGE TERMINAL CHARACTERISTIC
MESSAGE BLOCK PROCESSING.
#
BEGIN
ACN = TCHACN[0]; # APPLICATION CONNECTION NUMBER #
NIT$PW[ACN] = TCHPW[0]; # PAGE WIDTH #
NIT$PL[ACN] = TCHPL[0]; # PAGE LENGTH #
NIT$TC[ACN] = TCHTCL[0]; # TERMINAL CLASS #
GOTO END$A$PFC;
END
A$PFC$INTR:
#
INTRRUPT PROCESSING
#
BEGIN
TEMP2 = INTRCHR[0]; # USER INTERRUPT CHARACTER #
ACN = INTRACN[0]; # APPLICATION CONNECTION NUMBER #
NIT$CON[0] = ACN;
IF (NIT$STATE[ACN] EQ S"INTRRSP") AND
(SFC[0] EQ RSP)
THEN # INTERRUPT RESPONSE RECEIVED #
BEGIN
NIT$STATE[ACN] = S"OK"; # SET TO NORMAL STATE #
NIT$RC[0] = S"INTR$RSP"; # SET RETURN CODE IN NIT #
RESPONSE = TRUE;
END
ELSE # INTERRUPT USER RECEIVED #
BEGIN
IF (NIT$STATE[ACN] NQ S"WCONENDN") AND
(NIT$STATE[ACN] NQ S"LEND")
THEN # CONNECTION HAS NOT BEEN TERMINATED #
BEGIN
IF (NIT$DEVTYP[ACN] EQ 0) AND
((TEMP2 EQ RIR"UB1") OR
(TEMP2 EQ RIR"UB2"))
THEN # USER BREAK ENTERED FROM TERMINAL #
BEGIN
NIT$STATE[ACN] = S"USRBRK"; # UPDATE STATE #
IF (NOT BREAKMARK) AND
(NIT$C$ABL[ACN] NQ 0)
THEN # QTRM NEEDS TO SEND RO/MARK FOR APP #
BEGIN
CHARSET = NIT$CHAR$SET[0]; # SAVE CHAR SET #
NIT$CHAR$SET[0] = CT8ASCII; # APPL CHAR TYPE#
NIT$CTLC[0] = LROMARK; # LENGTH OF SUP MSG #
SPMSG0[0] = 0;
PFCSFC[0] = ROMARK; # PFC/SFC VALUE #
QTTIP(SUP$MES); # SEND SYNC SUP MSG #
NIT$CHAR$SET[0] = CHARSET; # RESTORE CHR SET#
END
ELSE # CANNOT SEND RO/MARK SUP MSG #
BEGIN
IF NOT BREAKMARK
THEN # QTRM WILL SEND RO/MARK AFTER FC/ACK #
BEGIN
NIT$STATE[ACN] = S"WBIROMK"; # NEW STATE #
END
END
IF NOT AUTOBREAK
THEN # NEED TO INFORM APP ABOUT USER BREAK #
BEGIN
IF TEMP2 EQ RIR"UB1"
THEN # USER BREAK ONE OCCURRED #
BEGIN
NIT$RC[0] = S"USER$B1"; # SET RETURN CODE #
END
ELSE # USER BREAK TWO OCCURRED #
BEGIN
NIT$RC[0] = S"USER$B2"; # SET RETURN CODE #
END
RESPONSE = TRUE;
END
END
ELSE # USER OR APPLICATION INTERRUPT OCCURRED #
BEGIN
NIT$SB$RC[0] = INTRCHR[0]; # INTERRUPT CHAR #
IF USERINTR
THEN # INFORM APP ABOUT USER/APPLICATION INTR #
BEGIN
NIT$RC[0] = S"USR$INTR"; # SET RETURN CODE #
RESPONSE = TRUE;
END
END
ABHWORD[0] = 0;
ABHABT[0] = APPCMD; # APPLICATION BLOCK TYPE #
ABHACT[0] = ACINTR; # APPLICATION CHARACTER TYPE#
ABHTLC[0] = LINTR; # LENGTH OF SUPERVISORY MSG #
SPMSG0[0] = 0;
PFCSFC[0] = INTRRSP; # PFC/SFC VALUE FOR INTR/RS#
INTRACN[0] = ACN; # APPLICATION CONNECTION NUM #
NETPUT(HEADER,SUP$MES); # SEND INTR/RSP SUP MSG #
END
END
GOTO END$A$PFC;
END
A$PFC$HOP:
#
HOST OPERATOR COMMAND PROCESSING
#
BEGIN
RESPONSE = TRUE; # INFORM APP UNLESS OTHERWISE #
GOTO SWTCH$HOP [SFC[0]];
HOP$BRK:
#
PROCESS AN OPERATOR BREAK
#
BEGIN
IF KDISPLAY
THEN # APP SUPPORTS K-DISPLAY #
BEGIN
NIT$RC[0] = S"HOP$BRK"; # SET RETURN CODE #
END
ELSE # IGNORE SUPERVISORY MESSAGE #
BEGIN
RESPONSE = FALSE; # DO NOT INFORM APP #
END
GOTO END$HOP;
END
HOP$CMD:
#
PROCESS AN OPERATOR TYPEIN
#
BEGIN
IF KDISPLAY
THEN # APP SUPPORTS K-DISPLAY #
BEGIN
NIT$RC[0] = S"HOP$CMD"; # SET RETURN CODE #
TEMP2 = ABHTLC[0] - 1; # NO OF CM WDS OF TYPE IN#
IF MAXWORDS GR TEMP2
THEN # WSA BUFFER IS BIG ENOUGH FOR TYPE IN #
BEGIN
NIT$CTLC[0] = HOPDTL[0]; # NO OF CHARS TYPED #
END
ELSE # WSA BUFFER IS NOT LONG ENOUGH #
BEGIN
NIT$TRUNC[0] = 1; # SET SUP MSG TRUNCATED FLAG#
NIT$CTLC[0] = MAXWORDS * 10; # NO OF CHARS #
TEMP2 = MAXWORDS; # NO OF WORDS TO COPY TO BUF#
END
P<MEM> = LOC(SUP$MES); # ADDRESS OF SUP MSG #
FOR J = 0 STEP 1 UNTIL TEMP2 - 1
DO # COPY OPERATOR TYPEIN TO WSA BUFFER #
BEGIN
WSA$WORD[J] = MEM$WORD[J+1]; # OPER TYPEIN TXT#
END
END
ELSE # IGNORE SUPERVISORY MESSAGE #
BEGIN
RESPONSE = FALSE; # DO NOT INFORM APP #
END
GOTO END$HOP;
END
HOP$TRCE:
#
PROCESS AN OPERATOR REQUEST TO BEGIN AIP TRACING
#
BEGIN
NETDBG(1,1,SUP$MES); # TURN AIP TRACING ON #
RESPONSE = FALSE;
GOTO END$HOP;
END
HOP$DU:
#
PROCESS AN OPERATOR REQUEST TO DUMP FIELD LENGTH
#
BEGIN
NIT$RC[0] = S"HOP$DU"; # SET RETURN CODE #
GOTO END$HOP;
END
HOP$IG:
#
PROCESS AN OPERATOR REQUEST TO NOT SEND ALERTS
#
BEGIN
IGNORE = TRUE; # SET FLAG TO NOT SEND HOP/ALT #
RESPONSE = FALSE;
GOTO END$HOP;
END
HOP$STRT:
#
PROCESS OPERATOR ASSIGNMENT OF K-DISPLAY TO THIS APP
#
BEGIN
IGNORE = FALSE; # CLEAR FLAG TO NOT SEND HOP/ALT #
IF KDISPLAY
THEN # APPLICATION SUPPORTS K-DISPLAY #
BEGIN
KDISAS = TRUE; # SET K-DISPLAY ASSIGNED FLAG #
NIT$RC[0] = S"HOP$START"; # SET RETURN CODE #
IF MAXWORDS NQ 0
THEN # WSA BUFFER IS AT LEAST ONE WORD LONG #
BEGIN
WSA$WORD[0] = SPMSG0[0]; # 1ST WD OF SUP MSG #
END
ELSE # WSA BUFFER IS ZERO WORDS LONG #
BEGIN
NIT$TRUNC[0] = 1; # SET SUP MSG TRUNCATED FLAG#
END
END
ELSE # DO NOT INFORM APPLICATION #
BEGIN
RESPONSE = FALSE;
END
GOTO END$HOP;
END
HOP$END:
#
PROCESS OPERATOR TERMINATION OF K-DISPLAY ASSIGNMENT
#
BEGIN
IF KDISPLAY
THEN # APPLICATION SUPPORTS K-DISPLAY #
BEGIN
KDISAS = FALSE; # CLEAR K-DISPLAY ASSIGNED FLAG #
NIT$RC[0] = S"HOP$END"; # SET RETURN CODE #
END
ELSE # DO NOT INFORM APPLICATION #
BEGIN
RESPONSE = FALSE;
END
GOTO END$HOP;
END
HOP$NOTR:
#
PROCESS AN OPERATOR REQUEST TO END AIP TRACING
#
BEGIN
NETDBG(0,0,SUP$MES); # TURN AIP TRACING OFF #
RESPONSE = FALSE;
GOTO END$HOP;
END
HOP$RS:
#
PROCESS AN OPERATOR REQUEST TO RESET STATISTICS
#
BEGIN
NIT$RC[0] = S"HOP$RS"; # SET RETURN CODE #
GOTO END$HOP;
END
HOP$PAGE:
#
PROCESS AN OPERATOR REQUEST TO CHANGE PAGING
#
BEGIN
IF KDISPLAY
THEN # APPLICATION SUPPORTS K-DISPLAY #
BEGIN
NIT$RC[0] = S"HOP$PAGE"; # SET RETURN CODE #
NIT$SBC$RC[0] = HOPPC[0]; # PAGE CHARACTER #
END
ELSE # DO NOT INFORM APPLICATION #
BEGIN
RESPONSE = FALSE;
END
GOTO END$HOP;
END
HOP$REL:
#
PROCESS AN OPERATOR REQUEST TO RELEASE AIP DEBUG
LOG FILE
#
BEGIN
NIT$RC[0] = S"HOP$REL"; # SET RETURN CODE #
GOTO END$HOP;
END
HOP$DB:
#
PROCESS AN OPERATOR REQUEST TO TURN ON DEBUG CODE
#
BEGIN
NIT$RC[0] = S"HOP$DB"; # SET RETURN CODE #
GOTO END$HOP;
END
HOP$DE:
#
PROCESS AN OPERATOR REQUEST TO TURN OFF DEBUG CODE
#
BEGIN
NIT$RC[0] = S"HOP$DE"; # SET RETURN CODE #
GOTO END$HOP;
END
END$HOP: # END OF HOP CASE STATEMENT #
GOTO END$A$PFC;
END
A$PFC$OFC:
#
PRU OUTPUT DEVICE SUPERVISORY MESSAGE PROCESSING
#
BEGIN
ACN = OFCACN[0]; # ACN FROM OFC SUP MSG #
NIT$CON[0] = ACN; # APPLICATION CONNECTION NUMBER #
IF NIT$STATE[ACN] NQ STATE"WCONENDN" AND
NIT$STATE[ACN] NQ STATE"LEND"
THEN # APP STILL NOWS ABOUT CONNECTION #
BEGIN
RESPONSE = TRUE; # INFORM APP UNLESS OTHERWISE #
IF SFC[0] EQ ABRT
THEN # RECEIVED OFC/ABT/N SUP MSG #
BEGIN
NIT$STATE[ACN] = STATE"PRUEOO"; # CHANGE STATE #
NIT$RC[0] = NITRTC"OFCABTN"; # NIT RETURN CODE #
WSA$WORD[0] = OFCCURP[0]; # ACCOUNTING DATA #
WSA$WORD[1] = OFCPAR[0]; # LFN AND FNT ADR #
END
ELSE # DID NOT RECEIVE OFC/ABT/N SUP MSG #
BEGIN
IF SFC[0] EQ DATA
THEN # RECEIVED OFC/DATA/N SUP MSG #
BEGIN
IF NIT$STATE[ACN] EQ STATE"PRUEOO"
THEN # OFC/DATA/N WAS RESPONSE TO ACCTNG MSG #
BEGIN # OUTPUT JOB HAS ENDED #
NIT$STATE[ACN] = STATE"PRUCN"; # CHG STATE #
NIT$RC[0] = NITRTC"OFCEOJ"; # NIT RETURN CODE#
END
ELSE # OFC/DATA/N WAS RESPONSE TO BANNER MSG #
BEGIN
NIT$RC[0] = NITRTC"OFCDATAN"; # NIT RC #
END
END
ELSE # DID NOT RECEIVE OFC/DATA/N NOR OFC/ABT/N#
BEGIN
IF SFC[0] EQ EOO
THEN # RECEIVED OFC/EOO SUP MSG #
BEGIN
IF NIT$STATE[ACN] EQ STATE"PRUEOO"
THEN # COMPLETED TRANSFR OF OUTPUT JB#
BEGIN
NIT$STATE[ACN] = STATE"PRUCN"; # CHG STATE#
NIT$RC[0] = NITRTC"OFCEOJ"; # NIT RC #
END
ELSE # COMPLETED TRANSFR OF OUTPUT FL#
BEGIN
NIT$STATE[ACN] = STATE"PRUEOO"; # CHG STATE#
NIT$RC[0] = NITRTC"OFCEOO"; # NIT RC #
WSA$WORD[0] = OFCACNT[0]; # ACCOUNTING DATA#
WSA$WORD[1] = OFCPAR[0]; # LFN AND FNT ADR #
END
END
ELSE # RECEIVED OFC/STPD OR OFC/STP/N#
BEGIN
WSA$WORD[0] = OFCCURP[0]; # CURRENT PRU POS #
IF SFC[0] EQ STPD
THEN # RECEIVED OFC/STPD SUP MSG #
BEGIN
NIT$RC[0] = NITRTC"OFCSTPD"; # NIT RC #
NIT$SB$RC[0] = OFCRC[0]; # RC FOR STPD CON#
IF OFCRC[0] EQ ROS"MSE"
THEN # PIP STOPPED PRU TRAFFIC #
BEGIN
NIT$STATE[ACN] = STATE"PRUSTPP";
END
ELSE # NETWORK STOPPED PRU TRAFFIC #
BEGIN
NIT$STATE[ACN] = STATE"PRUSTPD";
IF OFCRC[0] EQ ROS"PMI"
THEN # PM MESSAGE TO COPY TO WSA #
BEGIN
TEMP2 = OFCPMCC[0]; # NO OF CHARS #
IF PMCONV NQ 0
THEN # NEED TO CONVERT PM MESSAGE #
BEGIN
IF MAXWORDS LS TEMP2/10
THEN # WSA BUFFER IS NOT BIG ENOUGH #
BEGIN
NIT$TRUNC[0] = 1; # PM MSG TRUNCATD#
TEMP2 = MAXWORDS*10; # SIZE OF PM #
END
OLDCP = 5; # INIT CHAR POS IN PM MSG #
OLDWP = 2; # INIT WORD POS IN PM MSG #
NEWCP = 0; # INIT CHAR POS IN WSA #
NEWWP = 1; # INIT WORD POS IN WSA #
P<MEM> = LOC(SUP$MES);
#
PM MESSAGES ARE ASSUMED TO BE IN 8/12
ASCII. IF CDCNET IS LATER ENHANCED
TO SEND PM MESSAGES IN 6/12 DISPLAY
CODE OR A QTRM APPLICATION IS USING
PRU INTERFACE ON 2550 NETWORK, THEN
THIS CODE WILL NEED TO BE CHANGED TO
SUPPORT PM MESSAGES IN 6/12 DISPLAY
CODE.
#
FOR J = 1 STEP 1 UNTIL TEMP2
DO # CONVERT CHARS ONE AT A TIME #
BEGIN
TEMP1 = B<OLDCP,7>MEM$WORD[OLDWP];
TEMP3 = TEMP1/10; # WRD INDEX #
TEMP1 = TEMP1 - TEMP3*10; # CHR IDX#
NEWCHAR = B<TEMP1*6,6>CONVW[TEMP3];
IF PMCONV EQ 2
THEN # CONVERT TO CONSOLE DISPLAY #
BEGIN
IF NEWCHAR GQ O"60"
THEN # NEED TO BLANK SPECIAL CHR#
BEGIN
NEWCHAR = O"55"; # BLANK CHAR #
END
END
B<NEWCP,6>WSA$WORD[NEWWP] = NEWCHAR;
OLDCP = OLDCP + 12; # NEXT PM CHAR#
IF OLDCP GQ 65
THEN # REACHED END OF THIS PM WORD#
BEGIN
OLDCP = 5; # INIT CHAR POS IN PM #
OLDWP = OLDWP + 1; # NEXT PM WORD#
END
NEWCP = NEWCP + 6; # NEXT WSA POS #
IF NEWCP GQ 60
THEN # REACHED END OF THS WSA WORD#
BEGIN
NEWCP = 0; # INIT CHAR POS IN WSA#
NEWWP = NEWWP + 1; # NEXT WSA WRD#
END
END
END
ELSE # COPY PM MSG TO WSA AS IS #
BEGIN
TEMP3 = ABHTLC[0] - 2; # NO OF WDS #
IF MAXWORDS LS TEMP3
THEN # WSA BUFFER IS NOT BIG ENOUGH #
BEGIN
NIT$TRUNC[0] = 1; # PM MSG TRUNCATD#
TEMP2 = MAXWORDS*5; # NO OF CHARS #
TEMP3 = MAXWORDS; # NO OF WDS #
END
P<MEM> = LOC(SUP$MES) + 1;
FOR J = 1 STEP 1 UNTIL TEMP3
DO # COPY PM MESSAGE TO WSA BUFFER #
BEGIN
WSA$WORD[J] = MEM$WORD[J];
END
END
NIT$CTLC[0] = TEMP2; # SIZE OF PM MSG #
END
END
END
ELSE # RECEIVED OFC/STP/N SUP MSG #
BEGIN
NIT$STATE[ACN] = STATE"PRUSTPN";
NIT$RC[0] = NITRTC"OFCSTPN"; # NIT RC #
END
END
END
END
END
GOTO END$A$PFC; # GO TO END OF CASE STATEMENT #
END
A$PFC$PRU:
#
PRU CONNECTION ESTABLISHMENT PROCESSING
#
BEGIN
ACN = PRUACN[0]; # ACN FROM PRU SUP MSG #
NIT$CON[0] = ACN; # APPLICATION CONNECTION NUMBER #
RESPONSE = TRUE; # SET FLAG TO STOP LOOPING #
IF EB[0]
THEN # ABNORMAL RESPONSE RECEIVED #
BEGIN
IF NIT$STATE[ACN] EQ STATE"WAITPRU"
THEN # APPLICATION DOES NOT KNOW ABOUT CON #
BEGIN
NIT$PARMADR[0] = 0;
QTENDT;
RESPONSE = FALSE;# CLEAR FLAG TO CONTINUE LOOPING#
END
ELSE # INFORM APP THAT PRU CON NOT ESTABLISHED #
BEGIN
NIT$STATE[ACN] = STATE"OK";
NIT$RC[0] = NITRTC"PRUONA"; # SET RETURN CODE #
NIT$SB$RC[0] = PRURC[0]; # RC FROM PRU/ON/A #
END
END
ELSE # PRU CONNECTION ESTABLISHED #
BEGIN
NIT$STATE[ACN] = STATE"PRUCN";
NIT$RC[0] = NITRTC"PRUONN"; # SET RETURN CODE #
END
GOTO END$A$PFC; # GO TO END OF CASE STATEMENT #
END
END$A$PFC:
FOUNDMATCH = TRUE; # END FOR LOOP FOR PFC SCAN #
END
END
IF (CONPOLL ) AND
(NOT RESPONSE)
THEN
BEGIN
NIT$CON[0] = 0; # RESET POLLING TO ASYNC #
END
END
ELSE
#
NO ASYNCHRONOUS SUPERVISORY MESSAGE HAS BEEN PROCESSED.
TRY TO GET DATA FOR APPLICATION.
#
BEGIN
#
IF CONNECTION POLLING IS IN EFFECT, THE CONNECTION NUMBER
MUST BE CHECKED BEFORE WE ISSUE THE NETGET CALL. IF AN
INVALID CONNECTION NUMBER WAS SPECIFIED, THE QTGET CALL IS
REJECTED.
#
IF CONPOLL
THEN # CONNECTION POLLING IS IN EFFECT #
BEGIN
IF NIT$CON[0] NQ 0
THEN # NONZERO CONNECTION NUMBER WAS SPECIFIED #
BEGIN
#
CHECK IF SPECIFIED CONNECTION NUMBER IS VALID
#
IF (NIT$CON[0] GR NIT$NO$TERMS[0] ) OR
(NIT$STATE[NIT$CON[0]] EQ S"NULL" ) OR
(NIT$STATE[NIT$CON[0]] EQ S"LEND" ) OR
(NIT$STATE[NIT$CON[0]] EQ S"LENT" ) OR
(NIT$STATE[NIT$CON[0]] EQ S"WCONENDN")
THEN # BAD CONNECTION NUMBER WAS SPECIFIED #
BEGIN
NIT$RC[0] = S"QTGETREJ"; # SET QTGET REJECT RC #
IF (NIT$STATE[NIT$CON[0]] EQ S"LEND" ) OR
(NIT$STATE[NIT$CON[0]] EQ S"LENT" )
THEN # CONNECTION HAS BEEN LOANED TO ANOTHER AP#
BEGIN
NIT$S$RC[0] = S"CONLOANED"; # STORE REASON FOR REJ#
END
ELSE # BAD CONNECTION NUMBER WAS SPECIFIED #
BEGIN
NIT$S$RC[0] = S"BADCN"; # STORE REASON FOR BAD CAL#
END
RESPONSE = TRUE; # TERMINATE LOOPING AND RETURN #
GOTO END$ABT$L;
END
ELSE # OKAY TO GET DATA FOR GIVEN CONNECTION NO#
BEGIN
NETGET(NIT$CON[0],HEADER,WSA,MAXWORDS); # GET DATA #
END
END
END
ELSE # LIST PROCESSING IS IN EFFECT #
BEGIN
#
TRY TO GET DATA MESSAGE FROM ANY CONNECTION
ALL CONNECTIONS ARE ON LIST = 1.
#
NETGETL(1,HEADER,WSA,MAXWORDS); # GET DATA FROM LIST #
END
BEGIN # BEGIN LIST = 1 ABT CASES #
GOTO SWTCH$ABT$L [ABHABT[0]];
ABT$L$NULL:
#
NO MESSAGE BLOCKS ARE AVAILABLE
#
BEGIN
NIT$RC[0] = S"NOBLK"; #PRESET RC TO NO BLOCK AVAIL #
IF NIT$SLEEP NQ 0
THEN
SLEEP = NIT$SLEEP;
ELSE
SLEEP = NIT$XSLEEP;
IF SLEEP EQ 0
THEN
BEGIN
RESPONSE = TRUE;
END
ELSE # IF SLEEP NQ 0 #
BEGIN
IF SLEEP LS 0
THEN
BEGIN
NETWAIT(4095,0); #WAIT UNTIL INPUT BLOCK AVAIL#
END
ELSE # IF SLEEP GT 0 #
BEGIN
IF NOSLEEP
THEN
RESPONSE = TRUE;
ELSE
BEGIN
NETWAIT(SLEEP,0);
NOSLEEP = TRUE; #ONLY SLEEP ONCE#
END;
END; #SLEEP GT 0 #
END; #IF SLEEP NQ 0#
GOTO END$ABT$L;
END
ABT$L$CMD:
#
SYNCHRONOUS COMMAND BLOCK PROCESSING
#
BEGIN
IF (ABHACT[0] EQ CT8ASCII
AND WSA$FC[0] EQ BIMARK)
OR (ABHACT[0] EQ CT12ASCII
AND WSA$P1[0] EQ BI
AND WSA$S1[0] EQ MARK)
THEN # RECEIVED BREAK MARKER SYNC SUP MSG #
BEGIN
ACN = ABHADR[0]; # APPLICATION CONNECTION NUMBER #
NIT$CON[0] = ACN;
IF (NIT$STATE[ACN] NQ S"WCONENDN") AND
(NOT AUTOBREAK) AND
(BREAKMARK)
THEN # INFORM APPLICATION ABOUT BREAK MARKER #
BEGIN
NIT$RC[0] = S"BI$MARK"; # SET RETURN CODE IN NIT#
RESPONSE = TRUE;
END
IF (NIT$STATE[ACN] EQ S"USRBRK") OR
(BREAKMARK)
THEN # WAITING FOR BI/MARK STATE #
BEGIN
NIT$STATE[ACN] = S"OK"; # BACK TO NORMAL STATE #
END
ELSE # WAITING FOR BI/MARK AND TO SEND RO/MARK #
BEGIN
NIT$STATE[ACN] = S"WROMARK"; # CHANGE STATE #
END
GOTO END$ABT$L;
END
END
ABT$L$BLK:
#
BLOCK BLOCK PROCESSING
#
ABT$L$MSG:
#
MESSAGE BLOCK PROCESSING
#
ABT$L$QBLK:
#
QUALIFIED BLOCK BLOCK PROCESSING
#
ABT$L$QMSG:
#
QUALIFIED MESSAGE BLOCK PROCESSING
#
IF ABHCAN NQ 0
THEN
GOTO END$ABT$L ; # IGNORE THIS MSG BLOCK AND #
# GO GET ANOTHER ONE #
BEGIN
ACN = ABHADR[0]; # APPLICATION CONNECTION NUMBER #
NIT$CON[0] = ACN;
# IF INPUT BLOCK UNDELIVERABLE OR #
IF ABHIBU[0] EQ 1
THEN # BREAK OFFENDING CONNECTION #
BEGIN
NIT$PARMADR[0] = 0;
QTENDT;
NIT$RC[0] = S"CON$BROKEN";
NIT$S$RC[0] = S"IBUSET"; # SET SEC RC FIELD IN NIT #
END
ELSE # DATA BLOCK WAS DELIVERED FROM NIP #
BEGIN
IF (AUTOBREAK) AND
( (NIT$STATE[ACN] EQ S"USRBRK") OR
(NIT$STATE[ACN] EQ S"WBIROMK") )
THEN
BEGIN
GOTO END$ABT$L; # IGNORE THIS MSG BLOCK AND #
# GO GET ANOTHER ONE #
END
IF ABHABT[0] EQ APPCMD # SYNCHRONOUS SUPERVISORY #
THEN # MESSAGE #
BEGIN
NIT$RC[0] = S"UNS$SCMD"; # REASON CODE 29 #
END
ELSE
BEGIN
NIT$RC[0] = S"OK"; # REGULAR DATA MESSAGE #
END
NIT$UP$ABH[NIT$CON[0]] = ABHWORD[0];
NIT$CTLC[0] = ABHTLC[0];
IF ABHTRU[0] NQ 0
THEN # DATA HAS BEEN TRUNCATED #
BEGIN
NIT$TRUNC[0] = 1; # SET TRUNCATION FLAG IN NIT #
END
IF ABHACT[0] EQ CT6DISPLAY
THEN
BEGIN
WORDS = ABHTLC[0] / WC;
CHARS = ABHTLC[0] - (WORDS * WC);
FOR TEMP3 = CHARS STEP 1 UNTIL 9 DO
BEGIN
C<TEMP3,1> WSA$WORD[WORDS] = " ";
END
END
ELSE
BEGIN
IF (ABHACT[0] EQ CT8ASCII) AND
(ICTD[0] EQ CT6DISPLAY) AND
(ABHABT[0] NQ APPCMD) AND
(NIT$DEVTYP[ACN] NQ 0)
THEN # NEED TO CHECK AND CONVERT SIZE OF MSG #
BEGIN
TEMP3 = ABHTLC[0] - (ABHTLC[0]/3)*3;
IF TEMP3 NQ 0
THEN # APP RECEIVED WRONG SIZE BLOCK FROM APP #
BEGIN
NIT$PARMADR[0] = 0;
QTENDT; # TERMINATE CONNECTION #
NIT$RC[0] = S"CON$BROKEN"; # STORE RETURN CODE#
NIT$S$RC[0] = S"RECBSZ"; # SET SEC RC FIELD #
END
ELSE # DIS CODE BLOCK ON A-A CON HAD RIGHT SIZE#
BEGIN
NIT$CTLC[0] = (ABHTLC[0]/3)*4; # NO OF CHARS #
END
END
END
END
RESPONSE = TRUE;
GOTO END$ABT$L;
END
END$ABT$L:
END
END
END # END ACN = 0 CASES #
END # END RESPONCE CONTROLLED LOOP #
RETURN;
END
TERM