User Tools

Site Tools


cdc:nos2.source:nam5871:neib

Table of Contents

NEIB

Table Of Contents

  • [00015] PROC NEIB
  • [00067] PROC MGETS
  • [00068] PROC MRELS
  • [00069] PROC NEIB1
  • [00070] PROC OPITRCE
  • [00071] PROC OPRETN
  • [00072] PROC OTIME
  • [00073] PROC OVLCALL
  • [00074] PROC PURGREG
  • [00075] PROC TWRITE
  • [00076] PROC XTRACE

Source Code

NEIB.txt
  1. *DECK NEIB
  2. USETEXT NIPDEF
  3. USETEXT BPIPBUF
  4. USETEXT DBGBUF
  5. USETEXT DRHDR
  6. USETEXT LLCB
  7. USETEXT NBT
  8. USETEXT PT
  9. USETEXT STATTAB
  10. USETEXT SUPMSG
  11. USETEXT SYSTIME
  12. USETEXT TNT
  13. USETEXT INPARUT
  14. USETEXT KDIS
  15. PROC NEIB; # EMPTY INPUT BUFFER #
  16.  
  17. STARTIMS;
  18. #
  19. *1DC NEIB
  20. *
  21. * 1. PROC NAME AUTHOR DATE
  22. * BUFFER AND THE INTRA-HOST A-A MESSAGE QUEUE.
  23. *
  24. * 2. FUNCTIONAL DESCRIPTION.
  25. * THIS ROUTINE IS RESPONSIBLE FOR EMPTYING A NETWORK INPUT
  26. * BUFFER.
  27. *
  28. * 3. METHOD USED.
  29. * FOR EACH HOSTNODE - PICK UP MESSAGE FROM PIP
  30. * INBOUND BUFFER AND CALL NEIB1 TO PROCESS IT-
  31. * CONTINUE UNTIL BUFFER IS EMTPY. PICK UP
  32. * MESSAGES FROM INTRA-HOST A-A MESSAGE
  33. * QUEUE AND CALL NEIB1 TO PROCESS THEM.
  34. *
  35. * 4. INPUT PARAMETERS.
  36. * NONE
  37. *
  38. * 5. EXIT PARAMETERS. NONE
  39. *
  40. * 6. COMDECKS CALLED AND SYMPL TEXTS USED.
  41. * BPIPBUF DBGBUF DRHDR NIPDEF
  42. * STATTAB SYSTIME SUPMSG LLCB
  43. * INPARUT KDIS NBT TNT
  44. * PT GLOBAL VARIABLES AND POINTERS
  45. *
  46. * 7. ROUTINES AND OVERLAYS CALLED.
  47. * MGETS GET BUFFER SPACE
  48. * MRELS RELEASE BUFFER SPACE
  49. * NEIB1 PROCESS UPLINE MESSAGES
  50. * OPITRCE INITIALIZE NIP DEBUG LOG FILE
  51. * OPRETN RETURN FILE
  52. * OTIME GET SYSTEM RTIME
  53. * TWRITE RECORD MESSAGE IN ZZZZZDN FILE
  54. * XTRACE TRACES CALLS
  55. *
  56. * 8. DAYFILE MESSAGES AND OTHER IMPORTANT INFORMATION
  57. * THIS PROCEDURE IS CALLED BY XEXEC.
  58. *
  59.  #
  60. STOPIMS;
  61. # INPUT PARAMETERS. NONE #
  62. # OUTPUT PARAMETERS. NONE
  63.  
  64.   EXTERNAL VARIABLES
  65. #
  66. XREF BEGIN
  67. PROC MGETS; # GET BUFFER SPACE #
  68. PROC MRELS; # RELEASE BUFFER SPACE #
  69. PROC NEIB1; # PROCESS MESSAGE #
  70. PROC OPITRCE; # INITIALIZE NIP DEBUG LOG FILE #
  71. PROC OPRETN; # RETURN FILE #
  72. PROC OTIME; # GET SYSTEM RTIME #
  73. PROC OVLCALL; # LOAD AND EXECUTE OVERLAY #
  74. PROC PURGREG; # INVALIDATE REGISTERS TO FORCE CM READ #
  75. PROC TWRITE; # RECORD MESSAGE IN ZZZZZDN FILE #
  76. PROC XTRACE; # RECORD TRACE #
  77. END
  78. #
  79.   INTERNAL VARIABLES
  80. #
  81. CONTROL PRESET;
  82. ITEM ACTIVENPU B = FALSE, # NPU ACTIVITY INDICATOR #
  83. JALLOC B = TRUE, # NIP JUST ALLOCATE AN INBOUND BUFFER #
  84. I, # TEMPIRARY LOOP VARIABLE #
  85. IND, # FRONT END INDEX NUMBER #
  86. IND2, # TEMP VARIABLE #
  87. CURIND, # TEMP VARIABLE #
  88. NXTIND, # TEMP VARIABLE #
  89. BUFSIZ, # BUFFER SIZE #
  90. BUF; # BUFFER FOR INTRA-HOST A-A QUEUE #
  91.  
  92. CONTROL IFEQ STAT,1;
  93. ARRAY STIME P(1); # RTIME BUFFER FOR STARTING TIME #
  94. BEGIN
  95. ITEM SMILS U(0,24,36); # STARTING TIME IN MILLESECONDS #
  96. END
  97. ARRAY ETIME P(1); # RTIME BUFFER FOR ENDING TIME #
  98. BEGIN
  99. ITEM EMILS U(0,24,36); # ENDING TIME IN MILLESECONDS #
  100. END
  101.  
  102. ITEM STTEMP; # TEMPORARY STATISTICS VARIABLE #
  103. ITEM WORK B; # FLAG TO INDICATE IF UPLINE MSGS PROCESSD#
  104. CONTROL FI;
  105.  
  106.  
  107. #**********************************************************************#
  108. BEGIN
  109. CONTROL IFEQ DEBUG,1 ;
  110. XTRACE("NEIB ") ;
  111. CONTROL FI;
  112.  
  113. CONTROL IFEQ STAT,1;
  114. WORK = FALSE;
  115. CONTROL FI;
  116.  
  117. #
  118.   LOOP ON ALL NPU-S
  119. #
  120. ACTIVENPU = FALSE; # PRESET TO NO NPU ACTIVITY #
  121. FOR IND = 0 STEP NBTFETNO UNTIL NBTMAXID
  122. DO
  123. BEGIN
  124. NBTIDX = IND; # NBT ENTRY INDEX #
  125.  
  126. NEIB2LOOP:
  127.  
  128. IF NBTIUF[IND] # NBT ACTIVE #
  129. THEN
  130. BEGIN
  131. IND2 = IND + 1 ;
  132. IF NBTCII[IND2] EQ IND # SET CURRENT INPUT INDEX #
  133. THEN
  134. BEGIN
  135. CURIND = IND;
  136. NXTIND = IND2;
  137. END
  138. ELSE
  139. BEGIN
  140. CURIND = IND2;
  141. NXTIND = IND;
  142. END
  143. IF (NBTBRF[CURIND]) # RELEASE CURRENT BUFFER #
  144. OR (NBTIN[CURIND] GQ NBTTA[CURIND])
  145. THEN # RELEASE SET OR BUFFER HALF USED #
  146. BEGIN
  147. IF (NBTBRF[CURIND]) OR
  148. (NBTLIMIT[CURIND] EQ NBTOUT[CURIND])
  149. THEN # RELEASING CURRENT BUFFER #
  150. BEGIN
  151. NBTCII[IND2] = NXTIND; # MOVE CUR BUF INDX TO OTHER FET#
  152. END
  153. IF NOT NBTBFS[NXTIND]
  154. THEN # BUFFER NOT ALLOCATED YET #
  155. BEGIN
  156. #
  157.   ALLOCATE NEW INBOUND BUFFER
  158. #
  159. IF NBTPIREJ[IND+5] NQ NBTRJCNT[IND2]
  160. THEN # PIP HAS REJECTED IVT DATA SINCE LAST BUF#
  161. BEGIN
  162. NBTRJCNT[IND2] = NBTPIREJ[IND+5]; # UPDATE REJ CNT #
  163. NBTRTIME[IND2] = RTSECS[0] + NINBRJTO; # UPDT TIMEOUT#
  164. IF NBTCOFF[IND2] EQ 0
  165. THEN # THRESHOLD ADR IS ALREADY AT BEGIN OF BUF#
  166. BEGIN # INCREASE SIZE OF INBOUND BUFFER #
  167. NBTCSIZE[IND2] = NBTCSIZE[IND2] + NINBINC;
  168. END
  169. ELSE # REDUCE OFFSET FOR THRESHOLD ADDR #
  170. BEGIN
  171. NBTCOFF[IND2] = NBTCOFF[IND2] - NINBINC;
  172. END
  173. IF NBTCSIZE[IND2] GQ MAXIBSZ # IF THE ATTEMPTTED #
  174. THEN # BUFFER SIZE IS TOO #
  175. BEGIN # BIG, THEN #
  176. NBTCSIZE[IND2] = MAXIBSZ; #REDUCE IT TO THE LIMIT.#
  177. CONTROL IFEQ STAT,1;
  178. ST$MXIB = ST$MXIB + 1;
  179. CONTROL FI;
  180. END
  181. END
  182. ELSE # PIP HAS NOT REJECTED IVT DATA #
  183. BEGIN
  184. IF RTSECS[0] GQ NBTRTIME[IND2]
  185. THEN # ONE MINUTE HAS ELAPSED WITH NO REJECTS #
  186. BEGIN
  187. NBTRTIME[IND2] = RTSECS[0] + NINBRJTO; #RESET TIMEO#
  188. IF NBTCSIZE[IND2] GR NINBMIN
  189. THEN # CUR INBOUND BUF SIZE GREATER THAN MIN #
  190. BEGIN
  191. NBTCSIZE[IND2] = NBTCSIZE[IND2] - NINBINC;
  192. END
  193. ELSE # INBOUND BUFFER SIZE IS ALREADY AT MIN #
  194. BEGIN
  195. IF NBTCOFF[IND2] LS NINBMIN
  196. THEN # OFFSET FOR THRESHOLD ADR NOT AT MAX #
  197. BEGIN # INCREASE OFFSET FOR THRESHOLD ADDR #
  198. NBTCOFF[IND2] = NBTCOFF[IND2] + NINBINC;
  199. END
  200. END
  201. END
  202. END
  203. MGETS(NBTCSIZE[IND2],P<DRHDRWD>,FALSE);
  204. NBTFIRST[NXTIND] = P<DRHDRWD>;# SET FIRST POINTER #
  205. NBTIN[NXTIND] = P<DRHDRWD>; # SET IN POINTER #
  206. NBTOUT[NXTIND] = P<DRHDRWD>; # SET OUT POINTER #
  207. NBTTA[NXTIND] = P<DRHDRWD> + NBTCOFF[IND2];
  208. NBTLIMIT[NXTIND] = P<DRHDRWD> + NBTCSIZE[IND2];
  209. NBTBAF[NXTIND] = TRUE; # SET BUFFER AVAILABLE #
  210. BLKID[0] = PIBIDVALUE;
  211.  
  212. CONTROL IFEQ STAT,1;
  213. ST$NIB = ST$NIB + 1;
  214. CONTROL FI;
  215.  
  216. END
  217. END
  218. #
  219.   PROCESS INPUT BUFFER
  220. #
  221.  
  222. CONTROL IFEQ STAT,1;
  223. IF NBTIN[CURIND] NQ NBTOUT[CURIND]
  224. THEN # UPLINE NETWORK MESSAGES TO PROCESS #
  225. BEGIN
  226. OTIME(STIME); # GET SYSTEM TIME BEFORE NEIB CALL #
  227. WORK = TRUE;
  228. CONTROL FI;
  229.  
  230. FOR CURIND = CURIND WHILE NBTIN[CURIND] NQ
  231. NBTOUT[CURIND]
  232. DO
  233. BEGIN # FOR EACH BLOCK IN INPUT BUFFER #
  234. ACTIVENPU = TRUE;
  235. P<DRHDRWD> = NBTOUT[CURIND];
  236. BUFSIZ = BLKBS[0]; # SAVE BUFFER SIZE #
  237.  
  238. CONTROL IFEQ DEBUG,1;
  239. TIMESECS[0] = RTSECS[0];# REAL TIME NETWK HAS UP #
  240. BPIPINW[BPIPINP] = TIMEWORD[0];# WRITE TIME IN BUFF #
  241. BPIPINP = BPIPINP + 1;# INCR BUFFER OFFSET PTR #
  242. IF BPIPINP GR 999
  243. THEN
  244. BPIPINP = 0;# INITIALIZE OFFSET PTR TO BEGINNING #
  245. #
  246.   COPY INBOUND BLOCKS TO DEBUG BUFFER
  247. #
  248. P<TRAP> = 0;
  249. FOR TRAPINDEX = 0 STEP 1 UNTIL BUFSIZ - 1
  250. DO
  251. BEGIN
  252. BPIPINW[BPIPINP] = WORD[P<DRHDRWD>+TRAPINDEX];
  253. BPIPINP = BPIPINP + 1;# INCR BUFFER OFFSET PTR #
  254. IF BPIPINP GR 999
  255. THEN
  256. BPIPINP = 0;# INITIALIZE OFFSET PTR TO BEGINNING #
  257. END
  258. CONTROL FI;
  259.  
  260. CONTROL IFEQ ZZDN,1;
  261. P<SUPMSG> = P<DRHDRWD> + BLKHSIZE + ABHSIZE;
  262. IF PFC[0] NQ NPU OR PFCSFC[0] EQ NPUIN
  263. THEN
  264. BEGIN
  265. IF KNAMLB[0]
  266. THEN # FLAG SET TO LOG NETWORK TRAFFIC #
  267. BEGIN
  268. TWRITE(BPFET,P<DRHDRWD>,BUFSIZ) ;
  269. MSGCNT = MSGCNT + 1; # INCREMENT COUNT OF MSGS #
  270. IF BPAT[0] NQ 0
  271. THEN # I/O ERROR HAS OCCURRED ON DEBUG LOG FILE#
  272. BEGIN
  273. OPRETN(BPFET); # RETURN BAD FILE #
  274. OPITRCE(ZNRF1,0); # REINITIALIZE DEBUG LOG FIL#
  275. END
  276. END
  277. END
  278. CONTROL FI;
  279.  
  280. NEIB1(P<DRHDRWD>,NBTHN[IND]) ;
  281. NBTOUT[CURIND] = NBTOUT[CURIND] + BUFSIZ;
  282. END
  283.  
  284. CONTROL IFEQ STAT,1;
  285. OTIME(ETIME);# GET SYSTEM TIME AFTER PROCESSING BUF #
  286. STTEMP = EMILS[0] - SMILS[0];
  287. IF STTEMP GR ST$LNI
  288. THEN # FOUND LARGER TIME INTERVAL #
  289. BEGIN
  290. ST$LNI = STTEMP; # LARGEST TIME INTERVAL #
  291. END
  292. IF STTEMP GR 200
  293. THEN # SPENT MORE THAN .2 SECONDS IN INTERVAL #
  294. BEGIN
  295. ST$MNI = ST$MNI + 1; # INCR NO OF TIMES > .2 SEC #
  296. END
  297. ST$TNI = ST$TNI + STTEMP; # INCR TOTAL TIME PROCESS #
  298. END
  299. CONTROL FI;
  300.  
  301. #
  302.   RELEASE REMAINING BUFFER IF NECESSARY
  303. #
  304. IF NBTBRF[CURIND]
  305. THEN
  306. BEGIN
  307. NEIB2END:
  308. PURGREG; # PIP MAY HAVE UPDATED IN - FORCE CM READ#
  309. IF NBTIN[CURIND] EQ NBTOUT[CURIND] # IF BUFFER EMPTY #
  310. THEN
  311. BEGIN
  312. P<DRHDRWD> = NBTOUT[CURIND];
  313. BLKBS[0] = NBTLIMIT[CURIND] - NBTOUT[CURIND];
  314. MRELS(P<DRHDRWD>);
  315. NBTBRF[CURIND] = FALSE;
  316. NBTIN[CURIND] = NBTLIMIT[CURIND];
  317. NBTOUT[CURIND] = NBTLIMIT[CURIND];
  318. JALLOC = TRUE;
  319. GOTO NEIB2LOOP; # PROCESS OTHER INBOUND BUFFER#
  320. GOTO NEIB2END; # FORCE WORD ALIGNMENT OF LABEL#
  321. END
  322.  
  323. END
  324. END
  325. END
  326. #
  327.   PROCESS MESSAGES IN INTRA-HOST A-A MESSAGE QUEUE
  328. #
  329.  
  330. CONTROL IFEQ STAT,1;
  331. IF NOT WORK
  332. THEN # NIP PROCESSED UPLINE MESSAGE #
  333. BEGIN
  334. ST$ENB = ST$ENB + 1; # INCREMENT NO OF TIMES FOUND NO WORK #
  335. END
  336. CONTROL FI;
  337.  
  338.  
  339. P<LLCB> = TNTLLAD[0];
  340. IF P<LLCB> NQ 0
  341. THEN
  342. BEGIN
  343. P<DRHDRWD> = 0;
  344. BUF = LLCBSHFP[0]; # FIRST MSG IN LIST #
  345. FOR I=I WHILE BUF NQ 0
  346. DO
  347. BEGIN
  348. LLCBSHFP[0] = NEXTPTR[BUF]; # UPDATE FORWARD PTR #
  349. NBTIDX = NBTMAXID + 1; # NBT INDEX FOR INTRAHOST MSG #
  350. NEIB1(BUF,0) ; # PROCESS MESSAGE #
  351. BUF = LLCBSHFP[0];
  352. END
  353. END
  354. END
  355. TERM
cdc/nos2.source/nam5871/neib.txt ยท Last modified: 2023/08/05 17:22 by Site Administrator