User Tools

Site Tools


cdc:nos2.source:nam5871:ndltrnk

NDLTRNK

Table Of Contents

  • [00007] PROC NDLTRNK
  • [00011] TRUNK PROCESSOR
  • [00048] PROC ABORT
  • [00049] PROC NDLCKPT
  • [00050] PROC NDLCKRG
  • [00051] PROC NDLEM2
  • [00052] FUNC XCDD C(10)
  • [00053] PROC MESSAGE

Source Code

NDLTRNK.txt
  1. *DECK NDLTRNK
  2. USETEXT NDLDATT
  3. USETEXT NDLER2T
  4. USETEXT NDLNCFT
  5. USETEXT NDLPS2T
  6. USETEXT NDLTBLT
  7. PROC NDLTRNK; # PROCESS TRUNK STATEMENT #
  8. BEGIN
  9. *IF,DEF,IMS
  10. #
  11. ** NDLTRNK - TRUNK PROCESSOR
  12. *
  13. * S.M. ILMBERGER 81/11/2
  14. *
  15. * PROCESS TRUNK STATEMENT
  16. *
  17. * PROC NDLTRNK
  18. *
  19. * ENTRY NONE
  20. *
  21. * EXIT NONE
  22. *
  23. * MESSAGE
  24. * INVALID KEYWORD I.D.-ABORT FROM NDLTRNK
  25. *
  26. * METHOD
  27. *
  28. * IF NO LABEL ERROR
  29. * SAVE NAME IN PLINK$XREF TABLE
  30. * FOR EACH PARAMETER ON LOGLINK LINE
  31. * IF NO VALUE ERROR
  32. * PROCESS AND STORE INFO IN APPROPRIATE PLINK$XREF ITEM
  33. * IF P1,P2,N1 OR N2 PARAMETER NOT SPECIFIED
  34. * FLAG ERROR - REQUIRED PARAMETER MISSING
  35. * CK FOR DUPLICATE TRUNK DEFINITIONS
  36. * IF DUPLICATE DEFINITION
  37. * FLAG ERROR
  38. * CALL NDLCKPT TO CHECK UNIQUENESS OF PORT NUMBERS
  39. * END
  40. *
  41. #
  42. *ENDIF
  43. #
  44. **** PROC NDLTRNK - XREF LIST BEGINS.
  45. #
  46. XREF
  47. BEGIN
  48. PROC ABORT; # ABORTS NDLP #
  49. PROC NDLCKPT; # CHECK UNIQUENESS OF PORT NUMBER #
  50. PROC NDLCKRG; # CHECK RANGE OF VALUE #
  51. PROC NDLEM2; # MAKE ENTRY IN PASS 2 ERROR FILE #
  52. FUNC XCDD C(10); #CONVERTS INTEGER TO DISPLAY CODE #
  53. PROC MESSAGE; # PRINT DAYFIL AND SYSTEM CONSOLE MESSAGE #
  54. END
  55. #
  56. ****
  57. #
  58. DEF FSTNT # 1 #; # FIRST ENTRY IN NPU TABLE #
  59. DEF FRAME0 # 0 #; # CODE FOR FRAME SIZE 256 #
  60. DEF FRAME1 # 1 #; # CODE FOR FRAME SIZE 500 #
  61. DEF FRAME2 # 2 #; # CODE FOR FRAME SIZE 1050 #
  62. DEF FR$499 # 499 #; # FRAME SIZE 499 #
  63. DEF FR$1049 # 1049 #; # FRAME SIZE 1049 #
  64. DEF MIN$FRAM # 0 # ; # MINIMUM FRAME SIZE #
  65. DEF MAX$FRAM # 1200 #; # MAXIMUM FRAME SIZE #
  66. DEF DEF$FRAME # 2 # ; # DEFAULT FRAME CODE #
  67.  
  68. DEF N1$PAR # "N1" #; # FOR ERROR MESSAGE #
  69. DEF N2$PAR # "N2" #; # FOR ERROR MESSAGE #
  70. DEF P1$PAR # "P1" #; # FOR ERROR MESSAGE #
  71. DEF P2$PAR # "P2" #; # FOR ERROR MESSAGE #
  72. DEF TRN$PAR # "TRUNK" #; # FOR ERROR MESSAGE #
  73.  
  74. ITEM DUPTRNK B; # DUPLICATE TRUNK FLAG #
  75. ITEM ENT$NUM; # ENTRY NUMBER OF NPU-TABLE #
  76. ITEM I; # LOOP COUNTER #
  77. ITEM J; # LOOP COUNTER #
  78. ITEM KWD$MAP; # KEYWORD EXISTS MAP #
  79. ITEM NOD;
  80. ITEM OK$STAT B;
  81. ITEM PORT$ST B;
  82. ITEM PRT;
  83. ITEM CHARVAL C(10); # TEMPORARY FOR CHAR VALUE #
  84.  
  85. SWITCH TRNK$PAR ERR$TR, # UNK #
  86. ERR$TR, # NODE #
  87. ERR$TR, # VARIANT #
  88. ERR$TR, # OPGO #
  89. ERR$TR, # #
  90. ERR$TR, # LLNAME #
  91. ERR$TR, # #
  92. ERR$TR, # #
  93. ERR$TR, # #
  94. ERR$TR, # #
  95. ERR$TR, # HNAME #
  96. ERR$TR, # LOC #
  97. ERR$TR, # #
  98. ERR$TR, # #
  99. ERR$TR, # #
  100. ERR$TR, # #
  101. ERR$TR, # #
  102. ERR$TR, # #
  103. ERR$TR, # NCNAME #
  104. DI$ID1, # DI #
  105. N1$ID$, # N1 #
  106. P1$ID, # P1 #
  107. N2$ID, # N2 #
  108. P2$ID, # P2 #
  109. NOLO1$ID, # NOLOAD1 #
  110. NOLO2$ID, # NOLOAD2 #
  111. ERR$TR, # #
  112. ERR$TR, # 27 #
  113. ERR$TR, # 28 #
  114. ERR$TR, # 29 #
  115. ERR$TR, # 30 #
  116. ERR$TR, # 31 #
  117. ERR$TR, # 32 #
  118. ERR$TR, # 33 #
  119. ERR$TR, # 34 #
  120. ERR$TR, # 35 #
  121. ERR$TR, # 36 #
  122. ERR$TR, # 37 #
  123. FRAME$ID ;# 38 #
  124.  
  125. CONTROL EJECT;
  126. # #
  127. # NDLTRNK CODE BEGINS HERE #
  128. # #
  129.  
  130. KWD$MAP = 0; # CLEAR KEYWORD EXISTS BIT MAP #
  131. PLWC[0] = PLWC[0] + 1;
  132. IF NOT STLBERR[1]
  133. THEN # NO LABEL ERROR #
  134. PLNAME[PLWC[0]] = STLABEL[1]; # SET NAME IN PHYSICAL-LINK-XREF #
  135. PLTYPE[PLWC[0]] = 1;
  136. FOR I=FSTKID2 STEP 1 UNTIL STWC[0] #PROCESS EACH ENT OF STMT TAB #
  137. DO
  138. BEGIN
  139. B<STKWID[I],1>KWD$MAP = 1; # SET BIT FOR KEYWORD #
  140. IF NOT STVLERR[I]
  141. THEN # NO VALUE ERROR #
  142. BEGIN
  143. IF STKWID[I] LS KID"NODE"
  144. OR STKWID[I] GR KID"FRAME"
  145. THEN
  146. GOTO ERR$TR;
  147. ELSE
  148. GOTO TRNK$PAR[STKWID[I]];
  149.  
  150. N1$ID$:
  151. N2$ID: # NEXT PARAMETER IS N1 OR N2 #
  152. ENT$NUM = 0;
  153. FOR J=FSTNT STEP NTENTSZ WHILE J LQ NTWC[0] AND ENT$NUM EQ 0
  154. DO # SEE ID NAME DEFINES IN NPU-TABLE #
  155. BEGIN
  156. IF NTNAME[J] EQ STVALNAM[I]
  157. THEN
  158. BEGIN
  159. ENT$NUM = J;
  160. END
  161. END
  162. IF ENT$NUM NQ 0
  163. THEN # NAME IS IN NPU-TABLE #
  164. BEGIN # SET NODE NUMBER IN PHYSICAL-LINK-XREF #
  165. IF STKWID[I] EQ KID"N1"
  166. THEN
  167. BEGIN
  168. PLNID1[PLWC[0]] = NTNID[ENT$NUM];
  169. END
  170. ELSE
  171. BEGIN
  172. PLNID2[PLWC[0]] = NTNID[ENT$NUM];
  173. END
  174. END
  175. ELSE
  176. BEGIN
  177. IF STKWID[I] EQ KID"N1"
  178. THEN # FLAG ERROR-PARAMETER NAME IS NOT AN NPU #
  179. NDLEM2(ERR119,STLNUM[0],N1$PAR);
  180. ELSE
  181. NDLEM2(ERR119,STLNUM[0],N2$PAR);
  182. END
  183. TEST I;
  184.  
  185. P1$ID: # NEXT PARAMETER IS P1 #
  186. NDLCKRG(KID"P1",STVALNUM[I],OK$STAT);
  187. IF OK$STAT
  188. THEN # STORE PORT NUMBER IN PHYSICAL-LINK-XREF #
  189. PLP1[PLWC[0]] = STVALNUM[I]; # TABLE #
  190. TEST I;
  191.  
  192. P2$ID: # NEXT PARAMETER IS P2 #
  193. NDLCKRG(KID"P2",STVALNUM[I],OK$STAT);
  194. IF OK$STAT
  195. THEN # STORE PORT NUMBRE IN PHYSICAL-LINK-XREF #
  196. PLP2[PLWC[0]] = STVALNUM[I]; # TABLE #
  197. TEST I;
  198.  
  199. DI$ID1: # NEXT PARAMETER IS DI #
  200. IF STVALNAM[I] EQ "YES"
  201. THEN # SET STATUS ELEMENT #
  202. PLST[PLWC[0]] = TRUE;
  203. TEST I;
  204.  
  205. NOLO1$ID: # NEXT PARAMETER = NOLOAD1 #
  206. IF STVALNAM[I] EQ "YES"
  207. THEN # SET NOLOAD1 FLAG #
  208. PLNLD1[PLWC[0]] = TRUE;
  209. TEST I;
  210.  
  211. NOLO2$ID: # NEXT PARAMETER = NOLOAD2 #
  212. IF STVALNAM[I] EQ "YES"
  213. THEN # SET NOLOAD2 FLAG #
  214. PLNLD2[PLWC[0]] = TRUE;
  215. TEST I;
  216.  
  217.  
  218. FRAME$ID:
  219. OK$STAT = TRUE;
  220. IF (STVALNUM[I] LS MIN$FRAM) OR
  221. (STVALNUM[I] GR MAX$FRAM) # CHECK RANGE #
  222. THEN
  223. BEGIN
  224. OK$STAT = FALSE ; # OUT OF RANGE#
  225. CHARVAL = XCDD(STVALNUM[I]);
  226. NDLEM2(ERR100,STLNUM[0],CHARVAL); # GENERATE ERROR MESSAGE#
  227. END
  228. IF OK$STAT # IF NO OUT OF RANGE #
  229. THEN
  230. BEGIN
  231. IF STVALNUM[I] LQ FR$499 # LESS THAN 499 #
  232. THEN
  233. BEGIN
  234. PLFRAME[PLWC[0]] = FRAME0; #ASSIGN FRAME CODE 0#
  235. END
  236. ELSE
  237. BEGIN
  238. IF STVALNUM[I] LQ FR$1049
  239. THEN
  240. BEGIN
  241. PLFRAME[PLWC[0]] = FRAME1; # ASSIGN FRAME CODE 1#
  242. END
  243. ELSE
  244. BEGIN
  245. PLFRAME[PLWC[0]] = FRAME2; #ASSIGN FRAME CODE 2#
  246. END
  247. END
  248. END
  249. TEST I;
  250.  
  251.  
  252. ERR$TR:
  253. EPRC2[0] = "NDLTRNK";
  254. MESSAGE(ABRTMSG2,0);
  255. ABORT;
  256. TEST I;
  257.  
  258. END
  259. END # I LOOP #
  260.  
  261. IF B<KID"FRAME",1>KWD$MAP NQ 1 # DEFAULT FRAME IS USED#
  262. THEN
  263. PLFRAME[PLWC[0]] = DEF$FRAME; # DEFAULT FRAME 2#
  264. IF B<KID"P1",1>KWD$MAP NQ 1
  265. THEN # P1 PARAMETER NOT SPECIFIED #
  266. NDLEM2(ERR103,STLNUM[0],P1$PAR);
  267. IF B<KID"P2",1>KWD$MAP NQ 1
  268. THEN # P2 PARAMETER NOT SPECIFIED #
  269. NDLEM2(ERR103,STLNUM[0],P2$PAR);
  270. IF B<KID"N1",1>KWD$MAP NQ 1
  271. THEN # N1 PARAMETER NOT SPECIFIED #
  272. NDLEM2(ERR103,STLNUM[0],N1$PAR);
  273. IF B<KID"N2",1>KWD$MAP NQ 1
  274. THEN # N2 PARAMETER NOT SPECIFIED #
  275. NDLEM2(ERR103,STLNUM[0],N2$PAR);
  276. IF PLNID1[PLWC[0]] NQ 0 AND
  277. PLNID2[PLWC[0]] NQ 0
  278. THEN # IF N1 AND N2 WERE O.K. #
  279. BEGIN
  280. DUPTRNK = FALSE; # CLEAR DUPLICATE TRUNK FLAG #
  281. FOR I=1 STEP 1 WHILE I LS PLWC[0] AND NOT DUPTRNK
  282. DO
  283. BEGIN
  284. IF (PLNID1[I] EQ PLNID1[PLWC[0]] AND
  285. PLNID2[I] EQ PLNID2[PLWC[0]]) OR
  286. (PLNID1[I] EQ PLNID2[PLWC[0]] AND
  287. PLNID2[I] EQ PLNID1[PLWC[0]])
  288. THEN
  289. BEGIN # IF TRUNK WAS ALREADY SPECIFIED #
  290. DUPTRNK = TRUE; # SET DUPLICATE TRUNK FLAG #
  291. END
  292. END
  293. IF DUPTRNK # IF DUPLICATE TRUNK WAS DISCOVERED #
  294. THEN
  295. BEGIN # FLAG ERROR -- DUPLICATE TRUNK FOUND #
  296. NDLEM2(ERR130,STLNUM[0],STLABEL[1]);
  297. END
  298. END
  299. IF PLNID1[PLWC[0]] EQ PLNID2[PLWC[0]]
  300. THEN # IF BOTH ENDS HAVE SAME NODE I.D. #
  301. BEGIN # FLAG ERROR -- TRNK CONNECTED TO SAME NPU#
  302. NDLEM2(ERR151,STLNUM[0]," ");
  303. END
  304.  
  305. PRT = PLP1[PLWC[0]]; # CHECK PORT NUMBERS FOR UNIQUENESS #
  306. NOD = PLNID1[PLWC[0]];
  307. NDLCKPT(PRT,NOD,PORT$ST);
  308. PRT = PLP2[PLWC[0]];
  309. NOD = PLNID2[PLWC[0]];
  310. NDLCKPT(PRT,NOD,PORT$ST);
  311. RETURN;
  312.  
  313. END # NDLTRNK PROC #
  314. TERM
cdc/nos2.source/nam5871/ndltrnk.txt ยท Last modified: 2023/08/05 17:22 by Site Administrator