User Tools

Site Tools


cdc:nos2.source:nam5871:nvfaiap

NVFAIAP

Table Of Contents

  • [00009] PROC NVFAIAP
  • [00010] NVFAIAP - A-A ACTION CR/IAP/R SMS (OUTCALL REQUESTS)
  • [00014] A-A ACTION CR/IAP/R SMS (OUTCALL REQUESTS).
  • [00097] PROC SSTRQE
  • [00098] PROC MESSAGE
  • [00099] PROC ABORT
  • [00100] PROC NVFAIAM
  • [00101] PROC NVFAFAI
  • [00102] PROC SSTAQE
  • [00103] PROC SSBEBF
  • [00104] PROC SSBSBF
  • [00105] PROC SSTATS
  • [00106] PROC SSTRTS
  • [00107] FUNC SSDCDA
  • [00108] PROC NVFCFCE
  • [00109] PROC NVFSCAD
  • [00110] PROC NVFUMQE
  • [00111] PROC NVFUFVO
  • [00112] PROC NVFUAFV
  • [00113] PROC NVFACTC
  • [00138] ACTSTAT - ACTION STATUS LIST.
  • [00163] ACTSWT - ACTION SWITCH.
  • [00273] ACENT - ACTIVE PID ENTRY TEMPLATE.
  • [00386] LPIDCELL - LID PID CELL FOR PARAMETER HOLDING.
  • [00398] TBLMSG - MISSING TABLE MESSAGE.

Source Code

