*DECK HBSTTP
USETEXT NIPDEF
USETEXT ACB
USETEXT ACNB
USETEXT ACNT
USETEXT AT
USETEXT APPSTAT
USETEXT AHEADER
USETEXT DRHDR
USETEXT DUMPFLG
USETEXT MSGIDX
USETEXT NCNB
USETEXT NWLNTRY
USETEXT OVERLAY
USETEXT PARAMP
USETEXT PARAMS
USETEXT STPRESP
USETEXT SYSTIME
USETEXT NHEADER
USETEXT SUPMSG
PROC HBSTTP((ACNBAD),(TRIGGER),(BLKPTR));
STARTIMS;
#
*1DC HBSTTP
*
* 1. PROC NAME AUTHOR DATE
* HBSTTP C. BITTNER 81/05/15
*
* 2. FUNCTIONAL DESCRIPTION
* HOST BLOCK PROTOCOL (IVT) STATE TABLE PROCESSOR.
*
* 3. METHOD USED
* VALIDATE TRIGGER. SET CURRENT STATE (IF THERE IS NO ACNB
* THEN SET THE CURRENT STATE TO STATX), CALL XSTTP (STATE
* TABLE PROCESSOR) PASSING THE STATE TABLE ORDINAL,
* CURRENT IVT STATE AND TRIGGER. IF A LEGAL TRIGGER IS
* RETURNED, THEN DO THE FOLLOWING (IF VALUE NOT SET TO
* NOCHG):
* A) ACTION - EXECUTE HOST BLOCK STATE TABLE ACTION
* (ISSUE SM, ETC)
* B) NEWSTATE - UPDATE NEW HOST BLOCK PROTOCOL STATE
* C) TRIGC - TRIGGER HOST CONNECTION STATE TABLE
* D) TRIGB - TRIGGER NETWORK BLOCK PROTOCOL STATE TABLE
*
* IF AN ILLEGAL TRIGGER IS RETURNED THEN DO THE
* FOLLOWING: IF THE TRIGGER IS INTERNAL TO NIP
* THEN ABORT NIP. IF ILLEGAL EXTERNAL TRIGGER -
* ISSUE ERR/LGL TO APPLICATION.
*
*
*
* 4. ENTRY PARAMETERS
* ACNBAD - ACNB ADDRESS
* TRIGGER - HOST BLOCK PROTOCOL STATE TABLE TRIGGER
* BLKPTR - ADDRESS OF SM BUFFER
*
* 5. EXIT PARAMETERS
* NONE
*
* 6. SYMPL TEXTS USED
* NIPDEF ACB
* ACNB ACNT
* AT APPSTAT
* DUMPFLG OVERLAY
* PARAMS STPRESP
*
* 7. ROUTINES CALLED
* ABORT - ABORT NIP
* BLINK - LINK DATA BLOCK TO DATA RING
* HBCHECK - VALIDATE CHARACTER TYPE
* HCSTTP - HOST CONNECTION STATE TABLE PROCESSOR
* HFASTQ - QUEUE UPLINE MESSAGES TO ACNB
* HSFCACK - SEND FC/ACK OR FC/NAK
* HUPDDAW UPDATE DATA AVAILABLE WORD IN ACB
* MGETS - ALLOCATE BUFFER
* HRELPWL - RELEASE USED PORTION OF NWL
* MRELS - RELEASE BUFFER
* NBSTTP - NETWORK BLOCK PROTOCOL STATE TABLE PROCESSOR
* OSCHAPP - SCHEDULE APPLICATION
* OVLCALL - LOAD AND EXECUTE OVERLAY
* XSTTP - STATE TABLE PROCESSOR
* XTRACE - RECORD PROCEDURE CALL
* STRTSW OVL CALL HCRSWHN/HCONREQ/RELACNB
* HSINTRU OVL SEND INTR/USR TO APPL
* HSFCBRK OVL SEND FC/BRK TO APPL
* HPRUSM OVL PROCESS PRU SM
* HSINTR OVL SEND FC/INIT/R TO APPL
* HPRUONX OVL SEND PRU/ON/A
* STPHERR OVL SEND STP ERROR MESSAGE
* HLGLERR OVL SEND ERR/LGL
* XERRMSG OVL OUTPUT ERROR MESSAGE
*
* 8. DAYFILE MESSAGES AND OTHER IMPORTANT INFORMATION
* "NIP INTERNAL ERROR - HBSTTP1"
* "NIP INTERNAL ERROR - HBSTTP2"
* "NIP/HBSTTP ERR AN= ,CN= ,TRIG,STATE"
* "INVALID TRIGGER NUMBER - HBSTTP"
*
#
STOPIMS;
#
INPUT PARAMETERS
#
ITEM ACNBAD; # ACNB ADDRESS #
ITEM TRIGGER; # HOST BLOCK PROTOCOL STATE TABLE TRIGGER #
ITEM BLKPTR; # ADDRESS OF BLK BUFFER #
#
EXTERNAL VARIABLES
#
XREF
BEGIN
PROC BLINK ;
PROC ABORT; # ABORT NIP #
PROC LOCLLCB; # LOCATE LLCB #
PROC HCSTTP; # HOST SIDE CONNECTION STATE TABLE #
PROC HFASTQ ;
PROC HSFCACK ;
PROC HUPDDAW; # UPDATE DATA AVAILABLE WORD IN ACB #
PROC MGETS ;
PROC MRELS; # RELEASE BUFFER #
PROC NBSTTP; # NETWORK BLOCK PROTOCOL STATE TABLE PROC #
PROC OMSG; # ISSUE DAYFILE MESSAGE #
PROC OSCHAPP ;
PROC OVLCALL; # LOAD AND EXECUTE OVERLAY #
PROC XSTTP; # STATE TABLE PROCESSOR #
PROC XTRACE; # RECORD PROCEDURE CALL #
END
#
INTERNAL VARIABLES
#
SWITCH HBACTION HB0,HB1,HB2,HB3,HB4,HB5,HB6,HB7,HB8,HB9,
HB10,HB11,HB12,HB13,HB14,HB15,HB16;
ITEM ACNTINDX; # ACNT INDEX #
ITEM AN; # APPLICATION NUMBER #
ITEM ACN ; # CONNECTION NUMBER #
ITEM CURST; # CURRENT STATE #
ITEM LLCBAD; # LLCB ADDRESS #
ITEM RESP; # RESPONSE WORD RETURNED FROM STAT TAB PRO#
ITEM TEMP ;
BASED ARRAY NHWORD2 P(1) ;
BEGIN
ITEM NHINTCHR U (0,0,8) ;
END
#**********************************************************************#
BEGIN
CONTROL IFEQ DEBUG,1;
XTRACE("HBSTT") ;
CONTROL FI;
# VALIDATE TRIGGER NUMBER #
IF TRIGGER LQ HBMTR AND TRIGGER GQ 0
THEN
BEGIN # VALID TRIGGER NUMBER #
P<ACNB> = ACNBAD; # BASE ACNB #
IF P<ACNB> EQ 0
THEN
BEGIN # ERROR - NO ACNB #
D27M2[0] = "HBSTTP1";
ABORT(DFMSG27,0); # "NIP INTERNAL ERROR" #
END
ELSE
BEGIN
AN = ACNBAN[0]; # APPLICATION NUMBER #
P<ACB> = ATACBA[AN]; # BASE ACB #
P<ACNT> = ACBACNT[0]; # BASE ACNT #
ACN = ACNBACN[0] ;
ACNTINDX = ACN + ACNTHSIZE - ACNTMINACN[0] ;
CURST = ACNTIS[ACNTINDX]; # IVT STATE #
END
XSTTP(HBORD,CURST,TRIGGER,RESP);
P<STRESP> = LOC(RESP); # RESPONSE WORD #
IF LEGTRIG[0]
THEN
BEGIN # LEGAL TRIGGER #
IF ACTION[0] NQ NOCHG
THEN
GOTO HBACTION[ACTION[0]]; # EXECUTE PROPER ACTION #
ELSE
GOTO HBA;
HB0:
#
DLACNB (ACTION NO. 0)
DELETE ACNB
#
PARAMS1 = P<ACNB>; # ACNB ADDRESS #
PARAMS5 = FALSE ; # NOT A SWICTH CASE #
PARAMS8 = FALSE; # NOT LOANING CONNECTION #
PARAMS9 = STRTSX"RACNB$" ;
OVLNAME = STRTSWP; # OVERLAY NAME #
OVLCALL; # LOAD AND EXECUTE OVERLAY #
GOTO HBA;
HB1:
# INTUSR ( ACTION NO. 1 )
SEND INTR/USR TO APPLICATION
#
P<NHEADER> = BLKPTR + BLKHSIZE ;
PARAMS1 = P<ACNB> ;
P<NHWORD2> = BLKPTR + BLKHSIZE + NBHSIZE ;
IF ACNBINTR[0] EQ 0
THEN
ACNBINTR[0] = NHINTCHR[0] ; # PUT INTERRUPT CHAR INTO ACNB #
OVLNAME = HSINTRUP ; # OVERLAY NAME #
OVLCALL ;
ACNBINTR[0] = 0 ; # CLEAR THE INTRP CHAR #
GOTO HBA ;
HB2:
#
FCBRK1 ( ACTION NO. 2 )
SEND FC/BRK TO APPLICATION. DISCARD SYNC DATA FROM ACNB
#
PARAMS1 = P<ACNB> ;
PARAMS2 = BLKPTR ;
OVLNAME = HSFCBRKP ;
OVLCALL ;
GOTO HBA ;
HB3:
#
FCRST ( ACTION NO. 3 )
SEND FC/RST TO APPLICATION. (USE SAME OVERLAY AS BRK)
#
PARAMS1 = P<ACNB> ;
PARAMS2 = 0 ; #( SIGNALS OVERLAY THAT THIS IS A RESET)#
OVLNAME = HSFCBRKP ;
OVLCALL ;
GOTO HBA ;
HB4:
#
SEND PRU/ON/A WITH REASON CODE = 3
#
PARAMP1 = 1; # INFORM HPPUT PRU/ON REJECTED #
IF ACBERCNT[0] LS MAXLGERR
THEN # OKAY TO GENERATE PRU/ON/A #
BEGIN
PARAMS1 = RPRU"CNV"; # REASON CODE FOR PRU/ON/A SM #
OVLNAME = HPRUONXP; # NAME OF OVERLAY TO LOAD #
OVLCALL; # LAOD AND EXECUTE OVERLAY #
END
ELSE # REACHED MAX NO OF ERR SUP MSG #
BEGIN
IF ACBERCNT[0] EQ MAXLGERR
THEN # REACHED MAX NO OF ERR SUP MSG #
BEGIN
PARAMS1 = RLG"IAL"; # ERR/LGL RC FOR TOO MANY ERRORS#
OVLNAME = HLGLERRP; # NAME OF OVERLAY TO LOAD #
OVLCALL; # LOAD AND EXECUTE OVERLAY #
END
END
GOTO HBA ;
HB5:
#
APLMSG (ACTION NO. 5)
INCREMENT APPLICATION BLOCK LIMIT
TURN OFF TLO FLAG IF -MSG- BLOCK ON HALF-DUPLEX CONNECTION.
#
P<NWLENTRY> = BLKPTR ;
ACNTABO[ACNTINDX] = ACNTABO[ACNTINDX] + 1;
GOTO HB7;
HB6:
#
EXECUTE PFC-S FROM PRU APPLICATIONS ( IFC, OFC, IFT, OFT, XFT )
#
OVLNAME = HPRUSMP ;
OVLCALL ;
GOTO HBA ;
HB7:
#
BRKDSM (ACTION NO. 7)
TURN OFF TLO FLAG IF A -MSG- BLOCK ON A HALF-DUPLEX CONNECTION.
#
P<NWLENTRY> = BLKPTR;
IF (ACNBTLO[0] ) AND # TEMP LIST OFF FLAG SET #
( (NWLABT[0] EQ APMSG ) OR # DOWNLINE MSG BLOCK #
(NWLABT[0] EQ APPQMSG) ) # DOWNLINE QMSG BLOCK #
THEN # NEED TO UPDATE NO OF DELIVERABLE BLKS #
BEGIN
ACNBTLO[0] = FALSE; # CLEAR TEMP LIST OFF FLAG #
HUPDDAW(P<ACB>,P<ACNB>,0,ACNBBLKSQ[0]); # UPDATE NO OF DELIV #
END
GOTO HBA ;
HB8:
#
FCINITR (ACTION NO.8)
SEND FC/INIT/R TO APP
#
PARAMS1 = ACN ;
PARAMS2 = AN; # APPLICATION NUMBER #
OVLNAME = HSINITRP; # OVERLAY NAME #
OVLCALL; # LOAD AND EXECUTE OVERLAY #
GOTO HBA;
HB9:
#
HBUINIT (ACTION NO. 9)
CHECKS AND ALLOWS ONLY A-A CONNECTION
#
IF ACNBDT[0] NQ DT$INTA AND
ACNBDT[0] NQ DT$INTE
THEN
BEGIN
LEGTRIG[0] = FALSE ; # SIGNALS TO ENTER ERROR PROCESSING #
GOTO ENDACTION ;
END
ELSE
GOTO HBA ;
HB10:
#
FCACKX ( ACTION NO. 10 )
SEND FCACK OR FCNAK TO APPLICATION
#
HSFCACK(BLKPTR,P<ACNB>) ;
GOTO HBA ;
HB11:
#
SAVE ( ACTION NO. 11 )
SAVE THE INTERUPT CHARACTER INTO THE ACNB
THIS ACTION CAN BE USED TO SAVE THE REASON CODE IN UPLINE
BREAK FOR AN A TO A CONNECTION DURING INITIZATION.
#
P<NHEADER> = BLKPTR + BLKHSIZE ;
ACNBINTR[0] = NHDBC[0] ; # SAVE THE INTERUPT CHARACTER #
GOTO HBA ;
HB12:
#
QUEUE ( ACTION NO. 12 )
QUEUE DATA ON ACNB
#
HFASTQ (BLKPTR,P<ACNB>) ;
GOTO HBA ;
HB13:
#
SEND PRU/ON/A WITH RC = 2
#
PARAMP1 = 1; # INFORM HPPUT PRU/ON REJECTED #
IF ACBERCNT[0] LS MAXLGERR
THEN # OKAY TO GENERATE PRU/ON/A #
BEGIN
PARAMS1 = RPRU"CNT"; # REASON CODE FOR PRU/ON/A SM #
OVLNAME = HPRUONXP; # NAME OF OVERLAY TO LOAD #
OVLCALL; # LAOD AND EXECUTE OVERLAY #
END
ELSE # REACHED MAX NO OF ERR SUP MSG #
BEGIN
IF ACBERCNT[0] EQ MAXLGERR
THEN # REACHED MAX NO OF ERR SUP MSG #
BEGIN
PARAMS1 = RLG"IAL"; # ERR/LGL RC FOR TOO MANY ERRORS#
OVLNAME = HLGLERRP; # NAME OF OVERLAY TO LOAD #
OVLCALL; # LOAD AND EXECUTE OVERLAY #
END
END
GOTO HBA ;
HB14:
#
INTAPP ( ACTION NUMBER 14 )
SET ACNBICMDR
#
IF ACNBICMDR[0]
THEN # APPLICATION INTERRUPT ALREADY PENDING #
TRIGB[0] = NOCHG; # CLEAR NETWORK BLOCK TRIGGER #
ELSE
ACNBICMDR[0] = TRUE; # SET DOWNLINE INTERRUPT PENDING FLAG #
GOTO HBA ;
HB15:
#
SINTRSP ( ACTION NO 15 )
SEND INTR/RSP TO APPLICATION
#
IF ACNBICMDR[0]
THEN
BEGIN
MGETS(LINTR+BLKHSIZE+ABHSIZE, TEMP,TRUE) ;
P<AHEADER> = TEMP + BLKHSIZE ;
ABHABT[0] = APPCMD ;
ABHACT[0] = CT60TRANS ;
ABHTLC[0] = LINTR ;
P<SUPMSG> = TEMP + BLKHSIZE + ABHSIZE ;
PFCSFC[0] = INTRRSP ;
INTRACN[0] = ACNBACN[0] ;
BLINK(TEMP,P<ACB>) ;
OSCHAPP(P<ACB>) ;
ACNBICMDR[0] = FALSE ;
END
GOTO HBA ;
HB16:
PARAMP1 = 1; # SET PARAMP1 TO 1 TO SIGNAL NO #
GOTO HBA; # PCNB CONVERSION, PRUON IS NOT O.K.#
HBA:
IF NEWSTATE[0] NQ STATX
THEN
BEGIN
ACNTIOS[ACNTINDX] = CURST; # SET OLD IVT STATE #
ACNTITR[ACNTINDX] = TRIGGER; # SET OLD IVT TRIGGER #
IF NEWSTATE[0] NQ NOCHG
THEN
ACNTIS[ACNTINDX] = NEWSTATE[0]; # UPDATE NEW IVT STATE #
END
IF TRIGC[0] NQ NOCHG
THEN
HCSTTP(P<ACB>,ACN,TRIGC[0],0) ;
IF TRIGB[0] NQ NOCHG
THEN
BEGIN # TRIGGER NETW BLOCK PROT STP #
P<NCNB> = ACNBNCNB[0]; # NCNB ADDRESS #
CONTROL IFEQ DEBUG,1;
IF P<NCNB> EQ 0
THEN
BEGIN
D27M2[0] = "HBSTTP2";
ABORT(DFMSG27,0); # "NIP INTERNAL ERROR" #
END
CONTROL FI;
NBSTTP(P<NCNB>,TRIGB[0],BLKPTR);
END
ENDACTION:END
IF NOT LEGTRIG[0]
THEN
BEGIN # ILLEGAL TRIGGER #
IF TRIGGER LS HBMINXT OR TRIGGER GR HBMAXXT
THEN
BEGIN # TRIGGER INTERNAL TO NIP #
PARAMS1 = AN; # APPLICATION NUMBER #
PARAMS2 = ACN ;
PARAMS3 = TRIGGER; # ILLEGAL TRIGGER #
PARAMS4 = CURST; # CURRENT BLOCK PROT STATE #
PARAMS6 = "HBSTTP"; # NAME OF STATE TABLE PROCESSOR #
OVLNAME = STPHERRP; # ISSUE STP ERROR MESSAGE #
OVLCALL; # LOAD AND EXECUTE OVERLAY #
ABORT(0,0); # ABORT NIP #
END
ELSE
BEGIN # ILLEGAL EXTERNAL TRIGGER FROM APPL #
IF TRIGGER EQ RMSG
THEN
PARAMS1 = RLG"ACN"; # RC=4 INVALID ACN #
ELSE
PARAMS1 = RLG"ISM"; # RC=7 ILLOGICAL SM #
OVLNAME = HLGLERRP; # SEND ERR/LGL TO APPL #
OVLCALL; # LOAD AND EXECUTE OVERLAY #
END
END
END
ELSE
BEGIN # TRIGGER NUMBER OUT OF RANGE #
PARAMS1 = DFMSG26;
PARAMS6 = "HB";
OVLNAME = XERRMSGP;
OVLCALL;
END
RETURN;
END
TERM