User Tools

Site Tools


cdc:nos2.source:nam5871:bldncnb

BLDNCNB

Table Of Contents

  • [00015] PROC BLDNCNB
  • [00085] PROC ABORT
  • [00086] PROC KPUT
  • [00087] PROC MGETS
  • [00088] PROC OVLCALL
  • [00089] PROC XTRACE

Source Code

BLDNCNB.txt
  1. *DECK BLDNCNB
  2. USETEXT NIPDEF
  3. USETEXT LLCB
  4. USETEXT KDIS
  5. USETEXT KHDRX
  6. USETEXT NCNB
  7. USETEXT NCNT
  8. USETEXT OVERLAY
  9. USETEXT PARAMS
  10. USETEXT ACKHEAD
  11. USETEXT NHEADER
  12. USETEXT PT
  13. USETEXT STATTAB
  14. USETEXT SUPMSG
  15. PROC BLDNCNB; # BUILD NCNT AND NCNB #
  16. STARTIMS;
  17. #
  18. *1DC BLDNCNB
  19. * 1. PROC NAME AUTHOR DATE
  20. * BLDNCNB C. BITTNER 81/03/17
  21. *
  22. * 2. FUNCTIONAL DESCRIPTION
  23. * BUILD NCNB. IF THERE IS A CORRESPONDING NCNT THEN
  24. * JUST BUILD NCNT ENTRY, ELSE BUILD NCNT ALSO. BUILD
  25. * LLCB ENTRY.
  26. * 3. METHOD
  27. *
  28. * IF THERE IS NO CORRESPONDING NCNT THEN CREATE
  29. * AN NCNT AND FILL IN HEADER INFORMATION. ALSO
  30. * FILL IN ENTRY INFORMATION FOR THE LLCB.
  31. *
  32. * ALLOCATE A BUFFER FOR THE NETWORK
  33. * CONNECTION BLOCK (NCNB). FILL IN INFORMATION
  34. * FOR NCNB AND LINK NCNT WITH NCNB. UPDATE THE
  35. * TOTAL NUMBER OF CONNECTIONS ON THIS LOGICAL
  36. * LINK IN THE LLCB HEADER.
  37. *
  38. * BUILD AN ACKNOWLEDGE QUEUE OF DBL+1 WORDS.
  39. *
  40. * FILL IN NCNB ENTRY INFORMATION
  41. * 1) SFC = TE (ICN/TE/R)
  42. * FILL IN NCNB ENTRY INFORMATION USING THE
  43. * INFORMATION FROM THE ICN/TE/R AND UPDATE THE
  44. * TOTAL NUMBER OF ACTIVE CONNECTIONS IN THE NCNT
  45. * HEADER.
  46. * 2) SFC = AP (ICN/AP/R)
  47. * FILL IN NCNB ENTRY INFORMATION FROM ICN/AP/R MESSAGE.
  48. * UPDATE K-DISPLAY BUFFERS IF NECESSARY.
  49. *
  50. * 4. ENTRY PARAMETERS
  51. * PARAMS1 - ADDRESS OF SM BUFFER (ICN/AP/R,ICN/TE/R)
  52. * PARAMS2 - LLCB ADDRESS
  53. *
  54. * 5. EXIT PARAMETERS
  55. * PARAMS3 - NCNB ADDRESS
  56. * PARAMS4 - NCNT ENTRY ADDRESS
  57. *
  58. * 6. COMDECKS CALLED AND SYMPL TEXTS USED
  59. * NIPDEF SUPMSG
  60. * LLCB PARAMS
  61. * NCNB ACKHEAD
  62. * NCNT NHEADER
  63. * STATTAB PT
  64. * KDIS MSGIDX
  65. *
  66. * 7. ROUTINES AND OVERLAYS CALLED
  67. * KPUT - UPDATE K-DISPLAY BUFFER
  68. * MGETS - ALLOCATE A BUFFER
  69. * OMSG - OUTPUT DAYFILE MESSAGE
  70. * XDROP - SET PIP DROP FLAG AND STOP
  71. * XTRACE - RECORD PROCEDURE CALL
  72. *
  73. * 8. DAYFILE MESSAGES AND OTHER IMPORTANT INFORMATION
  74. * "NIP INTERNAL ERROR - BLDNCNB"
  75. * THIS PROCEDURE IS CALLED BY OVERLAY STRTCON VIA NCSTTP.
  76. *
  77. *
  78.  #
  79. STOPIMS;
  80. #
  81.   EXTERNAL VARIABLES
  82. #
  83. XREF
  84. BEGIN
  85. PROC ABORT; # ABORT NAM #
  86. PROC KPUT; # UPDATE NAM STATUS DISPLAY #
  87. PROC MGETS; # ALLOCATE A BUFFER #
  88. PROC OVLCALL; # LOAD AND EXECUTE OVERLAY #
  89. PROC XTRACE; # RECORD PROCEDURE CALL #
  90. END
  91. #
  92.   INTERNAL VARIABLES
  93. #
  94.  
  95. ARRAY CNX;
  96. BEGIN
  97. ITEM NCN U(00,00,60); # NETWORK CONNECTION NUMBER #
  98. ITEM CN1 U(00,52,04); # CONNECTION INDEX #
  99. ITEM CN2 U(00,56,04); # NCNT INDEX #
  100. END
  101.  
  102.  
  103. ITEM KN U;
  104. ITEM ACKQBUF; # ACKNOWLEDGE QUEUE BUFFER ADDRESS #
  105. ITEM ACKQSIZE; # ACKNOWLEDGE QUEUE SIZE #
  106. ITEM NCNTADDR; # NCNT ADDRESS #
  107. ITEM CI; # CONNECTION INDEX #
  108. ITEM FOUND B; # CN FOUND FLAG #
  109. ITEM NCNTINDX; # INDEX INTO NCNT #
  110. ITEM LLCBINDX; # INDEX INTO LLCB #
  111. ITEM MAXNCNTCN; # MAXIMUM NO. OF CONNECTIONS FOR NCNT #
  112. ITEM NCNBADDR; # NCNB ADDRESS #
  113. ITEM PFCSFCV; # PFC/SFC FUNCTION CODE #
  114. ARRAY ERR$MSG [0:0] S(4);
  115. BEGIN # ERROR MESSAGE #
  116. ITEM MSG$TEXT C(00,00,38) =
  117. ["BLDNCNB/INVALID CONNECTION NUMBER."];
  118. ITEM MSG$END U(03,48,12) = [0];
  119. END
  120. #**********************************************************************#
  121.  
  122.  
  123.  
  124.  
  125.  
  126. BEGIN
  127. CONTROL IFEQ DEBUG,1;
  128. XTRACE("BNCNB") ;
  129. CONTROL FI;
  130.  
  131. P<SUPMSG> = PARAMS1;
  132. P<SMNIP> = PARAMS1; # BASE SM #
  133. P<SMNVF> = PARAMS1;
  134. P<LLCB> = PARAMS2; # BASE LLCB #
  135. NCN = ICNCN[0]; # NETWORK CONNECTION NUMBER #
  136. LLCBINDX = CN1 + LLCBHSIZE; # INDEX INTO LLCB #
  137. PFCSFCV = PFCSFC[0]; # PFC/SFC VALUE #
  138. PARAMS3 = 0; # INITIALIZE RESPONSE CODE #
  139.  
  140. IF NCN EQ 0
  141. THEN # NETWORK CONNECTION NUMBER IN SM IS ZERO #
  142. BEGIN # DETERMINE WHOSE AT FAULT #
  143. IF PFCSFCV EQ ICNTE
  144. OR PFCSFCV EQ ICNEX
  145. THEN # CCP ERROR, INVALID CONNECTION NUMBER #
  146. PARAMS3 = RTEA"TCE";
  147. ELSE # CR/IAP/N OR ICN/AP/R #
  148. BEGIN
  149. IF PFCSFCV EQ CRIAPN
  150. THEN # INTERNAL NIP ERROR, ABORT #
  151. ABORT(ERR$MSG,0); # INVALID CR/IAP/N #
  152. ELSE # INVALID ICN/AP/R FROM NETWORK #
  153. PARAMS3 = RAPA"SNA";
  154. END
  155. GOTO BNCNB$EXIT;
  156. END
  157.  
  158. IF LLCBNCNT[LLCBINDX] EQ 0
  159. THEN # ALLOCATE AN NCNT #
  160. BEGIN
  161. MGETS(NCNTSIZE,NCNTADDR,TRUE); # ALLOCATE NCNT BUFFER #
  162. P<NCNT> = NCNTADDR;
  163. # FILL IN NCNT HEADER INFORMATION #
  164. NCNTID[0] = NCNTIDVALUE;
  165. NCNTHN[0] = LLCBHN[0]; # HOST NODE #
  166. NCNTTN[0] = LLCBTN[0]; # TERMINAL NODE #
  167. NCNTCI[0] = CN1; # CONNECTION INDEX #
  168.  
  169. LLCBNCNT[LLCBINDX] = NCNTADDR; # SET POINTER TO NCNT #
  170. LLCBCI[LLCBINDX] = CN1; # INITIALIZE LLCB CONN INDX #
  171. END
  172. ELSE
  173. BEGIN
  174. P<NCNT> = LLCBNCNT[LLCBINDX]; # BASE NCNT #
  175. CONTROL IFEQ DEBUG,1;
  176. NCNTINDX = CN2 + NCNTHSIZE; # INDEX INTO NCNT #
  177. IF NCNTNCNB[NCNTINDX] NQ 0
  178. THEN # CONNECTION ALREADY EXISTS #
  179. ABORT(ERR$MSG,0); # NIP ERROR, ABORT #
  180. CONTROL FI;
  181. END
  182.  
  183.  
  184.  
  185. # ALLOCATE AN NCNB #
  186. MGETS(NCNBSIZE,NCNBADDR,TRUE); # ALLOCATE NCNB BUFFER #
  187. P<NCNB> = NCNBADDR; # BASE NCNB #
  188. NCNBID[0] = NCNBIDVALUE; # SET BLOCK ID #
  189. NCNBCTAD[0] = P<NCNT>; # SET NCNT POINTER #
  190. NCNBNBTE[0] = LLCBNBTE[0]; # INITIALIZE NETWORK BUFFER TAB ENTRY#
  191.  
  192.  
  193. # FILL IN INFORMATION FOR NCNB #
  194. IF PFCSFCV EQ ICNTE
  195. THEN
  196. BEGIN # ICN/TE/R #
  197. NCNBDBL[0] = ICNDBL[0]; # DOWNLINE BLOCK LIMIT #
  198. IF ICNTPRI[0]
  199. THEN
  200. NCNBPRI[0] = 1; # HIGH PRIORITY CONNECTION #
  201. ELSE
  202. NCNBPRI[0] = 2; # LOW PRIORITY CONNECTION #
  203. NCNBDT[0] = ICNDT[0]; # DEVICE TYPE #
  204. NCNBTC[0] = ICNTC[0]; # TERMINAL CLASS #
  205. NCNBPW[0] = ICNPW[0]; # PAGE WIDTH #
  206. NCNBPL[0] = ICNPL[0]; # PAGE LENGTH #
  207. END
  208. ELSE
  209. BEGIN # CR/IAP/N OR ICN/EX/R OR ICN/AP/R #
  210. IF PFCSFCV EQ CRIAPN
  211. THEN # CR/IAP/N FROM NVF, SET DOWNLINE BLOCK LIMIT #
  212. BEGIN # SET CONNECTION PRIORITY AS WELL #
  213. NCNBDBL[0] = CRADBL[0];
  214. IF CRAPRI[0]
  215. THEN # ITS A HIGH PRIORITY CONNECTION #
  216. NCNBPRI[0] = 1;
  217. ELSE # ITS A LOW PRIORITY CONNECTION #
  218. NCNBPRI[0] = 2;
  219. END
  220. IF PFCSFCV EQ ICNEX
  221. THEN # ICN/EX/R FROM NETWORK, SET X.25 INDICATOR #
  222. NCNBX25[0] = TRUE;
  223. NCNBAA[0] = TRUE; # SET A-A FLAG #
  224. IF ICNSNOD[0] EQ 0 OR ICNDNOD[0] EQ 0
  225. THEN
  226. NCNBDT[0] = DT$INTA ; # CONNECTION IN THE SAME HOST #
  227. ELSE
  228. NCNBDT[0] = DT$INTE ; # CONNECTION BETWEEN 2 HOSTS #
  229. END
  230.  
  231. IF LLCBNRL[0] EQ BUFLSM # BUFFER REGULATION LEVEL 1 #
  232. THEN
  233. BEGIN
  234. NCNBNR[0] = TRUE; # PUT NCNB IN REGULATION #
  235. END
  236. ELSE
  237. BEGIN
  238. IF LLCBNRL[0] EQ BUFLHDS # BUFFER REGULATION LEVEL 2 #
  239. THEN
  240. BEGIN
  241. IF NCNBPRI[0] EQ 2 # LOW PRIORITY DATA #
  242. THEN
  243. BEGIN
  244. NCNBNR[0] = TRUE; # PUT NCNB IN REGULATION #
  245. END
  246. END
  247. END
  248. IF NCNBDBL[0] NQ 0
  249. THEN # DOWNLINE BLOCK LIMIT SET, BUILD ACKNOWLEDGE QUEUE #
  250. BEGIN
  251. ACKQSIZE = NCNBDBL[0]+ACKHSIZE; # ACK QUEUE SIZE #
  252. MGETS(ACKQSIZE,ACKQBUF,TRUE); # ALLOCATE ACK QUEUE BUFFER #
  253. P<ACKHEAD> = ACKQBUF; # FWA OF ACK QUEUE #
  254. ACKQID[0] = ACKQIDVALUE; # SET BLOCK ID #
  255. ACKNCNB[0] = NCNBADDR; # SET CORR NCNB ADDRESS #
  256. NCNBAKIN[0] = 0; # SET IN PTR #
  257. NCNBAKOU[0] = 0; # SET OUT PTR #
  258. NCNBACKQ[0] = ACKQBUF; # SET ACK QUEUE ADDRESS #
  259. CONTROL IFEQ STAT,1;
  260. ST$AQ = ST$AQ+1; # INCREMENT ACKNOWLEDGE QUEUE COUNT #
  261. CONTROL FI;
  262. END
  263.  
  264. NCNBHN[0] = LLCBHN[0]; # HOST NODE #
  265. NCNBTN[0] = LLCBTN[0]; # TERMINAL NODE #
  266. NCNBCN[0] = NCN; # NETWORK CONNECTION NUMBER #
  267. NCNBCST[0] = STATX; # SET INITIAL STATE FOR CONNECTION TABLE #
  268. NCNBBST[0] = STATX; # AND FOR BLOCK STATE TABLE PROCCESORS #
  269.  
  270.  
  271.  
  272. # FILL IN NCNT INFORMATION #
  273. NCNTINDX = CN2 + NCNTHSIZE; # NCNT INDEX #
  274. NCNTNCN[0] = NCNTNCN[0] + 1; # INCREMENT NO. ACTIVE CONN #
  275. CONCOUNT = CONCOUNT + 1;
  276. IF CONCOUNT GR MAXSWIT
  277. THEN
  278. BEGIN
  279. TBUF = 60000;
  280. NFSIZE = 2560;
  281. END
  282. NCNTNCNB[NCNTINDX] = NCNBADDR; # NETWORK CONN BLOCK ADDR #
  283. NCNTBHS[NCNTINDX] = 1; # SET BLOCK HANDLER STATE #
  284. NCNTNIB[NCNTINDX] = 1 ; # BSN OF NEXT INPUT BLOCK #
  285.  
  286. LLCBNC[0] = LLCBNC[0] + 1; # INCREMENT NO. OF CONN ON LOG LINK #
  287. IF KDIS$RT # REAL TIME UPDATE MODE IN EFFECT #
  288. AND NCNBDT[0] NQ DT$INTA # NOT INTRA-HOST A-A CONNECTION #
  289. AND LLCBKNDX[0] NQ 0 # LLCB ENTRY EXISTS IN STATUS DISPLAY #
  290. AND LLCBKNDX[0] GQ KDLGLST[0]
  291. AND LLCBKNDX[0] LQ KDLGLND[0]
  292. THEN
  293. BEGIN
  294. IF KDESTST[0] EQ 0 THEN
  295. KN=LLCBKNDX[0]-KDLGLST[0];
  296. ELSE
  297. IF KDAPPST[0] EQ 0 THEN
  298. KN=LLCBKNDX[0]+KDESTND[0]-KDESTST[0];
  299. ELSE
  300. KN=LLCBKNDX[0]+KDESTND[0]+KDAPPND[0]-KDAPPST[0];
  301. KPUT(KHDRNP[0],KN,KPLGNCN,LLCBNC[0]) ;
  302. END
  303.  
  304. PARAMS1 = NCNBADDR; # NCNB ADDRESS #
  305. PARAMS2 = P<NCNT>+NCNTINDX; # NCNT ENTRY ADDRESS #
  306.  
  307. BNCNB$EXIT:
  308. RETURN ;
  309. END
  310. TERM
cdc/nos2.source/nam5871/bldncnb.txt ยท Last modified: 2023/08/05 17:21 by Site Administrator