NVFAIAP.txt
  1. *DECK NVFAIAP
  2. USETEXT TXOUTAA
  3. USETEXT TXTAPSS
  4. USETEXT TEXTSS
  5. USETEXT TEXTNVF
  6. USETEXT TXTANVF
  7. USETEXT TXSMNVF
  8. USETEXT TXTSUSS
  9. PROC NVFAIAP;
  10. # TITLE NVFAIAP - A-A ACTION CR/IAP/R SMS (OUTCALL REQUESTS) #
  11. BEGIN
  12.  
  13. #
  14. ** NVFAIAP - A-A ACTION CR/IAP/R SMS (OUTCALL REQUESTS).
  15. *
  16. * C. BRION 82/09/18. 83/05/06. 83/07/18. 83/08/02.
  17. * 83/11/16. 83/12/12.
  18. * P. MURRAY 84/02/28.
  19. *
  20. * THIS PROCEDURE PROCESSES THE CR/IAP/R AND FAI/APP/N SMS FROM THE
  21. * OUTCALL QUEUE (OUTSMQ) AND THE COMPLETED LID/PID FUNCTION
  22. * REQUESTS FROM THE LPIDFXQ.
  23. * THE MAIN FUNCTION OF THIS PROCEDURE IS TO VALIDATE AND
  24. * LIMIT CHECK THE CALLING APPLICATION'S OUTCALL REQUEST TO EITHER
  25. * ANOTHER HOST'S APPLICATION OR AN APPLICATION IN THE SAME HOST.
  26. *
  27. * PROC NVFAIAP
  28. *
  29. * ENTRY:
  30. * OUTSMQ - AT LEAST 1 CR/IAP/R OR FAI/APP/N SM RESIDES IN OUTSMQ.
  31. * LPIDFXQ - A COMPLETED LID/PID FUNCTION REQUEST RESIDES IN Q.
  32. *
  33. * EXIT:
  34. * ALL ENTRIES IN THE LPIDFXQ ARE PROCESSED.
  35. * ALL ENTRIES IN THE OUTSMQ ARE PROCESSED.
  36. * A CR/IAP/N OR CR/IAP/A SM IS SENT TO NIP.
  37. *
  38. * NOTES:
  39. * THE CR/IAP/R SM MAY BE REPEATED FOR THE SAME OUTCALL REQUEST.
  40. * A REPEAT WILL INDICATE THAT A PREVIOUSLY ATTEMPTED OUTCALL VIA
  41. * A CR/IAP/N SM WAS NOT SUCCESSFUL.
  42. *
  43. * THERE MAY OR MAY NOT BE OUTCALL BLOCKS DEFINED. IF NO OUTCALL
  44. * BLOCKS ARE DEFINED IN THE LCF OR IN THE CR/IAP/R SM, THEN A
  45. * SINGLE HOST TREATMENT OF THE OUTCALL REQUEST IS PERFORMED ONLY
  46. * IF THE INCOMING CR/IAP/R SM CONTAINS A ZERO VALUE REMOTE HOST ID
  47. * FIELD.
  48. *
  49. * IF A FAI/APP/N SM IS FOUND IN THE OUTCALL QUEUE, *NVFAFAI* WILL
  50. * BE CALLED TO DELETE THE APPROPRIATE PAAC ENTRIES.
  51. *
  52. * METHOD:
  53. *
  54. * NVFAIAP IS STRUCTURED SUCH THAT THERE IS A FINITE SET OF ACTIONS
  55. * THAT MAY BE PERFORMED. THESE ACTIONS ARE FUNCTIONALLY GROUPED.
  56. * THE EXEC FUNCTION SIMPLY PERFORMS A SWITCH TO THE NEXT DESIRED
  57. * ACTION FUNCTION.
  58. * EACH ACTION FUNCTION THEN SETS THE APPROPRIATE NEXT ACTION TO BE
  59. * SWITCHED TO BY THE EXEC FUNCTION.
  60. *
  61. * THE FOLLOWING ACTION GROUPS ARE DEFINED:
  62. *
  63. * EXEC EXECUTIVE SWITCHER FUNCTION.
  64. * ACLPID ACTION LID/PID FUNCTION REQUESTS.
  65. * GETSM GET CR/IAP/R OR FAI/APP/N SM.
  66. * INITIAP PROCESS INITIAL CR/IAP/R SM.
  67. * CHLPID CHECK LID/PID REQUIREMENTS.
  68. * SECIAP PROCESS SECONDARY CR/IAP/R SM.
  69. * CHCLGAP LIMIT CHECK CALLING APPLICATION.
  70. * SETNAM2 SET NAME 2 FOR OUTCALL SEARCH.
  71. * FINDPATH FIND PATH IN LLPID TABLE.
  72. * FINDOUT FIND OUTCALL BLOCK.
  73. * CHSHOST CHECK SINGLE HOST REQUIREMENTS.
  74. * SENDIAPN SET UP CR/IAP/N SM AND SEND.
  75. * MOVEDTE MOVE DTE INFORMATION INTO CR/IAP/N SM.
  76. * MOVEFAC MOVE FACILITY INFORMATION INTO CR/IAP/N SM.
  77. * MOVECUD MOVE CALL USER DATA INTO CR/IAP/N SM.
  78. * SENDSWH SET UP AND SEND CR/SWH/R SM.
  79. * ERRCHEK PERFORM ERROR PROCESSING.
  80. * END END OF TASKS, EXIT.
  81. *
  82. * ALL ACTION FUNCTION GROUPS MUST SET THE NEXT ACTION (NXTACT)
  83. * PRIOR TO RETURN TO THE EXEC FUNCTION.
  84. *
  85. * VARIOUS ACTION FUNCTION GROUPS WILL SET THE RETURN ERROR ACTION
  86. * (ERRACT) SO AS TO CAUSE THE ERRCHEK FUNCTION TO SET THE NEXT
  87. * ACTION TO A REQUESTED RETURN ACTION GROUP.
  88. *
  89. #
  90.  
  91. #
  92. **** PROC NVFAIAP XREF LIST
  93. #
  94.  
  95. XREF
  96. BEGIN
  97. PROC SSTRQE; # SS-REMOVE QUEUE ENTRY #
  98. PROC MESSAGE;
  99. PROC ABORT;
  100. PROC NVFAIAM; # ISSUE ACCOUNT MSG #
  101. PROC NVFAFAI; # PROCESS FAI/APP/N SM #
  102. PROC SSTAQE; # SS-ACCEPT QUEUE ENTRY #
  103. PROC SSBEBF; # SS-EXTRACT BIT FIELD #
  104. PROC SSBSBF; # SS-STORE BIT FIELD #
  105. PROC SSTATS; # SS-ALLOCATE TABLE SPACE #
  106. PROC SSTRTS; # SS-RELEASE TABLE SPACE #
  107. FUNC SSDCDA; # SS-DISPLAY TO ASCII #
  108. PROC NVFCFCE; # FIND CONNECTION ENTRY #
  109. PROC NVFSCAD; # COMPLETE APPL DEPARTURE #
  110. PROC NVFUMQE; # MAKE QUEUE ENTRY #
  111. PROC NVFUFVO; # RELEASE VCB ORDINAL #
  112. PROC NVFUAFV; # ASSIGN VCB ORDINAL #
  113. PROC NVFACTC; # CLEANUP TERM CONNECTION #
  114. END
  115.  
  116. #
  117. ****
  118. #
  119.  
  120. #
  121. * PROC NVFAIAP DEFINITIONS.
  122. #
  123.  
  124.  
  125. # REASON CODE VALUES FOR CR/IAP/A SMS. #
  126.  
  127. DEF OK$ # 99 #; # NULL REASON CODE #
  128. DEF SEESM$ #127#; # REASON CODE IN PAAC #
  129. DEF PRIDWORD$ # 6 #; # WORD ORDINAL OF PRID #
  130. DEF SHUDL$ # 24 #; # SINGLE HOST USER DATA LEN #
  131. DEF PRIDBORD$ # 0 #; # BIT ORDINAL OF PRID #
  132. DEF APWORD$ # 7 #; # WORD ORDINAL OF AP NAME #
  133. DEF APBORD$ # 12 #; # BIT ORDINAL OF AP NAME #
  134. DEF BLK$LMT # 7 #; # ABL AND DBL LIMIT #
  135. DEF UBLK$LMT # 31 #; # UBL LIMIT #
  136.  
  137. #
  138. ** ACTSTAT - ACTION STATUS LIST.
  139. *
  140. * THIS SWITCH IS USED TO SELECT THE APPROPRIATE ACTION TO PERFORM.
  141. #
  142. STATUS ACTSTAT
  143. SEXEC, # EXEC FUNCTION #
  144. SACLPID, # ACTION LID/PID FUNCTION REQUEST #
  145. SGETSM, # GET CR/IAP/R SM FROM OUTSMQ #
  146. SINITIAP, # PROCESS INITIAL CR/IAP/R SM #
  147. SCHLPID, # CHECK LID/PID REQUIREMENTS #
  148. SSECIAP, # PROCESS SECONDARY CR/IAP/R SM #
  149. SCHCLGAP, # CHECK CALLING APPLICATION #
  150. SSETNAM2, # SET UP NAME2 #
  151. SFINDPATH, # FIND PATH IN LLPID TABLE #
  152. SFINDOUT, # FIND OUTCALL BLOCK #
  153. SCHSHOST, # CHECK FOR SINGLE HOST QUALIFICATION #
  154. SSENDIAPN, # SET UP AND SEND CR/IAP/N SM #
  155. SMOVEDTE, # MOVE DTE ADDRESSES INTO CR/IAP/N SM #
  156. SMOVEFAC, # MOVE FACILITY CODES INTO CR/IAP/R SM #
  157. SMOVECUD, # MOVE CALL USER DATA INTO CR/IAP/N SM #
  158. SSENDSWH, # SET UP AND SEND CR/SWH/R SM #
  159. SERRCHEK, # PERFORM ERROR PROCESSING #
  160. SEXIT; # EXIT NVFAIAP #
  161.  
  162. #
  163. ** ACTSWT - ACTION SWITCH.
  164. *
  165. * THIS SWITCH SELECTS WHICH FUNCTION GROUP IS TO BE CALLED IN
  166. * ORDER TO PERFORM THE NEXT ACTION.
  167. #
  168. SWITCH ACTSWT:ACTSTAT
  169. EXEC:SEXEC, # EXEC FUNCTION #
  170. ACLPID:SACLPID, # ACTION LID/PID FUNCTION REQUEST #
  171. GETSM:SGETSM, # GET CR/IAP/R SM FROM OUTSMQ #
  172. INITIAP:SINITIAP, # PROCESS INITIAL CR/IAP/R SM #
  173. CHLPID:SCHLPID, # CHECK LID/PID REQUIREMENTS #
  174. SECIAP:SSECIAP, # PROCESS SECONDARY CR/IAP/R SM #
  175. CHCLGAP:SCHCLGAP, # CHECK CALLING APPLICATION #
  176. SETNAM2:SSETNAM2, # SET UP NAME2 #
  177. FINDPATH:SFINDPATH, # FIND PATH IN LLPID TABLE #
  178. FINDOUT:SFINDOUT, # FIND OUTCALL BLOCK #
  179. CHSHOST:SCHSHOST, # CHECK FOR SINGLE HOST QUALIFICATION #
  180. SENDIAPN:SSENDIAPN, # SET UP AND SEND CR/IAP/N SM #
  181. MOVEDTE:SMOVEDTE, # MOVE DTE ADDRESSES INTO CR/IAP/N SM #
  182. MOVEFAC:SMOVEFAC, # MOVE FACILITY CODES INTO CR/IAP/R SM #
  183. MOVECUD:SMOVECUD, # MOVE CALL USER DATA INTO CR/IAP/N SM #
  184. SENDSWH:SSENDSWH, # SET UP AND SEND CR/SWH/R SM #
  185. ERRCHEK:SERRCHEK, # PERFORM ERROR PROCESSING #
  186. EXIT:SEXIT; # EXIT NVFAIAP #
  187.  
  188. #
  189. * PROC NVFAIAP ITEM LIST
  190. #
  191. ITEM OLDACT S:ACTSTAT; # OLD ACTION #
  192. ITEM CURACT S:ACTSTAT; # CURRENT ACTION #
  193. ITEM NXTACT S:ACTSTAT; # NEXT ACTION #
  194. ITEM ERRACT S:ACTSTAT; # ERROR RETURN ACTION #
  195. ITEM RETACT S:ACTSTAT; # RETURN CALLER ACTION #
  196. ITEM CONTACT S:ACTSTAT; # CONTROLLING ACTION #
  197. ITEM FOUND B; # LOCAL ENTRY FOUND FLAG #
  198. ITEM APO I; # APOUTCL INDEX VARIABLE #
  199. ITEM AX I; # ACPID INDEX VARIABLE #
  200. ITEM I,J,K,L I; # LOOP VARIABLES #
  201. ITEM LPORD I; # ACPID ENTRY ORDINAL #
  202. ITEM LPVCB I; # A-A CONNECTION VCB #
  203. ITEM WORKB B; # TMP BOOLEAN #
  204. ITEM XJ,XZ,AZ I; # LOOP VARIABLES #
  205. ITEM APODEF B; # APOUTCL ENTRY EXISTS FLAG #
  206. ITEM APOENTSZ I; # SIZE OF APOUTCL ENTRY #
  207. ITEM PATHFOUND B; # LLPID PATH FOUND FLAG #
  208. ITEM PIDSLEFT B; # PID REMAINING FLAG #
  209. ITEM NOOUTBLK B; # NO OUTCALL MATCH FLAG #
  210. ITEM VCB I; # LOCAL VCB ORDINAL #
  211. ITEM ERRFLG B; # ERROR FLAG #
  212. ITEM ERRCODE I; # LOCAL IAP ABNORMAL ERROR #
  213. ITEM ERRCODE2 I; # SECONDARY ERROR CODE #
  214. ITEM PAC I; # LOCAL PAAC ORDINAL #
  215. ITEM NACN I; # ACN OF CR/IAP/R SM #
  216. ITEM NUMENT I; # NUMBER OF PAAC ENTRIES #
  217. ITEM PACDEF B; # PAAC ENTRY EXISTS FLAG #
  218. ITEM ASTNUM I; # NUMBER AST ENTRIES #
  219. ITEM AORD I; # CALLING APPL AST ORDINAL #
  220. ITEM PORD I; # PRIMARY APPL AST ORDINAL #
  221. ITEM ZCHAR I; # LOCAL CHARACTER TEMP CELL #
  222. ITEM STORD,STBIT I; # LOCAL STORE VARIABLES #
  223. ITEM EXORD,EXBIT I; # LOCAL EXTRACT VARIABLES #
  224. ITEM AORD2 I; # CALLED APPL AST ORDINAL #
  225. ITEM DTEBITS I; # DTE NUMBER OF BITS #
  226. ITEM FACLORD I; # FACILITY LENGTH LOCATION #
  227. ITEM FACLBIT I; # FACILITY LENGTH BIT LOC #
  228. ITEM FACBITS I; # FACILITY PAIRS BIT LENGTH #
  229. ITEM NUMBITS I; # SM BIT LENGTH #
  230. ITEM UDATBITS I; # USER DATA BIT LENGTH #
  231. ITEM LENIAPN I; # IAP/N SM LENGTH #
  232. ITEM VCBDEF B; # VCB ASSIGNED FLAG #
  233. ITEM TEMP I; # LOCAL TRANSLATION CELL #
  234. ITEM MTYP I; # ACCOUNT MSG TYPE #
  235. ITEM CUDL I; # LOCAL CALL USER DATA LEN #
  236. ITEM ACNN I; # TEMPORARY CONNECTION NUMBER #
  237. ITEM AE I; # INDEX TO ACN TABLE #
  238. ITEM NEWACN B; # TRUE IF ACN DOES NOT EXIST #
  239.  
  240. #
  241. * OUTCALL - OUTCALL BLOCK FIXED (BASE) PORTION.
  242. *
  243. * DEFINITION OF THE FIXED PORTION OF EACH OUTCALL BLOCK CONTAINED IN
  244. * THE OUTCALL RECORD.
  245. #
  246.  
  247. BASED ARRAY OUTCALL [00:00] S(7);
  248. BEGIN
  249. ITEM OUT$WRD2 U(02,00,60); # WORD 2 REF #
  250. ITEM OUT$WRD3 U(03,00,60);
  251. ITEM OUT$WRD4 U(04,00,60);
  252. ITEM OUT$WC U(00,52,08); # BLOCK WORD COUNT #
  253. ITEM OUT$NM1 C(01,00,07); # NAME 1 (CALLED APPL NAME) #
  254. ITEM OUT$NM2 C(01,42,03); # NAME 2 (CALLED RHID ) #
  255. ITEM OUT$PRI B(02,00,01); # PRIORITY FLAG #
  256. ITEM OUT$DBL U(02,04,08); # DOWNLINE BLOCK LIMIT #
  257. ITEM OUT$DBZ U(02,12,12); # DOWNLINW BLOCK SIZE #
  258. ITEM OUT$ABL U(02,24,08); # APPL BLOCK LIMIT #
  259. ITEM OUT$UBL U(02,36,08); # UPLINE BLOCK LIMIT #
  260. ITEM OUT$UBZ U(02,44,08); # UPLINE BLOCK SIZE #
  261. ITEM OUT$PORT U(02,52,08); # NPU CALL ACCESS PORT #
  262. ITEM OUT$SNOD U(03,00,08); # SOURCE NODE OF CALL #
  263. ITEM OUT$DNOD U(03,08,08); # DEST NODE OF CALL #
  264. ITEM OUT$WS U(03,16,04); # SEND WINDOW #
  265. ITEM OUT$DPLS U(03,20,08); # SEND PACKET SIZE #
  266. ITEM OUT$FACNUM U(03,28,08); # NUMBER OF FACILITY CODES #
  267. ITEM OUT$UDL U(03,36,08); # LENGTH OF CALL USER DATA #
  268. ITEM OUT$SL U(03,56,04); # BLOCK SECURITY LEVEL #
  269. ITEM OUT$DTEL U(04,00,08); # CALLED DTE ADDR LENGTH #
  270. ITEM OUT$WRD6 U(06,00,60);
  271. END
  272. #
  273. ** ACENT - ACTIVE PID ENTRY TEMPLATE.
  274. *
  275. * TEMPLATE FOR THE PID ENTRY WORD OF THE ACPID ENTRY.
  276. #
  277. BASED ARRAY ACENT [00:00] S(1);
  278. BEGIN
  279. ITEM ACE$PID C(00,00,03); # PID #
  280. ITEM ACE$SF B(00,18,01); # STORE/FORWARD FLAG #
  281. ITEM ACE$NAMAC B(00,59,01); # NAM ACCESS FLAG #
  282. END
  283.  
  284. #
  285. * BPAAC - WORKING BASED ARRAY.
  286. #
  287.  
  288. BASED ARRAY BPAAC[00:00] S(1);
  289. BEGIN
  290. ITEM BPA$WORD U(00,00,60);
  291. END
  292.  
  293. #
  294. * SHOSTOUT - OUTCALL BLOCK FOR SINGLE HOST.
  295. *
  296. * THIS ARRAY DEFINES THE OUTCALL BLOCK TO BE USED WHEN THE REQUEST
  297. * RESULTS IN THE SAME HOST.
  298. #
  299.  
  300. ARRAY SHOSTOUT [00:00] S(10);
  301. BEGIN
  302. ITEM SH$WC U(00,52,08); # BLOCK WORD SIZE #
  303. ITEM SH$NM1 C(01,00,07); # NAME 1 CALLED APPL NAME #
  304. ITEM SH$NM2 C(01,42,03); # NAME 2 REMOTE HOST ID #
  305. ITEM SH$PRI U(02,00,01) = [1]; # PRIORITY FLAG OFF #
  306. ITEM SH$DBL U(02,04,08) = [INTRADBL$]; # DL BLOCK LIMIT #
  307. ITEM SH$DBZ U(02,12,12) = [INTRADBZ$]; # DL BLOCK SIZE #
  308. ITEM SH$ABL U(02,24,08) = [INTRABL$]; # APPL BLOCK LIM #
  309. ITEM SH$UBL U(02,36,08) = [INTRAUBL$]; # UL BLOCK LIMIT #
  310. ITEM SH$UBZ U(02,44,08) = [INTRAUBZ$]; #UL BLOCK SIZE #
  311. ITEM SH$PORT U(02,52,08) = [0]; # ACCESS NPU PORT #
  312. ITEM SH$UDL U(03,36,08); # CALL USER DATA LEN #
  313. ITEM SH$WRD3 U(03,00,60) = [0];
  314. ITEM SH$WRD4 U(04,00,60) = [0]; # WORD 4 = 0 #
  315. ITEM SH$WRD5 U(05,00,60) = [0]; # WORD 5 = 0 #
  316. ITEM SH$WRD6 U(06,00,60) = [0]; # WORD 6 = 0 #
  317. ITEM SH$WRD7 U(07,00,60) = [0]; # WORD 7 = 0 #
  318. ITEM SH$WRD8 U(08,00,60);
  319. ITEM SH$WRD9 U(09,00,60);
  320. END
  321.  
  322. #
  323. * OCFAC - FACILITY WORD DEFINITION IN OUTCALL BLOCK.
  324. *
  325. * WORD OVERLAY DEF FOR EXTRACTING LENGTH AND FACILITY CODE PAIRS
  326. * FROM THE OUTCALL BLOCK.
  327. #
  328.  
  329. BASED ARRAY OCFAC [00:00] S(1);
  330. BEGIN
  331. ITEM OCF$LEN U(00,00,08); # FACILITY SEMI-OCTET LENGTH #
  332. ITEM OCF$WORD U(00,00,60);
  333. END
  334.  
  335.  
  336.  
  337. #
  338. * OCUDATA - CALL USER DATA TEMPLATE.
  339. *
  340. * CALL USER DATA DEFINITION.
  341. #
  342.  
  343. BASED ARRAY OCUDATA [00:00] S(1);
  344. BEGIN
  345. ITEM OCU$WORD U(00,00,60);
  346. ITEM OCU$CUDL U(00,24,08); # CALL USER DATA LENGTH #
  347. END
  348.  
  349. #
  350. * PATH - TEMPLATE FOR A PATH DEFINITION IN LLPID TABLE.
  351. #
  352.  
  353. BASED ARRAY PATH [00:00] S(2);
  354. BEGIN
  355. ITEM PATH$DN U(00,00,08); # DESTINATION NODE OF PATH #
  356. ITEM PATH$SN U(00,08,08); # SOURCE NODE OF PATH #
  357. ITEM PATH$PORT U(00,16,08); # NPU CALL ACCESS PORT #
  358. ITEM PATH$DTEL U(00,24,08); # CALLED DTE ADDRESS LENGTH #
  359. ITEM PATH$DTEA U(01,00,60); # DTE ADDR, 0 - 15 SEMI OCTETS#
  360. END
  361.  
  362. #
  363. * PID - TEMPLATE FOR PID DEFINITION IN LLPID TABLE.
  364. #
  365.  
  366. BASED ARRAY PID [00:00] S(1);
  367. BEGIN
  368. ITEM PID$PNAME C(00,00,03); # PID NAME #
  369. ITEM PID$PSTAT B(00,48,01); # PID ACCESSABLE FLAG #
  370. ITEM PID$LLCNT U(00,49,11); # LOG LINKS DEFINED FOR PID #
  371. END
  372.  
  373. #
  374. * FCL - FACILITY CODE LENGTH DEFINTION.
  375. *
  376. * DEFINITION USED TO ACCUMULATE THE FACILITY CODE PAIRS LENGTH.
  377. #
  378.  
  379. ARRAY FCL [00:00] S(1);
  380. BEGIN
  381. ITEM FCL$LEN U(00,00,08);
  382. ITEM FCL$WORD U(00,00,60);
  383. END
  384.  
  385. #
  386. ** LPIDCELL - LID PID CELL FOR PARAMETER HOLDING.
  387. #
  388. ARRAY LPIDCELL [00:00] S(3);
  389. BEGIN
  390. ITEM LPC$LID C(00,42,03); # LID #
  391. ITEM LPC$PID C(01,42,03); # PID #
  392. ITEM LPC$TEMP C(02,42,03); # HOLDING CELL FOR LID-PID #
  393. END
  394.  
  395.  
  396. $BEGIN
  397. #
  398. ** TBLMSG - MISSING TABLE MESSAGE.
  399. #
  400. ARRAY TBLMSG [00:00] S(5);
  401. BEGIN
  402. ITEM TBL$MSG C(00,00,30) =
  403. ["NVFAIAP: CANNOT FIND ENTRY IN "];
  404. ITEM TBL$NAME C(03,00,10);
  405. ITEM TBL$ZERO U(04,00,60) = [0];
  406. END
  407.  
  408. $END
  409.  
  410. CONTROL EJECT;
  411.  
  412. #
  413. * $$$$ MAIN PROCEDURE STARTS HERE $$$$
  414. #
  415. #
  416. * SET THE INITIAL ACTION CODES.
  417. #
  418.  
  419. OLDACT = S"SEXEC";
  420. CURACT = S"SEXEC";
  421. NXTACT = S"SACLPID";
  422. ERRACT = S"SEXEC";
  423. RETACT = S"SEXEC";
  424. CONTACT = S"SEXEC";
  425. #
  426.  ........................................................................
  427. #
  428.  
  429. EXEC: # EXEC FUNCTION #
  430.  
  431. OLDACT = CURACT;
  432. CURACT = NXTACT;
  433. GOTO ACTSWT[NXTACT];
  434. #
  435.  ......................................................................
  436. #
  437. CONTROL EJECT;
  438.  
  439. ACLPID: # ACTION COMPLETED LID/PID FUNCTION REQUESTS #
  440.  
  441. #
  442. * THIS FUNCTION PROCESSES ALL ENTRIES IN THE LPIDFXQ.
  443. * WHEN ALL ENTRIES PROCESSED, THE NEXT ACTION SET TO
  444. * CONTINUE WITH GETSM ACTION.
  445. *
  446. * THE ERROR ACTION IS SET TO RETURN CONTROL TO THIS FUNCTION
  447. * UPON COMPLETION OF ANY ERROR PROCESSING. THIS IS DUE TO
  448. * THE FACT THAT THIS FUNCTION MUST CONTINUE PROCESSING UNTIL
  449. * THE LPIDFXQ IS EMPTY.
  450. * THE RETURN ACTION IS SET TO RETURN TO THIS FUNCTION ALSO.
  451. * THE CONTROL ACTION IS SET TO S"SACLPID" OR S"SGETSM" DEPENDENT
  452. * ON WHETHER THE LPIDFXQ IS EMPTY.
  453. #
  454.  
  455. #
  456. * INITIALIZE THE ERRCODE VALUES.
  457. * IF LPIDFXQ EMPTY, NO NEED TO PROCESS. RETURN.
  458. #
  459. ERRCODE = OK$;
  460. ERRCODE2 = OK$;
  461.  
  462. IF LPIDFXQL EQ 0
  463. THEN
  464. BEGIN
  465. NXTACT = S"SGETSM";
  466. CONTACT = S"SGETSM";
  467. GOTO EXACLPID;
  468. END
  469. #
  470. * ENTRIES EXIST IN LPIDFXQ.
  471. * SET ERROR ACTION SO AS TO RETURN TO THIS FUNCTION.
  472. * SET CONTROLLING ACTION TO S"SACLPID" SO AS TO CAUSE PROCESSING
  473. * OF ALL ENTRIES IN THE LPIDFXQ.
  474. * REMOVE QUEUE ENTRY AND PROCESS.
  475. #
  476.  
  477. RETACT = S"SACLPID";
  478. ERRACT = S"SACLPID";
  479. CONTACT = S"SACLPID";
  480. #
  481. * ZERO OUT THE MSGBUF AREA.
  482. #
  483. FOR J = 0 STEP 1 UNTIL NMSGBUF$
  484. DO
  485. BEGIN
  486. MSG$WORD[J] = 0;
  487. END
  488.  
  489. #
  490. * REMOVE COMPLETED LID/PID FUNCTION REQUEST FROM LPIDFXQ.
  491. #
  492. P<LPIDBUF> = LOC(MSGBUF);
  493. SSTRQE(P<LPIDFXQ>,WCBUF,ABHBUF,MSGBUF);
  494. #
  495. * SET LOCAL VCB ORDINAL VALUE.
  496. * LOCATE OWNING PAAC ENTRY.
  497. #
  498. VCB = LPI$VCB[0];
  499. FOR PAC = 0 STEP 1 WHILE
  500. (VCB NQ PA$VCB[PAC]) AND
  501. (PAC LS (PACLNGTH/PAACSIZ$))
  502. DO
  503. BEGIN
  504. END
  505.  
  506. $BEGIN
  507. #
  508. * DEBUG - IF NO PAAC THEN SERIOUS PROBLEM.
  509. #
  510. IF PAC EQ (PACLNGTH/PAACSIZ$)
  511. THEN
  512. BEGIN
  513. $BEGIN
  514. TBL$NAME[0] = "PAAC";
  515. MESSAGE(TBLMSG,0);
  516. ABORT;
  517. $END
  518. END
  519. $END
  520. #
  521. * SET PAC AND VCB DEFINED FLAGS.
  522. * LOCATE THE ACPID TABLE ENTRY FOR THIS PAAC ENTRY.
  523. #
  524. VCBDEF = TRUE;
  525. PACDEF = TRUE;
  526. FOUND = FALSE;
  527.  
  528. FOR I = 0 STEP ACP$ESIZ[I] WHILE
  529. (I LS ACPIDL) AND NOT FOUND
  530. DO
  531. BEGIN
  532. IF ACP$VCB[I] EQ VCB
  533. THEN
  534. BEGIN
  535. AX = I;
  536. LPORD = I;
  537. FOUND = TRUE;
  538. END
  539. END
  540.  
  541. $BEGIN
  542. #
  543. * IF NO ACPID TABLE ENTRY, DEBUG ABORT NVF.
  544. #
  545. IF NOT FOUND
  546. THEN
  547. BEGIN
  548. TBL$NAME[0] = "ACPID";
  549. MESSAGE(TBLMSG,0);
  550. ABORT;
  551. END
  552.  
  553. $END
  554. #
  555. * IF THE APPLICATION HAD SPECIFIED OUTCALL PARAMETERS, THEN LOCATE
  556. * THE APOUTCL ENTRY.
  557. #
  558. APODEF = FALSE;
  559. IF PA$OUTSPEC[PAC]
  560. THEN
  561. BEGIN
  562. FOR APO = 0 STEP APO$WC[APO]
  563. WHILE ((PA$VCB[PAC] NQ APO$VCB[APO]) AND
  564. (APO LS APOUTCLL))
  565. DO
  566. BEGIN
  567. END
  568.  
  569. $BEGIN
  570. #
  571. * IF NO APOUTCL ENTRY, ABORT NVF (IN DEBUG MODE).
  572. #
  573. IF APO EQ APOUTCLL
  574. THEN
  575. BEGIN
  576. TBL$NAME[0] = "APOUTCL";
  577. MESSAGE(TBLMSG,0);
  578. ABORT;
  579. END
  580.  
  581. $END
  582.  
  583. APODEF = TRUE;
  584. END
  585.  
  586. PA$ACPIDL[PAC] = ACP$ESIZ[AX];
  587. #
  588. * IF GETLIDC FUNCTION AND RETURN CODE INDICATES BAD LID
  589. * SET ERRCODE AND EXIT.
  590. #
  591. IF LPI$FC[0] EQ GLIDCFC$ AND
  592. ACP$RC[AX] EQ LPIDBADLP$
  593. THEN
  594. BEGIN
  595. ERRCODE = RCIA"ILP";
  596. NXTACT = S"SERRCHEK";
  597. GOTO EXACLPID;
  598. END
  599. #
  600. * IF GETPIDA FUNCTION AND RETURN CODE INDICATES BAD PID
  601. * SET STATUS AS IF NAME2 IS ACCESSIBLE MEANING THAT THIS
  602. * PID IS NOT VALID TO NOS SO ATTEMPT OUTCALL AS NAME2 ONLY.
  603. #
  604. IF LPI$FC[0] EQ GPIDAFC$
  605. THEN
  606. BEGIN
  607. IF ACP$RC[AX] EQ LPIDBADLP$
  608. THEN
  609. BEGIN
  610. ACP$RC[AX] = 0;
  611. ACP$GPAST[AX] = PIDOPST$;
  612.  
  613. END
  614. ELSE
  615. BEGIN
  616. #
  617. * VALID PID STATUS RETURNED.
  618. * IF NOT ACCESSIBLE, SET ERROR CODE AND EXIT.
  619. #
  620. IF ACP$GPAST[AX] NQ PIDOPST$
  621. THEN
  622. BEGIN
  623. ERRCODE = RCIA"PNS";
  624. NXTACT = S"SERRCHEK";
  625. GOTO EXACLPID;
  626. END
  627. END
  628. END
  629. #
  630. * SET THE CURRENT PID POINTER OF THE PAAC ENTRY TO THE LAST
  631. * PID ENTRY OF THE ACPID TABLE ENTRY FOR THIS PAAC ENTRY.
  632. * SET ENTRY BIAS WHERE PID DEFINITIONS START DEPENDENT ON
  633. * EACH FUNCTION TYPE.
  634. #
  635. IF LPI$FC[0] EQ GPIDAFC$
  636. THEN
  637. BEGIN
  638. PA$CUACPID[PAC] = 1;
  639. PA$PIDBIAS[PAC] = GPIDABIAS$;
  640. END
  641. ELSE
  642. BEGIN
  643. PA$CUACPID[PAC] = ACP$GLCNP[AX];
  644. PA$PIDBIAS[PAC] = GLIDCBIAS$;
  645. END
  646. #
  647. * PROCEED TO CHECK CALLING APPLICATION FUNCTION.
  648. #
  649. NXTACT = S"SCHCLGAP";
  650.  
  651. EXACLPID: # EXIT SUBFUNCTION OF FUNCTION ACLPID #
  652.  
  653. #
  654. * THE NEXT ACTION, RETURN ACTION AND ERRCODES ARE SET.
  655. * SIMPLY RETURN TO THE EXECUTIVE.
  656. #
  657. GOTO EXEC;
  658. #
  659.  ..............................................................
  660. #
  661. CONTROL EJECT;
  662.  
  663. GETSM: # GETSM FUNCTION #
  664.  
  665. #
  666. * ALL ENTRIES RESIDENT IN THE OUTSMQ ARE PROCESSED.
  667. * THE ERROR RETURN ACTION MUST BE SET TO RETURN TO GETSM
  668. * SO THAT AFTER A CR/IAP/R SM HAS BEEN ABNORMALLY RESPONDED
  669. * TO, CONTROL IS RETURNED TO GETSM TO PROCESS NEXT CR/IAP/R
  670. * SM IN OUTSMQ. THE RETURN ACTION IS SET TO GETSM ALSO.
  671. * THE CONTROLLING FUNCTION WAS SET TO S"SGETSM" BY ACLPID ACTION.
  672. * SET CONTROLLING ACTION TO GETSM.
  673. #
  674. CONTACT = S"SGETSM";
  675. #
  676. * CHECK IF NO CR/IAP/R SMS AVAILABLE.
  677. * IF NOT, FINISHED, EXIT NVFAIAP PROCEDURE.
  678. #
  679.  
  680. IF OUTSMQL EQ 0
  681. THEN
  682. BEGIN
  683. NXTACT = S"SEXIT";
  684. GOTO EXGETSM;
  685. END
  686. #
  687. * ENTRY RESIDENT IN OUTSMQ.
  688. * INITIALIZE THE SM AREA, WORD COUNT AND ABH WORDS.
  689. #
  690. ERRACT = S"SGETSM";
  691. FOR J = 0 STEP 1 UNTIL NMSGBUF$
  692. DO
  693. BEGIN
  694. MSG$WORD[J]= 0;
  695. END
  696.  
  697. WCB$WORD[0]= 0;
  698. WCB$WORD[1]= 0;
  699. ABH$WORD[0] = 0;
  700. ABH$WORD[1] = 0;
  701. #
  702. * GET AN INCOMING CR/IAP/R OR FAI/APP/N SM FROM THE OUTSMQ QUEUE.
  703. #
  704. SSTRQE(P<OUTSMQ>,WCBUF,ABHBUF,MSGBUF);
  705. #
  706. * IF FAI/APP/N SM, CALL NVFAFAI TO PROCESS IT.
  707. #
  708. IF WCB$SMID[0] EQ CTQSTAT"SFAI"
  709. THEN
  710. BEGIN
  711. NVFAFAI;
  712. NXTACT = S"SGETSM";
  713. GOTO EXGETSM;
  714. END
  715. #
  716. * INITIALIZE LOCAL FLAGS AND ERROR CODE VALUES.
  717. #
  718. PACDEF = FALSE;
  719. VCBDEF = FALSE;
  720. APODEF = FALSE;
  721. ERRCODE = OK$;
  722. ERRCODE2 = OK$;
  723. ASTNUM = ASTLNGTH / ASTSIZ$;
  724. AORD = ASTNUM;
  725. #
  726. * CHECK IF THE HOST IS IN IDLE OR DISABLE STATE IN WHICH
  727. * CASE THE CONNECTION REQUEST CAN NOT BE MADE.
  728. * SAVE THE ACN FOR LATER INSERTION INTO THE CR/IAP/A SM.
  729. * SET ERROR CODE , ERRCHEK ACTION AND EXIT.
  730. #
  731. IF NVFSTATE
  732. THEN
  733. BEGIN
  734. NACN = CRNACN[0];
  735. ERRCODE = RCIA"IDH";
  736. NXTACT = S"SERRCHEK";
  737. GOTO EXGETSM;
  738. END
  739. #
  740. * CHECK IF SM IS A REPEAT SM BY CHECKING THE VALUE OF
  741. * THE IAN FIELD.
  742. * IF NON-ZERO, THEN SM IS AN INITIAL SM.
  743. * SET NEXT ACTION TO INITIAL CR/IAP/R SM.
  744. * OTHERWISE, MUST BE A REPEAT SM. SET NEXT ACTION TO
  745. * SECONDARY CR/IAP/R SM.
  746. #
  747. IF CRIAN[0] NQ 0
  748. THEN
  749. NXTACT = S"SINITIAP";
  750. ELSE
  751. NXTACT = S"SSECIAP";
  752.  
  753. EXGETSM:
  754.  
  755. GOTO EXEC;
  756.  
  757. #
  758.  ..................................................................
  759. #
  760. CONTROL EJECT;
  761.  
  762. INITIAP: # PROCESS INITIAL CR/IAP/R SM #
  763.  
  764.  
  765. #
  766. * THIS FUNCTION PERFORMS THE FUNCTIONS FOR AN INITIAL
  767. * CR/IAP/R SM.
  768. *
  769. * GET A VCB ORDINAL ASSIGNED.
  770. * IF NO VCBS AVAILABLE, SET ERRCODE AND NEXT ACTION TO
  771. * TO ERRCHEK AND EXIT.
  772. * OTHERWISE, GET A PAAC ENTRY ASSIGNED.
  773. #
  774.  
  775. NVFUAFV(VCB,ERRFLG);
  776. IF ERRFLG
  777. THEN
  778. BEGIN
  779. ERRCODE = RCIA"NVO";
  780. NXTACT = S"SERRCHEK";
  781. GOTO EXINITIAP;
  782. END
  783.  
  784. #
  785. * VCB ASSIGNED, GET PAAC ENTRY.
  786. #
  787.  
  788. PAC = PACLNGTH / PAACSIZ$;
  789. VCBDEF = TRUE;
  790. SSTATS(P<PAAC>,PAACSIZ$);
  791. PACDEF = TRUE;
  792.  
  793. #
  794. * CLEAR PAAC ENTRY
  795. #
  796. P<BPAAC> = LOC(PAAC[PAC]);
  797. FOR J = 0 STEP 1 UNTIL (PAACSIZ$ - 1)
  798. DO
  799. BEGIN
  800. BPA$WORD[J] = 0;
  801. END
  802.  
  803. #
  804. * INITIALIZE THE PAAC ENTRY FROM THE CR/IAP/R SM.
  805. #
  806.  
  807. PA$RAPNM[PAC] = CRRANM[0];
  808. PA$URHID[PAC] = CRRHID[0];
  809. PA$NACN[PAC] = CRNACN[0];
  810. PA$VCB[PAC] = VCB;
  811. PA$IAPAN[PAC] = CRIAN[0];
  812. PA$SMAN[PAC] = CRIAN[0];
  813. PA$OUTCUR[PAC] = 0;
  814. PA$STATE[PAC] = PAACST"PAIAP";
  815. PA$OUTNXT[PAC] = 0;
  816. PA$ULID[PAC] = CRULID[0];
  817. PA$UPID[PAC] = CRUPID[0];
  818. PA$PIDCUR[PAC] = 0;
  819. PA$PATHNXT[PAC] = 0;
  820. #
  821. * CALCULATE NUMBER OF AST ENTRIES.
  822. #
  823. ASTNUM = ASTLNGTH / ASTSIZ$;
  824. #
  825. * LOCATE CALLING AST ENTRY.
  826. #
  827. FOR AORD = 0 STEP 1 WHILE
  828. ((AST$AN[AORD] NQ PA$IAPAN[PAC]) AND
  829. (AORD LS ASTNUM))
  830. DO
  831. BEGIN
  832. END
  833. #
  834. * IF THIS IS A SECONDARY APPL, LOCATE THE PRIMARY APPL AST ENTRY.
  835. #
  836. PORD = AORD;
  837. IF AST$PANAM[AORD] NQ AST$SANAM[AORD]
  838. THEN
  839. BEGIN
  840. FOR PORD = 0 STEP 1 WHILE
  841. ((PORD LS ASTNUM) AND
  842. (AST$SANAM[AORD] NQ AST$PANAM[PORD]))
  843. DO
  844. BEGIN
  845. END
  846. IF PORD EQ ASTNUM
  847. THEN
  848. BEGIN
  849. PORD = AORD;
  850. END
  851. END
  852. IF AST$PPF[AORD] # IF PRIVILEGED APPLICATION #
  853. THEN
  854. BEGIN
  855. PA$OUTSPEC[PAC] = (WCB$WC[0] GR (LCRIAP + 2));
  856. END
  857. ELSE
  858. BEGIN # IGNORE EXCESS WORDS FOR REGUALR #
  859. PA$OUTSPEC[PAC] = FALSE; # APPLICATION #
  860. END
  861. #
  862. * IF THE APPLICATION SUPPLIED OUTCALL PARAMETERS IN THE CR/IAP, COPY
  863. * THE SM WORDS INTO ANOTHER BUFFER TO SAVE THEM FOR LATER ACCESS.
  864. * DO NOT COPY THE FIRST AND THIRD WORDS OF THE SM AS THEY ARE NOT
  865. * NEEDED.
  866. #
  867. IF PA$OUTSPEC[PAC]
  868. THEN
  869. BEGIN
  870. APO = APOUTCLL;
  871. APOENTSZ = WCB$WC[0] - 2;
  872. SSTATS(P<APOUTCL>,APOENTSZ);
  873. APO$VCB[APO] = PA$VCB[PAC];
  874. APO$WC[APO] = APOENTSZ;
  875. P<BPAAC> = LOC(APOUTCL[APO]);
  876. BPA$WORD[1] = MSG$WORD[1];
  877. K = 3;
  878. FOR J = 2 STEP 1 UNTIL (APOENTSZ - 1)
  879. DO
  880. BEGIN
  881. BPA$WORD[J] = MSG$WORD[K];
  882. K = K + 1;
  883. END
  884. APODEF = TRUE;
  885. END
  886. #
  887. * NORMAL STATUS TO HERE. SET NEXT ACTION TO CHECK LID/PID
  888. * REQUIREMENTS OF THE CALL.
  889. #
  890.  
  891. NXTACT = S"SCHLPID";
  892.  
  893. EXINITIAP:
  894.  
  895. GOTO EXEC;
  896. #
  897.  ................................................................
  898. #
  899. CONTROL EJECT;
  900.  
  901. CHLPID: # CHECK LID/PID REQUIREMENTS #
  902.  
  903. #
  904. * THIS FUNCTION PERFORMS THE FUNCTIONS TO DETERMINE THE
  905. * LID/PID REQUIREMENTS OF THE CURRENT CR/IAP/R SM.
  906. * IF A LID IS SPECIFIED IN THE CR/IAP/R, THEN A GETLIDC
  907. * FUNCTION REQUEST IS SENT TO THE CPMRQ FOR ACTION.
  908. * IF ONLY A PID IS SPECIFIED, THEN A GETPIDA FUNCTION
  909. * IS SENT TO THE CPMRQ FOR ACTION.
  910. *
  911. * THIS FUNCTION WILL COMPLETE PHASE 1 PROCESSING OF THE
  912. * CR/IAP/R SM ONLY IF A LID WAS SPECIFIED ALONE, A LID AND
  913. * A PID SPECIFIED OR A PID ALONE SPECIFIED. IN THIS CASE,
  914. * THE NEXT ACTION IS SET TO GETSM.
  915. #
  916.  
  917. #
  918. * INITIALIZE LOCAL VARIABLES AND PAAC
  919. #
  920. LPORD = 0;
  921. LPVCB = PA$VCB[PAC];
  922. PA$ACPIDL[PAC] = 0;
  923. PA$CUACPID[PAC] = 0;
  924.  
  925. #
  926. * IF NO LID OR PID SPECIFIED, THE NEXT ACTION IS SET TO CHECK
  927. * CALLING APPLICATION SINCE THERE IS NO NEED TO VERIFY THE LID
  928. * OR PID WITH NOS.
  929. #
  930.  
  931. IF PA$ULID[PAC] EQ 0 AND PA$UPID[PAC] EQ 0
  932. THEN
  933. BEGIN
  934. NXTACT = S"SCHCLGAP";
  935. GOTO EXCHLPID;
  936. END
  937.  
  938. #
  939. * A LID OR A PID SPECIFIED THEREFORE A NEED TO ISSUE
  940. * A LID/PID FUNCTION REQUEST.
  941. #
  942.  
  943. #
  944. * SET UP THE FUNCTION REQUEST INDEPENDENT VALUES.
  945. #
  946. P<LPIDBUF> = LOC(MSGBUF);
  947. LPI$WORD0[0] = 0;
  948. LPI$WORD1[0] = 0;
  949. LPI$VCB[0] = PA$VCB[PAC];
  950. LPI$QNUM[0] = LOC(P<AALPID>);
  951. #
  952. * IF LID SPECIFIED, ISSUE GETLIDC FUNCTION.
  953. #
  954. IF PA$ULID[PAC] NQ 0
  955. THEN
  956. BEGIN
  957. LPI$FC[0] = GLIDCFC$;
  958. LPI$LID[0] = PA$LID[PAC];
  959. LPI$SIZE[0] = GLIDBUFS$;
  960. END
  961. ELSE
  962. #
  963. * LID NOT SPECIFIED, MUST BE PID.
  964. * SET UP GETPIDA FUNCTION REQUEST.
  965. #
  966. BEGIN
  967. LPI$FC[0] = GPIDAFC$;
  968. LPI$PID[0] = PA$PID[PAC];
  969. LPI$SIZE[0] = GPIDBUFS$;
  970. END
  971. #
  972. * ISSUE REQUEST TO CPMRQ.
  973. #
  974. NVFUMQE(P<CPMRQ>,LPIDBUF[0],APPTTX$,0,LPIDLEN$);
  975. #
  976. * PHASE 1 PROCESSING DONE. MUST WAIT FOR COMPLETED LID/PID
  977. * FUNCTION TO RETURN THROUGH THE LPIDFXQ TO THE ACLPID
  978. * FUNCTION. SET NEXT ACTION TO PROCEED ONTO NEXT CR/IAP/R SM.
  979. #
  980. NXTACT = S"SGETSM";
  981.  
  982. EXCHLPID:
  983. GOTO EXEC;
  984. #
  985.  ................................................................
  986. #
  987. CONTROL EJECT;
  988.  
  989. SECIAP: # PROCESS SECONDARY CR/IAP/R SM #
  990.  
  991. #
  992. * THIS FUNCTION PERFORMS THE PROCESSING OF THE SECONDARY
  993. * CR/IAP/R SMS. IN THE EVENT THAT A CR/IAP/N SM ISSUED
  994. * BY NVF DID NOT SUCCEED, A REPEATED ATTEMPT (I.E. A SEC-
  995. * ONDARY SM) IS ISSUED BY NIP TO NVF.
  996. * A SECONDARY SM ALREADY HAS A PAAC ENTRY AND VCB ASSIGNED.
  997. * IF LID/PID REQUIRED BY THE INITIAL SM THEN THE INFORMA-
  998. * TION IS STILL INTACT FOR THE REPEATED SM.
  999. #
  1000.  
  1001. #
  1002. * SET ERROR CODE IN ORDER TO USE THE ERROR CODE OF THE RE-
  1003. * PEATED SM IN ALL ABNORMAL CR/IAP/R SM THAT MAY BE SENT.
  1004. * (ONLY IF CALLING APPLICATION FAILS DOES THE ERROR CODE GET
  1005. * OVERRIDDEN).
  1006. #
  1007. ERRCODE2 = SEESM$;
  1008. #
  1009. * CALCULATE NUMBER OF PAAC ENTRIES.
  1010. #
  1011. NUMENT = (PACLNGTH/PAACSIZ$);
  1012. #
  1013. * LOCATE PAAC ENTRY FOR THIS REPEATED SM.
  1014. #
  1015. FOR PAC = 0 STEP 1 WHILE
  1016. ((PA$NACN[PAC] NQ CRNACN[0]) AND
  1017. (PAC LS NUMENT))
  1018. DO
  1019. BEGIN
  1020. END
  1021. #
  1022. * IF NO PAAC ENTRY, THERE SHOULD BE.
  1023. * SET THE NEXT ACTION TO ERRCHEK WITH ERROR ACTION
  1024. * SET TO THE CONTROLLINH FUNCTION.
  1025. #
  1026. IF PAC EQ NUMENT
  1027. THEN
  1028. BEGIN
  1029. PACDEF = FALSE;
  1030. NXTACT = S"SERRCHEK";
  1031. ERRACT = CONTACT;
  1032. GOTO EXSECIAP;
  1033. END
  1034. #
  1035. * PAAC ENTRY EXISTS. SET STATE TO SECONDARY IAP AND SAVE REASON
  1036. * CODE FOR REPEATED SM .
  1037. #
  1038. PACDEF = TRUE;
  1039. VCBDEF = TRUE;
  1040. PA$IAPRC[PAC] = CRRIAP[0];
  1041. #
  1042. * IF THE APPLICATION HAD SPECIFIED OUTCALL PARAMETERS, THEN LOCATE
  1043. * THE APOUTCL ENTRY.
  1044. #
  1045. IF PA$OUTSPEC[PAC]
  1046. THEN
  1047. BEGIN
  1048. FOR APO = 0 STEP APO$WC[APO]
  1049. WHILE ((PA$VCB[PAC] NQ APO$VCB[APO]) AND
  1050. (APO LS APOUTCLL))
  1051. DO
  1052. BEGIN
  1053. END
  1054.  
  1055. $BEGIN
  1056. #
  1057. * IF NO APOUTCL ENTRY, ABORT NVF (IN DEBUG MODE).
  1058. #
  1059. IF APO EQ APOUTCLL
  1060. THEN
  1061. BEGIN
  1062. TBL$NAME[0] = "APOUTCL";
  1063. MESSAGE(TBLMSG,0);
  1064. ABORT;
  1065. END
  1066.  
  1067. $END
  1068.  
  1069. APODEF = TRUE;
  1070. END
  1071. #
  1072. * SINCE REPEAT SM, DECREMENT NUMBER A-A CONNECTIONS FOR APPL.
  1073. * LOCATE THE CALLING APPL AST ENTRY.
  1074. #
  1075. PA$SMAN[PAC] = CRIAN[0];
  1076. FOR AORD = 0 STEP 1 WHILE
  1077. ((AORD LS ASTNUM) AND
  1078. (PA$IAPNM[PAC] NQ AST$PANAM[AORD]))
  1079. DO
  1080. BEGIN
  1081. END
  1082. #
  1083. * CHECK IF THIS APPL IS A SECONDARY APPL AND THEN DETERMINE THE
  1084. * PRIMARY AST ORDINAL.
  1085. #
  1086. PORD = AORD;
  1087. IF AST$PANAM[AORD] NQ AST$SANAM[AORD]
  1088. THEN
  1089. BEGIN
  1090. FOR PORD = 0 STEP 1 WHILE
  1091. ((PORD LS ASTNUM) AND
  1092. (AST$SANAM[AORD] NQ AST$PANAM[PORD]))
  1093. DO
  1094. BEGIN
  1095. END
  1096. IF PORD EQ ASTNUM
  1097. THEN
  1098. BEGIN
  1099. PORD = AORD;
  1100. END
  1101. END
  1102. #
  1103. * DECREMENT THE NUMBER OF A-A CONNECTIONS TO THE APPL. IF THIS
  1104. * IS A SECONDARY APPL, THEN DECREMENT THE NUMBER OF A-A CONNECTIONS
  1105. * TO THE PRIMARY APPL ALSO.
  1106. #
  1107. AST$AACN[AORD] = AST$AACN[AORD] - 1;
  1108. IF AORD NQ PORD
  1109. THEN
  1110. BEGIN
  1111. AST$AACN[PORD] = AST$AACN[PORD] - 1;
  1112. END
  1113. #
  1114. * SINCE SECONDARY CR/IAP/R SM, MUST DETERMINE IF ACPID TABLE
  1115. * ENTRY EXISTS FOR THIS CONNECTION. SEARCH THE ACPID TABLE FOR
  1116. * A ENTRY WITH MATCHING VCB ORDINAL.
  1117. #
  1118. IF PA$ACPIDL[PAC] NQ 0
  1119. THEN
  1120. BEGIN
  1121. #
  1122. * ACPID TABLE ENTRY EXISTS FOR THIS CONNECTION.
  1123. * DETERMINE THE RELETIVE WORD ORDINAL OF THE ENTRY.
  1124. #
  1125. VCB = PA$VCB[PAC];
  1126. WORKB = FALSE;
  1127. FOR XJ = 0 STEP ACP$ESIZ[XJ] WHILE
  1128. XJ LS ACPIDL AND NOT WORKB
  1129. DO
  1130. BEGIN
  1131. IF VCB EQ ACP$VCB[XJ]
  1132. THEN
  1133. BEGIN
  1134. WORKB = TRUE;
  1135. LPORD = XJ;
  1136. END
  1137. END
  1138. END
  1139. #
  1140. * SET NEXT ACTION TO CHECK CALLING APPLICATION S"SCHCLGAP"
  1141. #
  1142. NXTACT = S"SCHCLGAP";
  1143.  
  1144. EXSECIAP:
  1145.  
  1146. GOTO EXEC;
  1147. #
  1148.  ..........................................................
  1149. #
  1150. CONTROL EJECT;
  1151.  
  1152. CHCLGAP: # CHECK CALLING APPLICATION #
  1153.  
  1154. #
  1155. * THIS FUNCTION LIMIT CHECKS THE CALLING APPLICATION.
  1156. * IF A LIMIT CHECK FAILS, THE NEXT ACTION IS SET TO
  1157. * ERRCHEK AND THE ERROR ACTION IS SET TO RETURN TO ACTION
  1158. * SPECIFIED BY THE CONTROLLING ACTION (CONTACT).
  1159. *
  1160. * IF ALL GOES WELL, THE NEXT ACTION IS SET TO SETNAM2 IN
  1161. * IN ORDER TO PREPARE FOR THE OUTCALL SEARCH.
  1162. #
  1163.  
  1164. #
  1165. * INITIALIZE THE ERROR ACTION TO THE CONTROLLING ACTION.
  1166. #
  1167. ERRACT = CONTACT;
  1168. #
  1169. * CALCULATE NUMBER OF AST ENTRIES.
  1170. #
  1171. ASTNUM = ASTLNGTH / ASTSIZ$;
  1172.  
  1173. #
  1174. * LOCATE CALLING AST ENTRY.
  1175. #
  1176. FOR AORD = 0 STEP 1 WHILE
  1177. ((AST$AN[AORD] NQ PA$IAPAN[PAC]) AND
  1178. (AORD LS ASTNUM))
  1179. DO
  1180. BEGIN
  1181. END
  1182.  
  1183. #
  1184. * IF NO AST ENTRY, SET ERRCODE, NEXT ACTION TO ERRCHEK.
  1185. #
  1186. IF AORD EQ ASTNUM
  1187. THEN
  1188. BEGIN
  1189. ERRCODE = RCIA"APF";
  1190. NXTACT = S"SERRCHEK";
  1191. GOTO EXCHCLGAP;
  1192. END
  1193. #
  1194. * IF THIS IS A SECONDARY APPL, LOCATE THE PRIMARY APPL AST ENTRY.
  1195. #
  1196. PORD = AORD;
  1197. IF AST$PANAM[AORD] NQ AST$SANAM[AORD]
  1198. THEN
  1199. BEGIN
  1200. FOR PORD = 0 STEP 1 WHILE
  1201. ((PORD LS ASTNUM) AND
  1202. (AST$SANAM[AORD] NQ AST$PANAM[PORD]))
  1203. DO
  1204. BEGIN
  1205. END
  1206. IF PORD EQ ASTNUM
  1207. THEN
  1208. BEGIN
  1209. PORD = AORD;
  1210. END
  1211. END
  1212. #
  1213. * CALLING APPL AST EXISTS.
  1214. * INSURE APPL UP AND OK.
  1215. * IF APPLICATION DOWN OR DISABLED OR NOT ACTIVE, SET THE
  1216. * NEXT ACTION TO ERRCHEK AND EXIT.
  1217. #
  1218. IF AST$DNF[AORD] OR
  1219. AST$DIF[AORD] OR
  1220. AST$JSN[AORD] EQ " "
  1221. THEN
  1222. BEGIN
  1223. ERRCODE = RCIA"APF";
  1224. NXTACT = S"SERRCHEK";
  1225. GOTO EXCHCLGAP;
  1226. END
  1227. #
  1228. * CALLING APPL OK SO FAR, START LIMIT CHECKS.
  1229. * CHECK NUMBER OF CONNECTIONS.
  1230. * IF CHECK FAILS, SET ERROR CODE, NEXT ACTION TO ERROR
  1231. * ACTION AND EXIT.
  1232. #
  1233. IF AST$MCN[AORD] LQ (AST$TACN[AORD] + AST$AACN[AORD]
  1234. + AST$RACN[AORD])
  1235. THEN
  1236. BEGIN
  1237. ERRCODE = RCIA"CAM";
  1238. NXTACT = S"SERRCHEK";
  1239. GOTO EXCHCLGAP;
  1240. END
  1241. #
  1242. * LIMIT CHECK NUMBER OF RETRY ATTEMPTS FOR CALLING APPLICATION
  1243. * IF CHECK FAILS, SET ERROR CODE, NEXT ACTION TO ERROR ACTION
  1244. * AND EXIT.
  1245. #
  1246. IF AST$RETRY[AORD] EQ AL
  1247. THEN
  1248. BEGIN
  1249. ERRCODE = RCIA"RLR";
  1250. NXTACT = S"SERRCHEK";
  1251. GOTO EXCHCLGAP;
  1252. END
  1253. #
  1254. * CALLING APPLICATION OK. SET THE PAAC ENTRY.
  1255. * SET CALLING APPL NAME, NUMBER AND SWITCHED APPL NAME
  1256. * AND NUMBER. SET NEXT ACTION TO SETNAM2 AND EXIT.
  1257. #
  1258.  
  1259. PA$IAPNM[PAC] = AST$ANAM[AORD];
  1260. PA$IAPAN[PAC] = AST$AN[AORD];
  1261. PA$SWAP[PAC] = AST$ANAM[AORD];
  1262. PA$SWAPAN[PAC] = AST$AN[AORD];
  1263. NXTACT = S"SSETNAM2";
  1264.  
  1265. EXCHCLGAP:
  1266.  
  1267. GOTO EXEC;
  1268.  
  1269. #
  1270.  ................................................................
  1271. #
  1272. CONTROL EJECT;
  1273.  
  1274. SETNAM2: # SET UP NAME 2 FOR OUTCALL SEARCH #
  1275.  
  1276. #
  1277. * THIS FUNCTION PERFORMS THE ACTIONS NEEDED TO SET UP THE NAME 2
  1278. * PARAMETER USED IN THE OUTCALL SEARCH.
  1279. #
  1280.  
  1281. #
  1282. * SET UP THE NAME2 (PID) VARIABLE SO THAT A VALID PID OR THE
  1283. * RECEIVED NAME2 PARAMETER IS SET IN THE PAAC ENTRY.
  1284. #
  1285. LPC$TEMP[0] = PA$RHID[PAC];
  1286. WORKB = FALSE;
  1287. IF (PA$UPID[PAC] NQ 0) OR
  1288. ((PA$UPID[PAC] EQ 0) AND (PA$ULID[PAC] NQ 0))
  1289. THEN
  1290. BEGIN
  1291. #
  1292. * AN ACPID TABLE ENTRY MUST EXIST.
  1293. * SET UP TO EXTRACT THE NEXT PID FROM THE ENTRY.
  1294. #
  1295. FOR XZ = 0 WHILE
  1296. (NOT WORKB AND PA$CUACPID[PAC] NQ 0)
  1297. DO
  1298. BEGIN
  1299. P<ACENT> = (P<ACPID> + PA$PIDBIAS[PAC] +
  1300. LPORD + PA$CUACPID[PAC]);
  1301. IF PA$UPID[PAC] NQ 0
  1302. THEN
  1303. BEGIN
  1304. #
  1305. * PID SPECIFIED.
  1306. * PID IN CR/IAP/R SM MUST MATCH A PID OF THE ENTRY AND THE
  1307. * PID MUST BE NAM ACCESSIBLE.
  1308. #
  1309. IF ((ACE$PID[0] EQ PA$PID[PAC]) AND
  1310. ACE$NAMAC[0])
  1311. THEN
  1312. WORKB = TRUE;
  1313. END
  1314. ELSE
  1315. BEGIN
  1316. #
  1317. * PID NOT SPECIFIED.
  1318. * CHECK IF NEXT PID IN ACPID ENTRY IS NAM ACCESSIBLE AND DOES NOT
  1319. * HAVE A LID STORE AND FORWARD ATTRIBUTE.
  1320. #
  1321. IF (ACE$NAMAC[0] AND
  1322. (NOT ACE$SF[0]))
  1323. THEN
  1324. WORKB = TRUE;
  1325. END
  1326. IF NOT WORKB
  1327. THEN
  1328. PA$CUACPID[PAC] = PA$CUACPID[PAC] - 1;
  1329. END
  1330. END
  1331. #
  1332. * RESTORE THE REMOTE HOST ID FROM WORK. EITHER BE A
  1333. * NEW PID FROM THE ACPID ENTRY OR THE PREVIOUS RHID VALUE
  1334. * OF THE CR/IAP/R SM.
  1335. #
  1336. IF WORKB
  1337. THEN
  1338. LPC$TEMP[0] = ACE$PID[0];
  1339.  
  1340. PA$RHID[PAC] = LPC$TEMP[0];
  1341. #
  1342. * IF OUTCALL PARAMETERS WERE SPECIFIED IN THE CR/IAP/R SM, THERE IS
  1343. * NO NEED TO PERFORM AN OUTCALL BLOCK SEARCH. SET THE NEXT ACTION
  1344. * TO FIND A PATH. OTHERWISE, SET THE NEXT ACTION TO FIND OUTCALL
  1345. * BLOCK.
  1346. #
  1347. IF PA$OUTSPEC[PAC]
  1348. THEN
  1349. BEGIN
  1350. NXTACT = S"SFINDPATH";
  1351. END
  1352. ELSE
  1353. BEGIN
  1354. NXTACT = S"SFINDOUT";
  1355. END
  1356.  
  1357. EXSETNAM2:
  1358.  
  1359. GOTO EXEC;
  1360. #
  1361.  .................................................................
  1362. #
  1363. CONTROL EJECT;
  1364.  
  1365. FINDPATH: # FIND APPROPRIATE PATH IN LLPID TABLE #
  1366.  
  1367. #
  1368. * THIS FUNCTION LOCATES AN APPROPRIATE PATH IN THE LLPID TABLE. IT
  1369. * STORES THE PATH INFORMATION IN THE OUTCALL BLOCK THAT WAS SUPPLIED
  1370. * BY THE CALLING APPLICATION IN THE CR/IAP/R.
  1371. #
  1372.  
  1373. PIDSLEFT = (PA$CUACPID[PAC] GR 0);
  1374. PATHFOUND = FALSE;
  1375.  
  1376. #
  1377. * LOOP THRU THE ACPID AND LLPID TABLES UNTIL EITHER A PATH IS FOUND,
  1378. * OR ALL THE PIDS IN THE ACPID TABLE HAVE BEEN EXHAUSTED.
  1379. #
  1380.  
  1381. FOR XZ = 0 WHILE
  1382. (NOT PATHFOUND) AND PIDSLEFT
  1383. DO
  1384. BEGIN
  1385. #
  1386. * LOOP THRU THE LLPID TABLE TO FIND A PID THAT MATCHES THE CURRENT
  1387. * PID.
  1388. #
  1389. FOR XZ = 0 WHILE
  1390. ((NOT PATHFOUND) AND
  1391. (PA$PIDCUR[PAC] LS LLPIDL))
  1392. DO
  1393. BEGIN
  1394. #
  1395. * LOCATE THE CURRENT LLPID ENTRY. IF THIS PID MATCHES THE
  1396. * CURRENT PID, THEN CHECK FOR AN AVAILABLE PATH.
  1397. #
  1398. P<PID> = P<LLPID> + PA$PIDCUR[PAC];
  1399. IF PID$PNAME[0] EQ PA$RHID[PAC]
  1400. THEN
  1401. BEGIN
  1402. #
  1403. * IF THE PID IS ACCESSABLE AND IF THE NEXT PATH EXISTS FOR
  1404. * THIS PID, COPY THE PATH INFORMATION FROM THE LLPID ENTRY
  1405. * INTO THE OUTCALL PORTION OF THE CR/IAP/R SM.
  1406. #
  1407.  
  1408. IF PA$PATHNXT[PAC] LS PID$LLCNT[0]
  1409. THEN
  1410. BEGIN
  1411. PATHFOUND = TRUE;
  1412. P<PATH> = P<PID> + ((PA$PATHNXT[PAC] * PIDLLSIZ$) + 1);
  1413. PA$PATHNXT[PAC] = PA$PATHNXT[PAC] + 1;
  1414. P<OUTCALL> = P<APOUTCL> + APO;
  1415. OUT$SNOD[0] = PATH$SN[0];
  1416. OUT$DNOD[0] = PATH$DN[0];
  1417. OUT$PORT[0] = PATH$PORT[0];
  1418. OUT$DTEL[0] = PATH$DTEL[0];
  1419. #
  1420. * MOVE THE DTE ADDRESS INTO THE OUTCALL BLOCK.
  1421. #
  1422. DTEBITS = OUT$DTEL[0] * 4;
  1423. EXORD = 1;
  1424. EXBIT = 0;
  1425. STORD = 4;
  1426. STBIT = 8;
  1427. TEMP = 0;
  1428. SSBEBF(PATH[0],EXORD,EXBIT,DTEBITS,TEMP);
  1429. SSBSBF(OUTCALL[0],STORD,STBIT,DTEBITS,TEMP);
  1430. IF (OUT$ABL[0] LQ 0 OR OUT$ABL[0] GR BLK$LMT)
  1431. OR (OUT$DBL[0] LQ 0 OR OUT$DBL[0] GR BLK$LMT)
  1432. OR (OUT$UBL[0] LQ 0 OR OUT$UBL[0] GR UBLK$LMT)
  1433. THEN
  1434. BEGIN
  1435. ERRCODE = RCIA"NPL"; # BAD NETWORK BLOCK VALUES #
  1436. NXTACT = S"SERRCHEK";
  1437. ERRACT = CONTACT;
  1438. GOTO EXFINDPATH;
  1439. END
  1440. END
  1441. ELSE
  1442. #
  1443. * A MATCHING PID EXISTS BUT IS EITHER INACCESSABLE, OR HAS NO
  1444. * MORE PATHS LEFT TO TRY. FORCE AN EXIT FROM THIS LOOP.
  1445. #
  1446. BEGIN
  1447. PA$PIDCUR[PAC] = LLPIDL;
  1448. END
  1449. END
  1450.  
  1451. ELSE
  1452. #
  1453. * THE LLPID PID DOES NOT MATCH THE CURRENT PID. MOVE TO THE
  1454. * NEXT LLPID ENTRY AND TRY AGAIN.
  1455. #
  1456. BEGIN
  1457. PA$PIDCUR[PAC] = PA$PIDCUR[PAC] +
  1458. ((PID$LLCNT[0] * PIDLLSIZ$) + 1);
  1459. END
  1460. END
  1461. #
  1462. * IF A PATH WAS NOT FOUND FOR THE CURRENT PID, GET THE NEXT
  1463. * AVAILABLE PID IN THE ACPID TABLE.
  1464. #
  1465. IF NOT PATHFOUND
  1466. THEN
  1467. BEGIN
  1468. FOUND = FALSE;
  1469. FOR AZ = 0 WHILE
  1470. PIDSLEFT AND (NOT FOUND)
  1471. DO
  1472. BEGIN
  1473. PA$CUACPID[PAC] = PA$CUACPID[PAC] - 1;
  1474. IF PA$CUACPID[PAC] GR 0
  1475. THEN
  1476. BEGIN
  1477. P<ACENT> = P<ACPID> + PA$PIDBIAS[PAC] +
  1478. LPORD + PA$CUACPID[PAC];
  1479. #
  1480. * IF A PID WAS SPECIFIED IN THE CR/IAP/R SM, THEN THE PID
  1481. * IN THE ACPID ENTRY MUST MATCH THE SM PID AND MUST BE NAM
  1482. * ACCESSABLE.
  1483. #
  1484. IF PA$UPID[PAC] NQ 0
  1485. THEN
  1486. BEGIN
  1487. IF (ACE$PID[0] EQ PA$PID[PAC]) AND
  1488. ACE$NAMAC[0]
  1489. THEN
  1490. BEGIN
  1491. FOUND = TRUE;
  1492. END
  1493. END
  1494. ELSE
  1495. #
  1496. * A PID WAS NOT SPECIFIED IN THE CR/IAP/R SM, SO THE ACPID
  1497. * NEED ONLY BE NAM ACCESSABLE AND MUST NOT HAVE A LID STORE
  1498. * AND FORWARD ATTRIBUTE.
  1499. #
  1500. BEGIN
  1501. IF (ACE$NAMAC[0] AND
  1502. (NOT ACE$SF[0]))
  1503. THEN
  1504. BEGIN
  1505. FOUND = TRUE;
  1506. END
  1507. END
  1508. END
  1509. ELSE
  1510. #
  1511. * ALL OF THE PIDS IN THE ACPID TABLE HAVE BEEN EXHAUSTED.
  1512. #
  1513. BEGIN
  1514. PIDSLEFT = FALSE;
  1515. END
  1516. END
  1517. #
  1518. * IF A MATCHING PID WAS FOUND IN THE ACPID TABLE, STORE THE
  1519. * NEWLY FOUND PID IN THE PAAC. INITIALIZE THE PATH AND PID
  1520. * COUNTERS.
  1521. #
  1522. IF FOUND
  1523. THEN
  1524. BEGIN
  1525. PA$RHID[PAC] = ACE$PID[0];
  1526. PA$PIDCUR[PAC] = 0;
  1527. PA$PATHNXT[PAC] = 0;
  1528. END
  1529. END
  1530. END
  1531. #
  1532. * IF A MATCHING PID WAS NOT FOUND IN THE ACPID TABLE, SET THE ERROR
  1533. * CODE, SET THE NEXT ACTION TO ERRCHEK, AND EXIT.
  1534. #
  1535. IF NOT PIDSLEFT
  1536. THEN
  1537. BEGIN
  1538. ERRCODE = RCIA"NPL";
  1539. NXTACT = S"SERRCHEK";
  1540. ERRACT = CONTACT;
  1541. GOTO EXFINDPATH;
  1542. END
  1543.  
  1544. NXTACT = S"SSENDIAPN";
  1545.  
  1546. EXFINDPATH:
  1547.  
  1548. GOTO EXEC;
  1549. #
  1550.  .......................................................................
  1551. #
  1552. CONTROL EJECT;
  1553.  
  1554. FINDOUT: # FIND APPROPRIATE OUTCALL BLOCK #
  1555.  
  1556. #
  1557. * THIS FUNCTION IS RESPONSIBLE FOR LOCATING THE APPROPRIATE
  1558. * OUTCALL BLOCK FOR THE CALL REQUEST.
  1559. * IF NO OUTCALL BLOCK FOUND THEN THE ERROR ACTION IS SET.
  1560. #
  1561.  
  1562. #
  1563. * PERFORM OUTCALL BLOCK SEARCH USING THE CURRENT PID VALUE IN
  1564. * PAAC ENTRY RHID UNTIL EITHER ALL OUTCALL BLOCKS ARE SCANNED
  1565. * WITHOUT A MATCH. IF NO MATCH OCCURS, ADVANCE TO THE NEXT PID
  1566. * VALUE FROM THE ACPID ENTRY. NOTE THAT ON THE FIRST ITERATION,
  1567. * THAT THE PID POINTING ALGORITHM WILL RESIDE ON THE FIRST PID
  1568. * ENTRY OF THE ACPID TABLE ENTRY.
  1569. #
  1570.  
  1571. PIDSLEFT = TRUE;
  1572. NOOUTBLK = TRUE;
  1573. IF (OUTRECL GR 0 AND
  1574. PA$URHID[PAC] NQ 0)
  1575. THEN
  1576. BEGIN
  1577.  
  1578. #
  1579. * OUTCALL SEARCH ONLY PERFORMED AT THIS STAGE IF OUTCALL
  1580. * BLOCKS EXIST AND THE NAME2 (PID) PARAMETER IS NON-ZERO.
  1581. #
  1582. FOR XZ= 0 WHILE
  1583. NOOUTBLK AND PIDSLEFT
  1584. DO
  1585. BEGIN
  1586.  
  1587. #
  1588. * CHECK IF OUTCALL BLOCKS EXHAUSTED FOR CURRENT PID.
  1589. #
  1590. IF PA$OUTNXT[PAC] GQ OUTRECL
  1591. THEN
  1592. BEGIN
  1593. #
  1594. * OUTCALL BLOCKS EXHAUSTED FOR CURRENT PID. ADVANCE TO NEXT PID
  1595. * AND START NEXT OUTCALL SEARCH.
  1596. #
  1597. PA$OUTNXT[PAC] = 0;
  1598.  
  1599. #
  1600. * REPEAT LOOP AS LONG AS OUTCALL BLOCK NOT FOUND AND PIDS
  1601. * ARE AVAILABLE.
  1602. #
  1603. IF PA$CUACPID[PAC] EQ 0
  1604. THEN
  1605. PIDSLEFT = FALSE;
  1606. ELSE
  1607. BEGIN
  1608. #
  1609. * PIDS STILL AVAILABLE.
  1610. * ADVANCE THE POINTERS TO THE NEXT ACTIVE PID ENTRY.
  1611. * PID ENTRY ONLY VALID IF-
  1612. * 1) NAM ACCESSIBLE AND REQUESTED PID ZERO AND NOT
  1613. * STORE/FORWARD LID TYPE.
  1614. * ** OR **
  1615. * 2) PID SPECIFIED AND EQUAL TO ACPID ENTRY PID AND
  1616. * ACPID ENTRY PID NAM ACCESSIBLE.
  1617. *
  1618. * IF NO PIDS LEFT, LEAVE THE LOOP.
  1619. #
  1620. WORKB = TRUE;
  1621. FOR AZ = 0 WHILE
  1622. WORKB AND PA$CUACPID[PAC] GR 0
  1623. DO
  1624. BEGIN
  1625. P<ACENT> = (P<ACPID> + PA$PIDBIAS[PAC]
  1626. + LPORD + PA$CUACPID[PAC]);
  1627.  
  1628. IF (ACE$NAMAC[0] AND
  1629. (PA$UPID[PAC] EQ 0) AND
  1630. (NOT ACE$SF[0]))
  1631. THEN
  1632. BEGIN
  1633. WORKB = FALSE;
  1634. END
  1635. IF (ACE$NAMAC[0] AND
  1636. (PA$UPID[PAC] NQ 0) AND
  1637. (PA$PID[PAC] EQ ACE$PID[0]))
  1638. THEN
  1639. BEGIN
  1640. WORKB = FALSE;
  1641. END
  1642. PA$CUACPID[PAC] = PA$CUACPID[PAC] - 1;
  1643. END
  1644.  
  1645. #
  1646. * IF PIDS EXHAUSTED, SET LOOP VARIABLES TO EXIT LOOP.
  1647. * OUTCALL SEARCH DONE, NO OUTCALL BLOCKS FOUND.
  1648. #
  1649. IF WORKB
  1650. THEN
  1651. PIDSLEFT = FALSE;
  1652. END
  1653.  
  1654. IF ((NOT PIDSLEFT) AND
  1655. ((PA$UPID[PAC] NQ 0) OR (PA$ULID[PAC] NQ 0)))
  1656. THEN
  1657. BEGIN
  1658. ERRCODE = RCIA"NOM";
  1659. NXTACT = S"SERRCHEK";
  1660. ERRACT = CONTACT;
  1661. GOTO EXFINDOUT;
  1662. END
  1663. #
  1664. * TO HERE, MUST HAVE FOUND AN OUTCALL BLOCK OR THE RHID IS 0.
  1665. * RESTORE THE RHID OF THE PAAC ENTRY.
  1666. #
  1667. IF WORKB
  1668. THEN
  1669. PA$RHID[PAC] = ACE$PID[0];
  1670. ELSE
  1671. PA$URHID[PAC] = PA$UPID[PAC];
  1672. END
  1673. #
  1674. * VALID PID SETTING ACCOMPLISHED. SCAN THE OUTCALL BLOCKS
  1675. * FOR A MATCH ON THE REQUESTED APPLICATION NAME, THE RHID AND THE
  1676. * SECURITY LEVEL.
  1677. #
  1678. FOR J = 0 WHILE
  1679. (NOOUTBLK AND (PA$OUTNXT[PAC] LS OUTRECL))
  1680. DO
  1681. BEGIN
  1682.  
  1683. #
  1684. * SET THE CURRENT OUTCALL BLOCK RELETIVE WORD LOCATION
  1685. * TO THE NEXT VALUE. POINT THE LOCAL OUTCALL BLOCK TEMPLATE
  1686. * TO THE BEGINNING OF THE OUTCALL RECORD PLUS THE CURRENT
  1687. * DISPLACEMENT VALUE.
  1688. * SET THE NEXT DISPLACEMENT VALUE TO THE CURRENT VALUE PLUS
  1689. * THE WORD COUNT OF THE CURRENT ENTRY SO AS TO BE POINTED TO THE
  1690. * NEXT OUTCALL BLOCK OF THE RECORD.
  1691. #
  1692. PA$OUTCUR[PAC] = PA$OUTNXT[PAC];
  1693. P<OUTCALL> = (P<OUTREC> + PA$OUTCUR[PAC]);
  1694. PA$OUTNXT[PAC] = PA$OUTNXT[PAC] + OUT$WC[0];
  1695.  
  1696. IF ((OUT$NM1[0] EQ PA$RAPNM[PAC]) AND
  1697. (OUT$NM2[0] EQ PA$RHID[PAC]) AND
  1698. (OUT$SL[0] LQ AST$AAL[AORD]))
  1699. THEN
  1700. BEGIN
  1701. NOOUTBLK = FALSE;
  1702. PA$NUMOUT[PAC] = PA$NUMOUT[PAC] + 1;
  1703. END
  1704. END
  1705. END
  1706. END
  1707. #
  1708. * OUTCALL SEARCH COMPLETE. SET NEXT ACTION TO CHSHOST.
  1709. #
  1710. NXTACT = S"SCHSHOST";
  1711.  
  1712. EXFINDOUT:
  1713.  
  1714.  
  1715. GOTO EXEC;
  1716.  
  1717. #
  1718.  .................................................................
  1719. #
  1720. CONTROL EJECT;
  1721.  
  1722. CHSHOST: # CHECK FOR SINGLE HOST OUTCALL REQUEST #
  1723.  
  1724. #
  1725. * THIS FUNCTION IS RESPONSIBLE FOR CHECKING IF A REQUEST DOES
  1726. * QUALIFY FOR A SINGLE HOST CALL IF NO OUTCALL WAS FOUND.
  1727. * IN THE EVENT THAT NO OUTCALL BLOCK FOUND AND THE CALL REQUEST
  1728. * QUALIFIES FOR SINGLE HOST, THEN THE HARDCODED SINGLE HOST
  1729. * OUTCALL BLOCK IS SET AND USED FOR THE CALL.
  1730. *
  1731. * IF THE CALL DOES NOT QUALIFY FOR SINGLE HOST AND THERE ARE
  1732. * NO OUTCALL BLOCKS THAT QUALIFY, THEN THE ERROR CODE IS SET
  1733. * AND THE NEXT ACTION IS SET ERRCHEK, THE ERROR ACTION IS SET
  1734. * TO THE CONTROLLING ACTION (CONTACT) AND AN EXIT IS MADE.
  1735. *
  1736. #
  1737. ERRCODE = OK$;
  1738. IF NOOUTBLK
  1739. THEN
  1740. BEGIN
  1741.  
  1742. #
  1743. * CHECK IF AT LEAST 1 OUTCALL MATCH OCCURRED. IF SO THEN
  1744. * IT MEANS THAT AT LEAST 1 OUTCALL ATTEMPT FAILED. SET ERROR
  1745. * CODE, NEXT ACTION TO ERRCHEK, ERROR ACTION TO SGETSM.
  1746. #
  1747. IF PA$NUMOUT[PAC] NQ 0
  1748. THEN
  1749. BEGIN
  1750. ERRCODE = RCIA"ANA";
  1751. END
  1752. ELSE
  1753. #
  1754. * NEVER MATCHED ON AN OUTCALL BLOCK.
  1755. #
  1756. BEGIN
  1757. IF PA$SMAN[PAC] EQ 0
  1758. THEN
  1759. #
  1760. * SECONDARY CR/IAP/R SM. A SINGLE HOST OUTCALL HAS ALREADY
  1761. * FAILED ONCE TO CONNECT. SET ERROR CODE, ACTIONS, ETC.
  1762. #
  1763. ERRCODE = RCIA"DRJ";
  1764. ELSE
  1765. #
  1766. * FIRST TIME OCCURRENCE FOR CR/IAP/R SM.
  1767. * CHECK IF RHID IS ZERO FOR SINGLE HOST REQUEST.
  1768. #
  1769. BEGIN
  1770. IF PA$UPID[PAC] EQ 0 AND PA$ULID[PAC] EQ 0
  1771. THEN
  1772. #
  1773. * CALL REQUEST IS SINGLE HOST. SET OUTCALL BLOCK TO THE
  1774. * SINGLE HOST OUTCALL BLOCK AND SET PAAC OUTCALL VALUES.
  1775. #
  1776. BEGIN
  1777. P<OUTCALL> = LOC(SHOSTOUT);
  1778. PA$OUTNXT[PAC] = OUTRECL;
  1779. PA$NUMOUT[PAC] = 1;
  1780.  
  1781. #
  1782. * THE SINGLE HOST OUTCALL BLOCK IS TO BE USED SINCE
  1783. * THERE HAS NEVER BEEN AN OUTCALL BLOCK MATCH AND THE
  1784. * REQUEST IS FOR A HOST RESIDENT APPLICATION.
  1785. *
  1786. * INITIALIZE THE CALL USER DATA FIELD OF THE SINGLE
  1787. * HOST OUTCALL BLOCK WITH THE ASCII EQUIVALENT OF THE
  1788. * ZERO PRID AND THE SOURCE NODE, DESTINATION NODE AND
  1789. * REQUESTED APPLICATION NAME FIELDS OF THE CR/IAP/R SM.
  1790. #
  1791.  
  1792. SH$UDL[0] = SHUDL$;
  1793. ZCHAR = O"33";
  1794. ZCHAR = SSDCDA(ZCHAR);
  1795. STORD = PRIDWORD$;
  1796. STBIT = PRIDBORD$;
  1797. #
  1798. * STORE NINE ASCII ZERO CHARS FOR PRID (4),
  1799. * DESTINATION HOST (2), SOURCE NODE (3).
  1800. #
  1801. FOR J = 1 STEP 1 UNTIL 9
  1802. DO
  1803. BEGIN
  1804. SSBSBF(SHOSTOUT[0],STORD,STBIT,8,ZCHAR);
  1805. END
  1806. #
  1807. * CONVERT REQUESTED APPLICATION NAME AND STORE INTO THE
  1808. * SINGLE HOST OUTCALL BLOCK.
  1809. #
  1810. EXORD = 0;
  1811. EXBIT = 0;
  1812. STORD = APWORD$;
  1813. STBIT = APBORD$;
  1814. #
  1815. * CONVERT AND STORE ASCII APPLICATION NAME INTO SHOST OUTCALL
  1816. * BLOCK.
  1817. #
  1818. L = PA$WORD3[PAC];
  1819. FOR J = 1 STEP 1 UNTIL 7
  1820. DO
  1821. BEGIN
  1822. SSBEBF(L,EXORD,EXBIT,6,ZCHAR);
  1823. ZCHAR = SSDCDA(ZCHAR);
  1824. SSBSBF(SHOSTOUT[0],STORD,STBIT,8,ZCHAR);
  1825. END
  1826. END
  1827. ELSE
  1828. #
  1829. * CALL REQUEST DOES NOT QUALIFY FOR SINGLE HOST.
  1830. * SET ERROR CODE.
  1831. #
  1832. ERRCODE = RCIA"NOM";
  1833. END
  1834. END
  1835. END
  1836. #
  1837. * CHECK ERRCODE. IF NOT OK, SET NEXT ACTION FOR ERRCHEK, SET
  1838. * ERROR ACTION TO CONTROLLING ACTION AND EXIT.
  1839. #
  1840. IF ERRCODE NQ OK$
  1841. THEN
  1842. BEGIN
  1843. NXTACT = S"SERRCHEK";
  1844. ERRACT = CONTACT;
  1845. END
  1846. ELSE
  1847. #
  1848. * EVERYTHING OK TO HERE. SET NEXT ACTION TO SEND CR/IAP/N SM.
  1849. #
  1850. NXTACT = S"SSENDIAPN";
  1851.  
  1852. GOTO EXEC;
  1853.  
  1854. #
  1855.  ..........................................................
  1856. #
  1857. CONTROL EJECT;
  1858.  
  1859. SENDIAPN: # FORMAT AND SEND THE CR/AIP/N SM #
  1860.  
  1861. #
  1862. * THIS FUNCTION FORMATS THE CR/IAP/N SM.
  1863. * THIS FUNCTION INVOKES THE MOVEDTE, MOVEFAC AND MOVECUD
  1864. * FUNCTIONS. ORIGIN OF CALLER INTO THIS FUNCTION IS DETERMINED
  1865. * FROM THE OLD ACTION (OLDACT SET BY THE EXEC).
  1866. #
  1867. IF OLDACT NQ S"SMOVEDTE" AND
  1868. OLDACT NQ S"SMOVEFAC" AND
  1869. OLDACT NQ S"SMOVECUD"
  1870. THEN
  1871. BEGIN
  1872. #
  1873. * INITIALIZE THE MSGBUF STORAGE AREA.
  1874. #
  1875. FOR J = 0 STEP 1 UNTIL NMSGBUF$
  1876. DO
  1877. BEGIN
  1878. MSG$WORD[J] = 0;
  1879. END
  1880.  
  1881. #
  1882. * INITIAL ENTRY INTO THIS FUNCTION.
  1883. * SET FIELDS OF THE CR/AIP/N SM FROM THE OUTCALL BLOCK AND
  1884. * PAAC ENTRY.
  1885. #
  1886. PFCSFC[1] = CRIAPN;
  1887. CRALN[1] = 1;
  1888. CRACN[1] = PA$NACN[PAC];
  1889. CRICT[1] = CT6DISPLAY;
  1890. CRVCB[1] = PA$VCB[PAC];
  1891. SPMSG1[1] = OUT$WRD2[0];
  1892. CRADBZ[1] = OUT$DBZ[0];
  1893. CRAABL[1] = OUT$ABL[0];
  1894. CRASNOD[1] = OUT$SNOD[0];
  1895. CRADNOD[1] = OUT$DNOD[0];
  1896. CRIWS[1] = OUT$WS[0];
  1897. CRIDPLS[1] = OUT$DPLS[0];
  1898. #
  1899. * MUST MOVE THE DTE ADDRESSES INTO THE SM AREA.
  1900. * SET NEXT ACTION TO S"SMOVEDTE" AND EXIT.
  1901. #
  1902. NXTACT = S"SMOVEDTE";
  1903. RETACT = S"SSENDIAPN";
  1904. GOTO EXSENDIAPN;
  1905. END
  1906. #
  1907. * CHECK IF RETURN FROM MOVEDTE.
  1908. * IF SO, THEN NEXT ACTION IS TO MOVE FACILITIES INTO SM AREA.
  1909. * SET NEXT ACTION TO S"SMOVEFAC", RETURN ACTION TO S"SSENDIAPN",
  1910. * AND EXIT.
  1911. #
  1912. IF OLDACT EQ S"SMOVEDTE"
  1913. THEN
  1914. BEGIN
  1915. NXTACT = S"SMOVEFAC";
  1916. RETACT = S"SSENDIAPN";
  1917. GOTO EXSENDIAPN;
  1918. END
  1919. #
  1920. * CHECK IF RETURN FROM MOVEFAC.
  1921. * IF SO, NEXT ACTION IS TO MOVE CALL USER DATA INTO THE SM AREA.
  1922. #
  1923. IF OLDACT EQ S"SMOVEFAC"
  1924. THEN
  1925. BEGIN
  1926. NXTACT = S"SMOVECUD";
  1927. RETACT = S"SSENDIAPN";
  1928. GOTO EXSENDIAPN;
  1929. END
  1930. #
  1931. * CHECK IF RETURN FROM MOVECUD.
  1932. * IF SO, THEN CR/IAP/N IS READY TO SEND TO CONNECTION TRAFFIC
  1933. * QUEUE (CTQ).
  1934. #
  1935. IF OLDACT EQ S"SMOVECUD"
  1936. THEN
  1937. BEGIN
  1938. #
  1939. * DETERMINE THE TOTAL NUMBER OF OCTETS FOR THE WHOLE CR/IAP/N.
  1940. * THE FIXED LENGTH PART OF THE SM CONSISTS OF THE FIRST TWO
  1941. * WORDS THE FIRST 32 BITS OF THE 3RD WORD, A TOTAL OF 152 BITS.
  1942. * THE VARIABLE LENGTH PORTION OF THE SM IS THE SUM OF DTEBITS,
  1943. * FACBITS, AND UDATBITS. 7 BITS ARE ADDED TO THE TOTAL BEFORE
  1944. * IT IS DEVIDED BY 8 JUST FOR ROUNDING PURPOSE.
  1945. #
  1946. CRIOCTN[1] = (152 + DTEBITS + FACBITS + UDATBITS + 7) / 8;
  1947.  
  1948. #
  1949. * DETERMINE TOTAL LENGTH OF CR/IAP/R SM.
  1950. #
  1951.  
  1952. NUMBITS = (DTEBITS + FACBITS + UDATBITS -28 + 59);
  1953. LENIAPN = ((NUMBITS / 60) + 3);
  1954.  
  1955. #
  1956. * SEND THE CR/IAP/N SM TO THE OTQ, BYPASSING THE CTQ.
  1957. #
  1958.  
  1959. WCB$WORD[0] = 0;
  1960. WCB$WC[0] = LENIAPN + 2;
  1961.  
  1962. ABHWORD[0] =0;
  1963. ABHABT[0] = APPCMD;
  1964. ABHADR[0] = 0;
  1965. ABHTLC[0] = LENIAPN;
  1966. ABHACT[0] = 1;
  1967.  
  1968. SSTAQE (P<OTQ>, WCBUF, ABHBUF, APSM[1]);
  1969.  
  1970. #
  1971. * CHANGE ACN STATE FROM CREATE TO ACTIVE.
  1972. #
  1973. ACNN = PA$NACN[PAC];
  1974. NVFCFCE (ACNN,AE,NEWACN);
  1975. IF NEWACN # COULD NOT FIND ACN ENTRY, SERIOUS PROBLEM #
  1976. THEN
  1977. BEGIN
  1978. $BEGIN
  1979. TBL$NAME[0] = "ACN";
  1980. MESSAGE(TBLMSG,0);
  1981. ABORT;
  1982. $END
  1983. END
  1984. ELSE # ACN ENTRY EXIST, UPDATE ITS STATE #
  1985. ACN$STATE[AE] = ACNST"ACTIVE";
  1986.  
  1987. #
  1988. * POST INFO TO THE PAAC ENTRY.
  1989. #
  1990. PA$FAM[PAC] = " ";
  1991. PA$USER[PAC] = " ";
  1992. PA$SNODE[PAC] = OUT$SNOD[0];
  1993. PA$DNOD[PAC] = OUT$DNOD[0];
  1994. #
  1995. * FUNCTION COMPLETE. SET NEXT ACTION TO SEND CR/SWH/R SM.
  1996. #
  1997. NXTACT = S"SSENDSWH";
  1998. END
  1999.  
  2000. EXSENDIAPN:
  2001.  
  2002. GOTO EXEC;
  2003. #
  2004.  .............................................................
  2005. #
  2006. CONTROL EJECT;
  2007.  
  2008. MOVEDTE: # MOVE DTE ADDRESS INFO INTO CR/IAP/N SM #
  2009.  
  2010. #
  2011. * THIS FUNCTION MOVES THE DTE ADDRESS INFO INTO THE CR/IAP/N SM.
  2012. #
  2013.  
  2014. #
  2015. * INITIALIZE THE WORD AND BIT LOCATIONS FOR STORING.
  2016. #
  2017. EXORD = 4;
  2018. EXBIT = 0;
  2019. #
  2020. * CALCULATE NUMBER OF BITS IN CALLED DTE ADDRESS FIELD.
  2021. * NOTE THAT THE LENGTH IS THE NUMBER OF SEMI-OCTETS (4 BIT
  2022. * QUANITIES).
  2023. #
  2024.  
  2025. DTEBITS = 8 + (((OUT$DTEL[0] + 1)/2)*2)*4;
  2026. STORD = DTEASW$;
  2027. STBIT = DTEASB$;
  2028.  
  2029. #
  2030. * MOVE CALLED DTE ADDRESS LENGTH AND ADDRESS INTO SM
  2031. #
  2032.  
  2033. J = DTEBITS;
  2034. TEMP = 0;
  2035. FOR I = 0 WHILE J GR 0
  2036. DO
  2037. BEGIN
  2038. IF J GR 60
  2039. THEN
  2040. BEGIN
  2041. J = J - 60;
  2042. K = 60;
  2043. END
  2044. ELSE
  2045. BEGIN
  2046. K = J;
  2047. J = 0;
  2048. END
  2049. SSBEBF(OUTCALL[0],EXORD,EXBIT,K,TEMP);
  2050. SSBSBF(APSM[1],STORD,STBIT,K,TEMP);
  2051. TEMP = 0;
  2052. END
  2053. #
  2054. * RETURN VIA THE RETURN ACTION DICTATED.
  2055. #
  2056. NXTACT = RETACT;
  2057. GOTO EXEC;
  2058. #
  2059.  ..................................................................
  2060. #
  2061. CONTROL EJECT;
  2062.  
  2063. MOVEFAC: # MOVE FACILITY CODE/PARAMETER GROUPS INTO SM. #
  2064.  
  2065. #
  2066. * THIS FUNCTION IS RESPONSIBLE FOR MOVING THE FACILITY CODES
  2067. * FROM THE OUTCALL BLOCK INTO THE SM.
  2068. #
  2069.  
  2070. #
  2071. * SAVE THE WORD AND BIT LOCATIONS
  2072. * WHERE THE YET TO BE DETERMINED FACILITY LENGTH WILL BE
  2073. * INSERTED INTO THE CALL REQUEST PACKET PORTION OF THE SM.
  2074. #
  2075. FACLORD = STORD;
  2076. FACLBIT = STBIT;
  2077. FCL$LEN[0] = 0;
  2078. #
  2079. * ADVANCE THE STORE WORD AND BIT LOCATIONS BEYOND THE FACILITY
  2080. * LENGTH LOCATION TO WHERE THE ACTUAL FACILITY CODE PAIRS ARE
  2081. * TO BE INSERTED.
  2082. #
  2083. SSBSBF(APSM[1],STORD,STBIT,8,TEMP);
  2084. #
  2085. * ONLY IF FACILITIES DEFINED,
  2086. * MOVE FACILITY CODE PAIRS SERIALLY INTO THE SM FROM THE
  2087. * OUTCALL BLOCK. ACCUMULATE THE FACILITY OCTET LENGTH.
  2088. #
  2089.  
  2090. P<OCFAC> = (P<OUTCALL> + 6);
  2091. P<OCUDATA> = (P<OUTCALL> + 6);
  2092. FACBITS = 0;
  2093. IF OUT$FACNUM[0] NQ 0
  2094. THEN
  2095. BEGIN
  2096. #
  2097. * AT LEAST 1 FACILITY CODE DEFINED FOR OUTCALL.
  2098. #
  2099. FOR J = 0 STEP 1 UNTIL (OUT$FACNUM[0] - 1)
  2100. DO
  2101. BEGIN
  2102. EXORD = 0;
  2103. EXBIT = 8;
  2104. K = (P<OCFAC> + J);
  2105. P<OCFAC> = K;
  2106. FCL$LEN[0] = FCL$LEN[0] + OCF$LEN[0];
  2107. NUMBITS = (OCF$LEN[0] *4);
  2108. FACBITS = FACBITS + NUMBITS;
  2109. SSBEBF(OCFAC[0],EXORD,EXBIT,NUMBITS,TEMP);
  2110. SSBSBF(APSM[1],STORD,STBIT,NUMBITS,TEMP);
  2111. END
  2112.  
  2113. #
  2114. * FACILITY CODE PAIRS ARE STORED IN SM AREA. NOW STORE THE
  2115. * FACILITY LENGTH (OCTET LENGTH) AFTER CALCULATING SINCE THE
  2116. * LENGTH TO NOW IS A SEMI-OCTET LENGTH.
  2117. #
  2118.  
  2119. P<OCUDATA> = (P<OCFAC> + 1);
  2120. END
  2121.  
  2122. TEMP = (FCL$LEN[0] / 2);
  2123. SSBSBF(APSM[1],FACLORD,FACLBIT,8,TEMP);
  2124. FACBITS = FACBITS + 8;
  2125. #
  2126. * FACILITY CODES MOVED. RETURN VIA THE RETURN ACTION.
  2127. #
  2128. NXTACT = RETACT;
  2129. GOTO EXEC;
  2130. #
  2131.  ...............................................................
  2132. #
  2133. CONTROL EJECT;
  2134.  
  2135. MOVECUD: # MOVE CALL USER DATA INTO SM FROM OUTCALL BLOCK #
  2136.  
  2137. #
  2138. * THIS FUNCTION MOVES THE CALL USER DATA FROM THE OUTCALL BLOCK
  2139. * INTO THE CR/IAP/N SM.
  2140. #
  2141.  
  2142. #
  2143. * MOVE CALL USER DATA WITH PRID FIELD INTO SM AREA. THE STORE
  2144. * WORD AND BIT LOCATIONS ARE STILL INTACT.
  2145. * CALCULATE NUMBER OF BITS TO STORE FOR CALL USER DATA.
  2146. * USE CALL USER DATA LENGTH (SEMI-OCTETS) TIMES 4 PLUS THE
  2147. * PRID LENGTH (32 BITS).
  2148. #
  2149. UDATBITS = ((OUT$UDL[0] *4) + 32);
  2150. #
  2151. * CALCULATE THE OCTET LENGTH OF CALL USER DATA.
  2152. #
  2153.  
  2154. CUDL = (OUT$UDL[0] / 2) + 4;
  2155. #
  2156. * MOVE CALL USER DATA PREFIXED BY THE PRID FIELD.
  2157. #
  2158. J = UDATBITS;
  2159. TEMP = 0;
  2160. FOR I = 0 STEP 1 WHILE J GR 0
  2161. DO
  2162. BEGIN
  2163. K = 60;
  2164. IF J GR 60
  2165. THEN
  2166. J = J - 60;
  2167. ELSE
  2168. J = 0;
  2169. #
  2170. * STORE OCTET LENGTH OF CALL USER DATA INTO LAST OCTET OF
  2171. * THE PRID FIELD OF THE CALL USER DATA.
  2172. #
  2173.  
  2174. IF I EQ 0
  2175. THEN
  2176. OCU$CUDL[I] = CUDL;
  2177.  
  2178. TEMP = OCU$WORD[I];
  2179. SSBSBF(APSM[1],STORD,STBIT,K,TEMP);
  2180. TEMP = 0;
  2181. END
  2182. #
  2183. * RETURN VIA THE RETURN ACTION.
  2184. #
  2185. NXTACT = RETACT;
  2186. GOTO EXEC;
  2187. #
  2188.  ..........................................................
  2189. #
  2190. CONTROL EJECT;
  2191.  
  2192. SENDSWH: # SEND THE CR/SWH/R SM #
  2193.  
  2194. #
  2195. * THIS FUNCTION FORMATS AND SENDS THE CR/SWH/R SM TO THE CTQ.
  2196. #
  2197.  
  2198. #
  2199. * SET UP THE CR/SWH/R SM.
  2200. #
  2201. FOR J = MSBFNVL STEP 1 UNTIL NMSGBUF$
  2202. DO
  2203. BEGIN
  2204. MSG$WORD[J] = 0;
  2205. END
  2206. #
  2207. * SET UP THE HOST TYPE TO CALLING HOST FOR WHEN THE CR/ACC RETURNS.
  2208. * SET THE SWITCH SM VALUES.
  2209. #
  2210.  
  2211. PFCSFC[1] = CRSWH;
  2212. CRSNAME[1] = PA$RAPNM; # CALLED APPLICATION NAME #
  2213. CRNACN[1] = PA$NACN[PAC];
  2214. CRABL[1] = OUT$ABL[0];
  2215. #
  2216. * SET THE DEVICE TYPE DEPENDING ON IF THE REMOTE HOST ID IS
  2217. * ZERO (SAME HOST) OR NON-ZERO.
  2218. #
  2219. IF (PA$SNODE[PAC] EQ 0 AND PA$DNOD[PAC] EQ 0)
  2220. THEN
  2221. BEGIN
  2222. CRDT[1] = DT$INTA;
  2223. END
  2224. ELSE
  2225. BEGIN
  2226. CRDT[1] = DT$INTE;
  2227. END
  2228. #
  2229. * FINISH SETTING UP THE CR/SWH/R SM.
  2230. #
  2231. CRSWSL[1] = OUT$SL[0];
  2232. CRSWHID[1] = PA$URHID[PAC];
  2233. CRSWDBZ[1] = OUT$DBZ[0];
  2234. CRSWUBZ[1] = OUT$UBZ[0];
  2235. CRSWAN[1] = PA$IAPAN[PAC];
  2236. #
  2237. * MOVE CALL USER DATA AND CALL USER DATA LENGTH FROM THE OUTCALL
  2238. * BLOCK INTO THE SM AREA. INITIALIZE THE WORD AND BIT LOCATIONS
  2239. * FOR STORING THE DATA. INITIALIZE THE NUMBER OF BITS TO MOVE.
  2240. #
  2241. CRSWUDL[1] = OCU$CUDL[0];
  2242. STORD = 4;
  2243. STBIT = 0;
  2244. K = 60;
  2245. J = UDATBITS;
  2246. TEMP = 0;
  2247. FOR I = 0 STEP 1 WHILE J GR 0
  2248. DO
  2249. BEGIN
  2250. IF J GR 60
  2251. THEN
  2252. BEGIN
  2253. J = J - 60;
  2254. END
  2255. ELSE
  2256. BEGIN
  2257. J = 0;
  2258. END
  2259. TEMP = OCU$WORD[I];
  2260. SSBSBF(APSM[1],STORD,STBIT,K,TEMP);
  2261. TEMP = 0;
  2262. END
  2263. #
  2264. * SEND THE SWITCH SM TO THE CTQ.
  2265. #
  2266.  
  2267. NVFUMQE(P<CTQ>,APSM[1],APPPR$,0,LCRSWH);
  2268.  
  2269. #
  2270. * SAVE THE CONNECT TIME IN THE PAAC ENTRY.
  2271. #
  2272. PA$CNTIME[PAC] = CTM$PDT[0];
  2273. #
  2274. * INCREMENT NUMBER OF CONNECTIONS TO CALLING APPLICATION. IF THIS
  2275. * APPL IS A SECONDARY APPL, INCREMENT NUMBER OF CONNECTIONS TO THE
  2276. * PRIMARY APPL. CLEAR RETRY COUNT SINCE SUCCESSFUL CONNECTION.
  2277. #
  2278. AST$AACN[AORD] = AST$AACN[AORD] + 1;
  2279. IF AORD NQ PORD
  2280. THEN
  2281. BEGIN
  2282. AST$AACN[PORD] = AST$AACN[PORD] + 1;
  2283. END
  2284. AST$RETRY[AORD] = 0;
  2285. #
  2286. * SET NEXT ACTION TO THE CONTROLLING ACTION.
  2287. #
  2288. NXTACT = CONTACT;
  2289. GOTO EXEC;
  2290.  
  2291. #
  2292.  .................................................................
  2293. #
  2294. CONTROL EJECT;
  2295.  
  2296. ERRCHEK: # PERFORM ERROR CHECKS #
  2297.  
  2298. #
  2299. * THIS FUNCTION IS RESPONSIBLE FOR CHECKING IF ERRORS OCCURRED
  2300. * AND TO ISSUE THE APPROPRIATE ACCOUNTING MESSAGE AND CR/IAP/A
  2301. * SM RESPONSE IF NEEDED.
  2302. #
  2303.  
  2304. #
  2305. * IF AN ERROR HAS OCCURRED, ISSUE A CR/IAP/A SM, ISSUE AN ACCOUNT
  2306. * MESSAGE IF NEEDED, CLEAR THE ASSIGNED VCB AND PAAC ENTRY IF THEY
  2307. * EXIST.
  2308. #
  2309. IF ERRCODE NQ OK$
  2310. THEN
  2311. BEGIN
  2312.  
  2313. #
  2314. * IF THE SECONDARY ERROR CODE IS NOT OK, THEN THE REASON CODE
  2315. * FROM THE PAAC ENTRY IS TO BE USED.
  2316. #
  2317. IF ((ERRCODE2 EQ SEESM$) AND (ERRCODE NQ RCIA"APF"))
  2318. THEN
  2319. ERRCODE = PA$IAPRC[PAC];
  2320. #
  2321. * IF AN INVALID REQUEST ERROR, THEN ISSUE THE ABEA ACCOUNT MESSAGE
  2322. * AND CHARGE THE CALLING APPLICATION WITH AN ATTEMPT (RETRY).
  2323. #
  2324. IF (ERRCODE EQ RCIA"ANP" OR
  2325. ERRCODE EQ RCIA"NPL" OR
  2326. ERRCODE EQ RCIA"NOM" OR
  2327. ERRCODE EQ RCIA"AND") AND
  2328. PACDEF
  2329. THEN
  2330. BEGIN
  2331. MTYP = ABEA$;
  2332. NVFAIAM(PAC,MTYP);
  2333. AST$RETRY[AORD] = AST$RETRY[AORD] + 1;
  2334. END
  2335. #
  2336. * IF THE RETRY LIMIT REACHED ERROR OCCURRED, THEN ISSUE THE ABRE
  2337. * ACCOUNT MESSAGE.
  2338. #
  2339. IF ERRCODE EQ RCIA"RLR" AND PACDEF
  2340. THEN
  2341. BEGIN
  2342. MTYP = ABRE$;
  2343. NVFAIAM(PAC,MTYP);
  2344. END
  2345. #
  2346. * ISSUE THE CR/IAP/A SM.
  2347. #
  2348. SPMSG0[0] = 0;
  2349. PFCSFC[0] = CRIAP;
  2350. IF PACDEF
  2351. THEN
  2352. BEGIN
  2353. CRNACN[0] = PA$NACN[PAC];
  2354. END
  2355. ELSE
  2356. BEGIN
  2357. CRNACN[0] = NACN;
  2358. END
  2359. EB[0] = TRUE;
  2360. CRRIAP[0] = ERRCODE;
  2361. NVFUMQE(P<CTQ>,APSM[0],APPPR$,0,LCRIAPA);
  2362. #
  2363. * IF AN AST ENTRY EXISTS, CALL NVFSCAD TO COMPLETE APPLICATION
  2364. * DEPARTURE, IF NECESSARY.
  2365. #
  2366. IF AORD NQ ASTNUM
  2367. THEN
  2368. BEGIN
  2369. NVFSCAD(AORD);
  2370. END
  2371. #
  2372. * IF PAC ENTRY EXISTS, CALL NVFACTC TO RELEASE PAAC ENTRY,
  2373. * ACPID ENTRY TABLE SPACE, APOUTCL ENTRY, AND VCB IF DEFINED.
  2374. #
  2375. IF PACDEF
  2376. THEN
  2377. NVFACTC(PAC,VCBDEF);
  2378. END
  2379.  
  2380.  
  2381. #
  2382. * RETURN VIA THE ERROR ACTION.
  2383. #
  2384. NXTACT = ERRACT;
  2385. GOTO EXEC;
  2386. #
  2387.  .............................................................
  2388. #
  2389. CONTROL EJECT;
  2390.  
  2391. EXIT: # EXIT THE NVFAIAP PROCEDURE #
  2392.  
  2393. RETURN;
  2394.  
  2395. END # NVFAIAP #
  2396. TERM
cdc/nos2.source/nam5871/nvfaiap.txt ยท Last modified: 2023/08/05 17:22 by Site Administrator