User Tools

Site Tools


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
  1. *DECK NP$ON
  2. USETEXT AIPDEF
  3. USETEXT NP$MODE
  4. USETEXT NP$NWL
  5. USETEXT NP$STAT
  6. USETEXT NP$ZHDR
  7. *IF,DEF,DEBUG
  8. USETEXT NP$DB
  9. USETEXT NP$ONAM
  10. *ENDIF
  11. PROC NP$ON;
  12. *IF DEF,IMS
  13. #
  14. *1DC NP$ON
  15. *
  16. * 1. PROC NAME AUTHOR DATE
  17. * NP$ON V.M.SZIGETI 77/07/29
  18. *
  19. * 2. FUNCTIONAL DESCRIPTION
  20. * PROCESS NETON REQUEST RESPONSE FROM NIP.
  21. *
  22. * 3. METHOD USED
  23. * RESULT FROM THE NETON RESPONSE ENTRY IS STORED IN THE
  24. * USER"S CALLING PARAMETER AREA.
  25. * WHEN DEBUG OPTION IS DEFINED A FOUR WORD HEADER IS WRITTEN TO
  26. * THE DEBUG LOG FILE.
  27. *
  28. * WORD 0 - ANAME
  29. *
  30. * WORD 1
  31. * 2
  32. * 0 4
  33. * I-------------------------I----------------I
  34. * I I I
  35. * I SECONDS SINCE DEADSTART I MILLISECONDS I
  36. * I I I
  37. * I-------------------------I----------------I
  38. *
  39. * WORD 2 - CLOCK TIME: HH.MM.SS.
  40. *
  41. * WORD 3 - DATE: YY/MM/DD
  42. *
  43. * WHEN DEBUG OPTION IS DEFINED A 4 WORD NETON ENTRY IS ALSO
  44. * WRITTEN TO THE DEBUG LOG FILE.
  45. *
  46. * WORD 0 - SAME AS HEADER WORD 1 (RTIME)
  47. *
  48. * WORD 1
  49. * 2 4 5
  50. * 6 4 2 3
  51. * I----I---------I---------I----I---------I
  52. * I I I I I I
  53. * I I ON$NSUP I ON$CALL I I ON$OPC I
  54. * I I I I I I
  55. * I----I---------I---------I----I---------I
  56.  
  57. * ON$NSUP - LOCATION OF THE USER COMMUNICATION WORD
  58. * ON$CALL - CALLING ADDRESS OF ROUTINE
  59. * ON$OPC - NETON OPCODE (=6)
  60. *
  61. * WORD 2 - MINACN
  62. *
  63. * WORD 3 - MAXACN
  64. *
  65. * 4. ENTRY CONDITIONS
  66. * NEXT - POINTS TO THE NETON REQUEST/RESPONSE ENTRY
  67. * IN THE NWL
  68. *
  69. * 5. EXIT CONDITIONS
  70. * ACCEPTED - TRUE IF NETON SUCCESSFUL
  71. * RESULT WILL CONTAIN THE RESULT OF THE NETON
  72. *
  73. * 6. COMDECKS CALLED AND SYMPL TEXTS USED.
  74. * AIPDEF NAMLEV NP$CRT
  75. * NP$DB NP$MODE NP$NWL NP$ONAM
  76. * NP$STAT NP$ZHDR
  77. *
  78. * 7. ROUTINES CALLED
  79. * NP$CLK
  80. * NP$DATE
  81. * NP$ERR
  82. * NP$MSG - DAYFILES LOCAL MESSAGE WITHOUT RECALL.
  83. * NP$PIOE - PROCESS I/O ERROR ON DISK FILE
  84. * NP$TIM
  85. * NP$WRTW
  86. * NP$XCDD
  87. * NP$XCOD
  88. *
  89. * 8. DAYFILE MESSAGES
  90. * NETWORK APPLICATION ABORTED, RC = 50.
  91. * NP$ON: INVALID PROCESS NUMBER.
  92. *
  93. * NAM VERSION X.X-XXX
  94. *
  95.  #
  96. *ENDIF
  97. BEGIN
  98. *CALL NP$CRT
  99. #
  100.   EXTERNAL ROUTINE
  101. #
  102. XREF BEGIN
  103. *IF -DEF,DEBUG
  104. *IF DEF,STAT
  105. PROC NP$CLK; # CLOCK TIME IN DISPLAY CODE #
  106. PROC NP$DATE; # DATE IN DISPLAY CODE #
  107. *ENDIF
  108. *IF DEF,DEBUG
  109. PROC NP$CLK; # CLOCK TIME IN DISPLAY CODE #
  110. PROC NP$DATE; # DATE IN DISPLAY CODE #
  111. PROC NP$ERR; # ERROR ON INVALID PROCESS NO. #
  112. *ENDIF
  113. PROC NP$MSG; # DAYFILES A MESSAGE #
  114. PROC NP$PIOE; # PROCESS I/O ERROR ON FILE #
  115. *IF DEF,DEBUG
  116. PROC NP$RTIM; # REAL TIME SINCE DEADSTART #
  117. *ENDIF
  118. *IF DEF,STAT
  119. PROC NP$TIM; # GETS ACCUMULATED CPU TIME #
  120. *ENDIF
  121. *IF DEF,DEBUG
  122. PROC NP$WRTW; # WRITES WORDS TO LOG FILES #
  123. PROC NP$WRTO ;
  124. PROC NP$WRTR ;
  125. *ENDIF
  126. *IF -DEF,DEBUG
  127. *IF DEF,STAT
  128. PROC NP$WRTW;
  129. *ENDIF
  130. END
  131. #
  132.   COMMON VARIABLES
  133. #
  134. *CALL NAMLEV
  135. #
  136.   LOCAL VARIABLES
  137. #
  138. *IF DEF,DEBUG
  139. DEF PNMAX #255#;
  140.  
  141. ITEM CHARWD C(10);
  142. *ENDIF
  143. *IF -DEF,DEBUG
  144. *IF DEF,STAT
  145. ITEM CHARWD C(10);
  146. *ENDIF
  147. ITEM I; # LOCAL VARIABLE AND STAT LOOP VARIABLE #
  148. *IF DEF,DEBUG
  149. ITEM TIMEWD; # REAL TIME SINCE DEADSTART #
  150. *ENDIF
  151.  
  152. BASED ARRAY RES ;
  153. ITEM
  154. RESULT I(0) ;
  155. *IF DEF,DEBUG
  156.  
  157. *ENDIF
  158. *IF DEF,STAT
  159. ARRAY STMSG P(5);
  160. ITEM
  161. ST$CC C(0,0,10)=["0 "], #DOUBLE SPACE #
  162. ST$MSG12 C(1,0,35)=["NAM STATISTICS GATHERING STARTED "];
  163. ARRAY STMSGA P(6);
  164. ITEM
  165. ST$CCA C(0,0,10)=[" "], #SINGLE SPACE #
  166. ST$MSG3 C(1,0,13)=["NETON DATE "],
  167. ST$DATE C(2,18,10),
  168. ST$MSG4 C(3,18,7)=[" TIME"],
  169. ST$TIME C(4,0,10),
  170. ST$EOLA I(5,0,60)=[0];
  171. *ENDIF
  172. ARRAY NINMSG [0:0] S(3) ;
  173. BEGIN
  174. ITEM NINMSG1 C(0,0,17) = ["NETON WITH NIN = "] ;
  175. ITEM NINCUR C(1,42,3) ;
  176. ITEM NINMSG2 U(2,42,18) =[0] ;
  177. END
  178. #**********************************************************************#
  179.  
  180. # NP$ON EXECUTION BEGINS HERE #
  181.  
  182. P<RES> = NON[NEXT+5]; # ADDRESS OF RESULT #
  183. # #
  184. # PROCESS NETON RESPONSE: #
  185. # #
  186. IF CTL$NONAM[NCTL] OR CTL$BUSY[NCTL]
  187. THEN
  188. BEGIN
  189. RESULT=1; #NIP NOT AVAILABLE AT A SCP #
  190. GOTO EXIT;
  191.  
  192. END #CTL$FLAGS NQ 0#
  193.  
  194. IF NWL$RC[NEXT] NQ 0
  195. THEN
  196. BEGIN
  197. RESULT = NWL$RC[NEXT]; #NETON REJECTED BY NIP #
  198. GOTO EXIT;
  199.  
  200. END #NWL$RC NQ 0#
  201.  
  202. RESULT=0; #NETON ACCEPTED #
  203. PN = NWL[NEXT+1];
  204. *IF DEF,DEBUG
  205. IF ((PN LQ 0) OR (PN GR PNMAX))
  206. THEN
  207. NP$ERR("50"); # INVALID PROCESS NUMBER. #
  208. *ENDIF
  209. HDR$P[NHDR]=PN;
  210. # #
  211. I = 3; #SEND MESSAGE TO USER DAYFILE AND LINE 1 OF CTRL PT#
  212. NP$MSG(NAMLEV,I); #DAYFILE THE NAM LEVEL W/O RCL#
  213. NINCUR[0] = NWL$NIN[NEXT] ;
  214. NP$MSG(NINMSG,I) ;
  215. ACCEPTED = TRUE; #SUCCESSFUL NETON #
  216. *IF DEF,DEBUG
  217.  
  218. # INITIALIZE FET FOR FILE ZZZZZDN IF NOT ALREADY DONE #
  219.  
  220. IF FET$LFN NQ "ZZZZZDN" THEN
  221. BEGIN
  222. FET$LFN = "ZZZZZDN";
  223. FET$LN[0] = 0; # INITIALIZE LEVEL NO FIELD #
  224. FET$AT[0] = 0; # INITIALIZE ABNORMAL TERM FLD #
  225. FET$CODE = 1; # SET COMPLETION BIT #
  226. FET$LEN = 3; # SET FET LENGTH #
  227. DB$OP = LOC(DB$BUF); # DB$OP USED AS TEMPORARY STORE #
  228. FET$FIRST = DB$OP; # INITIALIZE CIRCULAR BUFFER PTRS #
  229. FET$IN = DB$OP;
  230. FET$OUT = DB$OP;
  231. FET$LIMIT = DB$OP + ZDNCIOBUFL;
  232. END
  233.  
  234.  
  235. # FORMAT LOG ENTRY FOR NETON CALL #
  236.  
  237. NP$RTIM(TIMEWD);
  238. ON$TIM[0] = TIMEWD;
  239. ZH$TIM[0] = TIMEWD; # REAL TIME SINCE DEADSTART #
  240. NP$CLK(CHARWD); # GET CLOCK TIME #
  241. ZH$CLK[0] = CHARWD;
  242. NP$DATE(CHARWD); # GET DATE #
  243. ZH$DATE[0] = CHARWD;
  244. NP$WRTW(DB$FET,ZHDR,4); # OUTPUT HEADER TO ZZZZZDN #
  245.  
  246. # WRITE AN EOR AFTER THE HEADER #
  247. NP$WRTR(DB$FET,1) ;
  248. NP$CLK(CHARWD) ;
  249. NP$WRTO(DB$FET,CHARWD) ;
  250.  
  251. ON$OPC[0] = OP$ON;
  252. ON$NSUP[0] = P<NSUPWRD>;
  253. NP$WRTW(DB$FET,ONLINE,4); # OUTPUT NETON TO ZZZZZDN #
  254. #
  255.   NSUPWRD BASED ARRAY POINTER TO THE COMMUNICATION WORD
  256.   WAS SET BY NETON. THE ARRAY IS LOCATION IN NP$NWL COMDECK.
  257.  
  258.   UPDATE MSGCNT IN NSUP COMMUNICATION WORD.
  259. #
  260. MSGCNT[0] = MSGCNT[0] + 1;
  261. #
  262.   CHECK FOR I/O ERROR IN DEBUG LOG FILE
  263. #
  264. IF FET$AT[0] NQ 0
  265. THEN # I/O ERROR HAS OCCURRED ON FIL#
  266. BEGIN
  267. NP$PIOE(DB$FET); # PROCESS I/O ERROR #
  268. END
  269. # #
  270. *ENDIF
  271. *IF DEF,STAT
  272. # #
  273. # INITIALIZE FET FOR FILE ZZZZZSN IF NOT ALREADY DONE #
  274. # #
  275. IF SN$LFN NQ "ZZZZZSN"
  276. THEN
  277. BEGIN
  278. SN$LFN = "ZZZZZSN";
  279. SN$CODE = 1; #SET COMPLETION BIT #
  280. SN$LEN = 3; #SET FET LENGTH #
  281. SN$FIRST = LOC(SN$BUF); #INITIALIZE CIRCULAR BUFFER #
  282. SN$IN = SN$FIRST; # POINTERS #
  283. SN$OUT = SN$FIRST;
  284. SN$LIMIT = SN$FIRST + ZSNCIOBUFL;
  285. END
  286.  
  287. FOR I=0 STEP 1 UNTIL STATSIZE DO
  288. STAT[I] = 0; #INITIALIZE STATISTICS ARRAY #
  289. NP$TIM(ST$TIM[0]);
  290. NP$DATE(CHARWD); #PUT CURRENT DATE IN OUTPUT LINE #
  291. ST$DATE = CHARWD;
  292. NP$CLK(CHARWD); #GET TIME IN DISPLAY CODE #
  293. ST$TIME = CHARWD; #PUT DISPLAY CODE TIME IN CHARACTER ARRAY #
  294. NP$WRTW(SN$FET,STMSG,5);
  295. NP$WRTW(SN$FET,STMSGA,6);
  296. #
  297.   CHECK FOR I/O ERROR IN STATISTICS FILE
  298. #
  299. IF SN$AT[0] NQ 0
  300. THEN # I/O ERROR HAS OCCURRED ON FILE#
  301. BEGIN
  302. NP$PIOE(SN$FET); # PROCESS I/O ERROR #
  303. END
  304. *ENDIF
  305.  
  306. EXIT:
  307. RETURN;
  308.  
  309. END # NP$ON #
  310. TERM
cdc/nos2.source/nam5871/np_on.txt ยท Last modified: 2023/08/05 17:22 by Site Administrator