*DECK NVFIAST USETEXT TEXTNVF USETEXT TEXTSS USETEXT TXTAPSS USETEXT TXVCBNV PROC NVFIAST; #TITLE NVFIAST - INITIALIZES THE APPLICATION-STATUS-TABLE (AST). # BEGIN # NVFIAST # # ** NVFIAST - INITIALIZES THE AST. * * A. LIM. 82/01/12 * C. BRION 83/04/23. 83/05/19. * * THIS ROUTINE IS PART OF THE INITIALIZATION PROCESS FOR NVF. * ITS JOB IS TO INITIALIZE THE APPLICATION-STATUS-TABLE (AST). * * PROC NVFIAST * * ENTRY NONE. * * EXIT AST IS INITIALIZED. * * METHOD READ THE NOS VALIDATION COMMON DECK - COMTNAP, AND * TRANSFER THAT PART OF INFORMATION TO AST. THEN BUILD * THE VALID APPLICATION MASK FROM THE APPLICATIONS IN AST. * READ THE LOCAL-CONFIGURATION FILE - LCF, AND TRANSFER * THAT PART OF INFORMATION TO AST. * SAVE THE LCF VERSION IN COMMON BLOCK *LCFVRSN* DEFINED * IN *TEXTNVF*. # # **** PROC NVFIAST XREF LIST # XREF BEGIN PROC APPLS; # COMPASS INTERFACE ROUTINE TO GET COMTNAP# PROC MESSAGE; # MACREL - SEND MESSAGE # PROC NVFIIAP; # INITIALIZATION ABORT PROCEDURE # PROC READ; # MACREL - READ FILE TO CIO BUFFER # PROC READW; # MACREL - TRANSFER DATA TO WORKING BUFFER# PROC REWIND; # MACREL - REWIND FILE # PROC SKIPB; # MACREL - SKIP RECORDS BACKWARD # PROC SKIPEI; # MACREL - SKIP TO EOR # PROC SSTAQE; # SS - ACCEPT A QUEUE ENTRY # PROC SSTATS; # ALLOCATE TABLE SPACE # PROC SSTETS; # SS - ENLARGE TABLE SPACE # END # **** # *CALL NAMLEV # DEFS # DEF APESIZ$ # 1 #; # APPL ENTRY SIZE # DEF LCFETSIZ$ # 5 #; # LCF FET SIZE # DEF LCFPTSIZ$ # 17 #; # LCF PREFIX TBL + 2 WORDS # DEF TRNS$OK # 0 #; # STATUS RETURNED WHEN READ IS O.K. # DEF XTRAPPLS$ # 5 #; # NUMBER OF APPLS NOT IN COMTNAP (NS, ETC)# DEF NVFLEVL$ # 5 #; # LENGTH OF NVF LEVEL MSG # DEF LCFBDTL$ # 6 #; # LENGTH OF LCF BUILD DATE, TIME MSG # DEF LCFTITL$ # 9 #; # LENGTH OF LCF TITLE MSG # # ITEMS # ITEM CMTNAP U; # APPLS RETURN PARM- COMTNAP ADDR # ITEM ENDPROCG B = FALSE; # END PROCESSING LCF RECORDS # ITEM I,II U; # AST INDEX # ITEM J U; # INDUCTION VARIABLE # ITEM K U; # DUMMY INDUCTION VARIABLE # ITEM LAST$RCNAM C(7); # NAME OF THE LAST LCF-RECORD PROCESSED # ITEM MATCH B; # LOOP EXIT INDICATOR # ITEM NAPPLS U; # APPLS RETURN PARM- NO OF APPLS # ITEM NENTRY U; # NUMBER OF ENTRIES IN THE AST # ITEM STATS I; # READW RETURN PARM- STATUS # ITEM TAPENTRY U; # TOTAL NO OF ENTRIES IN APPL RECD # ITEM TOTAPPLS U; # TOTAL NO OF APPLS IN AST # # * LCFFET - LCF FET. * * THIS THE FET FOR LCF. IT IS DEFINED LOCALLY HERE SIMPLY BECAUSE * ONLY THIS INITIALIZATION PROC MANIPULATES IT. # ARRAY LCFFET[00:00] S(LCFETSIZ$); BEGIN ITEM LCF$WORD U(00,00,60); #FIRST WORD OF FET # ITEM LCF$LFN C(00,00,03) = ["LCF"]; ITEM LCF$ZERO U(00,18,24) = [0]; ITEM LCF$LNAT U(00,42,08); #COMB LEVEL NR AND ABN TERM CODE# ITEM LCF$CODE U(00,50,10); #CIO FUNCTION CODE # ITEM LCF$CBIT B(00,59,01) = [TRUE]; # CIO COMPLETE BIT # ITEM LCF$L U(01,36,06) =[0]; # FET LEN IN EXCESS OF 5 WRDS# ITEM LCF$FIRST U(01,42,18); #FIRST WORD ADDR OF CIO BUFF # ITEM LCF$IN U(02,00,60); #NEXT DATA IN POINTER # ITEM LCF$OUT U(03,00,60); #NEXT DATA OUT POINTER # ITEM LCF$LIMIT U(04,42,18); #LAST WORD ADDR + 1 OF CIO BUF # END # * LCFWSA - LCF WORKING STORAGE AREA. * * THIS IS THE WORKING STORAGE OF LCF RECORD. # ARRAY LCFWSA[00:00] S(LCFPTSIZ$); BEGIN ITEM LFW$RCNAM C(00,00,07); # RECORD NAME # ITEM LFW$RCNAM1 C(01,00,07); # RECORD NAME IN LAST RECORD # ITEM LFW$ANAM C(00,00,07); # APPL NAME # ITEM LFW$MXCOP U(00,42,04); # MAX NUMBER COPIES # ITEM LFW$XFERF B(00,53,01); # NETXFER FLAG # ITEM LFW$KDSPF B(00,54,01); # K-DISPLAY FLAG # ITEM LFW$PRUF B(00,55,01); # PRU INTERFACE FLAG # ITEM LFW$RS B(00,56,01); # REQUEST STARTABLE INDICATOR # ITEM LFW$PPF B(00,57,01); # PRIVILEGED PROGRAM FLAG # ITEM LFW$UIDF B(00,58,01); # UNIQUE IDENTIFER REQUIRED FLAG# ITEM LFW$DIF B(00,59,01); # APPL DISABLED FLAG # ITEM LFW$RWC U(01,42,18); # RECORD WORD COUNT # ITEM LFW$DAT C(02,00,20); # CREATION DATE AND TIME # ITEM LFW$DATE C(02,00,10); # CREATION DATE # ITEM LFW$TIME C(03,00,10); # CREATION TIME # ITEM LFW$TITLE C(08,00,50); # TITLE- TRUNCATED TO 50 CHAR # ITEM LFW$VALIDW U(16,00,60); # VALID LCF INDICATOR WORD # END # * REN - RESERVED ENTRY NAME. * * THIS ARRAY DEFINES THE NAME USED IN COMTNAP FOR ENTRIES THAT * ARE RESERVED FOR LATER USE. * # ARRAY REN [00:00] S(1); BEGIN ITEM REN$ANAM U(00,00,42); ITEM REN$AN1 U(00,00,12) = [O"7777"]; ITEM REN$AN2 U(00,12,30) = [0]; END # * TCMTNAP - TEMPLATE FOR COMTNAP. * * THIS IS A TEMPLATE FOR THE ENTRY IN THE NOS VALIDATION COMMON * DECK - COMTNAP. EACH ENTRY REPRESENTS AN APPLICATION, AND THE * ENTRY SIZE IS ONE WORD. # BASED ARRAY TCMTNAP[00:00] S(1); BEGIN ITEM TCM$ANAM C(00,00,07); # APPLICATION NAME # ITEM TCM$ANAMU U(00,00,42); # APPLICATION NAME(UNSIGNED INT)# ITEM TCM$AWBP U(00,54,06); # ACCESS-WORD-BIT-POSITION # END # * BNAMLEV - BASED ARRAY FOR NAM LEVEL MESSAGE BUFFER. # BASED ARRAY BNAMLEV[00:00] S(2); BEGIN ITEM BNL$VER C(00,54,03); ITEM BNL$LEV C(01,30,03); END # * NVFLEV - NVF VERSION AND LEVEL BUFFER. # ARRAY NVFLEV[00:00] S(NVFLEVL$); BEGIN ITEM NLV$WORD0 U(00,00,60) = [0]; ITEM NLV$PSFC U(00,00,16) = [HOPLG]; ITEM NLV$MSG C(01,00,35) = ["NV/ HH.MM.SS. VER VER - LVL."]; ITEM NLV$TIM C(02,00,10); ITEM NLV$VER C(03,30,03); ITEM NLV$LVL C(04,06,03); ITEM NLV$ZRO U(04,30,30) = [0]; END # * LCFBDT - LCF BUILD DATE AND TIME BUFFER. # ARRAY LCFBDT[00:00] S(LCFBDTL$); BEGIN ITEM LBT$WORD0 U(00,00,60) = [0]; ITEM LBT$PSFC U(00,00,16) = [HOPLG]; ITEM LBT$MSG C(01,00,44) = ["NV/ HH.MM.SS. LCF YY/MM/DD, HH.MM.SS."]; ITEM LBT$TIM C(02,00,10); ITEM LBT$DATE C(03,30,08); ITEM LBT$TIME C(04,30,08); ITEM LBT$ZRO U(05,24,36) = [0]; END # * LCFTIT - LCF TITLE BUFFER. # ARRAY LCFTIT[00:00] S(LCFTITL$); BEGIN ITEM LTL$WORD0 U(00,00,60) = [0]; ITEM LTL$PSFC U(00,00,16) = [HOPLG]; ITEM LTL$MSG C(01,00,21) = ["NV/ HH.MM.SS. "]; ITEM LTL$TIM C(02,00,10); ITEM LTL$TITLE C(03,06,50); ITEM LTL$ZRO U(08,06,54) = [0]; END # * LCFMSG1 AND LCFMSG2 - LCF MESSAGE 1 AND 2 ARRAYS * * LCFMSG1 AND LCFMSG2 CONTAINS THE FOLLOWING MESSAGES TO BE * SENT TO SYSTEM DAYFILE, LOCAL DAYFILE, AND A AND B DISPLAY. # ARRAY LCFMSG1[00:00] S(2); BEGIN ITEM L1$MSG C(00,00,09) = [" BAD LCF."]; ITEM L1$ZERO U(00,54,06) = [0]; # ZERO BYTE TERMINATOR # ITEM L1$ZERO1 U(01,00,60) = [0]; END ARRAY LCFMSG2[00:00] S(3); BEGIN ITEM L2$MSG C(00,00,20) = [" LCF DOES NOT EXIST."]; ITEM L2$ZERO U(02,00,60) = [0]; # ZERO BYTE TERMINATOR # END CONTROL EJECT; VAPMASK = 0; # PRESET VALIDATION MASK TO 0 # APPLS(CMTNAP,NAPPLS); # GET COMTNAP ADDR, AND NO OF APPLS # P = CMTNAP; # PLACE TEMPLATE ON THE COMMON DECK # TOTAPPLS = NAPPLS + XTRAPPLS$; # GET TOTAL NO. OF APPLS IN AST # SSTETS(P, 0, ASTSIZ$ * TOTAPPLS); # ENLRGE AST & PRESET 0# # * TRANSFER DATA FROM COMTNAP TO AST. * SPECIAL CASE NS, SINCE AT CURRENT LEVEL OF SOFTWARE, NS CANNOT * SUPPORT TERMINAL CONNECTION, SO IT WILL NOT BE FOUND IN COMTNAP. # AST$ANAM[0] = "NS"; AST$KDSPF[0] = TRUE; # K-DISPLAY ALWAYS SET FOR NS # AST$AWBP[0] = NSAWBP$; # SET NS AWBP TO OUT OF RANGE # AST$JSN[0] = " "; # SET JSN # AST$MXCOP[0] = 1; # SET MAX COPY TO 1 # AST$SANAM[0] = "NS"; # SET SEC NAME EQUAL TO PRI NAME# # * SPECIAL CASE PTF, PTFS, QTF, AND QTFS, AS THEY ARE NOT IN COMTNAP. # AST$ANAM[1] = "PTF"; AST$ANAM[2] = "PTFS"; AST$ANAM[3] = "QTF"; AST$ANAM[4] = "QTFS"; FOR I = 1 STEP 1 UNTIL 4 DO BEGIN AST$AWBP[I] = NSAWBP$; # SET AWBP TO OUT OF RANGE # AST$JSN[I] = " "; AST$MXCOP[I] = 1; AST$SANAM[I] = AST$PANAM[I]; END NENTRY = 5; # SET ENTRY COUNT TO ONE FOR NS # FOR I = 1 STEP 1 UNTIL NAPPLS DO BEGIN IF TCM$ANAMU[I-1] NQ REN$ANAM[0] THEN BEGIN AST$ANAM[NENTRY] = TCM$ANAM[I-1]; AST$AWBP[NENTRY] = TCM$AWBP[I-1]; AST$JSN[NENTRY] = " "; AST$MXCOP[NENTRY] = 1; AST$SANAM[NENTRY] = AST$PANAM[NENTRY]; IF AST$ANAM[NENTRY] EQ "CS" THEN AST$KDSPF[NENTRY] = TRUE;# K-DISPLAY ALWAYS SET FOR CS # IF AST$ANAM[NENTRY] EQ "RBF" OR AST$ANAM[NENTRY] EQ "PSU" THEN BEGIN AST$PRUF[NENTRY] = TRUE; # PRU FLAG ALWAYS SET FOR RBF # END # AND PSU # NENTRY = NENTRY + 1; # INCREMENT THE ENTRY COUNT # END END IF NENTRY LS TOTAPPLS THEN # IF NOT ALL THE ENTRIES WERE STORED # BEGIN # RELEASE UNUSED SPACE # SSTATS(P,(NENTRY-TOTAPPLS)*ASTSIZ$); END # * DETERMINE IF BIT NOT UNIQUE TO APPLICATION. (MORE THAN ONE * APPLICATION SHARES THE SAME AWBP). IF BIT NOT UNIQUE, SET BIT * IN BOTH THE INITIAL ENTRY AND THE CURRENT ENTRY. # FOR I = 1 STEP 1 UNTIL NENTRY-1 DO BEGIN IF NOT AST$BNUF[I] THEN BEGIN MATCH = FALSE; FOR II = I+1 STEP 1 UNTIL NENTRY-1 DO BEGIN IF AST$AWBP[II] EQ AST$AWBP[I] AND # ALLOW MANDATORY IAF # AST$ANAM[II] NQ "MAIL" AND # APPL THOUGH MAIL IS # AST$ANAM[I] NQ "MAIL" # AN EQUIVALENCE ON IT# THEN BEGIN AST$BNUF[II] = TRUE; # SET BIT NOT UNIQ IN CUR APPL # MATCH = TRUE; END END IF MATCH THEN AST$BNUF[I] = TRUE; # SET BIT NOT UNIQ IN INIT APPL # END END # * BUILD VALID APPLICATION MASK # FOR I = 1 STEP 1 UNTIL NENTRY-1 DO BEGIN B<59-AST$AWBP[I],1>VAPMASK = 1; END # * INITIALIZES ADDRESS IN LCF FET. * NOTE: VCB CIRCULAR BUFFER IS USED HERE FOR THE SAKE OF * CONSERVING MEMORY. THIS HAS NOTHING TO DO WITH VCB FILE. # LCF$FIRST[0] = LOC(VCBBUFR); LCF$IN[0] = LOC(VCBBUFR); LCF$OUT[0] = LOC(VCBBUFR); LCF$LIMIT[0] = LCF$FIRST[0] + VBBUFLIM$ + 1; # * READ THE LCF # SKIPEI(LCFFET); # SKIP TO END OF INFORMATION # SKIPB(LCFFET,2); # SKIP BACKWARD 2 RECORDS # READ(LCFFET); # READ THIS LAST RECORD TO CIO BUFF # READW(LCFFET,LCFWSA,LCFPTSIZ$,STATS); # TRNSFR THE RECD TO WSA # IF STATS EQ -2 THEN BEGIN # LCF DOES NOT EXIST # MESSAGE(LCFMSG2[0], DFILE$); NVFIIAP; END IF LFW$VALIDW[0] EQ 0 THEN BEGIN # BAD LCF # MESSAGE(LCFMSG1[0], DFILE$); NVFIIAP; END # * SEND NVF VERSION NUMBER AND THE LCF BUILD DATE AND TIME, AND * TITLE TO NAM DAYFILE. # ABHWORD[0] = 0; ABHABT[0] = APPCMD; ABHACT[0] = CT60TRANS; WCB$WORD[0] = 0; P = LOC(NAMLEV); # NVF VERSION AND LVL MSG # NLV$TIM[0] = CTM$CLOCK[0]; NLV$VER[0] = BNL$VER[0]; NLV$LVL[0] = BNL$LEV[0]; ABHTLC[0] = NVFLEVL$; WCB$WC[0] = NVFLEVL$ + 2; SSTAQE(P, WCBUF[0],ABHBUF[0], NVFLEV[0]); LBT$TIM[0] = CTM$CLOCK[0]; # LCF BUILD DATE AND TIME MSG # LBT$DATE[0] = LFW$DATE[0]; LBT$TIME[0] = LFW$TIME[0]; ABHTLC[0] = LCFBDTL$; WCB$WC[0] = LCFBDTL$ + 2; SSTAQE(P, WCBUF[0], ABHBUF[0], LCFBDT[0]); LTL$TIM[0] = CTM$CLOCK[0]; # LCF TITLE MSG # LTL$TITLE[0] = LFW$TITLE[0]; ABHTLC[0] = LCFTITL$; WCB$WC[0] = LCFTITL$ + 2; SSTAQE(P, WCBUF[0], ABHBUF[0], LCFTIT[0]); # SAVE THE LCF CREATION DAY AND TIME IN *LCFVRN* # LFV$VRN[0] = "LCF VERSION "; LFV$DAT[0] = LFW$DAT[0]; LFV$ZERO[0] = 0; REWIND(LCFFET); # REWIND LCF TO POINT TO BOF # READ(LCFFET); # READ FILE HEADER RECORD TO CIO BUFF # READW(LCFFET,LCFWSA,LCFPTSIZ$,STATS); # DISCARD THIS RECD # # * PROCESS THE REST OF RECORDS IN THE LCF. # LAST$RCNAM = " "; # INITIALIZE LAST RECORD NAME TO BLANK # FOR K = 0 WHILE NOT ENDPROCG DO BEGIN # PROCESSING RECORDS IN LCF # READ(LCFFET); # READ NEXT RECORD # READW(LCFFET,LCFWSA,2,STATS); # TRNSFR FIRST 2 WORDS TO WSA # # WHEN SOME RECORD SIZE IS AN EXACT MULTIPLE OF PRU. THE COMBI-# # NATION OF READ AND READW USED IN THIS LOOP MAY NOT ALWAYS # # FUNCTION AS EXPECTED. THESE TWO MACROS MAY HAVE COMPLETELY # # TRANSFERED A RECORD WITHOUT DISCOVERING THE EOR MARK. IF THIS# # HAPPENS, THE READ WILL READ, IN THE NEXT ITERATION, AN EOR # # INSTEAD OF THE NEXT RECORD. TO AVOID THIS, WE WILL SAVE THE # # RECORD NAM FOR THE CURRENT ITERATION, AND ASSURE THAT WE # # PROCESS A NEW RECORD FOR EACH ITERATION. # IF LAST$RCNAM EQ LFW$RCNAM[0] THEN BEGIN # THE READ DID NOT READ IN A NEW RECORD, GO BACK DO IT OVER # TEST K; END ELSE BEGIN LAST$RCNAM = LFW$RCNAM[0]; # SAVE CURRENT RECORD NAME # END IF LFW$RCNAM[0] EQ "APPL" THEN BEGIN GOTO LLAPPL; END ELSE IF LFW$RCNAM[0] EQ "USER" THEN BEGIN GOTO LLUSER; END ELSE IF LFW$RCNAM[0] EQ "OUTCALL" THEN BEGIN GOTO LLOUTCALL; END ELSE IF LFW$RCNAM[0] EQ "INCALL" THEN BEGIN GOTO LLINCALL; END ELSE IF LFW$RCNAM[0] EQ "PATHPID" THEN BEGIN GOTO LLPATHPID; END ELSE IF LFW$RCNAM1[0] EQ "ENDLCF" THEN BEGIN ENDPROCG = TRUE; GOTO ENDCASE; # DONT CARE ABOUT LAST RECD # END ELSE # UNKNOWN RECORD TYPE, ABORT NVF # BEGIN MESSAGE(LCFMSG1[0], DFILE$); NVFIIAP; END LLAPPL: # RECORD TYPE = APPLICATION # TAPENTRY = LFW$RWC[0] - 1; # TOTAL NO OF APPL ENTRY # IF TAPENTRY EQ 0 THEN GOTO ENDCASE; # EMPTY APPL RECORD # FOR J = 0 STEP 1 UNTIL TAPENTRY - 1 DO # LOOP UNTIL APPL RECORD EXHAUSTED # BEGIN READW(LCFFET,LCFWSA,APESIZ$,STATS); # TRNSFR ENTRY TO WSA # MATCH = FALSE; FOR I = 0 STEP 1 WHILE I LS NENTRY AND NOT MATCH DO # SEARCH AST FOR APPL # BEGIN IF LFW$ANAM[0] EQ AST$ANAM[I] THEN BEGIN AST$XFERF[I] = LFW$XFERF[0]; AST$KDSPF[I] = LFW$KDSPF[0]; AST$UIDF[I] = LFW$UIDF[0]; AST$DIF[I] = LFW$DIF[0]; AST$PPF[I] = LFW$PPF[0]; AST$RS[I] = LFW$RS[0]; AST$MXCOP[I] = LFW$MXCOP[0]; IF AST$MXCOP[I] EQ 0 # 2.2 LCF HAS MXCOP = 0 # THEN BEGIN AST$MXCOP[I] = 1; # CHANGE MXCOP TO 1 # END AST$USANAM[I] = AST$UPANAM[I]; IF AST$ANAM[I] NQ "RBF" # DO NOT SET PRU FLAG FOR # THEN # RBF - IT IS ALREADY SET # BEGIN AST$PRUF[I] = LFW$PRUF[0]; END MATCH = TRUE; END END END TEST K; LLUSER: # RECORD TYPE = USER # # * ALLOCATE TABLE SPACE TO THE AUTO LOGIN TABLE. FOR EACH ENTRY IN * THE USER RECORD, ENTER IT INTO THE ALT UNTIL AN END OF RECORD IS * DETECTED. # SSTATS(P,LFW$RWC[0]-1); FOR J=0 STEP 1 WHILE STATS EQ TRNS$OK DO BEGIN READW(LCFFET,ALTB[J],ALTSIZ$,STATS); END TEST K; LLOUTCALL: # RECORD TYPE = OUTCALL # SSTATS(P,LFW$RWC[0] - 1); READW(LCFFET,OUTSMQ,OUTSMQL,STATS); TEST K; LLINCALL: # RECORD TYPE = INCALL # SSTATS(P,LFW$RWC[0] - 1); READW(LCFFET,INSMQ,INSMQL,STATS); TEST K; LLPATHPID: SSTATS(P,LFW$RWC[0] - 1); READW(LCFFET,LLPID,LLPIDL,STATS); TEST K; ENDCASE: END # PROCESS RECORDS IN LCF # END # NVFIAST # TERM