User Tools

Site Tools


cdc:nos2.source:nam5871:nvfarap

NVFARAP

Table Of Contents

  • [00009] PROC NVFARAP
  • [00010] NVFARAP - PROCESS A-A INCALL REQUESTS.
  • [00014] PROCESS A-A INCALL REQUEST SMS.
  • [00060] PROC SSTRQE
  • [00061] PROC SSTATS
  • [00062] PROC NVFUAFV
  • [00063] PROC NVFUMQE
  • [00064] PROC NVFUFVO
  • [00065] PROC NVFAIAM
  • [00066] PROC SSBEBF
  • [00067] PROC SSBSBF
  • [00068] FUNC SSDCAD
  • [00069] PROC SSTRTS
  • [00070] PROC NVFUCRS
  • [00071] PROC SSCATR
  • [00072] PROC MESSAGE
  • [00073] PROC ABORT
  • [00074] PROC SSTAQE
  • [00075] PROC NVFCFCE
  • [00321] TMBBUF - TIMER REQUEST BUFFER.
  • [00340] TBLMSG - MISSING TABLE MESSAGE.
  • [00354] PROC DISSECT
  • [00355] DISSECT - DISSECT THE CR/RAP/R SM.
  • [00755] PROC CHEKFAC(PC)
  • [00756] CHEKFAC - CHECK FACILITIES

Source Code

