User Tools

Site Tools


cdc:nos2.source:nam5871:hbsttp

HBSTTP

Table Of Contents

  • [00021] PROC HBSTTP1)
  • [00115] PROC BLINK
  • [00116] PROC ABORT
  • [00117] PROC LOCLLCB
  • [00118] PROC HCSTTP
  • [00119] PROC HFASTQ
  • [00120] PROC HSFCACK
  • [00121] PROC HUPDDAW
  • [00122] PROC MGETS
  • [00123] PROC MRELS
  • [00124] PROC NBSTTP
  • [00125] PROC OMSG
  • [00126] PROC OSCHAPP
  • [00127] PROC OVLCALL
  • [00128] PROC XSTTP
  • [00129] PROC XTRACE

Source Code

HBSTTP.txt
  1. *DECK HBSTTP
  2. USETEXT NIPDEF
  3. USETEXT ACB
  4. USETEXT ACNB
  5. USETEXT ACNT
  6. USETEXT AT
  7. USETEXT APPSTAT
  8. USETEXT AHEADER
  9. USETEXT DRHDR
  10. USETEXT DUMPFLG
  11. USETEXT MSGIDX
  12. USETEXT NCNB
  13. USETEXT NWLNTRY
  14. USETEXT OVERLAY
  15. USETEXT PARAMP
  16. USETEXT PARAMS
  17. USETEXT STPRESP
  18. USETEXT SYSTIME
  19. USETEXT NHEADER
  20. USETEXT SUPMSG
  21. PROC HBSTTP((ACNBAD),(TRIGGER),(BLKPTR));
  22. STARTIMS;
  23. #
  24. *1DC HBSTTP
  25. *
  26. * 1. PROC NAME AUTHOR DATE
  27. * HBSTTP C. BITTNER 81/05/15
  28. *
  29. * 2. FUNCTIONAL DESCRIPTION
  30. * HOST BLOCK PROTOCOL (IVT) STATE TABLE PROCESSOR.
  31. *
  32. * 3. METHOD USED
  33. * VALIDATE TRIGGER. SET CURRENT STATE (IF THERE IS NO ACNB
  34. * THEN SET THE CURRENT STATE TO STATX), CALL XSTTP (STATE
  35. * TABLE PROCESSOR) PASSING THE STATE TABLE ORDINAL,
  36. * CURRENT IVT STATE AND TRIGGER. IF A LEGAL TRIGGER IS
  37. * RETURNED, THEN DO THE FOLLOWING (IF VALUE NOT SET TO
  38. * NOCHG):
  39. * A) ACTION - EXECUTE HOST BLOCK STATE TABLE ACTION
  40. * (ISSUE SM, ETC)
  41. * B) NEWSTATE - UPDATE NEW HOST BLOCK PROTOCOL STATE
  42. * C) TRIGC - TRIGGER HOST CONNECTION STATE TABLE
  43. * D) TRIGB - TRIGGER NETWORK BLOCK PROTOCOL STATE TABLE
  44. *
  45. * IF AN ILLEGAL TRIGGER IS RETURNED THEN DO THE
  46. * FOLLOWING: IF THE TRIGGER IS INTERNAL TO NIP
  47. * THEN ABORT NIP. IF ILLEGAL EXTERNAL TRIGGER -
  48. * ISSUE ERR/LGL TO APPLICATION.
  49. *
  50. *
  51. *
  52. * 4. ENTRY PARAMETERS
  53. * ACNBAD - ACNB ADDRESS
  54. * TRIGGER - HOST BLOCK PROTOCOL STATE TABLE TRIGGER
  55. * BLKPTR - ADDRESS OF SM BUFFER
  56. *
  57. * 5. EXIT PARAMETERS
  58. * NONE
  59. *
  60. * 6. SYMPL TEXTS USED
  61. * NIPDEF ACB
  62. * ACNB ACNT
  63. * AT APPSTAT
  64. * DUMPFLG OVERLAY
  65. * PARAMS STPRESP
  66. *
  67. * 7. ROUTINES CALLED
  68. * ABORT - ABORT NIP
  69. * BLINK - LINK DATA BLOCK TO DATA RING
  70. * HBCHECK - VALIDATE CHARACTER TYPE
  71. * HCSTTP - HOST CONNECTION STATE TABLE PROCESSOR
  72. * HFASTQ - QUEUE UPLINE MESSAGES TO ACNB
  73. * HSFCACK - SEND FC/ACK OR FC/NAK
  74. * HUPDDAW UPDATE DATA AVAILABLE WORD IN ACB
  75. * MGETS - ALLOCATE BUFFER
  76. * HRELPWL - RELEASE USED PORTION OF NWL
  77. * MRELS - RELEASE BUFFER
  78. * NBSTTP - NETWORK BLOCK PROTOCOL STATE TABLE PROCESSOR
  79. * OSCHAPP - SCHEDULE APPLICATION
  80. * OVLCALL - LOAD AND EXECUTE OVERLAY
  81. * XSTTP - STATE TABLE PROCESSOR
  82. * XTRACE - RECORD PROCEDURE CALL
  83. * STRTSW OVL CALL HCRSWHN/HCONREQ/RELACNB
  84. * HSINTRU OVL SEND INTR/USR TO APPL
  85. * HSFCBRK OVL SEND FC/BRK TO APPL
  86. * HPRUSM OVL PROCESS PRU SM
  87. * HSINTR OVL SEND FC/INIT/R TO APPL
  88. * HPRUONX OVL SEND PRU/ON/A
  89. * STPHERR OVL SEND STP ERROR MESSAGE
  90. * HLGLERR OVL SEND ERR/LGL
  91. * XERRMSG OVL OUTPUT ERROR MESSAGE
  92. *
  93. * 8. DAYFILE MESSAGES AND OTHER IMPORTANT INFORMATION
  94. * "NIP INTERNAL ERROR - HBSTTP1"
  95. * "NIP INTERNAL ERROR - HBSTTP2"
  96. * "NIP/HBSTTP ERR AN= ,CN= ,TRIG,STATE"
  97. * "INVALID TRIGGER NUMBER - HBSTTP"
  98. *
  99.  #
  100. STOPIMS;
  101.  
  102. #
  103.  INPUT PARAMETERS
  104. #
  105. ITEM ACNBAD; # ACNB ADDRESS #
  106. ITEM TRIGGER; # HOST BLOCK PROTOCOL STATE TABLE TRIGGER #
  107. ITEM BLKPTR; # ADDRESS OF BLK BUFFER #
  108.  
  109. #
  110.  EXTERNAL VARIABLES
  111. #
  112.  
  113. XREF
  114. BEGIN
  115. PROC BLINK ;
  116. PROC ABORT; # ABORT NIP #
  117. PROC LOCLLCB; # LOCATE LLCB #
  118. PROC HCSTTP; # HOST SIDE CONNECTION STATE TABLE #
  119. PROC HFASTQ ;
  120. PROC HSFCACK ;
  121. PROC HUPDDAW; # UPDATE DATA AVAILABLE WORD IN ACB #
  122. PROC MGETS ;
  123. PROC MRELS; # RELEASE BUFFER #
  124. PROC NBSTTP; # NETWORK BLOCK PROTOCOL STATE TABLE PROC #
  125. PROC OMSG; # ISSUE DAYFILE MESSAGE #
  126. PROC OSCHAPP ;
  127. PROC OVLCALL; # LOAD AND EXECUTE OVERLAY #
  128. PROC XSTTP; # STATE TABLE PROCESSOR #
  129. PROC XTRACE; # RECORD PROCEDURE CALL #
  130. END
  131.  
  132. #
  133.  
  134.  INTERNAL VARIABLES
  135. #
  136.  
  137. SWITCH HBACTION HB0,HB1,HB2,HB3,HB4,HB5,HB6,HB7,HB8,HB9,
  138. HB10,HB11,HB12,HB13,HB14,HB15,HB16;
  139.  
  140.  
  141.  
  142.  
  143.  
  144.  
  145.  
  146. ITEM ACNTINDX; # ACNT INDEX #
  147. ITEM AN; # APPLICATION NUMBER #
  148. ITEM ACN ; # CONNECTION NUMBER #
  149. ITEM CURST; # CURRENT STATE #
  150. ITEM LLCBAD; # LLCB ADDRESS #
  151. ITEM RESP; # RESPONSE WORD RETURNED FROM STAT TAB PRO#
  152. ITEM TEMP ;
  153.  
  154. BASED ARRAY NHWORD2 P(1) ;
  155. BEGIN
  156. ITEM NHINTCHR U (0,0,8) ;
  157. END
  158.  
  159.  
  160. #**********************************************************************#
  161.  
  162. BEGIN
  163.  
  164. CONTROL IFEQ DEBUG,1;
  165. XTRACE("HBSTT") ;
  166. CONTROL FI;
  167.  
  168. # VALIDATE TRIGGER NUMBER #
  169. IF TRIGGER LQ HBMTR AND TRIGGER GQ 0
  170. THEN
  171. BEGIN # VALID TRIGGER NUMBER #
  172. P<ACNB> = ACNBAD; # BASE ACNB #
  173. IF P<ACNB> EQ 0
  174. THEN
  175. BEGIN # ERROR - NO ACNB #
  176. D27M2[0] = "HBSTTP1";
  177. ABORT(DFMSG27,0); # "NIP INTERNAL ERROR" #
  178. END
  179. ELSE
  180. BEGIN
  181. AN = ACNBAN[0]; # APPLICATION NUMBER #
  182. P<ACB> = ATACBA[AN]; # BASE ACB #
  183. P<ACNT> = ACBACNT[0]; # BASE ACNT #
  184. ACN = ACNBACN[0] ;
  185. ACNTINDX = ACN + ACNTHSIZE - ACNTMINACN[0] ;
  186. CURST = ACNTIS[ACNTINDX]; # IVT STATE #
  187. END
  188. XSTTP(HBORD,CURST,TRIGGER,RESP);
  189. P<STRESP> = LOC(RESP); # RESPONSE WORD #
  190. IF LEGTRIG[0]
  191. THEN
  192. BEGIN # LEGAL TRIGGER #
  193. IF ACTION[0] NQ NOCHG
  194. THEN
  195. GOTO HBACTION[ACTION[0]]; # EXECUTE PROPER ACTION #
  196. ELSE
  197. GOTO HBA;
  198.  
  199. HB0:
  200. #
  201.   DLACNB (ACTION NO. 0)
  202.   DELETE ACNB
  203. #
  204. PARAMS1 = P<ACNB>; # ACNB ADDRESS #
  205. PARAMS5 = FALSE ; # NOT A SWICTH CASE #
  206. PARAMS8 = FALSE; # NOT LOANING CONNECTION #
  207. PARAMS9 = STRTSX"RACNB$" ;
  208. OVLNAME = STRTSWP; # OVERLAY NAME #
  209. OVLCALL; # LOAD AND EXECUTE OVERLAY #
  210. GOTO HBA;
  211.  
  212. HB1:
  213. # INTUSR ( ACTION NO. 1 )
  214.   SEND INTR/USR TO APPLICATION
  215. #
  216.  
  217. P<NHEADER> = BLKPTR + BLKHSIZE ;
  218.  
  219. PARAMS1 = P<ACNB> ;
  220. P<NHWORD2> = BLKPTR + BLKHSIZE + NBHSIZE ;
  221.  
  222. IF ACNBINTR[0] EQ 0
  223. THEN
  224. ACNBINTR[0] = NHINTCHR[0] ; # PUT INTERRUPT CHAR INTO ACNB #
  225. OVLNAME = HSINTRUP ; # OVERLAY NAME #
  226. OVLCALL ;
  227. ACNBINTR[0] = 0 ; # CLEAR THE INTRP CHAR #
  228. GOTO HBA ;
  229.  
  230. HB2:
  231. #
  232.   FCBRK1 ( ACTION NO. 2 )
  233.   SEND FC/BRK TO APPLICATION. DISCARD SYNC DATA FROM ACNB
  234. #
  235.  
  236. PARAMS1 = P<ACNB> ;
  237. PARAMS2 = BLKPTR ;
  238. OVLNAME = HSFCBRKP ;
  239. OVLCALL ;
  240. GOTO HBA ;
  241.  
  242. HB3:
  243. #
  244.   FCRST ( ACTION NO. 3 )
  245.   SEND FC/RST TO APPLICATION. (USE SAME OVERLAY AS BRK)
  246. #
  247.  
  248. PARAMS1 = P<ACNB> ;
  249. PARAMS2 = 0 ; #( SIGNALS OVERLAY THAT THIS IS A RESET)#
  250. OVLNAME = HSFCBRKP ;
  251. OVLCALL ;
  252. GOTO HBA ;
  253. HB4:
  254. #
  255.   SEND PRU/ON/A WITH REASON CODE = 3
  256. #
  257. PARAMP1 = 1; # INFORM HPPUT PRU/ON REJECTED #
  258. IF ACBERCNT[0] LS MAXLGERR
  259. THEN # OKAY TO GENERATE PRU/ON/A #
  260. BEGIN
  261. PARAMS1 = RPRU"CNV"; # REASON CODE FOR PRU/ON/A SM #
  262. OVLNAME = HPRUONXP; # NAME OF OVERLAY TO LOAD #
  263. OVLCALL; # LAOD AND EXECUTE OVERLAY #
  264. END
  265. ELSE # REACHED MAX NO OF ERR SUP MSG #
  266. BEGIN
  267. IF ACBERCNT[0] EQ MAXLGERR
  268. THEN # REACHED MAX NO OF ERR SUP MSG #
  269. BEGIN
  270. PARAMS1 = RLG"IAL"; # ERR/LGL RC FOR TOO MANY ERRORS#
  271. OVLNAME = HLGLERRP; # NAME OF OVERLAY TO LOAD #
  272. OVLCALL; # LOAD AND EXECUTE OVERLAY #
  273. END
  274. END
  275. GOTO HBA ;
  276. HB5:
  277. #
  278.   APLMSG (ACTION NO. 5)
  279.   INCREMENT APPLICATION BLOCK LIMIT
  280.   TURN OFF TLO FLAG IF -MSG- BLOCK ON HALF-DUPLEX CONNECTION.
  281. #
  282. P<NWLENTRY> = BLKPTR ;
  283. ACNTABO[ACNTINDX] = ACNTABO[ACNTINDX] + 1;
  284. GOTO HB7;
  285.  
  286. HB6:
  287. #
  288.   EXECUTE PFC-S FROM PRU APPLICATIONS ( IFC, OFC, IFT, OFT, XFT )
  289. #
  290. OVLNAME = HPRUSMP ;
  291. OVLCALL ;
  292. GOTO HBA ;
  293. HB7:
  294. #
  295.   BRKDSM (ACTION NO. 7)
  296.   TURN OFF TLO FLAG IF A -MSG- BLOCK ON A HALF-DUPLEX CONNECTION.
  297. #
  298. P<NWLENTRY> = BLKPTR;
  299. IF (ACNBTLO[0] ) AND # TEMP LIST OFF FLAG SET #
  300. ( (NWLABT[0] EQ APMSG ) OR # DOWNLINE MSG BLOCK #
  301. (NWLABT[0] EQ APPQMSG) ) # DOWNLINE QMSG BLOCK #
  302. THEN # NEED TO UPDATE NO OF DELIVERABLE BLKS #
  303. BEGIN
  304. ACNBTLO[0] = FALSE; # CLEAR TEMP LIST OFF FLAG #
  305. HUPDDAW(P<ACB>,P<ACNB>,0,ACNBBLKSQ[0]); # UPDATE NO OF DELIV #
  306. END
  307. GOTO HBA ;
  308. HB8:
  309. #
  310.   FCINITR (ACTION NO.8)
  311.   SEND FC/INIT/R TO APP
  312. #
  313.  
  314. PARAMS1 = ACN ;
  315. PARAMS2 = AN; # APPLICATION NUMBER #
  316. OVLNAME = HSINITRP; # OVERLAY NAME #
  317. OVLCALL; # LOAD AND EXECUTE OVERLAY #
  318. GOTO HBA;
  319.  
  320. HB9:
  321. #
  322.   HBUINIT (ACTION NO. 9)
  323.   CHECKS AND ALLOWS ONLY A-A CONNECTION
  324. #
  325. IF ACNBDT[0] NQ DT$INTA AND
  326. ACNBDT[0] NQ DT$INTE
  327. THEN
  328. BEGIN
  329. LEGTRIG[0] = FALSE ; # SIGNALS TO ENTER ERROR PROCESSING #
  330. GOTO ENDACTION ;
  331. END
  332. ELSE
  333. GOTO HBA ;
  334.  
  335.  
  336.  
  337. HB10:
  338. #
  339.   FCACKX ( ACTION NO. 10 )
  340.   SEND FCACK OR FCNAK TO APPLICATION
  341. #
  342.  
  343. HSFCACK(BLKPTR,P<ACNB>) ;
  344.  
  345. GOTO HBA ;
  346.  
  347. HB11:
  348. #
  349.   SAVE ( ACTION NO. 11 )
  350.   SAVE THE INTERUPT CHARACTER INTO THE ACNB
  351.   THIS ACTION CAN BE USED TO SAVE THE REASON CODE IN UPLINE
  352.   BREAK FOR AN A TO A CONNECTION DURING INITIZATION.
  353. #
  354.  
  355. P<NHEADER> = BLKPTR + BLKHSIZE ;
  356. ACNBINTR[0] = NHDBC[0] ; # SAVE THE INTERUPT CHARACTER #
  357. GOTO HBA ;
  358.  
  359. HB12:
  360. #
  361.   QUEUE ( ACTION NO. 12 )
  362.   QUEUE DATA ON ACNB
  363. #
  364.  
  365. HFASTQ (BLKPTR,P<ACNB>) ;
  366.  
  367. GOTO HBA ;
  368.  
  369. HB13:
  370. #
  371.   SEND PRU/ON/A WITH RC = 2
  372. #
  373. PARAMP1 = 1; # INFORM HPPUT PRU/ON REJECTED #
  374. IF ACBERCNT[0] LS MAXLGERR
  375. THEN # OKAY TO GENERATE PRU/ON/A #
  376. BEGIN
  377. PARAMS1 = RPRU"CNT"; # REASON CODE FOR PRU/ON/A SM #
  378. OVLNAME = HPRUONXP; # NAME OF OVERLAY TO LOAD #
  379. OVLCALL; # LAOD AND EXECUTE OVERLAY #
  380. END
  381. ELSE # REACHED MAX NO OF ERR SUP MSG #
  382. BEGIN
  383. IF ACBERCNT[0] EQ MAXLGERR
  384. THEN # REACHED MAX NO OF ERR SUP MSG #
  385. BEGIN
  386. PARAMS1 = RLG"IAL"; # ERR/LGL RC FOR TOO MANY ERRORS#
  387. OVLNAME = HLGLERRP; # NAME OF OVERLAY TO LOAD #
  388. OVLCALL; # LOAD AND EXECUTE OVERLAY #
  389. END
  390. END
  391. GOTO HBA ;
  392.  
  393. HB14:
  394. #
  395.   INTAPP ( ACTION NUMBER 14 )
  396.   SET ACNBICMDR
  397. #
  398. IF ACNBICMDR[0]
  399. THEN # APPLICATION INTERRUPT ALREADY PENDING #
  400. TRIGB[0] = NOCHG; # CLEAR NETWORK BLOCK TRIGGER #
  401. ELSE
  402. ACNBICMDR[0] = TRUE; # SET DOWNLINE INTERRUPT PENDING FLAG #
  403. GOTO HBA ;
  404.  
  405. HB15:
  406. #
  407.   SINTRSP ( ACTION NO 15 )
  408.   SEND INTR/RSP TO APPLICATION
  409. #
  410. IF ACNBICMDR[0]
  411. THEN
  412. BEGIN
  413. MGETS(LINTR+BLKHSIZE+ABHSIZE, TEMP,TRUE) ;
  414.  
  415. P<AHEADER> = TEMP + BLKHSIZE ;
  416. ABHABT[0] = APPCMD ;
  417. ABHACT[0] = CT60TRANS ;
  418. ABHTLC[0] = LINTR ;
  419.  
  420. P<SUPMSG> = TEMP + BLKHSIZE + ABHSIZE ;
  421. PFCSFC[0] = INTRRSP ;
  422. INTRACN[0] = ACNBACN[0] ;
  423. BLINK(TEMP,P<ACB>) ;
  424. OSCHAPP(P<ACB>) ;
  425. ACNBICMDR[0] = FALSE ;
  426. END
  427.  
  428. GOTO HBA ;
  429.  
  430. HB16:
  431. PARAMP1 = 1; # SET PARAMP1 TO 1 TO SIGNAL NO #
  432. GOTO HBA; # PCNB CONVERSION, PRUON IS NOT O.K.#
  433.  
  434.  
  435. HBA:
  436. IF NEWSTATE[0] NQ STATX
  437. THEN
  438. BEGIN
  439. ACNTIOS[ACNTINDX] = CURST; # SET OLD IVT STATE #
  440. ACNTITR[ACNTINDX] = TRIGGER; # SET OLD IVT TRIGGER #
  441. IF NEWSTATE[0] NQ NOCHG
  442. THEN
  443. ACNTIS[ACNTINDX] = NEWSTATE[0]; # UPDATE NEW IVT STATE #
  444. END
  445.  
  446. IF TRIGC[0] NQ NOCHG
  447. THEN
  448. HCSTTP(P<ACB>,ACN,TRIGC[0],0) ;
  449.  
  450. IF TRIGB[0] NQ NOCHG
  451. THEN
  452. BEGIN # TRIGGER NETW BLOCK PROT STP #
  453. P<NCNB> = ACNBNCNB[0]; # NCNB ADDRESS #
  454. CONTROL IFEQ DEBUG,1;
  455. IF P<NCNB> EQ 0
  456. THEN
  457. BEGIN
  458. D27M2[0] = "HBSTTP2";
  459. ABORT(DFMSG27,0); # "NIP INTERNAL ERROR" #
  460. END
  461. CONTROL FI;
  462. NBSTTP(P<NCNB>,TRIGB[0],BLKPTR);
  463. END
  464.  
  465.  
  466. ENDACTION:END
  467.  
  468. IF NOT LEGTRIG[0]
  469. THEN
  470.  
  471. BEGIN # ILLEGAL TRIGGER #
  472. IF TRIGGER LS HBMINXT OR TRIGGER GR HBMAXXT
  473. THEN
  474. BEGIN # TRIGGER INTERNAL TO NIP #
  475. PARAMS1 = AN; # APPLICATION NUMBER #
  476. PARAMS2 = ACN ;
  477. PARAMS3 = TRIGGER; # ILLEGAL TRIGGER #
  478. PARAMS4 = CURST; # CURRENT BLOCK PROT STATE #
  479. PARAMS6 = "HBSTTP"; # NAME OF STATE TABLE PROCESSOR #
  480. OVLNAME = STPHERRP; # ISSUE STP ERROR MESSAGE #
  481. OVLCALL; # LOAD AND EXECUTE OVERLAY #
  482. ABORT(0,0); # ABORT NIP #
  483. END
  484. ELSE
  485.  
  486. BEGIN # ILLEGAL EXTERNAL TRIGGER FROM APPL #
  487. IF TRIGGER EQ RMSG
  488. THEN
  489. PARAMS1 = RLG"ACN"; # RC=4 INVALID ACN #
  490. ELSE
  491. PARAMS1 = RLG"ISM"; # RC=7 ILLOGICAL SM #
  492. OVLNAME = HLGLERRP; # SEND ERR/LGL TO APPL #
  493. OVLCALL; # LOAD AND EXECUTE OVERLAY #
  494. END
  495.  
  496. END
  497. END
  498. ELSE
  499.  
  500. BEGIN # TRIGGER NUMBER OUT OF RANGE #
  501. PARAMS1 = DFMSG26;
  502. PARAMS6 = "HB";
  503. OVLNAME = XERRMSGP;
  504. OVLCALL;
  505. END
  506.  
  507. RETURN;
  508.  
  509. END
  510. TERM
1)
ACNBAD),(TRIGGER),(BLKPTR
cdc/nos2.source/nam5871/hbsttp.txt ยท Last modified: 2023/08/05 17:22 by Site Administrator