User Tools

Site Tools


cdc:nos2.source:nam5871:np_get

NP$GET

Table Of Contents

  • [00015] PROC NP$GET
  • [00081] PROC NP$ERR
  • [00082] PROC NP$GSM
  • [00083] PROC NP$SEND
  • [00085] PROC NP$SN
  • [00087] PROC NP$UCV
  • [00088] PROC NP$USI
  • [00090] PROC NP$ITMG

Source Code

NP$GET.txt
  1. *DECK NP$GET
  2. USETEXT AIPDEF
  3. USETEXT HEADER
  4. USETEXT NP$GETS
  5. USETEXT NP$MODE
  6. *IF DEF,XFR
  7. USETEXT NX$ACBF
  8. *ENDIF
  9. USETEXT NP$NWL
  10. USETEXT NP$STAT
  11. USETEXT NP$TAA
  12. *IF,DEF,DEBUG
  13. USETEXT NP$DB
  14. *ENDIF
  15. PROC NP$GET;
  16. *IF DEF,IMS
  17. #
  18. *
  19. * 1. PROC NAME AUTHOR DATE
  20. * NP$GET J.C. LEE 78/10/10
  21. *
  22. * 2. FUNCTIONAL DESCRIPTION
  23. * THIS ROUTINE IS CALLED BY NETGET AND NETGETF TO BUILD A GET
  24. * REQUEST IN THE NWL WORKLIST FOR A BLOCK FROM A SPECIFIED
  25. * CONNECTION OR LIST IF THERE IS DATA FOR THE APPLICATION QUEUED
  26. * IN NIP, OR TO DELIVER A SUPERVISORY MESSAGE IF IT
  27. * IS A GET REQUEST ON CONNECTION/LIST ZERO AND SMB IS NOT EMPTY.
  28. *
  29. * 3. METHOD USED
  30. * SEE DOCUMENTATION ON NETGET AND NETPUT.
  31. *
  32. * 4. ENTRY CONDITIONS
  33. * ACLN - APPLICATION CONNECTION / LIST NUMBER.
  34. * BS - WORKLIST ENTRY SIZE.
  35. * IAM - ROUTINE CURRENTLY EXECUTING.
  36. * LOC$HA - ADDRESS OF HEADER AREA.
  37. * LOC$TA - ADDRESS OF TEXT ARRAY.
  38. * NEXT - NEXT AVAILABLE SPACE POINTER IN WORKLIST.
  39. * OPCODE - OPCODE VALUE.
  40. * SPACE$LEFT - NUMBER OF CELLS AVAILABLE IN WORKLIST.
  41. *
  42. * 5. EXIT CONDITIONS
  43. * DEFER$GSM - TRUE FOR ADR=0 IF SMB IS EMPTY.
  44. * I$FLAG - TRUE IF INPUT DATA QUEUED IN NIP
  45. * S$FLAG - TRUE IF A NON-EMPTY SMB OR SM QUEUED IN NIP
  46. * LTAA - RESET TO ZERO.
  47. * NEXT - RESET TO INITIAL VALUE IF NWL IS SENT TO NIP.
  48. * SPACE$LEFT - RESET TO INITIAL VALUE IF NWL IS SENT TO NIP.
  49. *
  50. * 6. COMDECKS CALLED AND SYMPL TEXTS USED.
  51. * AIPDEF NP$CRT NP$DB NP$GETS
  52. * NP$MODE NP$NWL NP$STAT
  53. *
  54. * 7. ROUTINES CALLED
  55. * NP$ERR - ERROR PROCESSOR.
  56. * NP$GSM - DELIVER A SUPERVISORY MESSAGE TO APPLICATION.
  57. * NP$SEND - SEND NWL TO NIP.
  58. * NP$SN - UPDATE STATISTICS COUNTERS.
  59. * NP$UCV - UPDATE NWL CONTROL VARIABLES
  60. * NP$USI - UPDATE S AND I BITS IN NSUP WORD
  61. *
  62. * 8. DAYFILE MESSAGES
  63. * NETWORK APPLICATION ABORTED, RC = 31.
  64. * NP$GET: REQUEST INVALID BEFORE NETON.
  65. *
  66. * NETWORK APPLICATION ABORTED, RC = 42.
  67. * NP$GET: PREVIOUS REQUEST INCOMPLETE.
  68. *
  69. *
  70.  #
  71. *ENDIF
  72.  
  73. BEGIN
  74.  
  75. *CALL NP$CRT
  76. #
  77.   ROUTINES CALLED
  78. #
  79. XREF
  80. BEGIN
  81. PROC NP$ERR; # ERROR PROCESSOR #
  82. PROC NP$GSM; # DELIVER A SM TO APP #
  83. PROC NP$SEND; # SEND NWL TO NIP #
  84. *IF DEF,STAT
  85. PROC NP$SN; # INCREMENT STATISTICS COUNTERS#
  86. *ENDIF
  87. PROC NP$UCV; # UPDATE CONTROL VARIABLES #
  88. PROC NP$USI; # UPDATE S AND I BITS IN NSUP #
  89. *IF,DEF,XFR
  90. PROC NP$ITMG ; # INTERCEPT MESSAGE #
  91. *ENDIF
  92. END
  93. #
  94.   LOCAL VARIABLES
  95. #
  96. ITEM I I;
  97.  
  98. *IF,DEF,STAT
  99. ITEM NULLBLK B; # SEND NULL BLOCK TO APP FLAG #
  100. *ENDIF
  101.  
  102. *IF,DEF,XFR
  103. ITEM TEMP$HA U ; # TEMP LOCATION FOR TRUE ABH #
  104. ITEM TEMP$TA U ; # TEMP LOACTION FOR TRUE TEXT #
  105. *ENDIF
  106. #**********************************************************************#
  107. #
  108.   NP$GET EXECUTION BEGINS HERE
  109. #
  110. *IF DEF,STAT
  111.  
  112. #
  113.   UPDATE STATISTICS IF STAT IS TURNED ON
  114. #
  115.  
  116. NP$SN(IAM); # INCREMENT STATISTICS COUNTER #
  117.  
  118. *ENDIF
  119. IF NOT ACCEPTED
  120. THEN
  121. NP$ERR("31"); # REQUEST INVALID BEFORE NETON. #
  122. IF DEFER$PRO
  123. THEN
  124. NP$ERR("42"); # PREVIOUS REQUEST INCOMPLETE. #
  125. *IF DEF,DEBUG
  126.  
  127. #
  128.   SET UP PARAMETERS FOR DEBUG MESSAGE LOGGING
  129. #
  130. DB$OP = OPCODE; # NWL OP CODE #
  131.  
  132. *ENDIF
  133. #
  134.   HA IS INITIALIZED TO CONTAIN A NULL BLOCK HEADER
  135. #
  136. *IF,DEF,XFR
  137. TEMP$HA = LOC$HA ; # SAVE THE TRUE APPL ABH #
  138. TEMP$TA = LOC$TA ; # AND THE TRUE APPL TEXT AREA #
  139. MSGFORAP = FALSE; # ASSUMING MSG NOT FOR APPL. #
  140. FOR I = I WHILE NOT MSGFORAP # LOOP TO GET UNTIL OBTAIN A #
  141. DO # MESSAGE FOR APPLICATION #
  142. BEGIN
  143. *ENDIF
  144. I = NEXT + 1;
  145. ABH[I] = 0;
  146. ABH$ADR[I] = ACLN;
  147. P<HEADER> = LOC$HA; # HEADER ADDRESS #
  148. ABHWORD[0] = ABH[I];
  149. #
  150.   IF THERE IS DATA QUEUED IN NIP FOR THIS APPLICATION, THEN
  151.   BUILD A GET WORKLIST ENTRY FOR A NON-ZERO ACN, OR FOR A LIST
  152.   ZERO REQUEST WHEN AIP"S SMB DOES NOT CONTAIN SUPERVISORY MSG.
  153.   #
  154. IF HEAD NQ FOOT AND # AIP HAS SUP MSG QUEUED #
  155. ACLN EQ 0 # APP WILL ACCEPT SUP MSG #
  156. THEN # DELIVERED QUEUED SUP MSG #
  157. BEGIN
  158. NP$GSM; # GET SUPERVISORY MESSAGE #
  159. END
  160. ELSE # NEED TO GET MSG FROM NIP #
  161. BEGIN
  162.  
  163. *IF,DEF,STAT
  164. NULLBLK = TRUE; # INIT FLAG TO RETURN NULL BLOCK#
  165. *ENDIF
  166.  
  167. IF NOT AIPQONLY
  168. THEN # OKAY TO SEND WORKLIST TO NIP #
  169. BEGIN
  170. IF (ACLN EQ 0 ) AND
  171. (SD$FLAG NQ 0)
  172. THEN # SENT GETSM WORKLIST ONLY #
  173. BEGIN
  174. DEFER$GSM = TRUE; # SET DEFERRED GET SUP MSG FLAG #
  175.  
  176. *IF,DEF,STAT
  177. NULLBLK = FALSE; # NOT RETURNING NULL BLOCK #
  178. *ENDIF
  179.  
  180. END
  181. ELSE # CHECK IF NIP HAS DATA TO GET #
  182. BEGIN
  183. IF ( (LIST ) AND
  184. (WD$FLAG ) ) OR
  185. ( (NOT LIST ) AND
  186. (ACLN NQ 0 ) AND
  187. (ID$FLAG NQ 0) )
  188. THEN # SEND GET/GETL WORKLIST TO NIP #
  189. BEGIN
  190. N$GETAWL[0] = 1; # AWL RESPONSE TO PROCESS #
  191. NWL$ID[NEXT] = AWLID;
  192. NWL$OP[NEXT] = OPCODE;
  193. ABH$TLC[I] = 4095;
  194. IF TLMX LS 4095
  195. THEN # BUF LESS THAN MAXIMUM SIZE #
  196. BEGIN
  197. ABH$TLC[I] = TLMX;
  198. END
  199. #
  200.   UPDATE NWL HEADER AND CONTROL VARIABLES
  201. #
  202. NP$UCV;
  203.  
  204. *IF,DEF,STAT
  205. NULLBLK = FALSE;
  206. *ENDIF
  207.  
  208. END
  209. END
  210. END
  211. #
  212.   SEND WORKLIST TO NIP
  213. #
  214. NP$SEND; # SEND WORKLIST #
  215.  
  216. *IF,DEF,STAT
  217. IF NULLBLK
  218. THEN # RETURN NULL BLOCK TO APP #
  219. BEGIN
  220. NP$SN(TYPE"INB"); # UPDATE AIP STATISTICS #
  221. END
  222. *ENDIF
  223.  
  224. END
  225. #
  226.   UPDATE I, S, AND D BITS IN NSUP WORD
  227. #
  228. NP$USI;
  229.  
  230. *IF,DEF,XFR
  231.  
  232. #
  233.   IF FILE TRANSFER CONNECTION IS OUTSTANDING AND BLOCK RETURNED
  234.   IS NOT A NULL BLOCK AND IBU BIT NOT ON, THEN INTERCEPT THIS
  235.   BLOCK.
  236. #
  237. P<HEADER> = LOC$HA ; # HEADER OF NEW MESSAGE #
  238. IF NUMFILEXFR NQ 0
  239. AND ABHABT[0] NQ 0 # NOT A NULL BLOCK #
  240. AND ABHIBU[0] NQ 1 # NOT IBU #
  241. AND ABHADR[0] EQ 0 # SUPERVISORY MSG ONLY #
  242. THEN
  243. BEGIN
  244. NP$ITMG ; # INTERCEPT THIS MESSAGE #
  245. LOC$HA = TEMP$HA ; # RESTORE THE APPLICATION ABH #
  246. LOC$TA = TEMP$TA ; # RESTORE THE APPLICATION TA #
  247. OPCODE = OP$GET ;
  248. *IF DEF,STAT,1
  249. IAM = TYPE"GET" ;
  250. END
  251. ELSE
  252. MSGFORAP = TRUE ; # MSG GOTTEN IS FOR APPLICATION#
  253. NWL$TA[NEXT] = LOC$TA ;
  254.  
  255. END # LOOP TO GET #
  256.  
  257. *ENDIF
  258.  
  259. IF NOT DEFER$GSM
  260. THEN
  261. LTAA = 0;
  262.  
  263. RETURN;
  264. END # NP$GET #
  265. TERM
cdc/nos2.source/nam5871/np_get.txt ยท Last modified: 2023/08/05 17:22 by Site Administrator