User Tools

Site Tools


cdc:nos2.source:nam5871:hpget

Table of Contents

HPGET

Table Of Contents

  • [00013] PROC HPGET
  • [00096] PROC BDELINK
  • [00097] PROC BWLBLK
  • [00098] PROC HGETDA
  • [00099] PROC MRELS
  • [00100] PROC OVLCALL
  • [00101] PROC XTRACE
  • [00102] PROC HRDPUT

Source Code

HPGET.txt
  1. *DECK HPGET
  2. USETEXT NIPDEF
  3. USETEXT ACB
  4. USETEXT ACNT
  5. USETEXT AHEADER
  6. USETEXT APPSTAT
  7. USETEXT DBGBUF
  8. USETEXT NP$TAA
  9. USETEXT NWLHEAD
  10. USETEXT NWLNTRY
  11. USETEXT OVERLAY
  12. USETEXT PARAMS
  13. PROC HPGET; # PROCESS *NET GET* AND *NET GETL* #
  14.  
  15. STARTIMS;
  16. #
  17. *1DC HPGET
  18. *
  19. * 1. PROC NAME AUTHOR DATE
  20. * HPGET E. GEE 85/04/10
  21. *
  22. * 2. FUNCTIONAL DESCRIPTION.
  23. * PROCESS AIP *NETGET*, *NETGETL*, *NETGETF*, AND *NETGTFL*
  24. * WORKLIST ENTRIES
  25. *
  26. * 3. METHOD USED.
  27. * IF FRAGMENTED GET CALL,
  28. * VALIDATE IT IS CORRECT CALL.
  29. * IF GET CALL FOR DATA FROM CONNECTION,
  30. * VALIDATE CONNECTION NUMBER IS CORRECT.
  31. * IF VALID CALL,
  32. * IF ASYNC SUPERVISORY MESSAGE CAN BE DELIVERED,
  33. * CALL BDELINK TO DELINK SUPERVISORY MESSAGE FROM ACB DR.
  34. * ELSE (CHECK IF DATA MESSAGE CAN BE DELIVERED),
  35. * CALL HGETDA TO GET DATA MESSAGE.
  36. * UPDATE GET AWL ENTRY.
  37. * IF MESSAGE TO DELIVER,
  38. * IF TEXT TO WRITE BACK TO APPLICATION TEXT AREA,
  39. * IF FRAGMENTED CALL,
  40. * CALL HPGTF TO WRITE FRAGMENTED TEXT BACK TO APP.
  41. * ELSE (TEXT IS DELIVERED TO ONE BUFFER),
  42. * CALL BWLBLK TO WRITE TEXT BACK TO APP TEXT AREA.
  43. * ELSE (INVALID GET TYPE CALL),
  44. * CALL HLGLERR TO SEND ERR/LGL SUP MSG TO APPLICATION.
  45. *
  46. * 4. ENTRY PARAMETERS.
  47. * WLADDR WORKLIST ENTRY LOCATION
  48. * ACBADDR CURRENT APPLICATION"S ACB
  49. * NWLOP A GET OR GETL REQUEST
  50. *
  51. * 5. EXIT PARAMETERS.
  52. * AWLADR CONNECTION NUMBER
  53. * AWLCB =1,THE COMPLETE BIT
  54. * AWLIBU TRUE,IF INPUT BLOCK IS UNDELIVERABLE
  55. * AWLRC REASON CODE FOR NETGET RESPONSE
  56. * PARAMS1 BAD ACN,TOO MANY FRAGMENTED BUFFERS,
  57. *
  58. * 6. COMDECKS CALLED AND SYMPL TEXTS USED.
  59. * NIPDEF CONSTANT DEFINITIONS
  60. * ACB APPLICATION CONTROL BLOCK
  61. * ACNB APPLICATION CONNECTION BLOCK
  62. * ACNT APPLICATION CONNECTION TABLE
  63. * AHEADER APPLICATION BLOCK HEADER WORD
  64. * APPSTAT APPLICATION STATUS COMMON BLOCK
  65. * AT APPLICATION TABLE
  66. * DBGBUF DEBUG BUFFER
  67. * DRHDR BUFFER HEADER WORD
  68. * NCNB NETWORK CONNECTION BLOCK
  69. * NP$NWNC CHARACTER TYPE/WORD CONVERSION TABLE
  70. * NP$TAA FRAGMENT TEXT ARRAY
  71. * NWLHEAD NETWORK WORKLIST ENTRY HEADER WORD
  72. * NWLNTRY NETWORK WORKLIST ENTRY
  73. * OVERLAY OVERLAY TABLE
  74. * PARAMS PARAMETERS FOR PASSING TO SECONDARY OVERLAY
  75. * PT POINTER TABLE
  76. *
  77. * 7. ROUTINES CALLED.
  78. * BDELINK DELINK DATA BLOCK FROM DATA RING
  79. * BWLBLK XFER A BLOCK TO THE APP FL
  80. * HGETDA GET DATA MESSAGE FOR DELIVERY
  81. * HLGLERR OVL FORM AND ENQUEUE LOGICAL ERROR MESSAGE
  82. * HPGTF OVL READ FRAGMENTED TEXT INTO NIP-S FL
  83. * HRDPUT READ TEXT INTO NIP-S FIELD LENGTH
  84. * MRELS RETURN BUFFER TO FREE BUFFER CHAIN
  85. * OVLCALL LOAD AND EXECUTE OVERLAY
  86. * XTRACE TRACES CALLS
  87. *
  88. * 8. DAYFILE MESSAGES. NONE
  89. *
  90.  #
  91. STOPIMS;
  92. #
  93.   EXTERNAL VARIABLES
  94. #
  95. XREF BEGIN
  96. PROC BDELINK; # DELINK DATA BLOCK FROM DATA RING #
  97. PROC BWLBLK; # XFER A BLOCK TO THE APP FL #
  98. PROC HGETDA; # GET DATA MESSAGE TO DELIVER #
  99. PROC MRELS; # RETURN BUFFER TO FREE CHAIN #
  100. PROC OVLCALL; # LOAD AND EXECUTE OVERLAY #
  101. PROC XTRACE; # RECORD CALLS #
  102. PROC HRDPUT; # READ TEXT OR TEXT DESCRIPTION FROM APP #
  103. END
  104. #
  105.   INTERNAL VARIABLES
  106. #
  107. ITEM ABHWD; # WORD FOR SAVING ABH #
  108. ITEM ACNALN; # ACN/ALN IN GET/GETL CALL #
  109. ITEM ACNTINDX U ; # ACNT INDEX #
  110. ITEM BUFADDR; # ADDR OF BLOCK TO WRITE TO UCP #
  111. ITEM ELTAA ;
  112. ITEM FOUND B; # RESULT FROM DATA SEARCH SCAN #
  113. ITEM FRAG B; # FRAGMENT TYPE CALL FLAG #
  114. ITEM I; # INDEX FOR COUNTING FRAG BUF SZ#
  115. ITEM LIST B; # LIST NUMBER SCAN FLAG #
  116. ITEM OPCODE; # AIP WORKLIST OPCODE #
  117. ITEM SEND U; # STATUS FOR SENDING MSG TO APP #
  118. ITEM SIZE; # SIZE OF DATA MESSAGE TO DELIVR#
  119. ITEM TLW; # TEXT LENGTH IN WORDS #
  120.  
  121. STATUS BLOCKS NULL,DATA,SM;
  122.  
  123. #**********************************************************************#
  124.  
  125. BEGIN
  126. CONTROL IFEQ DEBUG,1 ;
  127. XTRACE("HPGET") ;
  128. CONTROL FI;
  129.  
  130. P<NWLENTRY> = WLADDR; # WORKLIST ADDRESS #
  131. P<ACB> = ACBADDR; # ACB ADDRESS #
  132. P<ACNT> = ACBACNT[0] ; # ACNT ADDRESS #
  133. ACNALN = NWLADR[0]; # ACN/ALN IN GET/GETL CALL #
  134. ACNTINDX = ACNALN + ACNTHSIZE - ACNTMINACN[0] ;
  135. ACBAWL0[0] = NWLEAIPH[0];
  136. OPCODE = NWLOP[0] ;
  137. FRAG = FALSE; # ASSUME NOT FRAGMENTED CALL #
  138. SEND = BLOCKS"NULL"; # ASSUME NULL BLOCK TO BE DELIV #
  139. PARAMS1 = 0 ;
  140. #
  141.   VALIDATE NETGETF/NETGTFL CALL
  142. #
  143. IF (OPCODE EQ WLOPGETF) OR # NETGETF CALL #
  144. (OPCODE EQ WLOPGTFL) # NETGTFL CALL #
  145. THEN # DELIVER SUP MSGS IF ANY #
  146. BEGIN
  147. FRAG = TRUE; # SET FRAGMENT CALL FLAG #
  148. IF NWLTA[0] NQ 0
  149. THEN # TEXT ARRAY NOT ON WL #
  150. BEGIN
  151. ELTAA = NWLELTAA[0];
  152. HRDPUT(ELTAA); # READ TEXT #
  153. P<NWLENTRY> = WLADDR; # NEW WORKLIST ADDR #
  154. END
  155. IF ELTAA GR MAXNA
  156. THEN # THERE ARE MANY FRAGMENT BUFS #
  157. BEGIN
  158. PARAMS1 = RLG"RES" ; # FRAG. IO ERROR RETURN #
  159. END
  160. ELSE # NO OF FRAG BUFS IS OKAY #
  161. BEGIN
  162. P<TAA> = WLADDR + FLSIZE ; # TEMPLATE FOR FRAGMENT ENTRY #
  163.  
  164. FOR I = 1 STEP 1 WHILE I LQ ELTAA AND PARAMS1 EQ 0
  165. DO
  166. BEGIN
  167. IF TAASIZE[I] GQ 64
  168. THEN # SIZE OF FRAG BUF IS TOO LARGE #
  169. BEGIN
  170. PARAMS1 = RLG"RES" ; # FRAG IO ERROR RETURN CODE #
  171. END
  172. END
  173. END
  174. END
  175. #
  176.   VALIDATE NETGET WITH NONZERO ACN CALL
  177. #
  178. IF (OPCODE EQ WLOPGETL) OR # NETGETL CALL #
  179. (OPCODE EQ WLOPGTFL) # NETGTFL CALL #
  180. THEN # GET MSG FROM LIST NUMBER CALL #
  181. BEGIN
  182. LIST = TRUE;
  183. END
  184. ELSE # GET MSG FROM CON NUMBER CALL #
  185. BEGIN
  186. LIST = FALSE;
  187. IF ACNALN NQ 0
  188. THEN # GET DATA FROM CONNECTION #
  189. BEGIN
  190. IF (ACNALN GR ACNTHCN[0]) OR # CONNECTION NUMBER TOO LARGE #
  191. (ACNALN LS ACNTMINACN[0]) OR # CONNECTION NO TOO SMALL #
  192. (ACNTACNB[ACNTINDX] EQ 0) # NONEXISTENT CONNECTION #
  193. THEN # BAD CON NUMBER WAS SPECIFIED #
  194. BEGIN
  195. PARAMS1 = RLG"ACN"; # REASON CODE FOR ERR/LGL SM #
  196. END
  197. END
  198. END
  199. IF PARAMS1 EQ 0
  200. THEN # VALID GET TYPE CALL #
  201. BEGIN
  202. #
  203.   CHECK IF ASYNCHRONOUS SUPERVISORY MESSAGE CAN BE DELIVERED
  204. #
  205. ABHWD = 0; # INITIALIZE ABH RESPONSE #
  206. IF (ACNALN EQ 0) AND # ALN/ACN ZERO CALL #
  207. (ACBDRFP[0] NQ 0) # THERE ARE SUP MSGS QUEUED #
  208. THEN # DELIVER SUP MSG TO APP #
  209. BEGIN
  210. P<AHEADER> = ACBDRFP[0] + BLKHSIZE;
  211. ABHWD = ABHWORD[0]; # APP BLOCK HEADER WORD #
  212. P<AHEADER> = LOC(ABHWD);
  213. TLW = ABHTLC[0]; # SIZE OF ASYNC SUP MSG IN WDS #
  214. IF NWLTLC[0] GQ TLW
  215. THEN # BUFFER IS BIG ENOUGH FOR MSG #
  216. BEGIN
  217. BDELINK(ACBADDR,BUFADDR,TLW); # DELINK SUP MSG #
  218. IF ABHABT[0] NQ APPSUP
  219. THEN # NOT SUPERVISION BLOCK TYPE #
  220. BEGIN
  221. ABHABN[0] = 0; # CLEAR ABN IN ABH #
  222. END
  223. SEND = BLOCKS"SM";
  224. END
  225. ELSE # BUFFER IS NOT BIG ENOUGH #
  226. BEGIN
  227. ABHIBU[0] = 1; # SET IBU BIT IN ABH WORD #
  228. END
  229. END
  230. ELSE # NOT DELIVERING SUP MSG #
  231. BEGIN
  232. #
  233.   CHECK IF DATA MESSAGE TO DELIVER
  234. #
  235. IF LIST OR # GET DATA FROM LIST CALL #
  236. (NOT LIST AND ACNALN NQ 0) # GET DATA FROM CON NUM CALL #
  237. THEN
  238. BEGIN
  239. BUFADDR = 0; # SET FLAG FOR NOT COPYING MSG #
  240. SIZE = NWLTLC[0]; # APP BUFFER SIZE FOR DATA MSG #
  241. HGETDA(BUFADDR,SIZE,ACNALN,LIST,ABHWD); # GET DATA MSG #
  242. P<AHEADER> = LOC(ABHWD); # ABH WORD OF DELINKED MSG #
  243. IF ABHWD NQ 0
  244. THEN # FOUND DATA BLOCK TO DELIVER #
  245. BEGIN
  246. IF ABHIBU[0] EQ 0
  247. THEN # DATA MSG IS DELIVERABLE #
  248. BEGIN
  249. SEND = BLOCKS"DATA";
  250. TLW = SIZE - ABHSIZE; # SIZE OF TEXT IN WORDS #
  251. END
  252. END
  253. ELSE # NO DATA BLOCK TO DELIVER #
  254. BEGIN
  255. ABHADR[0] = ACNALN; # STORE ACN/ALN IN ABH WORD #
  256. END
  257. END
  258. END
  259. ACBAWL1[0] = ABHWD;
  260. IF SEND NQ BLOCKS"NULL" # MSG TO DELIVER TO APP #
  261. THEN # DELIVER MESSAGE TO APP #
  262. BEGIN
  263. #
  264.   FOUND MESSAGE TO DELIVER TO APPLICATION
  265. #
  266.  
  267. CONTROL IFEQ DEBUG,1;
  268.  
  269. PNVALUE[0] = ACBAN[0]; # APPL. NUMBER #
  270. BGETW[BGETP] = PNWORD[0] ;
  271. BGETP = BGETP + 1 ;
  272. IF BGETP GR 999
  273. THEN
  274. BEGIN
  275. BGETP = 0;
  276. END
  277. P<TRAP> = BUFADDR + BLKHSIZE;
  278. FOR TRAPINDEX = 0 STEP 1 UNTIL TLW
  279. DO
  280. BEGIN
  281. BGETW[BGETP] = WORD[TRAPINDEX] ;
  282. BGETP = BGETP + 1;
  283. IF BGETP GR 999
  284. THEN
  285. BEGIN
  286. BGETP = 0;
  287. END
  288. END
  289.  
  290. CONTROL FI;
  291.  
  292. IF TLW NQ 0
  293. THEN
  294. BEGIN # TEXT WRITEN TO APPL. #
  295. #
  296.   THERE IS TEXT TO WRITE BACK TO APPLICATION TEXT AREA
  297. #
  298. IF NOT FRAG
  299. THEN # NOT FRAGMENT TYPE CALL #
  300. BEGIN
  301. BWLBLK(BUFADDR,NWLTA[0],TLW) ;
  302. END
  303. ELSE
  304. BEGIN # HPGTF TO PUT DATA INTO #
  305. PARAMS1 = BUFADDR ;
  306. PARAMS2 = TLW ;
  307. OVLNAME = HPGTFP ;
  308. OVLCALL ;
  309. END
  310. END # TEXT WRITTEN TO APPL. #
  311. ELSE # NO TEXT TO BE WRITTEN TO APP #
  312. BEGIN
  313. MRELS(BUFADDR); # RELEASE BUFFER FOR DATA MSG #
  314. END
  315. END
  316. IF DONE
  317. THEN
  318. BEGIN
  319. ACBAWL0C[0] = 1 ; # SET COMPLETE BIT #
  320. END
  321. END
  322. ELSE # APP TO RECEIVE ERR/LGL #
  323. BEGIN
  324. ACBAWL1[0] = 0 ; # CLEAR AWL RESPONSE WD IN ACB #
  325. OVLNAME = HLGLERRP ; # NAME OF OVERLAY TO LOAD #
  326. OVLCALL; # LOAD AND EXECUTE OVERLAY #
  327. END
  328.  
  329. RETURN;
  330. END
  331. TERM
cdc/nos2.source/nam5871/hpget.txt ยท Last modified: 2023/08/05 17:22 by Site Administrator