NVFARAP.txt
  1. *DECK NVFARAP
  2. USETEXT TXINAA
  3. USETEXT TEXTNVF
  4. USETEXT TEXTSS;
  5. USETEXT TXTANVF;
  6. USETEXT TXSMNVF;
  7. USETEXT TXTAPSS;
  8. USETEXT TXTSUSS;
  9. PROC NVFARAP;
  10. # TITLE NVFARAP - PROCESS A-A INCALL REQUESTS. #
  11. BEGIN #NVFARAP#
  12.  
  13. #
  14. ** NVFARAP - PROCESS A-A INCALL REQUEST SMS.
  15. *
  16. * C. BRION 82/10/01. 83/04/19. 83/05/12.
  17. *
  18. * THE FUNCTION OF THIS PROCEDURE IS TO PROCESS THE INCALL REQUEST
  19. * SM - CR/RAP/R. THIS PROC VALIDATES THE INCALL REQUEST AND WILL
  20. * GENERATE EITHER A VALIDATION REQUEST (IF VALID MULTI HOST REQUEST)
  21. * OR IT WILL GENERATE A CR/RAP/N RESPONSE AND A CR/SWH/R SM IF THE
  22. * DETERMINED MODE IS FOR SINGLE HOST A-A CONNECTION.
  23. *
  24. * PROC NVFARAP
  25. *
  26. * ENTRY:
  27. *
  28. * THE CR/RAP/R SM RESIDES IN THE INSMQ.
  29. *
  30. * EXIT:
  31. *
  32. * A VALIDATION REQUEST MAY BE QUEUED TO THE CPM REQUEST QUEUE.
  33. * A CR/RAP/N OR ABNORMAL MAY BE ISSUED.
  34. * A CR/SWH/R MAY BE ISSUED TO THE CTQ.
  35. *
  36. * NOTES:
  37. *
  38. * WHEN A CR/RAP/R SM IS RECEIVED, THE CALLED APPLICATION MUST PASS
  39. * LIMIT CHECKS, THERE MUST BE A VCB ORDINAL AVAILABLE, AND THERE
  40. * MUST BE EITHER 1) A VALID INCALL BLOCK FOR THE REQUEST OR 2) THE
  41. * REQUEST MUST BE FOR A SINGLE HOST A-A CONNECTION. A SINGLE HOST
  42. * TYPE OF CONNECTION IS DETERMINED BY THE FACT THAT THE SOURCE AND
  43. * DESTINATION NODES ARE BOTH ZERO.
  44. *
  45. * THERE ARE TWO INTERNAL PROCEDURES THAT ARE CALLED BY THE MAIN
  46. * LINE. THEY ARE DISSECT, WHICH BREAKS APART THE INCOMING SM INTO
  47. * ITS VARIOUS PARTS AND CHEKFAC, WHICH VERIFIES THAT THE REQUESTED
  48. * FACILITIES IN THE CR/RAP/R SM ARE IN FACT THE FACILITIES THAT ARE
  49. * ALLOWED ON A SPECIFIC INCALL BLOCK.
  50. *
  51. #
  52. CONTROL EJECT;
  53.  
  54. #
  55. **** PROC NVFARAP XREF LIST.
  56. #
  57.  
  58. XREF
  59. BEGIN
  60. PROC SSTRQE; # SS-REMOVE QUEUE ENTRY #
  61. PROC SSTATS; # SS-ALLOCATE TABLE SPACE #
  62. PROC NVFUAFV; # ASSIGN VCB ORDINAL #
  63. PROC NVFUMQE; # MAKE QUEUE ENTRY #
  64. PROC NVFUFVO; # FREE UP VCB #
  65. PROC NVFAIAM; # ISSUE ACCOUNT MESSAGE #
  66. PROC SSBEBF; # SS-EXTRACT BIT FIELD #
  67. PROC SSBSBF; # SS-STORE BIT FIELD #
  68. FUNC SSDCAD; # SS-CONVERT ASCII-DISPLAY #
  69. PROC SSTRTS; # SS-RELEASE TABLE SPACE #
  70. PROC NVFUCRS; # CHECK REQUEST START #
  71. PROC SSCATR; # SS-ACCEPT TIMER REQUEST #
  72. PROC MESSAGE; # ISSUE DAYFILE MESSAGE #
  73. PROC ABORT; # ABORT PROGRAM #
  74. PROC SSTAQE; # ACCEPT QUEUE ENTRY #
  75. PROC NVFCFCE; # FIND CONNECTION ENTRY #
  76. END
  77.  
  78. #
  79. ****
  80. #
  81. CONTROL EJECT;
  82.  
  83. DEF MAXFACN$ # 10 #; # MAX ALLOWED FACILITIES#
  84. DEF MAXCUDL$ # 17 #; # MAX LEN (WORDS) OF USER DATA#
  85. DEF MXCUDOCT$ # 124 #; # MAX LEN (OCTETS) OF USR DATA#
  86. DEF ZSHOST$ # X"303030" #; # ASCII ZERO SHOST #
  87. DEF VARPARM$ # 32 #; # LEN OF VARIABLE PARM #
  88. DEF OK$ # 99 #; # NULL ERROR CODE #
  89. DEF FACWORD$ # 20 #; # WORD ORD FOR FACILITIES #
  90. DEF FACSBIT$ # 48 #; # START BIT FOR FACILITIES #
  91. ITEM ERRCODE I;
  92. ITEM NORMBITS I;
  93. ITEM MOVNUM I;
  94. ITEM J,I,K I;
  95. ITEM IDX I;
  96. ITEM IDXA I;
  97. ITEM PACDEF B;
  98. ITEM ERRFLAG B;
  99. ITEM VCBDEF B;
  100. ITEM PAC I;
  101. ITEM VCB I;
  102. ITEM ASTNUM I;
  103. ITEM AORD I;
  104. ITEM FOUND B;
  105. ITEM PORD I; # PRIMARY AST ENTRY ORDINAL #
  106. ITEM XX I;
  107. ITEM NUMFACS I;
  108. ITEM FACREJ B;
  109. ITEM RSTAT I;
  110. ITEM CTYP I;
  111. ITEM DTEA U; # CALLED DTE ADDR FROM CR/RAP #
  112. ITEM DTEBITS I; # LENGTH (BITS) OF DTEA ADDR #
  113. ITEM DTEREJ B; # DTEA REJECTED FLAG #
  114. ITEM EXBIT,EXORD I; # LOCAL EXTRACT VARIABLES #
  115. ITEM PARMBIT I; # LENGTH (BITS) OF FAC PARAMS #
  116. ITEM SBIT,SORD I; # LOCAL STORE VARIABLES #
  117. ITEM TEMP I; # TEMPORARY VARIABLE #
  118. ITEM UDATBITS I; # NUM BITS IN CALL USER DATA #
  119. ITEM UDATL I; # LEN OF CALL USR DATA(OCTETS)#
  120. ITEM ACNN I; # TEMPORARY FOR CONNECTION NO.#
  121. ITEM AE I; # INDEX TO ACN TABLE #
  122. ITEM NEWACN B; # TRUE IF ACN NOT FOUND #
  123. #
  124. * FINCALL - INCALL FACILITY TEMPLATE.
  125. #
  126.  
  127. BASED ARRAY FINCALL [00:00] S(1);
  128. BEGIN
  129. ITEM FIN$LEN U(00,00,08); # FACILITY OCTET LNGTH #
  130. ITEM FIN$CODE U(00,08,08); # FACILITY CODE #
  131. ITEM FIN$WSIN U(00,16,08); # RECV WINDOW SIZE #
  132. ITEM FIN$WSOUT U(00,24,08); # SEND WINDOW SIZE #
  133. ITEM FIN$DPLIN U(00,16,08); # RECV PKT SIZE #
  134. ITEM FIN$DPLOUT U(00,24,08); # SEND PKT SIZE #
  135. ITEM FIN$FAC U(00,08,48);
  136. END
  137. #
  138. * TMPFAC - TEMP ARRAY FOR FACILITIES.
  139. #
  140.  
  141. ARRAY TMPFAC [00:00] S(1);
  142. BEGIN
  143. ITEM TMP$CODE U(00,00,08); # FACILITY CODE #
  144. ITEM TMP$WININ U(00,08,08); # RECV WIN SIZE #
  145. ITEM TMP$WINOUT U(00,16,08); # SEND WIN SIZE #
  146. ITEM TMP$DPLIN U(00,08,08); # RECV PKT SIZE #
  147. ITEM TMP$DPLOUT U(00,16,08); # SEND PKT SIZE #
  148. ITEM TMP$FAST U(00,00,16); # FAST SELECT FAC #
  149. ITEM TMP$COLL U(00,00,16); # REV CHARGE FAC #
  150. ITEM TMP$TWINOUT U(00,08,08); # TELENET SEND WIN SIZE #
  151. ITEM TMP$TDPLOUT U(00,08,08); # TELENET SEND PKT SIZE #
  152. END
  153.  
  154.  
  155. #
  156. * ASCANAME - ASCII APPL NAME.
  157. #
  158. BASED ARRAY ASCANAME [00:00] S(1);
  159. BEGIN
  160. ITEM ASCA$APPL U(00,04,56);
  161. END
  162.  
  163. #
  164. * ASCSHOST - ASCII SOURCEHOST.
  165. #
  166. BASED ARRAY ASCSHOST [00:00] S(1);
  167. BEGIN
  168. ITEM ASCS$HOST U(00,36,24);
  169. END
  170.  
  171. #
  172. * CUD - ARRAY FOR HOLDING CALL USER DATA.
  173. #
  174.  
  175. ARRAY CUD [00:00] S(MAXCUDL$);
  176. BEGIN
  177. ITEM CUD$WORD U(00,00,60); # FULL WORD REFERENCE #
  178. END
  179.  
  180. #
  181. * FACCODE - ARRAY FOR HOLING FACILITY CODE OCTET VALUES.
  182. #
  183.  
  184. ARRAY FACCODE [00:MAXFACN$] S(1);
  185. BEGIN
  186. ITEM FACC$WORD U(00,00,60); # WORD REFERENCE #
  187. ITEM FACC$BLEN U(00,44,08); # BIT LENGTH OF FACILITY #
  188. ITEM FACC$CODE U(00,52,08); # FACILITY CODE #
  189. ITEM FACC$LEN U(00,52,02); # CODED LENGTH #
  190. ITEM FACC$VLEN U(00,52,08);
  191. END
  192.  
  193. #
  194. * FACPARM - ARRAY FOR HOLING PARAMETER FIELDS.
  195. #
  196.  
  197. ARRAY FACPARM [00:MAXFACN$] S(1);
  198. BEGIN
  199. ITEM FACP$WORD U(00,00,60); # WORD REF #
  200. ITEM FACP$PARM U(00,00,40); # PARAMETER FIELD REF #
  201. ITEM FACP$WININ U(00,00,08); # RECV WINDOW SIZE #
  202. ITEM FACP$WINOUT U(00,08,08); # SEND WINDOW SIZE #
  203. ITEM FACP$DPLIN U(00,00,08); # RECV PKT SIZE #
  204. ITEM FACP$DPLOUT U(00,08,08); # SEND PKT SIZE #
  205. ITEM FACP$FREQ U(00,00,08); # FAST SEL PARM #
  206. ITEM FACP$COLL U(00,00,08); # REV CHARGE PARM #
  207. ITEM FACP$FSCL U(00,00,08); # FAST SEL AND REV CHARGE #
  208. ITEM FACP$TELN U(00,00,08); # TELENET FACS FOLLOW #
  209. ITEM FACP$TWINOUT U(00,00,08); # TELENET SEND WINDOW SIZE #
  210. ITEM FACP$TDPLOUT U(00,00,08); # TELENET SEND PACKET SIZE #
  211. END
  212.  
  213. #
  214. * INCFACS - ARRAY FOR ACCESSING THE FACILITIES IN THE INCALL BLOCK.
  215. #
  216.  
  217. BASED ARRAY INCFACS [00:00] S(1);
  218. BEGIN
  219. ITEM INCF$WORD U(00,00,60); # FULL WORD REFERENCE #
  220. ITEM INCF$CODE U(00,08,08); # FACILITY CODE #
  221. ITEM INCF$LEN U(00,08,02); # CODED LENGTH #
  222. ITEM INCF$VLEN U(00,16,08); # VARIABLE LENGTH #
  223. ITEM INCF$PARM U(00,24,32); # PARAMETER FIELD #
  224. END
  225.  
  226. #
  227. * BPAC - DUMMY ARRAY FOR CLEARING PAAC ENTRY.
  228. #
  229.  
  230. BASED ARRAY BPAC [00:00] S(1);
  231. BEGIN
  232. ITEM BPA$WORD U(00,00,60);
  233. END
  234.  
  235.  
  236.  
  237. #
  238. * SHOSTDCD - DCD SOURCE HOST.
  239. #
  240. BASED ARRAY SHOSTDCD [00:00] S(1);
  241. BEGIN
  242. ITEM SHO$HID C(00,00,03);
  243. END
  244.  
  245. #
  246. * ANAMEDCD - DCD APPLICATION NAME.
  247. #
  248. BASED ARRAY ANAMEDCD [00:00] S(1);
  249. BEGIN
  250. ITEM ANA$ANAME C(00,00,07);
  251. END
  252.  
  253. #
  254. * INCALL - FIXED PORTION OF INCALL BLOCK.
  255. #
  256.  
  257. BASED ARRAY INCALL [00:00] S(9);
  258. BEGIN
  259. ITEM INC$WC U(00,49,11); # BLOCK WORD LENGTH #
  260. ITEM INC$RANAME U(01,00,56); # ASCII CALLED APPL NAME #
  261. ITEM INC$PRI B(02,00,01); # PRIORITY FLAG #
  262. ITEM INC$DBL U(02,04,08); # DL BLOCK LIMIT #
  263. ITEM INC$DBZ U(02,12,12); # DL BLOCK SIZE #
  264. ITEM INC$ABL U(02,24,08); # APPL BLOCK LIMIT #
  265. ITEM INC$UBL U(02,36,08); # UL BLOCK LIMIT #
  266. ITEM INC$UBZ U(02,44,08); # UL BLOCK SIZE #
  267. ITEM INC$PORT U(02,52,08); # CALL ACCESS PORT ON NPU #
  268. ITEM INC$SNOD U(03,00,08); # CDC SOURCE NODE OF CALL #
  269. ITEM INC$DNOD U(03,08,08); # CDC DESTINATION NODE #
  270. ITEM INC$WS U(03,16,04); # SEND WINDOW THRESHOLD #
  271. ITEM INC$DPLS U(03,20,08); # PACKET SIZE #
  272. ITEM INC$WR U(03,28,04); # RECV WINDOW SIZE #
  273. ITEM INC$DPLR U(03,32,08); # RECV PKT SIZE #
  274. ITEM INC$COLL B(03,40,01); # REVERSE CHARGE #
  275. ITEM INC$FAST B(03,41,01); # FAST SELECT #
  276. ITEM INC$DTEL U(03,56,04); # LEN OF DTEA (SEMI-OCTETS) #
  277. ITEM INC$SHOST U(04,00,24); # ASCII SOURCE HOST #
  278. ITEM INC$FAM C(05,00,07); # FAMILY NAME #
  279. ITEM INC$FWORD U(05,00,60);
  280. ITEM INC$USER C(06,00,07); # USER NAME #
  281. ITEM INC$FACL U(06,52,08); # NUMBER OF FACILITIES #
  282. ITEM INC$UWORD U(06,00,60);
  283. ITEM INC$DTEA U(07,00,60); # DTE ADDRESS #
  284. ITEM INC$WRD2 U(02,00,60);
  285. ITEM INC$WRD3 U(03,00,60);
  286. END
  287.  
  288. #
  289. * SHINCALL - SINGLE HOST INCALL BLOCK.
  290. *
  291. * SINGLE HOST INCALL BLOCK DEFINITION FOR INCOMING CALLS THAT
  292. * QUALIFY AS A INTRA HOST CALL.
  293. #
  294.  
  295. ARRAY SHINCALL [00:00] S(7);
  296. BEGIN
  297. ITEM SHI$WC U(00,49,11)=[7]; # WORD COUNT #
  298. ITEM SHI$RANAME U(01,00,56)=[0]; # CALLED APPL-ASCII #
  299. ITEM SHI$PRI U(02,00,01)=[0]; # PRIORITY FALSE #
  300. ITEM SHI$DBL U(02,04,08)=[INTRADBL$]; # DL BLK LIMIT #
  301. ITEM SHI$DBZ U(02,12,12)=[INTRADBZ$]; # DL BLK SIZE #
  302. ITEM SHI$ABL U(02,24,08)=[INTRABL$]; # APPL BLK LIMIT #
  303. ITEM SHI$UBL U(02,36,08)=[INTRAUBL$]; # UL BLK LIMIT #
  304. ITEM SHI$UBZ U(02,44,08)=[INTRAUBZ$]; # UL BLK SIZE #
  305. ITEM SHI$PORT U(02,52,08)=[0]; # ACCESS PORT #
  306. ITEM SHI$SNOD U(03,00,08)=[0]; # ZERO SOURCE NODE #
  307. ITEM SHI$DNOD U(03,08,08)=[0]; # ZERO DEST NODE #
  308. ITEM SHI$WS U(03,16,04)=[0]; # ZERO WINDOW SIZE #
  309. ITEM SHI$DPLS U(03,20,08)=[0]; # ZERO DATA PKT LEN #
  310. ITEM SHI$WR U(03,28,04)=[0]; # ZERO RECV WINDOW #
  311. ITEM SHI$DPLR U(03,32,08)=[0]; # ZERO RECV PKT SIZE #
  312. ITEM SHI$COLL B(03,40,01)=[FALSE]; # NO REV CHARGE #
  313. ITEM SHI$FAST B(03,41,01)=[FALSE]; # NO FAST SELECT #
  314. ITEM SHI$SHOST U(04,00,24)=[ZSHOST$]; # ZERO SOURCE HOST #
  315. ITEM SHI$FAM U(05,00,42)=[0]; # NULL FAMILY #
  316. ITEM SHI$USER U(06,00,42)=[0]; # NULL USER #
  317. END
  318.  
  319.  
  320. #
  321. ** TMBBUF - TIMER REQUEST BUFFER.
  322. *
  323. * BUFFER CONTAINING THE TIMER INFO. SET UP TO CONTAIN THE
  324. * FC/INACT SM WHICH IS RETURNED TO THE TAINPQ WHEN THE TIMER EXPIRES.
  325. #
  326. ARRAY TMBBUF[00:00] S(TMBSIZ$);
  327. BEGIN
  328. ITEM TMB$SMID S:CTQSTAT(00,00,12) = [S"SINA"];
  329. ITEM TMB$WC U(00,48,12) = [TMBSIZ$];
  330. ITEM TMB$ABT U(01,00,06) = [APPCMD];
  331. ITEM TMB$CNUM U(01,18,18);
  332. ITEM TMB$PFCSFC U(02,00,16) = [FCINA];
  333. ITEM TMB$ACN U(02,24,12);
  334. ITEM TMB$DELAY U(03,24,18) = [NETPTIME$];
  335. ITEM TMB$QNUM U(03,42,18);
  336. END
  337.  
  338. $BEGIN
  339. #
  340. ** TBLMSG - MISSING TABLE MESSAGE.
  341. #
  342. ARRAY TBLMSG [00:00] S(5);
  343. BEGIN
  344. ITEM TBL$MSG C(00,00,30) =
  345. ["NVFARAP: CANNOT FIND ENTRY IN "];
  346. ITEM TBL$NAME C(03,00,10);
  347. ITEM TBL$ZERO U(04,00,60) = [0];
  348. END
  349.  
  350. $END
  351.  
  352.  
  353. CONTROL EJECT;
  354. PROC DISSECT;
  355. # TITLE DISSECT - DISSECT THE CR/RAP/R SM. #
  356. BEGIN #DISSECT#
  357.  
  358. #
  359. * DISSECT - BREAK APART THE CR/RAP/R/ SM.
  360. *
  361. * C. BRION 82/09/30.
  362. *
  363. * THE FUNCTION OF THIS PROCEDURE IS TO EXTRACT THE DYNAMIC FIELDS
  364. * OF THE CR/RAP/R SM AND ENTER THEM IN A KNOWN FORMAT FOR THE
  365. * PROCESSING BY THE PROC NVFARAP.
  366. *
  367. * PROC DISSECT
  368. *
  369. * ENTRY:
  370. *
  371. * THE CR/RAP/R SM HAS BEEN REMOVED INTO LOCAL MSGBUF.
  372. *
  373. * EXIT:
  374. *
  375. * THE CALLED DTE ADDRESS IN DTEA.
  376. * THE FACILITY LENGTH EXTRACTED INTO FACL.
  377. * NUMBER OF FACILITY PAIRS IN NUMFAC.
  378. * FACILITY PAIR LENGTHS IN THE FACCODE ARRAY.
  379. * FACILITY PAIR PARAMETERS IN THE FACPARM ARRAY.
  380. * THE CALL USER DATA LENGTH IN UDATL.
  381. * THE ASCII SOURCE HOST NAME IN ASCSHOST ARRAY.
  382. * THE ASCII CALLED APPLICATION NAME IN ASCANAME ARRAY.
  383. * THE ERRCODE SETTING IF ERRORS OCCUR.
  384. * THE DISPLAY CALLED APPLICATION NAME IN DCDSHOST.
  385. * THE CALL USER DATA IN THE CUD ARRAY.
  386. #
  387. CONTROL EJECT;
  388.  
  389. #
  390. * **** ITEM LIST ****
  391. #
  392.  
  393.  
  394. ITEM LEN I;
  395. ITEM LEN2 I;
  396. ITEM FACL I;
  397. ITEM FACBITS I;
  398. ITEM TABSIZ I;
  399. ITEM LOOPNUM I;
  400. ITEM REM I;
  401. ITEM W,X I;
  402. ITEM BITNUM I;
  403. ITEM FACTMP I;
  404. ITEM DONE B;
  405. ITEM FINBITS I;
  406. ITEM CUDEXBIT I;
  407. ITEM CUDEXORD I;
  408. ITEM EXFORD,EXFBIT I;
  409. ITEM STFORD,STFBIT I;
  410. ITEM Z I;
  411. ITEM TEMP U;
  412. ITEM CHAR U;
  413. ITEM SRCHOST U;
  414. ITEM DSTHOST U;
  415. ITEM ASANAME U;
  416. ITEM DCDSHOST U;
  417. ITEM DCDANAME U;
  418. ITEM TEMP2 U;
  419. ITEM PARMLEN U;
  420.  
  421. CONTROL EJECT;
  422.  
  423. #
  424. * **** PROC DISSECT ENTRY ****
  425. #
  426.  
  427.  
  428. #
  429.   INITIALIZE THE ERROR CODE FOR EXIT.
  430. #
  431. ERRCODE = OK$;
  432.  
  433. #
  434.   INITIALIZE THE STARTING WORD AND BIT ORDINALS FOR THE CALLED DTE
  435.   ADDRESS. EXTRACT THE CALLED DTE ADDR FROM THE CR/RAP SM.
  436. #
  437.  
  438. EXORD = 2;
  439. EXBIT = 40;
  440. DTEBITS = (((CRRAL2[0] + 1)/2)*2)*4;
  441. SSBEBF(APSM[0],EXORD,EXBIT,DTEBITS,DTEA);
  442.  
  443. #
  444.   DETERMINE THE STARTING WORD ORDINAL AND BIT ORDINAL FROM THE
  445.   WORD 2 OF THE SM AREA WHERE THE FACILITY LENGTH WOULD START.
  446. #
  447. LEN = 40 + ((((CRRAL1[0]+CRRAL2[0])+1)/2)*2)*4;
  448. LEN2 = LEN / 60;
  449. EXBIT = LEN - (LEN2 * 60);
  450. EXORD = 2 + LEN2;
  451.  
  452. #
  453.   EXTRACT THE FACILITY LENGTH OCTET.
  454. #
  455.  
  456. SSBEBF(APSM[0],EXORD,EXBIT,8,FACL);
  457. FACBITS = FACL * 8;
  458. NORMBITS = LEN + FACBITS + 8;
  459. NUMFACS = 0;
  460. #
  461.   IF FACILITIES ARE REQUESTED IN THE SM THEN DETERMINE THE SIZE OF
  462.   THE FACTAB MANAGED TABLE AND EXTRACT THE FACL LENGTH NUMBER OF
  463.   BITS INTO THE TABLE.
  464. #
  465.  
  466. IF FACL NQ 0
  467. THEN
  468. BEGIN
  469. IF FACL LS 8
  470. THEN
  471. TABSIZ = 1;
  472. ELSE
  473. TABSIZ = 1 + (FACBITS/60);
  474.  
  475. SSTATS(P<FACTAB>,TABSIZ);
  476.  
  477.  
  478. #
  479.   THE FACILITY FIELDS MUST BE EXTRACTED FROM THE SM AREA AND STORED
  480.   INTO THE FACTAB MANAGED TABLE.
  481.  
  482.   DETERMINE THE VALUES NEEDED TO MOVE THE BITS INTO FACTAB FROM
  483.   THE SM AREA.
  484.  
  485. #
  486.  
  487. LOOPNUM = FACBITS / 60;
  488. IF FACBITS LS 60
  489. THEN
  490. REM = FACBITS;
  491. ELSE
  492. REM = FACBITS - (LOOPNUM * 60);
  493.  
  494. IF REM NQ 0
  495. THEN
  496. LOOPNUM = LOOPNUM + 1;
  497.  
  498. SORD = 0;
  499. SBIT = 0;
  500.  
  501. #
  502.   EXTRACT AND STORE THE FACILITY BITS.
  503. #
  504.  
  505. FOR W = 1 STEP 1 UNTIL LOOPNUM
  506. DO
  507. BEGIN
  508.  
  509. IF W EQ LOOPNUM
  510. THEN
  511. BITNUM = REM;
  512. ELSE
  513. BITNUM = 60;
  514.  
  515. SSBEBF(APSM[0],EXORD,EXBIT,BITNUM,FACTMP);
  516. SSBSBF(FACTAB[0],SORD,SBIT,BITNUM,FACTMP);
  517. END
  518.  
  519. #
  520.   THE ENTIRE FACILITY PAIR GROUPS HAVE BEEN MOVED INTO FACTAB.
  521.   NOW, MUST SEPARATE EACH PAIR INTO THE FACCODE AND FACPARM ARRAYS.
  522.   EACH FACILITY PAIR CONSISTS OF A CODED LENGTH OCTET. THERE ARE
  523.   4 POSSIBLE VALUES -
  524.  
  525.   00XXXXXX = 1 OCTET PARAMETER LENGTH.
  526.   01XXXXXX = 2 OCTET PARAMETER LENGTH.
  527.   10XXXXXX = 3 OCTET PARAMETER LENGTH.
  528.   11XXXXXX = VARIABLE NUMBER OCTET PARAMETER LENGTH.
  529.   FOLLOWING OCTET CONTAINS THE NUMBER OF OCTETS IN THE
  530.   PARAMETER FIELD.
  531.   **** MAX IS 4 OCTETS FOR CDC CURRENTLY ****
  532.  
  533. #
  534.  
  535. DONE = FALSE;
  536. FINBITS = 0;
  537. EXFORD = 0;
  538. EXFBIT = 0;
  539.  
  540. FOR X = 0 STEP 1 WHILE
  541. ((NOT DONE) AND
  542. (X LS MAXFACN$))
  543. DO
  544. BEGIN
  545. TEMP = 0;
  546. TEMP2 = 0;
  547.  
  548. #
  549.   GET THE FACILITY LENGTH CODE OCTET.
  550. #
  551.  
  552. SSBEBF(FACTAB[0],EXFORD,EXFBIT,8,TEMP);
  553. STFORD = 0;
  554. STFBIT = 52;
  555. FACC$WORD[X] = 0;
  556.  
  557. #
  558.   STORE THE LENGTH CODE INTO THE CODE ARRAY.
  559. #
  560.  
  561. SSBSBF(FACCODE[X],STFORD,STFBIT,8,TEMP);
  562. PARMBIT = ((FACC$LEN[X] + 1) * 8);
  563. #
  564.   IF A VARIABLE LENGTH PARAMETER FIELD, MUST DETERMINE THE LENGTH
  565.   FROM THE NEXT SUBSEQUENT OCTET.
  566. #
  567.  
  568. IF PARMBIT EQ VARPARM$
  569. THEN
  570. BEGIN
  571. TEMP = 0;
  572. SSBEBF(FACTAB[0],EXFORD,EXFBIT,8,TEMP);
  573. STFORD = 0;
  574. STFBIT = 52;
  575. SSBSBF(FACCODE[X],STFORD,STFBIT,8,TEMP);
  576. PARMBIT = FACC$VLEN[X] * 8;
  577.  
  578. #
  579.   MAX SIZE FOR ANY PARAMETER FIELD IS 4 OCTETS (32 BITS).
  580.   IF LARGER ENCOUNTERED, SET CONDITIONS SO THAT THE SCAN ENDS AND
  581.   THE ERRCODE IS SET TO TERMINATE THE PROCESSING AND RETURN AN
  582.   CR/RAP/A RESPONSE, RC=INVALID REQUEST.
  583. #
  584. IF PARMBIT GR 32
  585. THEN
  586. BEGIN
  587. ERRCODE = RCRA"XFP";
  588. PARMLEN = PARMBIT;
  589. PARMBIT = 32;
  590. FINBITS = FACBITS; # FORCES END TO LOOP #
  591. END
  592. ELSE
  593. FINBITS = FINBITS + PARMBIT + 16;
  594. END
  595. ELSE
  596. FINBITS = FINBITS + PARMBIT + 8;
  597.  
  598. FACC$BLEN[X] = PARMBIT;
  599.  
  600. #
  601.   READY TO EXTRACT THE FACILITY PARAMETER FIELD.
  602. #
  603.  
  604. TEMP = 0;
  605. SSBEBF(FACTAB[0],EXFORD,EXFBIT,PARMBIT,TEMP);
  606.  
  607. #
  608.   STORE THE PARAMETER FIELD INTO THE FACPARM ARRAY.
  609. #
  610. TEMP2 = 0;
  611. STFORD = 0;
  612. STFBIT = 0;
  613. SSBSBF(TEMP2,STFORD,STFBIT,PARMBIT,TEMP);
  614. B<0,PARMBIT>FACP$PARM[X] = B<0,PARMBIT>TEMP2;
  615.  
  616. #
  617.   IF NUMBER OF BITS MOVED EQUALS NUMBER OF BITS IN SM, THEN DONE.
  618. #
  619.  
  620. IF FINBITS EQ FACBITS
  621. THEN
  622. DONE = TRUE;
  623.  
  624. END
  625.  
  626. NUMFACS = X;
  627.  
  628.  
  629. #
  630.   RELEASE THE FACTAB SPACE
  631. #
  632.  
  633. SSTRTS(P<FACTAB>,0,TABSIZ);
  634.  
  635. END # IF FACL NQ 0 #
  636.  
  637. #
  638.   SAVE THE CURRENT WORD AND BIT POSITION IN THE CR/RAP SM. THIS IS
  639.   WHERE THE CALL USER DATA STARTS.
  640. #
  641.  
  642. CUDEXBIT = EXBIT;
  643. CUDEXORD = EXORD;
  644.  
  645. #
  646.   EXTRACT THE CALL USER DATA LENGTH, ASCII SOURCE HOST, ASCII
  647.   DESTINATION HOST AND THE ASCII CALLED APPLICATION NAME.
  648.  
  649.   ADVANCE THE EXTRACTION VECTORS PAST THE PRID FIELD.
  650. #
  651.  
  652. UDATL = 0;
  653. TEMP = 0;
  654. SSBEBF(APSM[0],EXORD,EXBIT,24,TEMP);
  655. SSBEBF(APSM[0],EXORD,EXBIT,8,UDATL);
  656. SSBEBF(APSM[0],EXORD,EXBIT,24,SRCHOST);
  657. SSBEBF(APSM[0],EXORD,EXBIT,16,DSTHOST);
  658. SSBEBF(APSM[0],EXORD,EXBIT,56,ASANAME);
  659. P<ASCANAME> = LOC(ASANAME);
  660. P<ASCSHOST> = LOC(SRCHOST);
  661. P<ANAMEDCD> = LOC(DCDANAME);
  662. P<SHOSTDCD> = LOC(DCDSHOST);
  663.  
  664. #
  665.   CONVERT THE RHID TO DCD.
  666. #
  667.  
  668. SORD = 0;
  669. SBIT = 0;
  670. EXFORD = 0;
  671. EXFBIT = 36;
  672.  
  673.  
  674. FOR Z = 1 STEP 1 UNTIL 3
  675. DO
  676. BEGIN
  677. SSBEBF(SRCHOST,EXFORD,EXFBIT,8,CHAR);
  678. CHAR = SSDCAD(CHAR);
  679. SSBSBF(DCDSHOST,SORD,SBIT,6,CHAR);
  680. END
  681. #
  682.   CONVERT THE CALLED APPLICATION NAME TO DCD.
  683. #
  684.  
  685. SORD = 0;
  686. SBIT = 0;
  687. EXFORD = 0;
  688. EXFBIT = 4;
  689.  
  690.  
  691. FOR J = 1 STEP 1 UNTIL 7
  692. DO
  693. BEGIN
  694. SSBEBF(ASANAME,EXFORD,EXFBIT,8,CHAR);
  695. CHAR = SSDCAD(CHAR);
  696. SSBSBF(DCDANAME,SORD,SBIT,6,CHAR);
  697. END
  698.  
  699. #
  700.   IF CALL USER DATA EXISTS, EXTRACT IT FROM THE CR/RAP/R SM AND
  701.   STORE IT IN THE CUD.
  702. #
  703.  
  704. IF UDATL NQ 0
  705. THEN
  706. BEGIN
  707.  
  708. #
  709.   THE MAX SIZE FOR THE CALL USER DATA IS 124 OCTETS. SET THE
  710.   ERROR CODE IF THIS SIZE IS EXCEEDED.
  711. #
  712.  
  713. IF UDATL GR MXCUDOCT$
  714. THEN
  715. BEGIN
  716. ERRCODE = RCRA"XUD";
  717. END
  718. ELSE
  719. BEGIN
  720.  
  721. #
  722.   INITIALIZE THE WORD AND BIT LOCATIONS FOR STORING THE DATA.
  723.   CALCULATE THE NUMBER OF BITS TO STORE.
  724. #
  725.  
  726. SORD = 0;
  727. SBIT = 0;
  728. UDATBITS = UDATL * 8;
  729. J = UDATBITS;
  730. TEMP = 0;
  731.  
  732. FOR I = 0 WHILE J GR 0
  733. DO
  734. BEGIN
  735. IF J GR 60
  736. THEN
  737. BEGIN
  738. K = 60;
  739. J = J - 60;
  740. END
  741. ELSE
  742. BEGIN
  743. K = J;
  744. J = 0;
  745. END
  746. SSBEBF(APSM[0],CUDEXORD,CUDEXBIT,K,TEMP);
  747. SSBSBF(CUD[0],SORD,SBIT,K,TEMP);
  748. TEMP = 0;
  749. END
  750. END
  751. END
  752.  
  753. END #DISSECT#
  754. CONTROL EJECT;
  755. PROC CHEKFAC(PC);
  756. # TITLE CHEKFAC - CHECK FACILITIES #
  757. BEGIN
  758.  
  759. #
  760. * CHEKFAC - GENERATE FACILITIES.
  761. *
  762. * C. BRION 83/03/25.
  763. *
  764. * THE FUNCTION OF THIS INTERNAL PROCEDURE IS TO QUALIFY THE
  765. * RECEIVED OPTIONAL USER FACILITIES OF THE CR/RAP/R SM.
  766. * THIS ROUTINE WILL ALSO SET THE RETURN USER FACILITIES IN THE
  767. * CR/RAP/N SM AREA OF THE PAAC ENTRY IF NEGOTIATION OF THE USER
  768. * FACILITY IS WARRANTED. THIS ROUTINE WILL NOT ALLOW CERTAIN
  769. * FACILITITES TO BE USED IF NOT SPECIFIED IN THE INCALL BLOCK
  770. * THAT IS CURRENTLY BEING SCANNED FOR QUALIFICATION.
  771. *
  772. * PROC CHEKFAC(PC)
  773. *
  774. * ENTRY:
  775. *
  776. * PC = THE CURRENT INDEX OF THE PAAC ENTRY FOR THIS CON-
  777. * NECTION REQUEST.
  778. *
  779. * EXIT:
  780. *
  781. * THE GLOBAL FACREJ WILL BE SET ACCORDINGLY:
  782. *
  783. * IF THE FACILITY IS NOT ALLOWED, FACREJ IS SET TO TRUE.
  784. * OTHERWISE, THE FACILITIES ARE ALLOWED AND/OR NEGOTIATED.
  785. *
  786. * THE CR/RAP/SM RESPONSE FOR FACILITY NEGOTIATED PARAMETERS WILL
  787. * BE SET UP IN THE PAAC ENTRY.
  788. #
  789.  
  790.  
  791. #
  792. * A CHECK OF THE TYPE OF FACILITY IN THE CR/RAP/R IS MADE. IF
  793. * REVERSE CHARGING OR FAST SELECT USER FACILITY IS REQUESTED AND NOT
  794. * DEFINED IN THE INCALL BLOCK, THE QUALIFICATION OF THIS INCALL
  795. * BLOCK HAS FAILED.
  796. *
  797. * IF THE REQUESTED FACILITY IS EITHER WINDOW SIZE OR PACKET SIZE THEN
  798. * FOR THE FACILITIES DEFINED IN THE INCALL BLOCK, THE SMALLER VALUE
  799. * OF THE REQUESTED IN, REQUESTED OUT AND DEFINED VALUE IS USED AS
  800. * THE VALUE TO BE NEGOTIATED. IF THE NEGOTIATED VALUE IS LESS THAN THE
  801. * REQUESTED VALUE, FACILITY NEGOTIATION ON THE RESPONSE (CALL CONNECTED
  802. * PACKET - CR/RAP/N SM) MUST BE PERFORMED.
  803. *
  804. * IF THE FACILITY IS NOT REVERSE CHARGING, FAST SELECT, WINDOW SIZE,
  805. * OR PACKET SIZE, THEN THE INCALL BLOCK IS SEARCHED FOR A MATCHING
  806. * FACILITY. IF A MATCH IS FOUND, THE FACILITY PARAMETERS MUST
  807. * MATCH. IF A MATCH IS NOT FOUND OR IF THE FACILITY PARAMETERS DO
  808. * NOT MATCH, THEN QUALIFICATION OF THIS INCALL BLOCK HAS FAILED.
  809. #
  810. CONTROL EJECT;
  811. #
  812. * DEFINITIONS AND ITEM DECLARATIONS
  813. #
  814. DEF COLLECT$ # 01 #; # REV CHARGE CODE #
  815. DEF COLLREQ$ # 01 #; # COLLECT REQ PARM #
  816. DEF DEFPKTSIZ$ # 07 #; # DEFAULT PACKET SIZE (128) #
  817. DEF DEFWSIZE$ # 02 #; # DEFAULT WINDOW SIZE #
  818. DEF FASCOL1$ # X"81" #; # COLLECT AND FASTSEL COMBINED#
  819. DEF FASCOL2$ # X"C1" #; # COLLECT AND FASTSEL COMBINED#
  820. DEF FAST$ # 01 #; # FAST SELECT CODE #
  821. DEF FSEL1$ # X"80" #; # FAST SEL REQ 1 #
  822. DEF FSEL2$ # X"C0" #; # FAST SEL REQ 2 #
  823. DEF PKTSIZ$ # X"42" #; # PKT SIZE CODE #
  824. DEF PKTSIZL$ # 3 #; # OCTET LEN OF PKT SIZE FAC #
  825. DEF TELCODE$ # X"00" #; # TELENET FACILITY CODE #
  826. DEF TELPARM$ # X"21" #; # TELENET FACILITY PARAM #
  827. DEF TPKTSIZ$ # X"06" #; # TELENET PACKET SIZE CODE #
  828. DEF TPKTSIZL$ # 2 #; # OCTET LEN TELENET PKTSIZ FAC#
  829. DEF TWSIZE$ # X"05" #; # TELENET WINDOW SIZE CODE #
  830. DEF TWSIZEL$ # 2 #; # OCTET LEN OF TELNET WSIZ FAC#
  831. DEF WSIZE$ # X"43" #; # WIN SIZE CODE #
  832. DEF WSIZEL$ # 3 #; # OCTET LEN OF WSIZE FAC #
  833. ITEM FACEC I; # FACILITY ERROR CODE #
  834. ITEM FACERR B; # ERROR CODE #
  835. ITEM FCBIT I; # BIT ORDINAL LOC #
  836. ITEM FCORD I; # WORD ORDINAL LOC #
  837. ITEM MATCHFOUND B; # TRUE IF MATCH ON INCALL FAC #
  838. ITEM NUMINFACS I; # NUM OF FACS IN INCALL BLOCK #
  839. ITEM PC I; # PAAC ENTRY ORDINAL #
  840. ITEM PIDX I; # FACILITY ARRAY INDEX #
  841. ITEM PKTCODE B; # PACKET SIZE FAC SEEN #
  842. ITEM PKTIN I; # LOCAL RECV PKT SIZE #
  843. ITEM PKTOUT I; # LOCAL SEND PKT SIZE #
  844. ITEM TELENET B; # TRUE IF TELENET FACILITY #
  845. ITEM TEMP1 U; # TEMP VARIABLE #
  846. ITEM TEMP2 U; # TEMP VARIABLE #
  847. ITEM TEMP3 U; # TEMP VARIABLE #
  848. ITEM WINCODE B; # WINDOW SIZE FAC SEEN #
  849. ITEM WININ I; # LOCAL RECV WINDOW #
  850. ITEM WINOUT I; # LOCAL SEND WINDOW #
  851. ITEM PARMPOS I; # STARTING BIT POSITION OF PARAMETER FIELD #
  852.  
  853. CONTROL EJECT;
  854.  
  855. WINCODE = FALSE;
  856. PKTCODE = FALSE;
  857.  
  858. #
  859. * IF NO FACILITIES REQUESTED IN THE CR/RAP/R SM, THEN NO NEED TO
  860. * CHECK. SET THE WINDOW SIZE AND PACKET SIZE FROM THE INCALL BLOCK.
  861. #
  862. IF NUMFACS NQ 0
  863. THEN
  864. BEGIN
  865.  
  866. #
  867. * FACILITIES REQUESTED. MUST CHECK EACH FACILITY REQUESTED TO THE
  868. * CURRENT INCALL BLOCK BEING QUALIFIED.
  869. #
  870. FACERR = FALSE;
  871. FACEC = 0;
  872. FACREJ = FALSE;
  873. PA$FACWRD[PC] = FACWORD$;
  874. PA$FACSBIT[PC] = FACSBIT$;
  875. TELENET = FALSE;
  876.  
  877. FOR PIDX = 0 STEP 1 WHILE
  878. PIDX LS NUMFACS AND NOT FACERR
  879. DO
  880. BEGIN
  881.  
  882. #
  883. * FOR EACH REQUESTED FACILITY CODE/PARAMETER GROUP, A CHECK IS
  884. * MADE AGAINST THE CURRENT INCALL BLOCK.
  885. #
  886.  
  887. #
  888. * IF FACILITY IS FAST SELECT REQUESTED AND FAST SELECT IS NOT
  889. * ALLOWED FOR THIS INCALL BLOCK, QUALIFICATION HAS FAILED.
  890. * COLLECT HAS THE SAME FACILITY CODE AS THE FAST SELECT.
  891. * HERE, IF COLLECT PARAM 01 SPECIFIED AND COLLECT NOT
  892. * SPECIFIED, THEN QUALIFICATION FAILS TOO.
  893. #
  894.  
  895. IF FACC$CODE[PIDX] EQ FAST$
  896. THEN
  897. BEGIN
  898. IF (FACP$FREQ[PIDX] EQ FSEL1$ OR
  899. FACP$FREQ[PIDX] EQ FSEL2$)
  900. THEN
  901. BEGIN
  902. IF NOT INC$FAST[0]
  903. THEN
  904. BEGIN
  905. FACERR = TRUE;
  906. FACEC = RCRA"MMF";
  907. GOTO ENDCHECK;
  908. END
  909. END
  910. IF (FACP$COLL[PIDX] EQ COLLREQ$)
  911. THEN
  912. BEGIN
  913. IF NOT INC$COLL[0]
  914. THEN
  915. BEGIN
  916. FACERR = TRUE;
  917. FACEC = RCRA"MMF";
  918. GOTO ENDCHECK;
  919. END
  920. END
  921. IF (FACP$FSCL[PIDX] EQ FASCOL1$)
  922. OR (FACP$FSCL[PIDX] EQ FASCOL2$)
  923. THEN
  924. BEGIN
  925. IF NOT INC$COLL[0] OR NOT INC$FAST[0]
  926. THEN
  927. BEGIN
  928. FACERR = TRUE;
  929. FACEC = RCRA"MMF";
  930. GOTO ENDCHECK;
  931. END
  932. END
  933. END
  934.  
  935. #
  936. * IF WINDOW SIZE FACILITY NEGOTIATION REQUESTED THEN RETURN NEGO-
  937. * TIATION IS NEEDED ONLY IF THE REQUESTED SIZE IS GREATER THAN THE
  938. * INCALL BLOCK SPECIFIED SIZE OR IF THE RECEIVE AND SENDING SIZES ARE
  939. * DIFFERENT.
  940. *
  941. * IF RETURN NEGOTIATION NEEDED, THEN THE SMALLEST VALUE OF THE REQUESTED
  942. * RECEIVE AND SEND AND THE SPECIFIED INCALL VALUES IS USED AS THE RETURN
  943. * NEGOTIATED VALUE.
  944. #
  945. ELSE IF (FACC$CODE[PIDX] EQ WSIZE$) OR
  946. (TELENET AND (FACC$CODE[PIDX] EQ TWSIZE$))
  947. THEN
  948. BEGIN
  949. WINCODE = TRUE;
  950. WININ = INC$WR[0];
  951. WINOUT = INC$WS[0];
  952. #
  953. * IF INC$WR IS ZERO, USE INC$WS FOR BOTH VALUES.
  954. #
  955. IF INC$WR[0] EQ 0
  956. THEN
  957. WININ = INC$WS[0];
  958. #
  959. * IF THIS IS A TELENET FACILITY, ONLY THE OUTGOING WINDOW SIZE VALUE
  960. * IS SPECIFIED. USE THE DEFAULT WINDOW SIZE VALUE FOR THE INCOMING
  961. * WINDOW SIZE VALUE.
  962. #
  963. IF TELENET
  964. THEN
  965. BEGIN
  966. FACP$WINOUT[PIDX] = FACP$TWINOUT[PIDX];
  967. FACP$WININ[PIDX] = DEFWSIZE$;
  968. END
  969.  
  970. IF FACP$WININ[PIDX] GR WININ OR
  971. FACP$WINOUT[PIDX] GR WINOUT OR
  972. FACP$WININ[PIDX] NQ FACP$WINOUT[PIDX]
  973. THEN
  974. BEGIN
  975.  
  976. #
  977. * NEGOTIATION NEEDED. INCREMENT FACILITY CODE LENGTH OCTET.
  978. * SET FACILITY CODE IN TEMP ARRAY TO WINDOW SIZE.
  979. * OBTAIN SMALLEST VALUE. SET WINDOW SIZE IN SM AREA OF PAAC.
  980. * MOVE FACILITY CODE/PARAMETER INTO PAAC SM AREA.
  981. #
  982. IF FACP$WININ[PIDX] LS WININ
  983. THEN
  984. PA$WININ[PC] = FACP$WININ[PIDX];
  985. ELSE
  986. PA$WININ[PC] = WININ;
  987. IF FACP$WINOUT[PIDX] LS WINOUT
  988. THEN
  989. PA$WINOUT[PC] = FACP$WINOUT[PIDX];
  990. ELSE
  991. PA$WINOUT[PC] = WINOUT;
  992.  
  993. FCORD = PA$FACWRD[PC];
  994. FCBIT = PA$FACSBIT[PC];
  995. IF NOT TELENET
  996. THEN
  997. BEGIN
  998. PA$FCL[PC] = PA$FCL[PC] + WSIZEL$;
  999. TMP$CODE[0] = WSIZE$;
  1000. IF PA$WININ[PC] LS PA$WINOUT[PC]
  1001. THEN
  1002. BEGIN
  1003. TMP$WINOUT[0] = PA$WININ[PC];
  1004. TMP$WININ[0] = PA$WININ[PC];
  1005. END
  1006. ELSE
  1007. BEGIN
  1008. TMP$WINOUT[0] = PA$WINOUT[PC];
  1009. TMP$WININ[0] = PA$WINOUT[PC];
  1010. END
  1011. PA$WSIZ[PC] = TMP$WININ[0];
  1012. SSBSBF(PAAC[PC],FCORD,FCBIT,WSIZEL$,TMPFAC[0]);
  1013. END
  1014. ELSE
  1015. BEGIN
  1016. PA$FCL[PC] = PA$FCL[PC] + TWSIZEL$;
  1017. TMP$CODE[0] = TWSIZE$;
  1018. IF PA$WININ[PC] LS PA$WINOUT[PC]
  1019. THEN
  1020. BEGIN
  1021. TMP$TWINOUT[0] = PA$WININ[0];
  1022. END
  1023. ELSE
  1024. BEGIN
  1025. TMP$TWINOUT[0] = PA$WINOUT[0];
  1026. END
  1027. PA$WSIZ[PC] = TMP$TWINOUT[0];
  1028. SSBSBF(PAAC[PC],FCORD,FCBIT,TWSIZEL$,TMPFAC[0]);
  1029. END
  1030. PA$FACWRD[PC] = FCORD;
  1031. PA$FACSBIT[PC] = FCBIT;
  1032. END
  1033. ELSE # NO NEGOTIATION NEEDED #
  1034. PA$WSIZ[PC] = FACP$WINOUT[PIDX];
  1035. END
  1036. #
  1037. * IF FACILITY IS PACKET SIZE, FOLLOW SAME LOGIC AS FOR WINDOW SIZE
  1038. * FACILITY NEGOTIATION.
  1039. #
  1040.  
  1041. ELSE IF FACC$CODE[PIDX] EQ PKTSIZ$
  1042. THEN
  1043. BEGIN
  1044. PKTCODE = TRUE;
  1045. PKTIN = INC$DPLR[0];
  1046. PKTOUT = INC$DPLS[0];
  1047. #
  1048. * IF INC$DPLR IS ZERO, USE THE INC$DPLS VALUE FOR BOTH.
  1049. #
  1050.  
  1051. IF INC$DPLR[0] EQ 0
  1052. THEN
  1053. PKTIN = INC$DPLS[0];
  1054.  
  1055. IF FACP$DPLIN[PIDX] GR PKTIN OR
  1056. FACP$DPLOUT[PIDX] GR PKTOUT OR
  1057. FACP$DPLIN[PIDX] NQ FACP$DPLOUT[PIDX]
  1058. THEN
  1059. BEGIN
  1060. PA$FCL[PC] = PA$FCL[PC] + 3;
  1061. TMP$CODE[0] = PKTSIZ$;
  1062. IF FACP$DPLIN[PIDX] LS PKTIN
  1063. THEN
  1064. PA$DPLIN[PC] = FACP$DPLIN[PIDX];
  1065. ELSE
  1066. PA$DPLIN[PC] = PKTIN;
  1067. TMP$DPLIN[0] = PA$DPLIN[PC];
  1068. IF FACP$DPLOUT[PIDX] LS PKTOUT
  1069. THEN
  1070. PA$DPLOUT[PC] = FACP$DPLOUT[PIDX];
  1071. ELSE
  1072. PA$DPLOUT[PC] = PKTOUT;
  1073. TMP$DPLOUT[0] = PA$DPLOUT[PC];
  1074. IF TMP$DPLIN[0] LS TMP$DPLOUT[0]
  1075. THEN
  1076. TMP$DPLOUT[0] = TMP$DPLIN[0];
  1077. ELSE
  1078. TMP$DPLIN[0] = TMP$DPLOUT[0];
  1079. PA$PSIZ[PC] = TMP$DPLIN[0];
  1080. FCORD = PA$FACWRD[PC];
  1081. FCBIT = PA$FACSBIT[PC];
  1082. SSBSBF(PAAC[PC],FCORD,FCBIT,PKTSIZL$,TMPFAC[0]);
  1083. PA$FACWRD[PC] = FCORD;
  1084. PA$FACSBIT[PC] = FCBIT;
  1085. END
  1086. ELSE # NEGOTIATION NOT NEEDED #
  1087. PA$PSIZ[PC] = FACP$DPLIN[PIDX];
  1088. END
  1089. #
  1090. * IF FACILITY IS TELENET PACKET SIZE, FOLLOW THE SAME LOGIC AS
  1091. * FOR WINDOW SIZE FACILITY NEGOTIATION.
  1092. #
  1093. ELSE IF TELENET AND
  1094. FACC$CODE[PIDX] EQ TPKTSIZ$
  1095. THEN
  1096. BEGIN
  1097.  
  1098. PKTCODE = TRUE;
  1099. PKTIN = INC$DPLR[0];
  1100. PKTOUT = INC$DPLS[0];
  1101. #
  1102. * IF INC$DPLR IS ZERO, USE THE INC$DPLS VALUE FOR BOTH.
  1103. #
  1104.  
  1105. IF INC$DPLR[0] EQ 0
  1106. THEN
  1107. PKTIN = INC$DPLS[0];
  1108. #
  1109. * SINCE THIS IS A TELENET FACILITY, ONLY THE OUTGOING PACKET SIZE
  1110. * IS SPECIFIED. USE THE DEFAULT PACKET SIZE VALUE FOR THE INCOMING
  1111. * PACKET SIZE VALUE.
  1112. *
  1113. * THE TELENET FACILITY PARAMTER VALUE FOR PACKET SIZE IS COMPUTED
  1114. * DIFFERENTLY FROM THE WAY THE INCALL VALUE FOR PACKET SIZE IS
  1115. * COMPUTED.
  1116. #
  1117. FACP$DPLOUT[PIDX] = FACP$TDPLOUT[PIDX];
  1118. FACP$DPLIN[PIDX] = DEFPKTSIZ$;
  1119.  
  1120. TEMP1 = FACP$DPLOUT[PIDX] * 16;
  1121. TEMP2 = 2 ** PKTOUT;
  1122. TEMP3 = 2 ** FACP$DPLIN[PIDX];
  1123.  
  1124. IF FACP$DPLIN[PIDX] GR PKTIN OR
  1125. TEMP1 GR TEMP2 OR
  1126. TEMP1 NQ TEMP3
  1127. THEN
  1128. BEGIN
  1129. #
  1130. * NEGOTIATION NEEDED. INCREMENT FACILITY CODE LENGTH OCTET. SET
  1131. * FACILITY CODE IN TEMP ARRAY TO TELENET PACKET SIZE.
  1132. #
  1133. PA$FCL[PC] = PA$FCL[PC] + TPKTSIZL$;
  1134. TMP$CODE[0] = TPKTSIZ$;
  1135. #
  1136. * OBTAIN SMALLEST PACKET SIZE VALUE. SET PACKET SIZE IN SM AREA
  1137. * OF PAAC. MOVE FACILITY CODE/PARAMETER INTO PAAC SM AREA.
  1138. #
  1139. IF FACP$DPLIN[PIDX] LS PKTIN
  1140. THEN
  1141. BEGIN
  1142. PA$DPLIN[PC] = FACP$DPLIN[PIDX];
  1143. END
  1144. ELSE
  1145. BEGIN
  1146. PA$DPLIN[PC] = PKTIN;
  1147. END
  1148.  
  1149. IF TEMP1 LS TEMP2
  1150. THEN
  1151. BEGIN
  1152. PA$DPLOUT[PC] = FACP$DPLOUT[PIDX];
  1153. END
  1154. ELSE
  1155. BEGIN
  1156. PA$DPLOUT[PC] = PKTOUT;
  1157. END
  1158.  
  1159. IF PA$DPLIN[PC] LS PA$DPLOUT[PC]
  1160. THEN
  1161. BEGIN
  1162. TMP$TDPLOUT[0] = PA$DPLOUT[PC];
  1163. END
  1164. ELSE
  1165. BEGIN
  1166. TMP$TDPLOUT[0] = PA$DPLOUT[PC];
  1167. END
  1168.  
  1169. PA$PSIZ[PC] = TMP$TDPLOUT[0];
  1170. FCORD = PA$FACWRD[PC];
  1171. FCBIT = PA$FACSBIT[PC];
  1172. SSBSBF(PAAC[PC],FCORD,FCBIT,TPKTSIZL$,TMPFAC[0]);
  1173. PA$FACWRD[PC] = FCORD;
  1174. PA$FACSBIT[PC] = FCBIT;
  1175. END
  1176. ELSE
  1177. BEGIN
  1178. PA$PSIZ[PC] = FACP$DPLIN[PIDX];
  1179. END
  1180. END
  1181. #
  1182. * IF THE COMBINATION OF FACILITY CODE AND FACILITY PARAMETER
  1183. * INDICATES THAT TELENET FACILITIES FOLLOW, SET THE TELENET FLAG.
  1184. #
  1185. ELSE IF (FACC$CODE[PIDX] EQ TELCODE$) AND
  1186. (FACP$TELN[PIDX] EQ TELPARM$)
  1187. THEN
  1188. BEGIN
  1189. TELENET = TRUE;
  1190. END
  1191. #
  1192. * UNSUPPORTED FACILITY CODE. TRY TO FIND A MATCH FOR IT IN THE
  1193. * INCALL BLOCK. IF NO MATCH IS FOUND, SET ERROR FLAG.
  1194. #
  1195.  
  1196. ELSE
  1197. BEGIN
  1198. P<INCFACS> = P<INCALL> + 8;
  1199. NUMINFACS = INC$FACL[0];
  1200. MATCHFOUND = FALSE;
  1201.  
  1202. #
  1203. * LOOP THROUGH THE FACILITIES IN THE INCALL BLOCK LOOKING FOR
  1204. * A MATCH.
  1205. #
  1206.  
  1207. FOR I = 0 STEP 1 WHILE
  1208. (NOT MATCHFOUND) AND
  1209. (I LS NUMINFACS)
  1210. DO
  1211. BEGIN
  1212. IF FACC$CODE[PIDX] EQ INCF$CODE[I]
  1213. THEN
  1214.  
  1215. #
  1216. * A MATCHING FACILITY CODE HAS BEEN FOUND. NOW CHECK IF THE
  1217. * FACILITY PARAMETERS MATCH.
  1218. #
  1219. BEGIN
  1220. MATCHFOUND = TRUE;
  1221. #
  1222. * FIRST FIGURE OUT THE NUMBER OF BITS IN THE PARAMETER
  1223. * FIELD, AND THE BIT POSITION WHERE THE FIELD STARTS.
  1224. * THESE DEPEND ON WHETHER THE FIELD HAS FIXED OR VARIABLE
  1225. * LENGTH.
  1226. #
  1227. IF INCF$LEN[I] LS 3
  1228. THEN # FIXED LENTGH PARAM FIELD #
  1229. BEGIN
  1230. PARMBIT = ((INCF$LEN[I] + 1) * 8); # NO. OF BITS #
  1231. PARMPOS = 16; # STARTING BIT POSITION #
  1232. END
  1233. ELSE # VARIABLE LENTGH PARAMETER FIELD#
  1234. BEGIN
  1235. PARMBIT = INCF$VLEN[I] * 8; # NO. OF BITS #
  1236. PARMPOS = 24; # STARTING BIT POSITION #
  1237. END
  1238.  
  1239. #
  1240. * THE LENGTH OF THE PARAMETERS ARE NOT THE SAME. SET THE
  1241. * ERROR FLAG.
  1242. #
  1243.  
  1244. IF PARMBIT NQ FACC$BLEN[PIDX]
  1245. THEN
  1246. BEGIN
  1247. FACERR = TRUE;
  1248. FACEC = RCRA"MMF";
  1249. GOTO ENDCHECK;
  1250. END
  1251.  
  1252. #
  1253. * THE FACILITY PARAMETER VALUES DO NOT MATCH. SET THE
  1254. * ERROR FLAG.
  1255. #
  1256.  
  1257. IF B<0,PARMBIT>FACP$WORD[PIDX] NQ
  1258. B<PARMPOS,PARMBIT>INCF$WORD[I]
  1259. THEN
  1260. BEGIN
  1261. FACERR = TRUE;
  1262. FACEC = RCRA"MMF";
  1263. GOTO ENDCHECK;
  1264. END
  1265. END
  1266. END
  1267.  
  1268. #
  1269. * NO MATCHING FACILITY CODE WAS FOUND. SET THE ERROR FLAG.
  1270. #
  1271.  
  1272. IF NOT MATCHFOUND
  1273. THEN
  1274. BEGIN
  1275. FACERR = TRUE;
  1276. FACEC = RCRA"NMF";
  1277. GOTO ENDCHECK;
  1278. END
  1279.  
  1280. END
  1281. END # FOR LOOP #
  1282. END # IF NUMFACS NQ 0 #
  1283.  
  1284. #
  1285. * IF NO FACS DEFINED OR WINDOW SIZE FAC NOT SEEN, MUST
  1286. * SET THE WINDOW SIZE FROM THE INCALL BLOCK.
  1287. #
  1288.  
  1289. IF NUMFACS EQ 0 OR
  1290. NOT WINCODE
  1291. THEN
  1292. BEGIN
  1293. WININ = INC$WR[0];
  1294. WINOUT = INC$WS[0];
  1295. IF INC$WR[0] EQ 0
  1296. THEN
  1297. WININ = INC$WS[0];
  1298. IF WININ LQ WINOUT
  1299. THEN
  1300. PA$WSIZ[PC] = WININ;
  1301. ELSE
  1302. PA$WSIZ[PC] = WINOUT;
  1303. END
  1304.  
  1305. #
  1306. * IF NO FACILITIES OR PACKET SIZE FAC NOT SEEN, MUST SET
  1307. * PACKET SIZE FROM INCALL BLOCK.
  1308. #
  1309. IF NUMFACS EQ 0 OR
  1310. NOT PKTCODE
  1311. THEN
  1312. BEGIN
  1313. PKTIN = INC$DPLR[0];
  1314. PKTOUT = INC$DPLS[0];
  1315. IF INC$DPLR[0] EQ 0
  1316. THEN
  1317. PKTIN = INC$DPLS[0];
  1318. IF PKTIN LQ PKTOUT
  1319. THEN
  1320. PA$PSIZ[PC] = PKTIN;
  1321. ELSE
  1322. PA$PSIZ[PC] = PKTOUT;
  1323. END
  1324.  
  1325. ENDCHECK:
  1326. IF FACERR
  1327. THEN
  1328. BEGIN
  1329. #
  1330. * ERROR OCCURRED. SET GLOBAL ERRCODE TO LOCAL FACILITY ERROR
  1331. * CODE FACEC.
  1332. #
  1333. FACREJ = TRUE;
  1334. ERRCODE = FACEC;
  1335. END
  1336. ELSE
  1337. ERRCODE = OK$;
  1338.  
  1339. END # CHEKFAC #
  1340.  
  1341. CONTROL EJECT;
  1342.  
  1343. #
  1344. * **** PROC NVFARAP ENTRY START ****
  1345. #
  1346.  
  1347. #
  1348.   MAIN LOOP REMOVES A CR/RAP/R SM FROM THE INSMQ AND PROCESSES IT.
  1349. #
  1350. FOR I = 0 WHILE INSMQL NQ 0
  1351. DO
  1352. BEGIN
  1353. #
  1354.   CLEAR THE SM AREAS.
  1355. #
  1356.  
  1357. FOR IDXA = 0 STEP 1 UNTIL NMSGBUF$
  1358. DO
  1359. BEGIN
  1360. MSG$WORD[IDXA] = 0;
  1361. END
  1362.  
  1363. WCB$WORD[0] = 0;
  1364. WCB$WORD[1] = 0;
  1365. ABHWORD[0] = 0;
  1366. ABHWORD[1] = 0;
  1367.  
  1368.  
  1369. SSTRQE(P<INSMQ>,WCBUF,ABHBUF,MSGBUF);
  1370.  
  1371. #
  1372.   INIT FLAGS FOR ERREXIT CONDITIONS.
  1373. #
  1374.  
  1375. PACDEF = FALSE;
  1376. ERRCODE = OK$;
  1377. VCBDEF = FALSE;
  1378.  
  1379. #
  1380. * CHECK IF HOST IN IDLE OR DISABLED STATE. IF SO, NO
  1381. * FURTHER CONNECTIONS ALLOWWED. SET UP ABNORMAL REASON CODE
  1382. * FOR SHUT HOST.
  1383. #
  1384.  
  1385. IF NVFSTATE
  1386. THEN
  1387. BEGIN
  1388. ERRCODE = RCRA"IDH";
  1389. GOTO ERREXIT;
  1390. END
  1391.  
  1392. #
  1393.   CHECK FOR AVAILABLE VCB ORDINAL
  1394. #
  1395.  
  1396. NVFUAFV(VCB,ERRFLAG);
  1397. IF ERRFLAG
  1398. THEN
  1399. BEGIN
  1400. ERRCODE = RCRA"NVO";
  1401. GOTO ERREXIT;
  1402. END
  1403.  
  1404.  
  1405. #
  1406.   VCB AVAILABLE, BUILD PAAC AND CLEAR IT.
  1407. #
  1408.  
  1409. VCBDEF = TRUE;
  1410. PAC = PACLNGTH / PAACSIZ$;
  1411. SSTATS(P<PAAC>,PAACSIZ$);
  1412. PACDEF = TRUE;
  1413.  
  1414. P<BPAC> = LOC(PAAC[PAC]);
  1415. FOR IDXA = 0 STEP 1 UNTIL (PAACSIZ$ - 1)
  1416. DO
  1417. BEGIN
  1418. BPA$WORD[IDXA] = 0;
  1419. END
  1420. #
  1421.   CALL DISSECT TO BREAK APART THE CR/RAP/R.
  1422. #
  1423.  
  1424. DISSECT;
  1425. IF ERRCODE NQ OK$
  1426. THEN
  1427. GOTO ERREXIT;
  1428.  
  1429. #
  1430.   INIT THE PAAC ENTRY FROM THE CR/RAP/R SM.
  1431. #
  1432. PA$RHID[PAC] = SHO$HID[0];
  1433. PA$RAPNM[PAC] = ANA$ANAME[0];
  1434. PA$NACN[PAC] = CRNACN[0];
  1435. PA$VCB[PAC] = VCB;
  1436. PA$INCUR[PAC] = 0;
  1437. PA$INNXT[PAC] = 0;
  1438. PA$SNODE[PAC] = CRASNOD[0];
  1439. PA$DNOD[PAC] = CRADNOD[0];
  1440. PA$PORT[PAC] = CRRPORT[0];
  1441. PA$ICMCN[PAC] = TRUE; # THIS IS AN INCOMING CONN #
  1442.  
  1443. #
  1444.   LOCATE THE CALLED APPLICATION IN THE AST.
  1445. #
  1446.  
  1447. ASTNUM = ASTLNGTH / ASTSIZ$;
  1448. FOR AORD = 0 STEP 1 WHILE
  1449. ((AORD LS ASTNUM) AND
  1450. (AST$ANAM[AORD] NQ ANA$ANAME[0]))
  1451. DO
  1452. BEGIN
  1453. END
  1454.  
  1455. #
  1456.   APPLICATION MAY NOT BE FOUND. IF SO, SET ERROR AND EXIT.
  1457. #
  1458.  
  1459. IF AORD EQ ASTNUM
  1460. THEN
  1461. BEGIN
  1462. ERRCODE = RCRA"AND";
  1463. GOTO ERREXIT;
  1464. END
  1465.  
  1466. #
  1467. * CHECK IF THIS IS A SECONDARY APPLICATION AND IF SO, DETERMINE THE
  1468. * PRIMARY AST ORDINAL.
  1469. #
  1470.  
  1471. PORD = AORD;
  1472. IF AST$PANAM[AORD] NQ AST$SANAM[AORD]
  1473. THEN
  1474. BEGIN
  1475. FOR PORD = 0 STEP 1 WHILE
  1476. ((PORD LS ASTNUM) AND
  1477. (AST$SANAM[AORD] NQ AST$PANAM[PORD]))
  1478. DO
  1479. BEGIN
  1480. END
  1481. IF PORD EQ ASTNUM
  1482. THEN
  1483. BEGIN
  1484. PORD = AORD;
  1485. END
  1486. END
  1487.  
  1488. #
  1489. * CHECK IF NON REQUEST STARTABLE APPLICATION OR APPL THAT ALLOWS
  1490. * ONLY ONE COPY ACTIVE, IS DOWN OR NOT NETTED ON. IF SO, SET ERROR
  1491. * CODE AND ERREXIT.
  1492. #
  1493. IF ((NOT AST$RS[AORD]) AND (AST$MXCOP[AORD] EQ 1)) AND
  1494. (AST$DNF[AORD] OR
  1495. (AST$JSN[AORD] EQ " "))
  1496. THEN
  1497. BEGIN
  1498. ERRCODE = RCRA"ANA";
  1499. GOTO ERREXIT;
  1500. END
  1501. #
  1502. * CHECK IF CALLED APPLICATION IS DISABLED
  1503. #
  1504. IF AST$DIF[AORD]
  1505. THEN # CALLED APPLICATION IS DISABLED #
  1506. BEGIN
  1507. ERRCODE = RCRA"ADI";
  1508. GOTO ERREXIT;
  1509. END
  1510.  
  1511. #
  1512. * CHECK IF REQUESTED APPL IS NS OR CS.
  1513. * IF SO, SET NO RECEIVER ERROR STATUS AND ERROR EXIT.
  1514. #
  1515. IF AST$PANAM[AORD] EQ "NS" OR
  1516. AST$PANAM[AORD] EQ "CS"
  1517. THEN
  1518. BEGIN
  1519. ERRCODE = RCRA"RCS";
  1520. GOTO ERREXIT;
  1521. END
  1522.  
  1523. #
  1524. * APPL OK SO FAR, CONTINUE LIMIT CHECK WITH MAX CONNECTION .
  1525. * IF NON REQUEST STARTABLE APPLICATION OR APPLICATION THAT ALLOWS
  1526. * ONLY ONE ACTIVE COPY IS AT CONNECTION LIMIT, SET ERROR EXIT CODE
  1527. * AND ERROR EXIT.
  1528. #
  1529.  
  1530. IF ((NOT AST$RS[AORD]) AND (AST$MXCOP[AORD] EQ 1)) AND
  1531. (AST$MCN[AORD] LQ
  1532. (AST$TACN[AORD] + AST$AACN[AORD] + AST$RACN[AORD]))
  1533. THEN
  1534. BEGIN
  1535. ERRCODE = RCRA"NMC";
  1536. GOTO ERREXIT;
  1537. END
  1538.  
  1539. #
  1540. * START THE INCALL BLOCK SEARCH.
  1541. #
  1542.  
  1543. FOUND = FALSE;
  1544.  
  1545. IF INRECL GR 0
  1546. THEN
  1547. BEGIN
  1548.  
  1549. #
  1550.   INCALL BLOCKS ARE DEFINED.
  1551.   COMPARE THE REQUEST INFO WITH THE INCALL BLOCKS DEFINED LOOKING
  1552.   FOR AN INCALL BLOCK THAT SATISFIES THE REQUEST.
  1553. #
  1554. FOR XX = 0 WHILE
  1555. ((NOT FOUND) AND
  1556. (PA$INNXT[PAC] LS INRECL))
  1557. DO
  1558. BEGIN
  1559. PA$INCUR[PAC] = PA$INNXT[PAC];
  1560. P<INCALL> = (P<INREC> + PA$INCUR[PAC]);
  1561. PA$INNXT[PAC] = PA$INNXT[PAC] + INC$WC[0];
  1562.  
  1563. #
  1564.   THE CALLED APPLICATION NAME, SOURCE HOST ID, SOURCE NODE,
  1565.   DESTINATION NODE AND PORT MUST MATCH BETWEEN THE SM AND THE
  1566.   INCALL BLOCK.
  1567.   IF EITHER OF THE PARAMETERS IS ZERO IN THE INCALL BLOCK,
  1568.   THEN THAT PARAMETER CHECK IS BYPASSED AND NOT USED TO
  1569.   QUALIFY THE MATCH.
  1570. #
  1571.  
  1572. IF INC$RANAME[0] EQ ASCA$APPL[0]
  1573. THEN
  1574. BEGIN
  1575.  
  1576. IF ((INC$SHOST[0] NQ ZSHOST$ AND
  1577. INC$SHOST[0] EQ ASCS$HOST[0]) OR
  1578. INC$SHOST[0] EQ ZSHOST$)
  1579. THEN
  1580. BEGIN
  1581. IF ((INC$SNOD[0] NQ 0 AND
  1582. INC$SNOD[0] EQ PA$SNODE[PAC]) OR
  1583. INC$SNOD[0] EQ 0)
  1584. THEN
  1585. BEGIN
  1586. IF ((INC$DNOD[0] NQ 0 AND
  1587. INC$DNOD[0] EQ PA$DNOD[PAC]) OR
  1588. INC$DNOD[0] EQ 0)
  1589. THEN
  1590. BEGIN
  1591. IF ((INC$PORT[0] NQ 0 AND
  1592. INC$PORT[0] EQ PA$PORT[PAC]) OR
  1593. INC$PORT[0] EQ 0)
  1594. THEN
  1595. BEGIN
  1596. #
  1597. * INCALL BLOCK MATCH SO FAR. NOW CHECK IF THE CALLED
  1598. * DTE ADDRESS IN THE CR/RAP MATCHES THE DTE ADDRESS IN
  1599. * THE INCALL BLOCK. ALSO CHECK IF THE FACILITIES MATCH.
  1600. #
  1601.  
  1602. DTEREJ = TRUE;
  1603. IF (INC$DTEL[0] EQ 0) OR
  1604. ((CRRAL2[0] EQ INC$DTEL[0]) AND
  1605. (DTEA EQ B<0,DTEBITS>INC$DTEA[0]))
  1606. THEN
  1607. BEGIN
  1608. DTEREJ = FALSE;
  1609. END
  1610.  
  1611. CHEKFAC(PAC);
  1612. IF NOT FACREJ AND NOT DTEREJ
  1613. THEN
  1614. BEGIN
  1615. FOUND = TRUE;
  1616. PA$STATE[PAC] = PAACST"PAAWTVAL";
  1617. END
  1618. END
  1619. END
  1620. END
  1621. END
  1622. END
  1623. END
  1624.  
  1625. END
  1626.  
  1627. #
  1628. * AT THIS POINT, EITHER A MATCHING INCALL BLOCK FOUND OR NO INCALL
  1629. * BLOCK FOUND OR INCALL BLOCKS NOT DEFINED. IF NO INCALL BLOCKS ARE
  1630. * DEFINED, THEN CHECK FOR SINGLE HOST INCALL REQUEST QUALIFICATION.
  1631. * A CALL IS QUALIFIED FOR SINGLE (OR INTRA ) HOST CALLING ATTEMPT
  1632. * IF THE SOURCE AND DESTINATION NODES ARE ZERO.
  1633. #
  1634.  
  1635. IF NOT FOUND
  1636. THEN
  1637. BEGIN
  1638. IF PA$SNODE[PAC] EQ 0 AND PA$DNOD[PAC] EQ 0
  1639. THEN
  1640.  
  1641. #
  1642. * CALL QUALIFIES FOR SINGLE HOST. SET THE INCALL BLOCK POINTER
  1643. * TO THE SINGLE HOST INCALL BLOCK, SET THE PAAC STATE SO IT IS
  1644. * KNOWN A SINGLE HOST CALL IN EFFECT AND SET FOUND FLAG.
  1645. #
  1646.  
  1647. BEGIN
  1648. P<INCALL> = LOC(SHINCALL);
  1649. PA$STATE[PAC] = PAACST"PARAP";
  1650. FOUND = TRUE;
  1651. ERRCODE = OK$;
  1652. FACREJ = FALSE;
  1653. END
  1654. END
  1655.  
  1656. #
  1657. * IF NO INCALL BLOCK ASSIGNED AT THIS POINT, THEN AN UNAUTHORIZED
  1658. * ATTEMPT TO MAKE AN INCALL HAS OCCURRED. SET THE ERROR CODE AND
  1659. * PROCEED TO ERROR EXIT PROCESSING.
  1660. #
  1661.  
  1662. IF NOT FOUND
  1663. THEN
  1664. BEGIN
  1665. IF NOT FACREJ
  1666. THEN
  1667. #
  1668. * ERROR UNRELATED TO FACILITY TYPE OF ERROR OCCURRED. MUST BE AN
  1669. * UNAUTHORIZED ATTEMPT. OTHERWISE ALREADY SET BY CHEKFAC PROCEDURE.
  1670. #
  1671. ERRCODE = RCRA"NIM";
  1672. GOTO ERREXIT;
  1673. END
  1674.  
  1675. #
  1676. * MOVE THE APPROPRIATE FIELDS OF THE ASSIGNED INCALL BLOCK
  1677. * TO THE PAAC ENTRY.
  1678. #
  1679.  
  1680. PA$ICWRD2[PAC] = INC$WRD2[0];
  1681. PA$DBZ[PAC] = INC$DBZ[0];
  1682. PA$ABL[PAC] = INC$ABL[0];
  1683. PA$ICWRD3[PAC] = INC$WRD3[0];
  1684. PA$FWORD[PAC] = INC$FWORD[0];
  1685. PA$UWORD[PAC] = INC$UWORD[0];
  1686.  
  1687. #
  1688. * MOVE THE CALLED APPLICATION INFO INTO THE PAAC ENTRY.
  1689. #
  1690.  
  1691. PA$RAPNM[PAC] = ANA$ANAME[0];
  1692. PA$RAPAN[PAC] = AST$AN[AORD];
  1693. PA$SWAP[PAC] = ANA$ANAME[0];
  1694. PA$SWAPAN[PAC] = AST$AN[AORD];
  1695.  
  1696.  
  1697. #
  1698. * ENTER WORDS OF THE CR/RAP/N SM IN THE PAAC ENTRY.
  1699. #
  1700.  
  1701. PA$RAPSM0[PAC] = SPMSG0[0];
  1702. PA$RAPSM1[PAC] = PA$ICWRD2[PAC];
  1703. IF (PA$SNODE[PAC] EQ 0 AND PA$DNOD[PAC] EQ 0)
  1704. THEN
  1705. PA$DT[PAC] = DT$INTA;
  1706. ELSE
  1707. PA$DT[PAC] = DT$INTE;
  1708. #
  1709. * CHECK IF REQUESTED APPLICATION IS REQUEST STARTABLE OR CAN HAVE
  1710. * MULTIPLE COPIES. IF SO, A CALL TO NVFUCRS IS MADE TO DETERMINE
  1711. * THE STATUS OF THE APPLICATION. UPON RETURN, THE CONNECTION IS PUT
  1712. * INTO A NETON PENDING STATE, IS CONSIDERED IN ERROR, OR IS ALLOWED
  1713. * THE CONNECTION.
  1714. #
  1715. IF AST$RS[AORD] OR
  1716. (AST$MXCOP[AORD] GR 1)
  1717.  
  1718. THEN
  1719. BEGIN
  1720. PORD = 0;
  1721. RSTAT = CONNOK$;
  1722. CTYP = AACON$;
  1723. NVFUCRS(AORD,PORD,RSTAT,CTYP);
  1724. IF RSTAT EQ NETP$
  1725. THEN
  1726. BEGIN
  1727. PA$STATE[PAC] = PAACST"PANETP";
  1728. TMB$ACN[0] = PA$NACN[PAC];
  1729. TMB$QNUM[0] = LOC(P<AAINPQ>);
  1730. SSCATR(TMBBUF[0]);
  1731. PA$SWAP[PAC] = AST$PANAM[AORD];
  1732. PA$CNUM[PAC] = TMB$CNUM[0];
  1733. GOTO ERREXIT;
  1734. END
  1735. IF RSTAT EQ NOCONN$ OR
  1736. RSTAT EQ MCLIMIT$
  1737. THEN
  1738. BEGIN
  1739. ERRCODE = RCRA"ANA";
  1740. GOTO ERREXIT;
  1741. END
  1742. IF RSTAT EQ CONNOK$
  1743. THEN
  1744. BEGIN
  1745. PA$RAPNM[PAC] = AST$PANAM[PORD];
  1746. PA$RAPAN[PAC] = AST$AN[PORD];
  1747. PA$SWAP[PAC] = AST$PANAM[PORD];
  1748. PA$SWAPAN[PAC] = AST$AN[PORD];
  1749. END
  1750.  
  1751. END
  1752.  
  1753. SPMSG0[1] = PA$RAPSM0[PAC];
  1754. SPMSG1[1] = PA$RAPSM1[PAC];
  1755. SPMSG2[1] = PA$RAPSM2[PAC];
  1756. ABHWORD[1] = ABHWORD[0];
  1757. RB[1] = TRUE;
  1758. CRALN[1] = 1;
  1759. CRVCB[1] = PA$VCB[PAC];
  1760. CRICT[1] = CT8ASCII;
  1761.  
  1762. #
  1763. * SEND THE CR/IAP/N SM TO THE OTQ, BYPASSING THE CTQ.
  1764. #
  1765.  
  1766. WCB$WORD[0] = 0;
  1767. WCB$WC[0] = LCRRAPN + 2;
  1768.  
  1769. ABHWORD[0] =0;
  1770. ABHABT[0] = APPCMD;
  1771. ABHADR[0] = 0;
  1772. ABHTLC[0] = LCRRAPN;
  1773. ABHACT[0] = 1;
  1774.  
  1775. SSTAQE (P<OTQ>, WCBUF, ABHBUF, APSM[1]);
  1776.  
  1777. #
  1778. * CHANGE ACN STATE FROM CREATE TO ACTIVE.
  1779. #
  1780. ACNN = PA$NACN[PAC];
  1781. NVFCFCE (ACNN,AE,NEWACN);
  1782. IF NEWACN # COULD NOT FIND ACN ENTRY, SERIOUS PROBLEM #
  1783. THEN
  1784. BEGIN
  1785. $BEGIN
  1786. TBL$NAME[0] = "ACN";
  1787. MESSAGE(TBLMSG,0);
  1788. ABORT;
  1789. $END
  1790. END
  1791. ELSE # ACN ENTRY EXIST, UPDATE ITS STATE #
  1792. ACN$STATE[AE] = ACNST"ACTIVE";
  1793.  
  1794. #
  1795. * CR/RAP/N SM SENT. CLEAR THE OUTGOING SM AREA AND SET UP THE
  1796. * CR/SWH/R SM.
  1797. #
  1798. IDX = (NMSGBUF$ + 1) / 2;
  1799. FOR J = IDX STEP 1 UNTIL NMSGBUF$
  1800. DO
  1801. BEGIN
  1802. MSG$WORD[J] = 0;
  1803. END
  1804.  
  1805. PFCSFC[1] = CRSWH;
  1806. CRNACN[1] = CRACN[0];
  1807. CRSNAME[1] = " ";
  1808. CRSWAN[1] = PA$RAPAN[PAC];
  1809. CRSWSL[1] = AASECLEV$;
  1810. CRDT[1] = PA$DT[PAC];
  1811. CRSWDBZ[1] = PA$DBZ[PAC];
  1812. CRABL[1] = PA$ABL[PAC];
  1813. CRSWHID[1] = PA$URHID[PAC];
  1814. CRSWUBZ[1] = PA$UBZ[PAC];
  1815. CRSWUDL[1] = UDATL;
  1816.  
  1817. #
  1818. * MOVE THE CALL USER DATA FROM THE CUD TO THE CR/SWH/R SM.
  1819. * INITIALIZE THE WORD AND BIT POSITIONS FOR EXTRACTING AND STORING
  1820. * THE DATA.
  1821. #
  1822.  
  1823. IF UDATL GR 0
  1824. THEN
  1825. BEGIN
  1826. SORD = 4;
  1827. SBIT = 0;
  1828. EXORD = 0;
  1829. EXBIT = 0;
  1830. TEMP = 0;
  1831. J = UDATBITS;
  1832.  
  1833. FOR I = 0 WHILE J GR 0
  1834. DO
  1835. BEGIN
  1836. IF J GR 0
  1837. THEN
  1838. BEGIN
  1839. K = 60;
  1840. J = J - 60;
  1841. END
  1842. ELSE
  1843. BEGIN
  1844. K = J;
  1845. J = 0;
  1846. END
  1847. SSBEBF(CUD[0],EXORD,EXBIT,K,TEMP);
  1848. SSBSBF(APSM[1],SORD,SBIT,K,TEMP);
  1849. TEMP = 0;
  1850. END
  1851. END
  1852.  
  1853. #
  1854. * SEND THE CR/SWH/R SM.
  1855. #
  1856.  
  1857. NVFUMQE(P<CTQ>,APSM[1],APPPR$,0,LCRSWH);
  1858.  
  1859. #
  1860. * INCREMENT THE NUMBER OF A-A CONNECTIONS AND INCOMING CONNEC-
  1861. * TION COUNT FOR THE CALLED APPLICATION.
  1862. #
  1863.  
  1864. AST$AACN[AORD] = AST$AACN[AORD] + 1;
  1865. AST$ICCN[AORD] = AST$ICCN[AORD] + 1; #INCR INCOMING CONN COUNT#
  1866. IF AORD NQ PORD
  1867. THEN
  1868. BEGIN
  1869. AST$AACN[PORD] = AST$AACN[PORD] + 1;
  1870. AST$ICCN[PORD] = AST$ICCN[PORD] + 1;
  1871. END
  1872.  
  1873.  
  1874. ERREXIT:
  1875.  
  1876. #
  1877. * CHECK IF AN ERROR HAS OCCURRED ALONG THE WAY.
  1878. * IF SO, A CR/RAP/A SM MUST BE ISSUED, AN ACCOUNT MSG IS ISSUED,
  1879. * THE PAAC AND VCB ARE RELEASED IF WARRANTED.
  1880. #
  1881.  
  1882. IF ERRCODE NQ OK$
  1883. THEN
  1884. BEGIN
  1885. SPMSG0[1] = 0;
  1886. PFCSFC[1] = PFCSFC[0];
  1887. EB[1] = TRUE;
  1888. CRNACN[1] = CRNACN[0];
  1889. CRRRAP[1] = ERRCODE;
  1890. NVFUMQE(P<CTQ>,APSM[1],APPPR$,0,LCRRAPA);
  1891.  
  1892. #
  1893. * ISSUE ACCOUNT MESSAGE ONLY IF PAAC ENTRY EXISTS.
  1894. #
  1895.  
  1896. IF PACDEF
  1897. THEN
  1898. BEGIN
  1899. MOVNUM = ABAR$;
  1900. NVFAIAM(PAC,MOVNUM);
  1901.  
  1902. #
  1903. * RELEASE THE PAAC ENTRY.
  1904. #
  1905.  
  1906. PAC = PAC * PAACSIZ$;
  1907. SSTRTS(P<PAAC>,PAC,PAACSIZ$);
  1908. END
  1909.  
  1910. #
  1911. * RELEASE THE VCB IF ASSIGNED.
  1912. #
  1913.  
  1914. IF VCBDEF
  1915. THEN
  1916. NVFUFVO(VCB);
  1917. END
  1918.  
  1919.  
  1920. END
  1921.  
  1922. END # NVFARAP #
  1923. TERM
cdc/nos2.source/nam5871/nvfarap.txt ยท Last modified: 2023/08/05 17:22 by Site Administrator