*DECK CSSCHB USETEXT TEXTCS; USETEXT TEXTSS; USETEXT TXTSMCS; USETEXT TXTAPSS; USETEXT TXTSUSS; PROC CSSCHB; # TITLE CSSCHB - COMPLETE HOST BROADCAST # BEGIN #CSSCHB# # ** CSSCHB - COMPLETE HOST BROADCAST. * * C. BRION 82/04/20. * * THIS PROCEDURE PROCESSES THE NORMAL AND ABNORMAL RESPONSES TO * THE HOST BROADCAST SET OF SMS. * * PROC CSSCHB * * ENTRY * 1. WCBWORD[0] = WORD COUNT BUFFER. * 2. ABHWORD[0] = APPLICATION BLOCK HEADER OF SM. * 3. MSGBUF[0] = BODY OF MSG SM RESPONSE. * * EXIT * 1. IF ABNORMAL RESPONSE -- SEND IT OFF TO THE EVENT QUEUE. * 2. IF NORMAL RESPONSE -- SEND TERMINAL TEXT TO THE CONNECTION * TRAFFIC QUEUE INDICATING MESSAGE WAS SENT. * # # **** PROC CSSCHB XREF LIST # XREF BEGIN PROC MOVEI; # MACREL-MOVE INDIRECT # PROC SSBCBW; # SS-CLEAR BIT IN WORD # PROC SSBFPB; # FIND PRIORITY BIT # PROC SSTAQE; # SS-ACCEPT QUEUE ENTRY # END # **** # ITEM FOUND B; # NPUCB FOUND INDICATOR # ITEM I U; # LOOP INDUCTION VAR # ITEM NORD U; # NPUCB ORDINAL # ITEM OORD U; # OCB ORDINAL # # * FLG$WORD - BASED ARRAY THAT POINTS TO THE PENDING SEND REQUEST * BIT MAPS IN THE NPUCB-S. # BASED ARRAY FLG$WORD [00:00] S(NPCBSZ$); BEGIN ITEM FW$WORD I(00,00,60); END # * HBSENT - MESSAGE FOR MESSAGE SENT. # ARRAY HBSENT [00:00] S(3); BEGIN ITEM HBS$TX0 C(00,00,05) =["NPU: "]; ITEM HBS$NP C(00,30,07); ITEM HBS$TXT C(01,12,14) = [", MESSAGE SENT"]; ITEM HBS$ZER U(02,36,24) =[0]; END WCB$WORD[1] = WCB$WORD[0]; # CLEAR ENTRY WORDS # ABHWORD[1] = ABHWORD[0]; FOUND = FALSE; # INIT NPUCB FOUND FLAG # # * SEARCH THE NPUCB ARRAY FOR A NPUCB WITH MATCHING NODES TO THE * INCOMING RESPONSE SM. # FOR I = 0 STEP 1 WHILE (NOT FOUND AND I LS CSNPCNT) DO BEGIN IF (ABHDN[0] EQ NPU$HID[I] AND ABHSN[0] EQ NPU$NID[I]) THEN BEGIN FOUND = TRUE; NORD = I; END END # * IF NPUCB FOUND, THEN CHECK TO SEE IF THE COMMAND IS STILL ACTIVE * BY CHECKING THE SEND OPERATOR OF THE NPUCB. IF OUT OF RANGE, THEN * THE COMMAND WAS PREMATURELY ENDED - JUST CLEAR OUT THE NPUCB. # IF FOUND THEN BEGIN IF NPU$OPSD[NORD] GR MAXACN$ THEN NPU$OPSD[NORD] = 0; ELSE # * SEND COMMAND STILL ACTIVE FOR THIS NPU. CLEAR THE NPUCB * AND CHECK THE NUMBER OF NPUS OUTSTANDING FOR THE SEND * COMMAND. IF COMMAND MULTIPLE AND STILL HAS OUTSTANDING * NPUS TO RESPOND, THEN DO NOT CLEAR OCB BUT DECREMENT * NUMBER OF SEND NPUS IN THE OCB. # BEGIN OORD = NPU$OPSD[NORD]; NPU$OPSD[NORD] = 0; OC$CNPU[OORD] = 0; OC$NCNT[OORD] = OC$NCNT[OORD] - 1; P = LOC(NPU$SDFLGS[NORD]); SSBCBW(FLG$WORD,OORD); # * IF ABNORMAL RESPONSE, SEND SUPERVISION EVENT. # IF EB[0] THEN BEGIN IF SFC[0] EQ LI THEN WCB$SMID[1] = SMID"MSGLIA"; ELSE IF SFC[0] EQ TE THEN WCB$SMID[1] = SMID"MSGTEA"; ELSE WCB$SMID[1] = SMID"MSGLLA"; ABHCN[1] = OORD; SSTAQE(P,WCBUF[1],ABH[1],CSSM[0]); END ELSE # * SEND COMPLETED MESSAGE TO OPERATOR. # BEGIN HBS$NP[0] = NPU$NAME[NORD]; WCB$WORD[1] = 0; ABHWORD[1] = 0; WCB$SMID[1] = SMID"TTEXT"; WCB$IAF[1] = TRUE; # * IF MORE SEND NPUS NEED TO RESPOND, SET INPUT ALLOWED FALSE. * OTHERWISE, CLEAR OCB AND SET IAF TRUE. # IF OC$NCNT[OORD] NQ 0 THEN WCB$IAF[1] = FALSE; ELSE OC$UVERB[OORD] = 0; WCB$WC[1] = 5; ABHADR[1] = OORD; SSTAQE(P,WCBUF[1],ABH[1],HBSENT[0]); END END # * IF THERE ARE MORE SENDS PENDING, GE AHEAD AND SEND IT OUT. # IF NPU$SDFLGS[NORD] NQ 0 THEN BEGIN P = LOC(NPU$SDFLGS[NORD]); SSBFPB(FLG$WORD,OORD); NPU$OPSD[NORD] = OORD; WCB$WORD[1] = OC$WC[OORD] + 2; ABHWORD[1] = OC$TLC[OORD]; ABHABT[1] = APPSUP; ABHBT[1] = APPSUP; ABHDN[1] = NPU$NID[NORD]; ABHSN[1] = NPU$HID[NORD]; ABHACT[1] = ACTCSNP$; MOVEI(OC$WC[OORD],LOC(OC$SM[OORD]),LOC(CSSM[1])); SSTAQE(P,WCBUF[1],ABH[1],CSSM[1]); END END END #CSSCHB# TERM