*DECK HPNON USETEXT NIPDEF USETEXT ACB USETEXT ACNT USETEXT AHEADER USETEXT APPSTAT USETEXT AT USETEXT DRHDR USETEXT FLIST USETEXT LLCB USETEXT MSGIDX USETEXT NWLHEAD USETEXT OVERLAY USETEXT PARAMP USETEXT PARAMS USETEXT PT USETEXT SCPCOM USETEXT SUPMSG USETEXT TNT PRGM HPNON; # PROCESS A *NET ON* WORK LIST ENTRY # *CALL ON STARTIMS; # *1DC HPNON * * 1. PROC NAME AUTHOR DATE * HPNON E. GEE 78/01/25 * * 2. FUNCTIONAL DESCRIPTION * PROCESS AIP NETON WORKLIST ENTRY * * 3. METHOD USED. * SET UP SF.CPID SCP FUNCTION TO CHECK * APPLICATION PRIVILEDGES AND ACCESS LEVEL. * ISSUE SCP FUNCTION * PROCESS SCP FUNCTION RETURN CODE * VALIDATE MINACN/MAXACN VALUES. * CHECK IF NVF NETTING ON * IF NVF NETTING ON, CHECK IF LEGITIMATE NVF BY MAKING SURE * NVF HAS NOT ALREADY NETTED ON OR NIP IS WAITING FOR * NET/OFF/R OR FAIL/APPL/R * IF LIBRES NOT DEFINED, NVF MUST ALSO BE SYSTEM * RESIDENT * OTHERWISE, ABORT MALICIOUS APP TRYING TO MASQUERADE AS NVF * IF IN SHUTDOWN MODE OR NVF HAS NOT NETTED ON, REJECT NETON * IF NOT IN SHUTDOWN MODE, THEN CREATE ACB * IF ACB CREATED, FINISH PROCESSING NETON * IF APP IS NVF OR NETON IS BEING REJECTED, THEN CREATE SCP * FUNCTION LIST TO WRITE NETON AWL TO APP FL AND CLEAR * SCP SHORT TERM CONNECTION * ISSUE SCP FUNCTION * PROCESS SCP FUNCTION RETURN CODE * * 4. ENTRY PARAMETERS. * NWLADDR ADDRESS OF NWL FOR APP NETTING ON * * 5. EXIT PARAMETERS. * ABTAPPF ABORT FLG SET IF NIP GET SCP RC = RCUCPAOOR * OR (NON-SUP) APP TRIED TO NETON AS NVF * * 6. COMDECKS CALLED AND SYMPL TEXTS USED. * ACB APPSTAT AT DRHAT * FLIST NSGIDX NIPDEF NWLHEAD ON * OPSIZE OVERLAY PARAMP PARAMS PT * SCPCOM SUPMSG * * 7. ROUTINES AND OVERLAYS CALLED. * BLDACB OVL BUILD ACB AND ACNT FOR APPLICATION * HCNONFL OVL CREATE NETON FUNCTION LIST * HPNONAP OVL COMPLETE PROCESSING NETON OF (NON-SUP) APP * HPNONSR OVL PROCESS SF.STAT FUNCTION RETURN CODE * MRELS RELEASE BUFFER SACBE * OSCCALL ISSUE SCP FUNCTION * OSCHAPP SCHEDULE APPLICATION * OSCPSI OVL SWAPIN (NO-ACB) APPLICATION * OVLCALL LOAD AND EXECUTE OVERLAY * RELACB OVL RELEASE ACB AND ACNT FROM APPLICATION * XERRMSG OVL ISSUE ERROR DAYFILE MESSAGE * XTRACE RECORD PROCEDURE CALLS * * 8. DAYFILE MESSAGES. * SECURITY VIOLATION. THIS MESSAGE IS PUT OUT IF THE * APPLICATION ATTEMPTING TO NETON SAYS IT IS A NVF THAT * NIP HAS ALREADY NETTED-ON. * * ADDRESS OUT OF RANGE. IF THE RETURN CODE FROM THE OPERATING * SYSTEM CALL SF.LIST REQUEST IS RCUCPAOOR. * * BAD MINACN/MAXACN VALUE JOBID = . INVALID MINACN * OR MAXACN ON NETON. * * 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 HHIR. * # STOPIMS; # EXTERNAL VARIABLES # XREF BEGIN PROC BLINK ; # LINK MESSAGE TO NVF ACB # PROC HWRAVAL; # WRITE DATA AVAILABLE WORD # PROC MRELS; # RELEASE BUFFER SACBE # PROC MGETS ; # GET BUFFER FOR CR/SLL # PROC OSCCALL; # SET LONG TERM CONNECTION # PROC OSCHAPP; # SCHEDULE AN APPLICATION # PROC OVLCALL; # LOAD OVERLAY # PROC XTRACE; # TRACE CALLS # LABEL RJMAIN; # RETURN ADDRESS IN OVLCALL # END # INTERNAL VARIABLES # ITEM CRADR I ; # ADDRESS OF CR/SLL # ITEM DELACB B; # TRUE = DELETE ACB AND FORGET ABOUT NETON# ITEM SCPADDR; # ADDR OF SCP FUNC LIST TO REJECT NETON # ITEM PRIVU B; # PRIVILEGED USER BIT # ITEM PRIVP B; # PRIVILEGED PROGRAM BIT # ITEM AAL; # APPLICATION ACCESS LEVEL # ITEM INDEX; # INDEX FOR SCANNING SUP NAME TABLE # ITEM ANAME C(WC); # APPLICATION NAME # ITEM NVFNETON B; # NVF NETON FLAG # ITEM MAXACN; # MAXIMUM ACN VALUE # ITEM MINACN; # MINIMUM ACN VALUE # ITEM NUMRCN ; # NUMBER OF RESERVED OUTGOING CONN. # ITEM RELADDR; # ADDR OF NEXT EMPTY WORD IN NWL # ITEM RELSIZE; # SIZE OF UNUSED AREA IN NWL # ITEM AN; # APPLICATION PROCESS NUMBER # ITEM ONADDR; # TEMP VAR TO SAVE DATA AVAIL ADDR # ITEM RRC ; # RESPONSE CODE # ARRAY SCPAWD [0:0] P(2); BEGIN ITEM SCPAWD0 U(0,0,60); ITEM SCPAWD1 U(1,0,60); END #**************** E X E C U T A B L E C O D E *****************# BEGIN CONTROL IFEQ DEBUG,1 ; XTRACE("HPNON") ; CONTROL FI; # C L E A R A P P L I C A T I O N N U M B E R # AN = 0; CONTROL OVERLAP NWLHEADER, SCPCALL; P = NWLADDR; # ADDR OF NWL BUFFER # JOBID = NWLJOBID[0]; # APPLICATION JOB ID WORD # CBA = NWLHADDR[0]; # UCP COMPLETION BIT ADDRESS # AWLA = NWLAWLADDR[0]; # UCP APPLICATION WORKLIST ADDRESS # # SET ABORT PARAMS IN CASE APP IS TO BE ABORTED # ABTJOBID = JOBID; # JOB ID WORD # P = NWLADDR + NWLHSIZE; # ADDR OF NETON WORKLIST ENTR # ANAME = ONANAME[0]; # APPLICATION NAME # MINACN = ONMINACN[0]; # MININUM ACN VALUE # NUMRCN = B<36,12>ONMAXACN[0] ; # NUMBER OF RESERVED OUTGOING CN# MAXACN = B<48,12>ONMAXACN[0] ; # THE MAX ACN FROM APPLICATION # ONADDR = ONDAWADR[0]; # SAVE DATA AVAIL ADDR # RELADDR = NWLADDR; # ADDR OF BUF TO REL AT END OF NETON PROC # RELSIZE = SIZENWL; # SIZE OF BUF TO REL AT END OF NETON PROC # # CREATE SF.CPID SYSTEM CONTROL POINT FUNCTION LIST # P = NWLADDR; SCPWD0[0] = 0; SCPID[0] = NAFLIDVALUE; # (NO ACB) SCP FUNCTION LIST ID VALUE # SCPBS[0] = SCPSIZE; # SIZE OF (NO ACB) SCP FUNCTION LIST # SCPFW[0] = 0; SCPJOBID[0] = JOBID; # APPLICATION JOB ID WORD # P = LOC(SCPFW[0]); SCPFC[0] = SFCPID; # SCP SF.CPID FUNCTION CODE # SCPFP[0] = 1; # TO GET ACCESS LEVEL # SCPSCPA[0] = LOC(SCPAWD1[0]); # ISSUE SYSTEM CONTROL POINT CALL # OSCCALL(FLE); # PROCESS SYSTEM CONTROL POINT CALL RETURN CODE # RRC = SCPRC[0]; IF RRC NQ 0 THEN # SCP FUNCTION NOT COMPLETED # BEGIN # PROCESS NONZERO SF.STAT RETURN CODE # OVLNAME = HPNONSRP; # NAME OF OVERLAY TO LOAD # OVLCALL; # LOAD AND EXECUTE OVERLAY # SCPADDR = PARAMS4; # ADDR OF SCP FUNC LIST TO REJECT NETON # IF RRC EQ RCSWAPPEDOUT THEN # APP WAS SWAPPED OUT # BEGIN # SWAPIN APP SO SCP FUNC CAN BE ISSUED # PARAMS1 = SCPADDR; # ADDR OF ORIGINAL SCP FUNCTION LIST # PARAMS2 = SCPADDR + SCPSIZE + 2*FLESIZE; #SWPIN ENTRY BUF ADR# PARAMS3 = NWLADDR; # ADDR OF NETON AWL TO WRITE TO APP FL # OVLNAME = OSCPSIP; # NAME OF OVERLAY TO LOAD # OVLCALL; # LOAD AND EXECUTE OVERLAY # INDEX = AWLNSIZE + SCPSIZE + 2*FLESIZE + SWPISIZE; RELADDR = RELADDR + INDEX; RELSIZE = RELSIZE - INDEX; END END ELSE # SF.CPID SCP FUNCTION COMPLETED # BEGIN P = LOC(SCPAWD0[0]); PRIVP = SCPPP[0]; # SAVE PRIVILEGED PROGRAM BIT # PRIVU = SCPPU[0]; # SAVE PRIVILEGED USER BIT # AAL = SCPAAL[0]; # SAVE APPLICATION ACCESS LEVEL # RRC = 0; # SET PARAMETERS TO BUILD ACN FOR APPLICATION # PARAMS1 = MINACN; # MINIMUM ACN VALUE # PARAMS2 = MAXACN; # MAXIMUM ACN VALUE # PARAMS3 = ANAME; # APPLICATION NAME # PARAMS4 = ONADDR; # DATA AVAILABLE ADDRESS # # CHECK FOR LEGAL MINACN/MAXACN VALUES # IF (MINACN LS 0) OR (MAXACN GR ACNMAX) OR (MAXACN LS MINACN) OR (MINACN EQ 0 AND MAXACN NQ 0) THEN BEGIN NWLBS[0] = NWLSIZE; # RESTORE NWL BUFFER SIZE # PARAMS1 = DFMSG20 ; # ILLEGAL VALUE # PARAMS2 = JOBID ; OVLNAME = XERRMSGP; # SEND ERROR MESSAGE TO THE DAYFILE # OVLCALL ; ABTAPPF = XBADMMACN;# FLAG TO ABORT THE APPLICATION # GOTO EXIT ; END # C H E C K I F N V F N E T O N # NVFNETON = FALSE; IF ANAME EQ "NVF" THEN # APP NETTING ON IS NVF # BEGIN NVFNETON = TRUE; # NVF IS NETTING ON # CONTROL IFEQ LIBRES,1; # DO NOT CHECK IF NVF IS SYS RESIDNT # IF ATACBA[NVFAN] NQ 0 THEN # NVF HAS ALREADY NETTED ON SO # BEGIN # ABORT THIS MALICIOUS APPLICATION # NWLBS[0] = NWLSIZE; # RESTORE NWL BUFFER SIZE # PARAMS1 = DFMSG02; # *SECURITY VIOLATION* # PARAMS2 = JOBID; # JOB ID OF JOB WHICH VIOLATED SECURITY # OVLNAME = XERRMSGP; # NAME OF OVERLAY TO LOAD # OVLCALL; # LOAD AND EXECUTE OVERLAY # ABTAPPF = XRESAPPNM; # REASON CODE FOR ABORTING APP # GOTO EXIT; END CONTROL FI; CONTROL IFNQ LIBRES,1; # CHECK IF NVF IS SYSTEM RESIDENT # IF ATACBA[NVFAN] NQ 0 OR NOT PRIVU THEN # THIS IS A SECURITY VIOLATION # BEGIN # SO ABORT MALICIOUS APP # PARAMS1 = DFMSG02; # *SECURITY VIOLATION.* # PARAMS2 = JOBID; # JOB ID OF JOB WHICH VIOLATED SECURITY # OVLNAME = XERRMSGP; # NAME OF OVERLAY TO LOAD # OVLCALL; # LOAD AND EXECUTE OVERLAY # ABTAPPF = XRESAPPNM; # SET ABORT-APPLICATION FLAG # GOTO EXIT; END CONTROL FI; ATK[NVFAN] = TRUE; # SET K-DISPLAY BIT # # B U I L D N V F ( A C B AND A C N T ) PARAMETERS REQUIRED... PARAMS1 MINIMUM ACN VALUE PARAMS2 MAXIMUM ACN VALUE PARAMS3 APPLICATION NAME PARAMS4 DATA AVAILABLE ADDRESS JOBID JOB IDENTIFCATION WORD PROGRAM NAME TO CALL BLDACB -- S Y M P L -- # OVLNAME = BLDACBP; # NAME OF OVERLAY TO LOAD # OVLCALL; # LOAD AND EXECUTE OVERLAY # AN = PARAMS1; # SAVE APPLICATION NUMBER # # LOOP THROUGH TNT TO SEND CR/SLL TO EXITING LLCB. # FOR INDEX = TNTHSIZE STEP 1 UNTIL TNTBS - TNTHSIZE DO # LOOP THROUGH ALL ENTRY IN TNT # BEGIN IF TNTLLAD[INDEX] NQ 0 THEN BEGIN # EXITING LLCB # P = TNTLLAD[INDEX] ; # FIRST LLCB IN CHAIN # CRLLS: IF LLCBHN[0] NQ 0 AND LLCBTN[0] NQ 0 THEN BEGIN # SEND CR/SLL FOR THIS ONE # # GET A BUFFER FOR MESSAGE TO INFORM NVF # MGETS( LCRSLL + ABHSIZE + BLKHSIZE , CRADR , TRUE ) ; # SET UP APPLICATION HEADER # P = CRADR + BLKHSIZE ; ABHABT[0] = APPCMD ; ABHACT[0] = CT60TRANS ; ABHTLC[0] = LCRSLL ; # SET-UP THE MESSAGE ITSELF # P = CRADR + ABHSIZE + BLKHSIZE ; # # PFCSFC[0] = CRSLL ; P = P ; # # CRSLDN [0] = LLCBTN[0] ; # DESTINATION NODE NUMBER # CRSLSN [0] = LLCBHN[0] ; # SOURCE NODE NUMBER # CRSLST [0] = 1 ; # LOGICAL LINK UP SIGNAL# # AND LINK MESSAGE TO NVF # BLINK ( CRADR,ATACBA[NVFAN]) ; # QUEUE TO NVF # END # SEND CR/SLL FOR THIS ONE # IF LLCBFP[0] NQ 0 THEN BEGIN # NEXT LLCB EXITED # P = LLCBFP[0] ; # NEXT LLCB THEN # GOTO CRLLS ; END END # EXITING LLCB # OSCHAPP(ATACBA[NVFAN]) ; END # SEND CR/SLL TO ALL LLCB # END P = ATACBA[NVFAN]; # NVF ACB ADDRESS # IF SHUTDOWN OR (P EQ 0 AND NOT NVFNETON) THEN # REJECT NETON CAUSE NETWORK SHUTTING DOWN# BEGIN # OR NVF HAS NOT NETTED ON YET # RRC = TRYAGAIN; # NETON RETURN CODE # END ELSE # NETWORK NOT SHUTTING DOWN # BEGIN IF NOT NVFNETON THEN # (NOT NVF) APPLICATION NETTING ON # BEGIN # B U I L D ( A C B AND A C N T ) FOR APPLICATION. PARAMETERS REQUIRED... PARAMS1 MINIMUM ACN VALUE PARAMS2 MAXIMUM ACN VALUE PARAMS3 APPLICATION NAME PARAMS4 DATA AVAILABLE ADDRESS JOBID JOB IDENTIFCATION WORD PROGRAM NAME TO CALL BLDACB -- S Y M P L -- # OVLNAME = BLDACBP; # NAME OF OVERLAY TO LOAD # OVLCALL; # LOAD AND EXECUTE OCERLAY # AN = PARAMS1; # APPL NUMBER FOR APP NETTING ON # IF AN NQ 0 THEN # ACB CREATED # BEGIN IF ANAME EQ "RBF" # IF APPLICATION IS RBF # THEN ATPRU[AN] = TRUE; # SET PRU ALLOWED FLAG # # SWAP APPLICATION OUT AND SEND NET/ON SUP MSG TO NVF # PARAMS0 = NUMRCN ; # NUMBER OF RESERVED OUTGOING CONNS. # PARAMS1 = MAXACN - MINACN + 1; # MAXIMUM ACN VALUE # IF PARAMS1 EQ 1 AND MINACN EQ 0 # NO CONN WANTED # THEN PARAMS1 = 0 ; PARAMS2 = ANAME; # APPLICATION NAME # PARAMS3 = ONADDR; # DATA AVAIL WORD ADDR # PARAMS4 = AN; # APPLICATION NUMBER # PARAMS5 = PRIVU; # PRIVILEGED USER BIT # PARAMS8 = PRIVP; # PROGRAM PRIVILEGED BIT # PARAMS7 = AAL; # APPLICATION ACCESS LEVEL # OVLNAME = HPNONAPP; # NAME OF OVERLAY TO LOAD # OVLCALL; # LOAD AND EXECUTE OVERLAY # DELACB = PARAMS5; # TRUE = APP NO LONGER IN SYSTEM # IF DELACB THEN # NEED TO DELETE ACB AND FORGET ABOUT THIS# BEGIN # APPLICATION # PARAMS1 = AN; # APPLICATION NUMBER # PARAMS2 = NETONR; # FUNCTION CODE FOR NET/ON/R # OVLNAME = RELACBP; # NAME OF OVERLAY TO LOAD. # OVLCALL; # LOAD AND EXECUTE OVERLAY # END GOTO EXIT; END ELSE # COULD NOT CREATE ACB SO REJECT NETON # RRC = RNO"DUP" ; # NO AN FOUND IN AT # END END # IF APPLICATION NOT NVF, THEN CREATE SCP FUNCTION LIST TO REJECT NETON IF NVF, THEN CREATE SCP FUNCTION LIST TO ACCEPT NETON # PARAMS1 = AN; # AN NON - ZERO = NVF. # PARAMS4 = RRC; # REASON CODE FOR REJECTING NETON # OVLNAME = HCNONFLP; # NAME OF OVERLAY TO LOAD # OVLCALL; # LOAD AND EXECUTE OVERLAY # P = PARAMS7; # ADDR OF SCP FUNCTION LIST # # ISSUE SCP FUNCTION # P = LOC(FLFW[0]); FLFC[0] = SFLIST; # SCP SF.LIST FUNCTION CODE # OSCCALL(FLE); # PROCESS SCP FUNCTION RETURN CODE # RRC = FLRC[0]; IF RRC EQ RCUCPAOOR THEN # APP GAVE US BAD ADDR TO WRITE NETON # BEGIN # RESPONSE TO SO ABORT APPLICATION # ABTAPPF = XFLERR; # REASON CODE FOR ABORTING APP # END ELSE BEGIN IF RRC NQ 0 THEN BEGIN IF RRC EQ RCSWAPPEDOUT THEN # APP WAS SWAPPED OUT # BEGIN IF NOT NVFNETON THEN # NON-NVF APP WAS SWAPPED OUT # BEGIN # CREATE (NO ACB) SWAPIN ENTRY AND SWAP IN APP # PARAMS1 = P; # ADDR OF SCP FUNCTION LIST # PARAMS2 = P + SCPSIZE + 2*FLESIZE; #SWP BUF ADR# PARAMS3 = NWLADDR; # ADDR OF AWL TO WRITE TO APP FL # OVLNAME = OSCPSIP; # NAME OF OVERLAY TO LOAD # OVLCALL; # LOAD AND EXECUTE OVERLAY # INDEX = SCPSIZE + 2*FLESIZE + AWLNSIZE + SWPISIZE; END ELSE # NVF WAS SWAPPED OUT # BEGIN # SWAP IN NVF # P = ACBADDR; ACBFLIST[0] = P; # STORE FUNC LIST ADR IN ACB # ATASBS[ACBAN[0]] = TRUE; # APP-SWAPPED-OUT-BY-OS FLAG # ACBWRADDR[0] = NWLADDR;# ADDR OF AWL TO WRITE TO APP FL# OSCHAPP(ACBADDR); # SCHEDULE NVF # INDEX = AWLNSIZE + FLSIZE + 3*FLESIZE; END RELADDR = NWLADDR + INDEX; RELSIZE = SIZENWL - INDEX; END ELSE # APP NO LONGER IN SYSTEM # BEGIN IF NVFNETON THEN BEGIN PARAMS1 = AN; # AN = NVF, ABORT NVF NETON # PARAMS2 = RRC; # REASON CODE FOR ABORTING NVF # # R E L E A S E A C B AND A C N T B U F F E R S .. # OVLNAME = RELACBP; # NAME OF OVERLAY TO LOAD # OVLCALL; # LOAD AND EXECUTE -RELACB- # END END END END END IF ABTAPPF EQ 0 THEN # NOT ABORTING APP SO REST OF NWL NOT NEED# BEGIN # RELEASE REST OF NWL # P = RELADDR; # ADDR OF REMAINS OF NWL TO RELEASE # BLKBS[0] = RELSIZE; # SIZE OF BUF TO RELEASE # MRELS(RELADDR); END EXIT: GOTO RJMAIN; # RETURN TO CALLING PROGRAM # END TERM