User Tools

Site Tools


cdc:nos2.source:nam5871:netgetq

NETGETQ

Table Of Contents

  • [00012] PROC NETGETQ((ADR),HA,ATA,(TLMAX),OPTWD)
  • [00100] PROC NETXFRC
  • [00101] PROC NP$ERR
  • [00102] PROC NP$GET
  • [00103] PROC NP$GETQ
  • [00104] PROC NP$SN
  • [00159] ENTRY PROC NETGTLQ((ADR),HA,ATA,(TLMAX),OPTWD)

Source Code

NETGETQ.txt
  1. *DECK NETGETQ
  2. USETEXT AIPDEF
  3. USETEXT HEADER
  4. USETEXT NP$DB
  5. USETEXT NP$GETS
  6. USETEXT NP$MODE
  7. USETEXT NP$NWL
  8. USETEXT NP$STAT
  9. *IF,DEF,XFR
  10. USETEXT NX$ACBF
  11. *ENDIF
  12. PROC NETGETQ((ADR),HA,ATA,(TLMAX),OPTWD);
  13. #
  14. *1DC NETGETQ
  15. *
  16. * 1. PROC NAME AUTHOR DATE
  17. * NETGETQ E. GEE 05/05/85
  18. *
  19. * 2. FUNCTIONAL DESCRIPTION.
  20. * THIS ROUTINE GETS DATA OR SUPERVISORY MESSAGES FROM EITHER
  21. * AIP-S OR NIP-S DATA OR SUPERVISORY MESSAGE BUFFER.
  22. *
  23. * 3. METHOD USED.
  24. * IF APPLICATION HAS ALREADY NETTED ON,
  25. * IF APPLICATION WANTS DATA ONLY AND EITHER WANTS ONLY
  26. * DATA QUEUED IN AIP OR AIP HAS DATA QUEUED,
  27. * CALL NP$GETQ TO GET THE DATA.
  28. * ELSE (APPLICATION DOES NOT WANT DATA ONLY),
  29. * IF APPLICATION WANTS SUPERVISORY MESSAGES ONLY,
  30. * CALL NP$GET TO GET THE SUP MSG.
  31. * ELSE (APPLICATION WANTS EITHER DATA OR SUP MSG),
  32. * IF AIP DOES NOT HAVE ANY SUP MSGS QUEUED AND EITHER
  33. * THE APP WANTS MSGS ONLY FROM AIP-S BUFFERS OR
  34. * AIP HAS DATA QUEUED AND EITHER THE APP WANTS
  35. * AIP-QUEUED DATA MORE THAN SUP-MSGS QUEUED IN
  36. * NIP OR NIP HAS NO SUP MSGS QUEUED,
  37. * CALL NP$GETQ TO GET DATA FROM AIP-S BUFFER.
  38. * ELSE (DELIVER SUP MSG QUEUED IN AIP/NIP OR DATA
  39. * QUEUED IN NIP),
  40. * CALL NP$GET TO GET THE SUP MSG OR DATA.
  41. * IF DELIVERED SUP MSG IS FC/BRK,
  42. * CALL NP$GETQ TO DISCARD MSGS FOR THAT CON.
  43. * ELSE (APPLICATION HAS NOT NETTED ON YET),
  44. * CALL NP$ERR TO ISSUE DAYFILE MSG AND ABORT APP.
  45. *
  46. * 4. ENTRY CONDITIONS.
  47. * ADR CONNECTION/LIST NUMBER
  48. * HA ADDR OF WORD TO RECEIVE APP BLK HEADER
  49. * ATA ADDR OF BUFFER TO RECEIVE THE TEXT
  50. * TLMAX SIZE OF BUFFER IN WORDS
  51. * OPTWD ADDR OF WORD TO PROVIDE ADDITIONAL OPTIONS
  52. * FOR THE CALL. THE FOLLOWING BITS (BIT 0 =
  53. * RIGHTMOST BIT) IN THAT WORD ARE USED.
  54. * BIT 0 = 0 GET DATA OR SUP MSG FROM AIP-S
  55. * OR NIP-S BUFFERS.
  56. * = 1 GET DATA OR SUP MSG FROM AIP-S
  57. * BUFFER ONLY.
  58. * BIT 1 = 0 DELIVER SUP MSGS FIRST EVEN IF
  59. * DATA MSGS ARE QUEUED IN UPLINE
  60. * DATA BUFFER.
  61. * BIT 1 = 1 DELIVER DATA QUEUED IN UPLINE
  62. * DATA BUFFER FIRST EVEN IF SUP
  63. * MSGS ARE QUEUED IN NIP.
  64. * 5. EXIT CONDITIONS.
  65. * HA CONTAIN NULL BLOCK IF NOT DATA/SUP MSG WAS
  66. * AVAILABLE. OTHERWISE, IT WILL CONTAIN THE
  67. * APP BLOCK HEADER OF THE MESSAGE.
  68. * ATA CONTAINS TEXT OF MESSAGE IF ONE WAS
  69. * DELIVERED.
  70. *
  71. * 6. COMDECKS AND SYMPL TEXT USED.
  72. * AIPDEF CONSTANT DEFINITIONS
  73. * HEADER ABH AND SUP MSG TEMPLATES
  74. * NP$DB UPLINE DATA BUFFER TEMPLATE
  75. * NP$GETS GLOBAL VARIABLES
  76. * NP$MODE GLOBAL VARIABLES
  77. * NP$NWL NETWORK WORKLIST TABLE
  78. * NP$STAT STATISTICS TABLE
  79. * NX$ACBF FILE TRANSFER TABLE
  80. *
  81. * 7. PROCEDURES/FUNCTIONS CALLED.
  82. * NP$ERR ISSUE ERROR MSG AND ABORT APP
  83. * NP$GET GET DATA/SUP MSG FROM AIP/NIP
  84. * NP$GETQ GET DATA MSG IN GMM BUFFER
  85. * NP$SN INCREMENT AIP STATISTICS
  86. *
  87. * 8. DAYFILE MESSAGES OR OTHER IMPORTANT INFORMATION.
  88. * THIS PROGRAM HAS A SECOND ENTRY POINT NETGTLQ FOR GETTING
  89. * DATA FROM A CONNECTION ON LIST ADR.
  90. *
  91. * * APPLICATION ABORTED, RC = 52. *
  92. * * NETFUNC: INVALID FUNCTION CODE USED. *
  93.  #
  94. BEGIN
  95. #
  96.   EXTERNAL ROUTINES CALLED
  97. #
  98. XREF
  99. BEGIN
  100. PROC NETXFRC; # FILE TRANSFER COMPLETE ROUTINE#
  101. PROC NP$ERR; # ISSUE ERROR MSG AND ABORT APP #
  102. PROC NP$GET; # GET DATA/SUP MSG FROM AIP/NIP #
  103. PROC NP$GETQ; # GET DATA MSG IN GMM BUFFER #
  104. PROC NP$SN; # INCREMENT AIP STATISTICS #
  105. END
  106. #
  107.   INPUT VARIABLES
  108. #
  109. ITEM ADR; # CONNECTION/LIST NUMBER #
  110. ITEM HA; # APPLICATION BLOCK HEADER ADDR #
  111. ITEM ATA; # APPLICATION TEXT AREA ADDRESS #
  112. ITEM TLMAX; # MAXIMUM TEXT LENGTH #
  113.  
  114. ARRAY OPTWD S(1); # ADDR OF WD CONTAINING OPTIONS #
  115. BEGIN
  116. ITEM OPTWDD B(0,58,01); # GET DATA FROM QUEUE BEFORE #
  117. # GETTING SUP MSG FROM NIP #
  118. ITEM OPTWDQ B(0,59,01); # GET MSG FROM DATA QUEUE ONLY #
  119. END
  120. #
  121.   LOCAL VARIABLES
  122. #
  123. ITEM GETQDATA B; # GET-DATA-FROM-AIP-BUF FLAG #
  124. ITEM GMMSC; # SEARCH CODE FOR NP$GETQ CALL #
  125. #**********************************************************************#
  126. CONTROL EJECT;
  127. #
  128.   EXECUTABLE CODE BEGINS HERE
  129. #
  130. IF NOT ACCEPTED
  131. THEN # APPLICATION HAS NOT NETTED ON #
  132. BEGIN
  133. NP$ERR("36"); # ISSUE DAYFILE MSG AND ABORT AP#
  134. END
  135. OPCODE = OP$GET; # GET DATA FOR CONNECTION OPCODE#
  136.  
  137. *IF,DEF,STAT
  138. IAM = TYPE"GETQ"; # TYPE OF AIP CALL #
  139. *ENDIF
  140.  
  141. GETQDATA = FALSE;
  142. AIPQONLY = OPTWDQ[0]; # GET-MSGS-FROM-AIP-BUF-ONLY FLG#
  143. PRIDATA = OPTWDD[0]; # GIVE-PRIORITY-TO-AIP-DATA FLAG#
  144. IF (ADR NQ 0 ) AND
  145. (GMBHEAD NQ GMBFOOT)
  146. THEN # WANT TO GET DATA FROM AIP BUF #
  147. BEGIN
  148. GETQDATA = TRUE; # SET GET-DATA-FROM-AIP-BUF FLAG#
  149. END
  150.  
  151. *IF,DEF,DEBUG
  152. DB$CALL = LOC(NETGETQ); # TRACE CALLING ADDRESS #
  153. *ENDIF
  154.  
  155. GMMSC = GMMSCN; # GET DATA FOR CONNECTION #
  156. LIST = FALSE; # SET FLAG FOR NOT LIST PROCESS #
  157. GOTO NETGETQ1;
  158.  
  159. ENTRY PROC NETGTLQ((ADR),HA,ATA,(TLMAX),OPTWD);
  160.  
  161. IF NOT ACCEPTED
  162. THEN # APPLICATION HAS NOT NETTED ON #
  163. BEGIN
  164. NP$ERR("37"); # ISSUE DAYFILE MSG AND ABORT AP#
  165. END
  166. OPCODE = OP$GETL; # GET DATA FOR LIST OPCODE #
  167.  
  168. *IF,DEF,STAT
  169. IAM = TYPE"GTLQ"; # TYPE OF AIP CALL #
  170. *ENDIF
  171.  
  172. GETQDATA = FALSE;
  173. AIPQONLY = OPTWDQ[0]; # GET-MSGS-FROM-AIP-BUF-ONLY FLG#
  174. PRIDATA = OPTWDD[0]; # GIVE-PRIORITY-TO-AIP-DATA FLAG#
  175. IF ( (ADR EQ 0 ) AND
  176. (HEAD EQ FOOT ) AND
  177. ( (GMBHEAD NQ GMBFOOT) AND
  178. ( (SD$FLAG EQ 0) OR
  179. (PRIDATA ) ) ) ) OR
  180. ( (ADR NQ 0 ) AND
  181. (GMBHEAD NQ GMBFOOT) )
  182. THEN # WANT TO GET DATA FROM AIP BUF #
  183. BEGIN
  184. GETQDATA = TRUE; # SET GET-DATA-FROM-AIP-BUF FLAG#
  185. END
  186.  
  187. *IF,DEF,DEBUG
  188. DB$CALL = LOC(NETGTLQ); # TRACE CALLING ADDRESS #
  189. *ENDIF
  190.  
  191. GMMSC = GMMSLN; # GET DATA FOR LIST NUMBER #
  192. LIST = TRUE; # SET FLAG FOR LIST PROCESSING #
  193.  
  194.  
  195. NETGETQ1:
  196. #
  197.   STORE INPUT PARAMETERS IN COMMON BLOCK
  198. #
  199.  
  200. *IF,DEF,DEBUG
  201. DB$OP = OPCODE; # OPCODE FOR TYPE OF CALL #
  202. *ENDIF
  203.  
  204. ACLN = ADR; # CONNECTION/LIST NUMBER #
  205. LOC$HA = LOC(HA); # ADDRESS FOR APPL BLK HEADER #
  206. LOC$TA = LOC(ATA); # ADDRESS FOR DATA #
  207. TLMX = TLMAX; # MAXIMUM TEXT LENGTH ALLOWED #
  208.  
  209. P<HEADER> = LOC$HA; # ADDR OF ABH OF UPLINE MSG #
  210. ABHABT[0] = APPNULL; # INITIALIZE BLOCK TYPE FIELD #
  211. IF GETQDATA
  212. THEN # ONLY WANT DATA QUEUED IN AIP #
  213. BEGIN
  214. NP$GETQ(GMMSC); # GET DATA MSG QUEUED IN AIP #
  215. END
  216. IF ABHABT[0] EQ APPNULL # NO MESSAGES IN AIP DATA QUEUE #
  217. THEN # GET MSG FROM AIP SM QUEUE/NIP #
  218. BEGIN # OR ANY TYPE OF MSG FROM NIP #
  219. NWL[NEXT] = 0; # CLEAR NWL OPCODE WORD #
  220. NWL$TA[NEXT] = LOC$TA; # ADDR TO WRITE TEXT TO #
  221. BS = OPABHSIZ; # SIZE OF WORKLIST ENTRY #
  222. NP$GET;
  223. P<SUPMSG> = LOC$TA; # ADDR OF TEXT OF UPLINE MSG #
  224. IF (PFCSFC[0] EQ FCBRK ) AND # DELIVERED UPLINE FC/BRK S M #
  225. (ABHABT[0] EQ APPCMD) AND # DELIVERED SUPERVISORY MESSAGE #
  226. (ABHADR[0] EQ 0 ) # ASYNC SUPERVISORY MESSAGE #
  227. THEN # NEED TO GET RID OF MSG IN QUE #
  228. BEGIN
  229. ACLN = SPACN[0]; # CONNECTION NUMBER OF FC/BRK #
  230. NP$GETQ(GMMDCN); # DISCARD MSGS IN QUEUE #
  231. END
  232. END
  233.  
  234. *IF DEF,XFR
  235. IF NUMFILEXFR NQ 0
  236. THEN # FILE TRANSFER OUTSTANDING #
  237. BEGIN
  238. NETXFRC; # CONTINUE TRANSFERRING FILE #
  239. END
  240. *ENDIF
  241.  
  242. RETURN;
  243. END
  244. TERM
cdc/nos2.source/nam5871/netgetq.txt ยท Last modified: 2023/08/05 17:22 by Site Administrator