User Tools

Site Tools


cdc:nos2.source:nam5871:nxblink

Table Of Contents

  • [00018] PROC NXBLINK(BUFADDR,PIPINDEX)

Source Code

NXBLINK.txt
  1. *DECK NXBLINK
  2. USETEXT NIPDEF
  3. USETEXT BPIPBUF
  4. USETEXT DBGBUF
  5. USETEXT DRHDR
  6. USETEXT PT
  7. USETEXT NBT
  8. USETEXT SYSTIME
  9. USETEXT SUPMSG
  10. USETEXT STATTAB
  11. USETEXT AHEADER
  12. USETEXT NHEADER
  13. USETEXT MSGIDX
  14. USETEXT PARAMS
  15. USETEXT OVERLAY
  16. USETEXT INPARUT
  17. USETEXT KDIS
  18. PROC NXBLINK(BUFADDR,PIPINDEX);
  19. STARTIMS;
  20. #
  21. *1DC NXBLINK
  22. * 1. PROC NAME AUTHOR DATE
  23. * NXBLINK L.T.NGUYEN 82/06/16
  24. *
  25. * 2. FUNCTIONAL DESCRIPTION:
  26. *
  27. * LOG MESSAGE INTO TRACE FILE, AND LINK IT TO APPROPRIATE
  28. * PIPOUT.
  29. *
  30. * 3. METHOD USED:
  31. * UPDATE STATISTIC.
  32. * LOG MESSAGE TO TRACE FILE
  33. * LINK TO PIP OUT.
  34. *
  35. * 4. INPUT MASSAGE:
  36. * BUFADDR - ADDRESS OF BUFFER TO BE LOGGED AND LINKED.
  37. * PIPINDEX- INDEX TO CORRECT PIPOUT IN NBT.
  38. *
  39. * 5. EXIT PARAMS:
  40. * NONE.
  41. *
  42. * 6. COMDECKS CALLED AND SYMPL TEXTS USED
  43. * NIPDEF BPIPBUF DBGBUF
  44. * DRHDR NBT SYSTIME
  45. * SUPMSG STATTAB NHEADER
  46. *
  47. * 7. ROUTINES CALLED
  48. * OPITRCE INITIALIZE NIP DEBUG LOG FILE
  49. * OPRETN RETURN FILE
  50. * TWRITE - COPY BUFFER INTO TRACE FILE.
  51. * XTRACE - RECORD FOR EASY TRACE.
  52. *
  53. * 8. DAYFILE MESSAGES AND OTHER IMPORTANT INFORMATION
  54. * THIS ROUTINE IS CALLED BY NFOB AND NLOBCH.
  55. *
  56.  #
  57. STOPIMS;
  58. #
  59.   XREF
  60. #
  61. XREF PROC OPITRCE; # INITIALIZE NIP DEBUG LOG FILE #
  62. XREF PROC OPRETN; # RETURN FILE #
  63. XREF PROC OVLCALL; # LOAD AND EXECUTE OVERLAY #
  64. XREF PROC TWRITE ;
  65. XREF PROC XTRACE ;
  66.  
  67. #
  68.   INPUT PARAMS
  69. #
  70. ITEM BUFADDR ;
  71. ITEM PIPINDEX ;
  72.  
  73. ITEM INBUF ;
  74. CONTROL EJECT ;
  75.  
  76. BEGIN # NXBLINK #
  77.  
  78. P<DRHDRWD> = 0 ;
  79. OUTREL = TRUE ; # LATER ON WE HAVE TO EMPTY BUFFERS #
  80. CONTROL IFEQ DEBUG,1;
  81.  
  82. XTRACE("NXBLK") ;
  83.  
  84. TIMESECS[0] = RTSECS[0]; # REAL TIME NETWORK HAS BEEN UP #
  85. BPIPOTW[BPIPOTP] = TIMEWORD[0]; # STORE TIME IN DEBUG BUFFER #
  86. BPIPOTP = BPIPOTP + 1; # INCREMENT BUFFER OFFSET PTR #
  87. IF BPIPOTP GR 999
  88. THEN # END OF BUFFER REACHED #
  89. BPIPOTP = 0; # RESET OFFSET PTR TO START #
  90.  
  91. #
  92.   COPY OUTBOUND DATA BLOCKS TO DEBUG BUFFER
  93. #
  94.  
  95. P<TRAP> = 0;
  96. FOR TRAPINDEX = 0 STEP 1 UNTIL BLKBS[BUFADDR] - 1
  97. DO
  98. BEGIN
  99. BPIPOTW[BPIPOTP] = WORD[BUFADDR+TRAPINDEX];
  100. BPIPOTP = BPIPOTP + 1; # INCREMENT BUFFER OFFSET PTR #
  101. IF BPIPOTP GR 999
  102. THEN # END OF BUFFER REACHED #
  103. BPIPOTP = 0; # RESET OFFSET PTR TO START #
  104. END # TRACE COPY #
  105. CONTROL FI;
  106. BLKID[BUFADDR] = POBIDVALUE ; # NON MOVABLE BUFFER #
  107. BACKPTR[BUFADDR] = 0 ; # ID FOR PIP OUTBOUND #
  108. NEXTPTR[BUFADDR] = 0 ;
  109.  
  110.  
  111. CONTROL IFEQ ZZDN,1;
  112. P<NHEADER> = BUFADDR + BLKHSIZE ; # NETWORK BLOCK HEADER #
  113. P<SUPMSG> = P<NHEADER> + NBHSIZE ;
  114. IF BT[0] NQ NETCMD # NOT COMMAND BLOCK #
  115. OR PFC[0] NQ NPU # NOT NS DUMP/LOAD MESSAGE #
  116. OR PFCSFC[0] EQ NPUIN
  117. THEN
  118. BEGIN
  119. IF KNAMLB[0]
  120. THEN # FLAG SET TO LOG NETWORK TRAFFIC #
  121. BEGIN
  122. TWRITE(BPFET,BUFADDR,BLKBS[BUFADDR]); # LOG MSG #
  123. MSGCNT = MSGCNT + 1; # INCREMENT COUNT OF MESSAGES #
  124. IF BPAT[0] NQ 0
  125. THEN # I/O ERROR HAS OCCURRED ON DEBUG LOG FILE#
  126. BEGIN
  127. OPRETN(BPFET); # RETURN BAD FILE #
  128. OPITRCE(ZNRF1,0); # REINITIALIZE DEBUG LOG FILE #
  129. END
  130. END
  131. END
  132. CONTROL FI;
  133.  
  134. CONTROL IFEQ STAT,1; # STATISTICS ON #
  135. P<NHEADER> = BUFADDR + BLKHSIZE ;
  136. IF BT[0] LQ NETMSG
  137. OR BT[0] EQ NETQBLK
  138. OR BT[0] EQ NETQMSG
  139. THEN
  140. BEGIN
  141. ST$ODB = ST$ODB + 1; # INC *N/W OUTBOUND BLOCK #
  142. ST$ODC = ST$ODC + CC[0] ; # INC *N/W OUT DATA CHAR #
  143. END
  144. ELSE
  145. BEGIN
  146. ST$ONB = ST$ONB + 1; # INC *N/W OUT NON-DATA BLOCK #
  147. ST$ONC = ST$ONC + CC[0] ; # INC *N/W OUT NON-DATA CHAR #
  148. END
  149. CONTROL FI;
  150.  
  151. # LINK MESSAGE TO PIP OUTBOUND CHAIN #
  152.  
  153. INBUF = NBTIN[PIPINDEX]; # CURRENT IN PTR OF OUTBOUND BUF #
  154. IF INBUF NQ 0
  155. THEN
  156. NEXTPTR[INBUF] = BUFADDR;
  157. ELSE # NO CHAIN #
  158. NBTFIRST[PIPINDEX] = BUFADDR;
  159. NBTIN[PIPINDEX] = BUFADDR;
  160.  
  161. END # NXBLINK #
  162.  
  163. TERM
cdc/nos2.source/nam5871/nxblink.txt ยท Last modified: 2023/08/05 17:23 by Site Administrator