*DECK HPRUSM
USETEXT NIPDEF
USETEXT ACB
USETEXT ACNB
USETEXT ACNT
USETEXT APPSTAT
USETEXT AT
USETEXT MSGIDX
USETEXT NBT
USETEXT NWLNTRY
USETEXT PARAMS
USETEXT PCNB
USETEXT PT
USETEXT PWL
USETEXT OVERLAY
USETEXT SSTCOM
USETEXT SUPMSG
PRGM HPRUSM; # PROCESS PRU INTERFACE SUPERVISORY MSG #
STARTIMS;
#
*1DC HPRUSM
* 1. PROC NAME AUTHOR DATE
* HPRUSM J.C. LEE 80/04/01
* S. WATANABE 81/03/16
*
* 2. FUNCTIONAL DESCRIPTION.
* PROCESS A PRU SUPERVISORY MESSAGE FROM APPLICATION.
*
* 3. METHOD USED.
* VALIDATE PRU SUPERVISORY MESSAGE,
* FOR SWITCH FILE COMMANDS OFC/START/R OR IFC/JOB/N, ISSUE SST
* REQUEST TO SWITCH FILE ASSIGNMENT FROM APPLICATION-S
* CONTROL POINT TO NAM-S CONTROL POINT
* FORMAT PRU WORKLIST FROM THE SUPERVISORY MESSAGE,
* LINK PRU WORKLIST TO PRU WORKLIST QUEUE OF ITS PRIORITY,
* UPDATE PRU WORKLIST POINTER IN PCNB,
* RELEASE USED PORTION OF NWL,
*
* 4. ENTRY PARAMETERS.
* ACBADDR APPLICATION ACB ADDRESS
* WLADDR WORKLIST ENTRY ADDRESS
*
* 5. EXIT PARAMETERS.
* NONE
*
* 6. COMDECKS CALLED AND SYMPL TEXTS USED
* ACB ACNB ACNT APPSTAT MSGIDX
* NBT NIPDEF NWLNTRY PARAMS
* PCNB PWL OVERLAY SUPMSG
* SSTCOM AT PT
*
* 7. ROUTINES AND OVERLAYS CALLED
* HLGLERR OVL ISSUE ERR/LGL SUPERVISORY MESSAGE
* XERRMSG OVL ISSUE ERROR MESSAGE
* ODAYFL OVL ISSUE DAYFILE MESSAGE
* OMSG DAYFILE MESSAGE
* OSCHAPP SCHEDULE APPLICATION
* OSREQ ISSUE RA+1 CALL
* OVLCALL LOAD AND EXECUTE OVERLAY
* XTRACE TRACE CALLS
*
* 8. DAYFILE MESSAGES.
* NIP/SST RC = XXB,JOBID = XXXX.
*
* THIS PROGRAM IS A PRIMARY OVERLAY LOADED BY SUBROUTINE OVLCALL.
* WHEN EXECUTION HAS COMPLETED, A JUMP IS MADE TO LOCATION RJMAIN
* TO RETURN TO THE CALLING PROGRAM.
*
* W A R N I N G - THIS PROGRAM CANNOT EXCEED THE PRIMARY
*CALL OPSIZE
*
* THIS OVERLAY IS CALLED BY HBSTTP.
*
#
STOPIMS;
#
EXTERNAL VARIABLES
#
XREF
BEGIN
PROC ABORT; # ABORT PROGRAM AND DAYFILE MSG #
PROC HCSTTP;
PROC HRELPWL; # RELEASE USED PORTION OF NWL #
PROC OMSG; # DAYFILE MESSAGE #
PROC OSCHAPP; # SCHEDULE APPLICATION #
PROC OSREQ; # ISSUE RA + 1 CALL #
PROC OVLCALL; # LOAD AND EXECUTE OVERLAY #
PROC XTRACE; # TRACE CALLS #
LABEL RJMAIN; # RETURN ADDRESS #
END
#
INTERNAL VARIABLES
#
ITEM
REASON, # REASON CODE FOR LOGICAL ERROR #
# OR SST CALL COMPLETION STATUS #
BLKSIZE, # BLOCK SIZE #
ACNBADDR, # ACNB ADDRESS #
WLPRI, # WORKLIST PRIORITY #
INDEX; # FOR LOOP VARIABLE #
#
TABLE OF PFC/SFC CODES OF PRU INTERFACE SUPERVISORY
MESSAGES FROM APPLICATION
#
DEF ENDPRUHSM#17#;
ARRAY PRUHSMTAB [0:ENDPRUHSM];
BEGIN
ITEM PRUHPFCSFC U(0,0,16) = [SETFLE, SETDEV,
OFCDTA,OFCSTRT,OFTSTRT,
IFCJOBN,IFCSTRT,IFTSTRT,
OFCSTP, OFCRSM,
IFCRSM, IFCEND, OFCRSTR,
OFCABRT, IFCABRT, IFCSRTT,
OFCTOM,
0];
END
# JUMP TABLE FOR PRU SUPERVISORY MESSAGE-S PFC/SFC #
SWITCH PRUHSMJT PRUSM2,PRUSM2,
PRUSM2,PRUSM1,PRUSM1,
PRUSM1,PRUSM2,PRUSM1,
PRUSM2,PRUSM0,
PRUSM2,PRUSM2,PRUSM2,
PRUSM0,PRUSM2,PRUSM2,
PRUSM2,
PRUSM3;
# ******************************************************************** #
BEGIN
CONTROL IFEQ DEBUG,1;
XTRACE("HPRSM") ;
CONTROL FI;
P<ACB> = ACBADDR; # APPLICATION ACB ADDRESS #
P<NWLENTRY> = WLADDR; # NWL ADDRESS #
P<SUPMSG> = WLADDR + AIPHSIZE + ABHSIZE; # ADDRESS OF PRU SM #
REASON = 0;
P<ACNT> = ACBACNT[0];
ACNBADDR = 0;
IF PRUACN[0] LQ ACNTHCN[0] AND PRUACN[0] GQ ACNTMINACN[0]
THEN
ACNBADDR = ACNTACNB[PRUACN[0] + ACNTHSIZE - ACNTMINACN[0]];
IF ACNBADDR NQ 0
THEN
BEGIN # ACN FOUND #
P<ACNB> = ACNBADDR; # ACNB ADDRESS #
P<PCNB> = ACNBNCNB[0]; # PCNB ADDRESS #
IF P<PCNB> EQ 0
THEN # CONNECTION BROKEN TEST #
BEGIN # ISSUE DAYFILE MESSAGE #
PARAMS1 = DFMSG03; # APP SENT BLOCK ON BROKEN CONN #
OVLNAME = XERRMSGP;
OVLCALL;
CONTROL IFEQ DEBUG,1;
#
IF DEBUG ON, DAYFILE ENTIRE BLOCK SENT ON BROKEN CONNECTION
#
PARAMS1 = WLADDR + AIPHSIZE; # ADDRESS OF BLOCK #
PARAMS2 = NWLEBS[0] - AIPHSIZE; # SIZE OF BLOCK #
OVLNAME = ODAYFLP;
OVLCALL;
CONTROL FI;
GOTO RJMAIN;
END
IF PCNBID[0] EQ PCNBIDVALUE
OR PCNBID[0] EQ LCNBIDVALUE
THEN # NETWORK-SIDE IS A PCNB #
BEGIN # PRU/ON/SM PROCESSED ON CONN #
WLPRI = CMDQP; # PRESET WL PRIORITY TO CMDQ #
#
VALIDATE PFC/SFC OF THE PRU SUPERVISORY MESSAGE
#
PRUHPFCSFC[ENDPRUHSM] = PFCSFC[0]; # GUARANTEE MATCH IN SRCH #
FOR INDEX = 0 STEP 1 DO
BEGIN
IF PRUHPFCSFC[INDEX] EQ PFCSFC[0]
THEN # FOUND A PFC/SFC MATCH #
GOTO PRUSM;
END
PRUSM:
#
SWITCH ON PRU SUPERVISORY MESSAGE-S PFC/SFC
#
GOTO PRUHSMJT [INDEX];
PRUSM0:
#
INTERRUPT COMMANDS OFC/RSM/R OR OFC/ABORT/R,
SET WORKLIST PRIORITY TO ICMDQP
#
WLPRI = ICMDQP;
GOTO PRUSM2; # QUEUE WORKLIST TO QCB #
PRUSM1:
IF PCNBFILE[0] NQ 0
THEN # FILE NOT YET TRANSFERRED BACK #
BEGIN
REASON = RLG"C"; # FILE STILL OUTSTANDING #
GOTO PRUSM4; # ISSUE ERR/LGL TO APP #
END
#
SWITCH FILE COMMANDS - OFC/START/R, IFC/JOB/N (FROM PRU
APPLICATIONS , I.E. QUEUE FILES) - IFT/START/R, OFT/START/R
( FROM FILE TRANSFER APPLICATIONS, I.E. LOCAL FILES )
ISSUE SCP REQUEST TO SWITCH FILE ASSIGNMENT FROM THE
APPLICATION-S CONTROL POINT TO NAM-S CONTROL POINT,
PROCESS SCP RETURN CODE
#
SSTPARAM[0] = 0; # CLEAR SST PARAMETER WORD #
SSTFNTS[0] = PRUFNT[0]; # FILE-S FNT ORDINAL FROM APP #
SSTFC[0] = SSTSQFFUCP; # SST FUNCTION CODE #
SSTJOBID[0] = ACBJNWD[0]; # ADD JOB IDENTIFICATION #
SSTPADDR[0] = LOC(SSTPARAM[0]); # FWA OF SST PARAMETER BLOCK#
OSREQ(SSTCALL[0]); # ISSUE SST RA+1 CALL #
REASON = SSTRC[0]; # SST COMPLETION STATUS #
IF REASON NQ 0
THEN # SST ERROR PROCESSING #
BEGIN
IF REASON EQ RC$UCPSO OR # APP SWAPPED OUT BY OS #
REASON EQ RC$UCPNF # APP FAILED #
OR REASON EQ RC$FNTIT # ILLEGAL FILE TYPE FOR SWITCH#
THEN
BEGIN
INDEX = REASON/8;
D14M2[0] = INDEX*O"100" + REASON - INDEX*8 + O"3333";
D14M3[0] = SSTJSN[0];
OMSG(DFMSG14,0); # DAYFILE SST RETURN STATUS #
IF REASON EQ RC$UCPSO
THEN # RESUME HOST WORKLIST PROC #
BEGIN # WHEN APP IS SWAPPED BACK IN #
ATASBS[ACBAN[0]] = TRUE; # APP SWAPPED OUT #
OSCHAPP(ACBADDR); # SCHEDULE APPLICATION #
END
ELSE # INITIATE APP FAILURE PROC #
BEGIN # REASON CODE 3 OR 4 #
IF REASON EQ RC$FNTIT
THEN
BEGIN # ILLEGAL FILE TYPE FOR SWITCHING #
REASON = RLG"A" ; # SEND ERR/LGL WITH RC = 11 #
# ILLEGAL FILETYPE FOR TRANSFERRING#
GOTO PRUSM4 ; # SEND ERR/LGL #
END
FAILADR = ACBADDR ; # SPECIFY ACB ADDRESS #
END # REASON CODE 3 OR 4 #
DONE = FALSE; # SUSPEND WORKLIST PROCESSING #
GOTO RJMAIN; # RETURN TO CALLING ROUTINE #
END
ELSE
BEGIN
RC[0] = REASON; # RETURN SST COMPLETION STATUS #
GOTO PRUSM3;
END
END
#
QUEUE FILE NOW TRANSFERRED TO NAM-S CONTROL POINT,
STORE FILE-S LFN AND FNTO IN PCNB
UPDATE FNT ORDINAL IN SUPERVISORY MESSAGE
#
PCNBLFN[0] = PRULFN[0];
PCNBFNTO[0] = SSTFNTR[0];
PRUFNT[0] = SSTFNTR[0];
PRUSM2:
#
FORMAT PRU WORKLIST FROM THE SUPERVISORY MESSAGE,
LINK PRU WORKLIST TO PRU WORKLIST QUEUE OF ITS PRIORITY LEVEL,
UPDATE WORKLIST POINTER IN PCNB IF NECESSARY.
#
BLKSIZE = NWLEBS[0]; # NWL ENTRY SIZE #
P<PWLHDR> = WLADDR; # PRU WORKLIST ADDRESS #
PWLBLKHDR[0] = 0; # CLEAR PWL BLOCK HEADER WORD #
PWLID[0] = PWLIDVALUE; # PRU WORKLIST ID #
PWLBS[0] = BLKSIZE; # PRU WORKLIST SIZE #
PWLWLHDR[0] = 0; # CLEAR PWL WORKLIST HEADER WORD#
PWLHN[0] = PCNBHN[0]; # HOST NODE NUMBER #
PWLTN[0] = PCNBTN[0]; # TERMINAL NODE NUMBER #
PWLCN[0] = PCNBCN[0]; # CONNECTION NUMBER #
PWLOP[0] = PWLOPHSM; # OPCODE, PROCESS APP-S SM #
P<PWLHDR> = LOC(PCNBIMMO[0]) + WLPRI; # PCNB-S PWL POINTER #
FOR WLPRI = WLPRI DO
BEGIN # SEARCH FOR LAST WORKLIST IN Q #
IF PWLNEXT[0] NQ 0
THEN # NOT LAST MEMBER OF PWL QUEUE #
P<PWLHDR> = PWLNEXT[0]; # UPDATE NEXT PWL ADDRESS #
ELSE # LAST PRU WORKLIST IN Q FOUND #
BEGIN
PWLNEXT[0] = WLADDR; # LINK CURRENT PWL TO PWL QUEUE #
GOTO PRUSM4;
END
END
PRUSM3:
#
RECEIVED INVALID PRU INTERFACE SUPERVISORY MESSAGE
#
REASON = RLG"ISM";
END
ELSE # NOT A PRU CONNECTION #
REASON = RLG"A";
END
ELSE # ACN NOT FOUND #
REASON = RLG"ACN";
PRUSM4:
IF REASON NQ 0
THEN
BEGIN # ERROR #
PARAMS1 = REASON; # REASON FOR REJECTING PRU/SM #
OVLNAME = HLGLERRP; # SEND ERR/LGL TO APP WITH RC #
OVLCALL; # LOAD AND EXECUTE OVERLAY #
END
GOTO RJMAIN;
END
TERM