cdc:nos2.source:nam5871:np_on
Table of Contents
NP$ON
Table Of Contents
- [00011] PROC NP$ON
- [00105] PROC NP$CLK
- [00106] PROC NP$DATE
- [00109] PROC NP$CLK
- [00110] PROC NP$DATE
- [00111] PROC NP$ERR
- [00113] PROC NP$MSG
- [00114] PROC NP$PIOE
- [00116] PROC NP$RTIM
- [00119] PROC NP$TIM
- [00122] PROC NP$WRTW
- [00123] PROC NP$WRTO
- [00124] PROC NP$WRTR
- [00128] PROC NP$WRTW
Source Code
- NP$ON.txt
- *DECK NP$ON
- USETEXT AIPDEF
- USETEXT NP$MODE
- USETEXT NP$NWL
- USETEXT NP$STAT
- USETEXT NP$ZHDR
- *IF,DEF,DEBUG
- USETEXT NP$DB
- USETEXT NP$ONAM
- *ENDIF
- PROC NP$ON;
- *IF DEF,IMS
- #
- *1DC NP$ON
- *
- * 1. PROC NAME AUTHOR DATE
- * NP$ON V.M.SZIGETI 77/07/29
- *
- * 2. FUNCTIONAL DESCRIPTION
- * PROCESS NETON REQUEST RESPONSE FROM NIP.
- *
- * 3. METHOD USED
- * RESULT FROM THE NETON RESPONSE ENTRY IS STORED IN THE
- * USER"S CALLING PARAMETER AREA.
- * WHEN DEBUG OPTION IS DEFINED A FOUR WORD HEADER IS WRITTEN TO
- * THE DEBUG LOG FILE.
- *
- * WORD 0 - ANAME
- *
- * WORD 1
- * 2
- * 0 4
- * I-------------------------I----------------I
- * I I I
- * I SECONDS SINCE DEADSTART I MILLISECONDS I
- * I I I
- * I-------------------------I----------------I
- *
- * WORD 2 - CLOCK TIME: HH.MM.SS.
- *
- * WORD 3 - DATE: YY/MM/DD
- *
- * WHEN DEBUG OPTION IS DEFINED A 4 WORD NETON ENTRY IS ALSO
- * WRITTEN TO THE DEBUG LOG FILE.
- *
- * WORD 0 - SAME AS HEADER WORD 1 (RTIME)
- *
- * WORD 1
- * 2 4 5
- * 6 4 2 3
- * I----I---------I---------I----I---------I
- * I I I I I I
- * I I ON$NSUP I ON$CALL I I ON$OPC I
- * I I I I I I
- * I----I---------I---------I----I---------I
- * ON$NSUP - LOCATION OF THE USER COMMUNICATION WORD
- * ON$CALL - CALLING ADDRESS OF ROUTINE
- * ON$OPC - NETON OPCODE (=6)
- *
- * WORD 2 - MINACN
- *
- * WORD 3 - MAXACN
- *
- * 4. ENTRY CONDITIONS
- * NEXT - POINTS TO THE NETON REQUEST/RESPONSE ENTRY
- * IN THE NWL
- *
- * 5. EXIT CONDITIONS
- * ACCEPTED - TRUE IF NETON SUCCESSFUL
- * RESULT WILL CONTAIN THE RESULT OF THE NETON
- *
- * 6. COMDECKS CALLED AND SYMPL TEXTS USED.
- * AIPDEF NAMLEV NP$CRT
- * NP$DB NP$MODE NP$NWL NP$ONAM
- * NP$STAT NP$ZHDR
- *
- * 7. ROUTINES CALLED
- * NP$CLK
- * NP$DATE
- * NP$ERR
- * NP$MSG - DAYFILES LOCAL MESSAGE WITHOUT RECALL.
- * NP$PIOE - PROCESS I/O ERROR ON DISK FILE
- * NP$TIM
- * NP$WRTW
- * NP$XCDD
- * NP$XCOD
- *
- * 8. DAYFILE MESSAGES
- * NETWORK APPLICATION ABORTED, RC = 50.
- * NP$ON: INVALID PROCESS NUMBER.
- *
- * NAM VERSION X.X-XXX
- *
- #
- *ENDIF
- BEGIN
- *CALL NP$CRT
- #
- EXTERNAL ROUTINE
- #
- XREF BEGIN
- *IF -DEF,DEBUG
- *IF DEF,STAT
- PROC NP$CLK; # CLOCK TIME IN DISPLAY CODE #
- PROC NP$DATE; # DATE IN DISPLAY CODE #
- *ENDIF
- *IF DEF,DEBUG
- PROC NP$CLK; # CLOCK TIME IN DISPLAY CODE #
- PROC NP$DATE; # DATE IN DISPLAY CODE #
- PROC NP$ERR; # ERROR ON INVALID PROCESS NO. #
- *ENDIF
- PROC NP$MSG; # DAYFILES A MESSAGE #
- PROC NP$PIOE; # PROCESS I/O ERROR ON FILE #
- *IF DEF,DEBUG
- PROC NP$RTIM; # REAL TIME SINCE DEADSTART #
- *ENDIF
- *IF DEF,STAT
- PROC NP$TIM; # GETS ACCUMULATED CPU TIME #
- *ENDIF
- *IF DEF,DEBUG
- PROC NP$WRTW; # WRITES WORDS TO LOG FILES #
- PROC NP$WRTO ;
- PROC NP$WRTR ;
- *ENDIF
- *IF -DEF,DEBUG
- *IF DEF,STAT
- PROC NP$WRTW;
- *ENDIF
- END
- #
- COMMON VARIABLES
- #
- *CALL NAMLEV
- #
- LOCAL VARIABLES
- #
- *IF DEF,DEBUG
- DEF PNMAX #255#;
- ITEM CHARWD C(10);
- *ENDIF
- *IF -DEF,DEBUG
- *IF DEF,STAT
- ITEM CHARWD C(10);
- *ENDIF
- ITEM I; # LOCAL VARIABLE AND STAT LOOP VARIABLE #
- *IF DEF,DEBUG
- ITEM TIMEWD; # REAL TIME SINCE DEADSTART #
- *ENDIF
- BASED ARRAY RES ;
- ITEM
- RESULT I(0) ;
- *IF DEF,DEBUG
- *ENDIF
- *IF DEF,STAT
- ARRAY STMSG P(5);
- ITEM
- ST$CC C(0,0,10)=["0 "], #DOUBLE SPACE #
- ST$MSG12 C(1,0,35)=["NAM STATISTICS GATHERING STARTED "];
- ARRAY STMSGA P(6);
- ITEM
- ST$CCA C(0,0,10)=[" "], #SINGLE SPACE #
- ST$MSG3 C(1,0,13)=["NETON DATE "],
- ST$DATE C(2,18,10),
- ST$MSG4 C(3,18,7)=[" TIME"],
- ST$TIME C(4,0,10),
- ST$EOLA I(5,0,60)=[0];
- *ENDIF
- ARRAY NINMSG [0:0] S(3) ;
- BEGIN
- ITEM NINMSG1 C(0,0,17) = ["NETON WITH NIN = "] ;
- ITEM NINCUR C(1,42,3) ;
- ITEM NINMSG2 U(2,42,18) =[0] ;
- END
- #**********************************************************************#
- # NP$ON EXECUTION BEGINS HERE #
- P<RES> = NON[NEXT+5]; # ADDRESS OF RESULT #
- # #
- # PROCESS NETON RESPONSE: #
- # #
- IF CTL$NONAM[NCTL] OR CTL$BUSY[NCTL]
- THEN
- BEGIN
- RESULT=1; #NIP NOT AVAILABLE AT A SCP #
- GOTO EXIT;
- END #CTL$FLAGS NQ 0#
- IF NWL$RC[NEXT] NQ 0
- THEN
- BEGIN
- RESULT = NWL$RC[NEXT]; #NETON REJECTED BY NIP #
- GOTO EXIT;
- END #NWL$RC NQ 0#
- RESULT=0; #NETON ACCEPTED #
- PN = NWL[NEXT+1];
- *IF DEF,DEBUG
- IF ((PN LQ 0) OR (PN GR PNMAX))
- THEN
- NP$ERR("50"); # INVALID PROCESS NUMBER. #
- *ENDIF
- HDR$P[NHDR]=PN;
- # #
- I = 3; #SEND MESSAGE TO USER DAYFILE AND LINE 1 OF CTRL PT#
- NP$MSG(NAMLEV,I); #DAYFILE THE NAM LEVEL W/O RCL#
- NINCUR[0] = NWL$NIN[NEXT] ;
- NP$MSG(NINMSG,I) ;
- ACCEPTED = TRUE; #SUCCESSFUL NETON #
- *IF DEF,DEBUG
- # INITIALIZE FET FOR FILE ZZZZZDN IF NOT ALREADY DONE #
- IF FET$LFN NQ "ZZZZZDN" THEN
- BEGIN
- FET$LFN = "ZZZZZDN";
- FET$LN[0] = 0; # INITIALIZE LEVEL NO FIELD #
- FET$AT[0] = 0; # INITIALIZE ABNORMAL TERM FLD #
- FET$CODE = 1; # SET COMPLETION BIT #
- FET$LEN = 3; # SET FET LENGTH #
- DB$OP = LOC(DB$BUF); # DB$OP USED AS TEMPORARY STORE #
- FET$FIRST = DB$OP; # INITIALIZE CIRCULAR BUFFER PTRS #
- FET$IN = DB$OP;
- FET$OUT = DB$OP;
- FET$LIMIT = DB$OP + ZDNCIOBUFL;
- END
- # FORMAT LOG ENTRY FOR NETON CALL #
- NP$RTIM(TIMEWD);
- ON$TIM[0] = TIMEWD;
- ZH$TIM[0] = TIMEWD; # REAL TIME SINCE DEADSTART #
- NP$CLK(CHARWD); # GET CLOCK TIME #
- ZH$CLK[0] = CHARWD;
- NP$DATE(CHARWD); # GET DATE #
- ZH$DATE[0] = CHARWD;
- NP$WRTW(DB$FET,ZHDR,4); # OUTPUT HEADER TO ZZZZZDN #
- # WRITE AN EOR AFTER THE HEADER #
- NP$WRTR(DB$FET,1) ;
- NP$CLK(CHARWD) ;
- NP$WRTO(DB$FET,CHARWD) ;
- ON$OPC[0] = OP$ON;
- ON$NSUP[0] = P<NSUPWRD>;
- NP$WRTW(DB$FET,ONLINE,4); # OUTPUT NETON TO ZZZZZDN #
- #
- NSUPWRD BASED ARRAY POINTER TO THE COMMUNICATION WORD
- WAS SET BY NETON. THE ARRAY IS LOCATION IN NP$NWL COMDECK.
- UPDATE MSGCNT IN NSUP COMMUNICATION WORD.
- #
- MSGCNT[0] = MSGCNT[0] + 1;
- #
- CHECK FOR I/O ERROR IN DEBUG LOG FILE
- #
- IF FET$AT[0] NQ 0
- THEN # I/O ERROR HAS OCCURRED ON FIL#
- BEGIN
- NP$PIOE(DB$FET); # PROCESS I/O ERROR #
- END
- # #
- *ENDIF
- *IF DEF,STAT
- # #
- # INITIALIZE FET FOR FILE ZZZZZSN IF NOT ALREADY DONE #
- # #
- IF SN$LFN NQ "ZZZZZSN"
- THEN
- BEGIN
- SN$LFN = "ZZZZZSN";
- SN$CODE = 1; #SET COMPLETION BIT #
- SN$LEN = 3; #SET FET LENGTH #
- SN$FIRST = LOC(SN$BUF); #INITIALIZE CIRCULAR BUFFER #
- SN$IN = SN$FIRST; # POINTERS #
- SN$OUT = SN$FIRST;
- SN$LIMIT = SN$FIRST + ZSNCIOBUFL;
- END
- FOR I=0 STEP 1 UNTIL STATSIZE DO
- STAT[I] = 0; #INITIALIZE STATISTICS ARRAY #
- NP$TIM(ST$TIM[0]);
- NP$DATE(CHARWD); #PUT CURRENT DATE IN OUTPUT LINE #
- ST$DATE = CHARWD;
- NP$CLK(CHARWD); #GET TIME IN DISPLAY CODE #
- ST$TIME = CHARWD; #PUT DISPLAY CODE TIME IN CHARACTER ARRAY #
- NP$WRTW(SN$FET,STMSG,5);
- NP$WRTW(SN$FET,STMSGA,6);
- #
- CHECK FOR I/O ERROR IN STATISTICS FILE
- #
- IF SN$AT[0] NQ 0
- THEN # I/O ERROR HAS OCCURRED ON FILE#
- BEGIN
- NP$PIOE(SN$FET); # PROCESS I/O ERROR #
- END
- *ENDIF
- EXIT:
- RETURN;
- END # NP$ON #
- TERM
cdc/nos2.source/nam5871/np_on.txt ยท Last modified: 2023/08/05 17:22 by Site Administrator