User Tools

Site Tools


cdc:nos2.source:nam5871:np_send

NP$SEND

Table Of Contents

  • [00007] PROC NP$SEND
  • [00068] PROC NP$RESP
  • [00069] PROC NP$SN
  • [00070] PROC NP$UCV
  • [00071] PROC NP$XFER

Source Code

NP$SEND.txt
  1. *DECK NP$SEND
  2. USETEXT AIPDEF
  3. USETEXT NP$GMB
  4. USETEXT NP$MODE
  5. USETEXT NP$NWL
  6. USETEXT NP$STAT
  7. PROC NP$SEND;
  8. *IF DEF,IMS
  9. #
  10. *1DC NP$SEND
  11. * 1. PROC NAME AUTHOR DATE
  12. * NP$SEND S.KRULEVITCH 77/05/23
  13. *
  14. * 2. FUNCTIONAL DESCRIPTION
  15. * SENDS A WORKLIST,POSSIBLY WITH A GETSM REQUEST, TO NIP.
  16. *
  17. * 3. METHOD USED
  18. * IF THE UPLINE DATA QUEUE FEATURE IS IN USE, AND IF THE
  19. * SENDGETMM AND ID$FLAG ARE SET TRUE, BUILD A
  20. * -GET MULTIPLE MESSAGES- ENTRY AT THE END OF THE WORKLIST.
  21. *
  22. * BUILD A -GET SUPERVISORY MESSAGE- ENTRY AT THE END OF THE WL
  23. * IF SENDGETSM AND SD$FLAG ARE SET TRUE.
  24. *
  25. * IF THE DOWNLINE MESSAGE BUFFERING FEATURE IS IN USE, AND IF
  26. * THE DOWNLINE BUFFER IS LESS THAN THE LENGTH OF THE (FIXED-SIZE)
  27. * NETWORK WORKLIST, COPY THE MESSAGES INTO THE WORKLIST.
  28. * OTHERWISE, BUILD A PUTQ ENTRY IN THE NETWORK WORKLIST,
  29. * CONTAINING THE ADDRESS OF THE DOWNLINE MESSAGE BUFFER.
  30. *
  31. * CALL NP$XFER TO TRANSFER THE NETWORK WORKLIST TO NIP. IF THE
  32. * WORKLIST RESPONSE IS RETURNED TO AIP THEN NP$RESP IS CALLED
  33. * TO PROCESS THE RESPONSE.
  34. *
  35. * 4. ENTRY CONDITIONS
  36. * NEXT - INDEX OF NEXT AVAILABLE WORKLIST CELL
  37. * SD$FLAG - TRUE IF SM DATA QUEUED IN NIP
  38. * SPACE$LEFT - NUMBER OF AVAILABLE WORKLIST CELLS
  39. *
  40. * 5. EXIT CONDITONS
  41. * IF A NETGET OR NETGETL WAS JUST ISSUED, THE DATA BLOCK (OR NULL
  42. * BLOCK) WILL BE FOUND (OR POINTED TO) IN THE WORKLIST. IF A
  43. * -GETSM- WAS INCLUDED IN THE WORKLIST, SUPERVISORY MESSAGES
  44. * (IF ANY) WILL BE FOUND IN THE SUPERVISORY MESSAGE BUFFER.
  45. *
  46. * 6. COMDECKS CALLED AND SYMPL TEXTS USED.
  47. * AIPDEF NP$CRT NP$MODE NP$NWL
  48. * NP$STAT
  49. *
  50. * 7. ROUTINES CALLED
  51. * NP$RESP - PROCESSES WORKLIST RESPONSE
  52. * NP$XFER - TRANSFER NWL TO NIP
  53. * NP$UCV - UPDATE CONTROL VARIABLES
  54. *
  55. * 8. DAYFILE MESSAGES
  56. * NONE
  57. *
  58.  #
  59. *ENDIF
  60. BEGIN
  61.  
  62. *CALL NP$CRT
  63.  
  64. # #
  65. # ROUTINES CALLED #
  66. # #
  67. XREF BEGIN
  68. PROC NP$RESP; # PROCESSES NIP RESPONSE #
  69. PROC NP$SN; # UPDATE AIP STATISTICS #
  70. PROC NP$UCV; # UPDATE CONTROL VARIABLES #
  71. PROC NP$XFER; # TRANSFER NWL TO NIP #
  72. END #XREFS#
  73. # #
  74. # LOCAL DECLARATIONS #
  75. # #
  76. DEF TIL #STEP 1 UNTIL#;
  77. ITEM
  78. I I,
  79. LEN I; #TEMPORARY VARIABLE #
  80. BASED ARRAY MEM[0];
  81. BEGIN
  82. ITEM MEMWORD I; # FULL WORD ACCESS #
  83. END
  84.  
  85. #**********************************************************************#
  86. # #
  87. # NP$SEND EXECUTION BEGINS HERE #
  88. # #
  89. #
  90.   ONLY CREATE GETMM WORKLIST ENTRY IF THE AIP MULTIPLE UPLINE DATA
  91.   MESSAGE QUEUING FEATURE IS IN USE AND NIP HAS DATA MESSAGES AND
  92.   EITHER THE WORKLIST BUFFER IS NOT EMPTY OR A WORKLIST REQUEST
  93.   WILL BE SENT ANYWAY TO GET SUPERVISORY MESSAGES.
  94. #
  95. IF (GMBUSE ) AND
  96. (SENDGETMM ) AND
  97. (ID$FLAG NQ 0 ) AND
  98. ( (HDR$N[NHDR] NQ 0) OR
  99. (DEFER$GSM ) )
  100.  
  101. THEN
  102. BEGIN
  103. # #
  104. # THE SHORTEST DATA MESSAGE IS TWO WORDS LONG. A GETMM #
  105. # REQUEST IS BUILT ONLY IF THERE IS AT LEAST TWO WORDS IN #
  106. # THE AIP UPLINE DATA BUFFER. #
  107. # #
  108. # STEP 1: CALCULATE LEN = EMPTY SPACE IN AIP DATA BUFFER #
  109.  
  110. IF (GMBHEAD LS GMBFOOT) AND
  111. (GMBLAST LQ GMBFOOT)
  112. THEN
  113. BEGIN
  114. IF GMBHEAD GQ 4
  115. THEN
  116. GMBFOOT = 1;
  117. END #BOUNDARY CONDITION#
  118. IF GMBHEAD GR GMBFOOT
  119. THEN
  120. BEGIN
  121. LEN = GMBHEAD - GMBFOOT - 1;
  122. END
  123. ELSE
  124. LEN = GMBLAST - GMBFOOT + 1;
  125. # #
  126. # STEP 2: BUILD GETMM ENTRY IF LEN IS LARGE ENOUGH #
  127. IF LEN GQ 2
  128. THEN # UPLINE DATA BUF LARGE ENOUGH #
  129. BEGIN
  130.  
  131. *IF,DEF,STAT
  132. NP$SN(TYPE"GMM"); # INCREMENT NO OF GMM WKLST BLT#
  133. *ENDIF
  134.  
  135. N$GMMAWL[0] = 1; # FLAG GMM AWL TO PROCESS #
  136. NWL[NEXT]=0; # CLEAR AND BUILD OP WORD #
  137. NWL$ID[NEXT]=AWLID;
  138. BS = OPABHSIZ; # NWL ENTRY SIZE #
  139. NWL$TA[NEXT]=LOC(GMBWRD[GMBFOOT]);
  140. NWL$OP[NEXT]=OP$GMM; # GETMM OPCODE #
  141. GMM$NFW[NEXT+1] = LEN; # SIZE OF AIP DATA BUFFER #
  142. GMM$ACN[NEXT+1] = GMBCN; # CON NO FOR AIP DATA BUFFER #
  143. GMM$ALN[NEXT+1] = GMBLN; # LIST NO FOR AIP DATA BUFFER #
  144. NP$UCV; # UPDATE NWL CONTROL VARIABLES #
  145. END
  146. END #SENDGETMM#
  147.  
  148. IF SENDGETSM AND (SD$FLAG NQ 0) # IF SM QUEUED IN NIP #
  149. THEN
  150. BEGIN
  151. # #
  152. # THE SHORTEST SUPERVISORY MESSAGE IS TWO WORDS LONG. A GETSM #
  153. # REQUEST IS BUILT ONLY IF THERE IS AT LEAST TWO WORDS IN THE #
  154. # SMB (SUPERVISORY MESSAGE BUFFER). #
  155. # #
  156. # STEP 1: CALCULATE LEN = EMPTY SPACE IN SMB #
  157. IF HEAD LS FOOT AND (LAST-FOOT+1) LS NEXTSMLEN
  158. THEN
  159. BEGIN
  160. IF (HEAD-FIRST) GQ NEXTSMLEN
  161. THEN
  162. FOOT = FIRST;
  163. END #BOUNDARY CONDITION#
  164. IF HEAD GR FOOT
  165. THEN
  166. LEN = HEAD - FOOT;
  167. ELSE
  168. LEN = LAST - FOOT + 1;
  169. # #
  170. # STEP 3: BUILD NP$GSM ENTRY IF LEN IS LARGE ENOUGH #
  171. IF LEN GQ NEXTSMLEN
  172. AND LEN GQ OPABHSIZ
  173. THEN
  174. BEGIN
  175. *IF,DEF,STAT
  176. NP$SN(TYPE"GSM"); # INCREMENT NO OF GSM WKLST BLT#
  177. *ENDIF
  178.  
  179. N$GSMAWL[0] = 1; # FLAG GSM AWL TO PROCESS #
  180. NWL[NEXT]=0; # CLEAR AND BUILD OP WORD #
  181. NWL$ID[NEXT]=AWLID;
  182. BS = OPABHSIZ; # NWL ENTRY SIZE #
  183. NWL$TA[NEXT]=LOC(GSM[FOOT]);
  184. NWL$OP[NEXT]=OP$GSM;
  185. NWL[NEXT+1]=LEN; # CLEAR AND SEND SMB SPACE SIZE#
  186. NP$UCV; # UPDATE NWL CONTROL VARIABLES #
  187. END
  188. END #SENDGETSM#
  189. # #
  190. # ISSUE NWL WORKLIST TO NIP IF NWL ENTRY EXISTS #
  191. # #
  192. IF HDR$N[NHDR] NQ 0
  193. THEN
  194. BEGIN
  195. IF DOWNUSE # DOWNLINE BUFFERING IN USE #
  196. THEN
  197. BEGIN
  198. P<WORKLIST> = LOC(NWLBUF); # ADDR OF FIXED WORKLIST #
  199. IF NOT RESEND # NOT RESENDING SAME WORKLIST #
  200. THEN
  201. BEGIN
  202. P<MEM> = LOC$APBUF; # SAVE LOC OF APP BUFFER #
  203. LEN = HDR$W[NHDR] - 1; # LENGTH (WORDS) OF TEXT IN BUF#
  204. NEXT = NNTR; # INITIALIZE POINTERS FOR WL #
  205. SPACE$LEFT = LWL;
  206. IF LEN LQ SPACE$LEFT
  207. THEN # TEXT IN BUFFER CAN FIT IN WL #
  208. BEGIN
  209. FOR I = 0 STEP 1 UNTIL (LEN - 1)
  210. DO # COPY TEXT FROM APP BUFF INTO #
  211. BEGIN # FIXED-SIZE NETWORK WORKLIST #
  212. NWL[NEXT + I] = MEMWORD[I];
  213. END
  214. END
  215. ELSE # TEXT IN BUF TOO LONG FOR WL #
  216. BEGIN # BUILD PUTQ ENTRY #
  217. NP$SN(TYPE"PUTQ"); # INCREMENT NO OF PUTQ WL BUILT#
  218.  
  219. PUTQ[NEXT] = 0; # CLEAR AND BUILD OP WORD #
  220. PQ$ID[NEXT] = AWLID;
  221. PQ$OP[NEXT] = OP$PUTQ; # PUTQ OPCODE #
  222. PQ$TA[NEXT] = LOC$APBUF; # ADDR OF TEXT AREA BUFFER #
  223. PQ$N[NEXT+1] = HDR$N[NHDR]; # NO. OF WL ENTRIES IN BUF #
  224. PQ$W[NEXT+1] = LEN; # NO. OF WORDS IN TEXT AREA BUF#
  225. #
  226.   THE HEADER FIELDS CONTAIN THE LENGTH AND NUMBER OF WORDS
  227.   OF THE DOWNLINE BUFFER. CLEAR THESE FIELDS, AS THEY
  228.   SHOULD NOW REFLECT THE LENGTH/NO. OF ENTRIES OF THE FIXED
  229.   WORKLIST. THE FIXED WORKLIST ONLY CONTAINS ONE 2-WORD
  230.   PUTQ ENTRY. THE HEADER FIELDS WILL BE RESET IN NP$UCV.
  231. #
  232. HDR$N[NHDR] = 0;
  233. HDR$W[NHDR] = 1;
  234. BS = OPABHSIZ;
  235. NP$UCV; # UPDATE NWL CONTROL VARIABLES #
  236.  
  237. END
  238. END
  239. END
  240.  
  241. NP$XFER(LOC(NWL[NCTL]));
  242. IF NOT DEFER$PRO
  243. THEN # IF NOT IN PARALLEL MODE #
  244. NP$RESP; # PROCESS RESPONSE AWL #
  245. END
  246.  
  247. RETURN;
  248. END #NP$SEND#
  249. TERM
cdc/nos2.source/nam5871/np_send.txt ยท Last modified: 2023/08/05 17:22 by Site Administrator