User Tools

Site Tools


cdc:nos2.source:nam5871:nbadbsn

NBADBSN

Table Of Contents

  • [00009] PRGM NBADBSN
  • [00059] PROC ABORT
  • [00060] PROC MGETS
  • [00061] PROC XTRACE

Source Code

NBADBSN.txt
  1. *DECK NBADBSN
  2. USETEXT NIPDEF
  3. USETEXT AHEADER
  4. USETEXT KDIS
  5. USETEXT NCNB
  6. USETEXT SUPMSG
  7. USETEXT PARAMS
  8.  
  9. PRGM NBADBSN; # PROCESS BAD BSN ON AN UPLINE BACK #
  10.  
  11. STARTIMS;
  12. #
  13. *1DC NBADBSN
  14. *
  15. * 1. PROC NAME AUTHOR DATE
  16. * NBADBSN L. T. NGUYEN 81/10/26
  17. *
  18. * 2. FUNCTIONAL DESCRIPTION
  19. * LOCATE ACKQ ENTRY THAT HAS BSN MATCHED.
  20. *
  21. * 3. METHOD USED
  22. * LOCATE THE ENTRY WITH MATCHING BSN (1ST FOR LOOP)
  23. * IF FOUND, FORM FC/NAK AND CALL HBSTTP TO SEND TO APPL.
  24. * FROM THE HOST SIDE FOR ALL ENTRIES NOT IN SEQUENCE.
  25. * THEN RETURN TO CALLER WITH THE GOOD ENTRY ADDRESS.
  26. * IF NOT FOUND, SET PARAMS3 TO ZERO.
  27. *
  28. * 4. ENTRY PARAMETERS
  29. * PARAMS1 - NCNB ADDRESS
  30. * PARAMS2 - BSN FROM CCP
  31. *
  32. * 5. EXIT PARAMETERS
  33. * PARAMS3 - 0 IF NO ACKQ ENTRY FOUND.
  34. * - OR ADDRESS OF ACKQ ENTRY HAS MATCHING BSN.
  35. *
  36. * 6. COMDECKS CALLED AND SYMPL TEXTS USED
  37. * NIPDEF PARAMS AHEADER SUPMSG
  38. * ACNB NCNB ACKHEAD OSSIZE
  39. * KDIS
  40. *
  41. * 7. ROUTINES AND OVERLAYS CALLED
  42. * MGETS - ALLOCATE BUFFER
  43. * XTRACE - TRACE PROCEDURE CALL
  44. *
  45. * 8. DAYFILE MESSAGES AND OTHER IMPORTANT INFORMATION
  46. * THIS IS A SECONDARY OVERLAY CALLED BY NPBACK.
  47. * W A R N I N G - THIS PROGRAM CANNOT EXCEED THE SECONDARY
  48. *CALL OSSIZE
  49.   INPUT PARAMETERS - PARAMS1 = NCNB ADDRESS
  50.   PARAMS2 = BSN OF THE UPLINE BLOCK
  51. #
  52. STOPIMS;
  53.  
  54. #
  55.   EXTERNAL REFERENCES
  56. #
  57. XREF
  58. BEGIN
  59. PROC ABORT; # ABORT NIP ON BAD BSN #
  60. PROC MGETS; # GET BUFFER #
  61. PROC XTRACE; # TRACE CALL #
  62. LABEL RJMAIN;
  63. END
  64. #
  65.   LOCAL VARIABLES
  66. #
  67. ITEM ACKHDR; # ACKQ HEADER ADDRESS #
  68. ITEM BUFADDR; # BUFFER ADDRESS FOR PSEUDO ACK/NAK(S) #
  69. ITEM BUFSIZE; # BUFFER SIZE #
  70. ITEM BSN; # BLOCK SEQUENCE NUMBER #
  71. ITEM MATCH B; # MATCH INDICATOR #
  72. ITEM I; # INDUCTION VARIABLE #
  73. ITEM J; # INDUCTION VARIABLE #
  74. ITEM OUTPTR; # ACKQ OUT POINTER #
  75.  
  76. ARRAY MSG$BADBSN [0:0] S(3);
  77. BEGIN
  78. ITEM MSG$TEXT C(00,00,28) = # MESSAGE TEXT #
  79. ["NIP RECEIVED BAD BSN."];
  80. ITEM MSG$END U(02,48,12) = [0];
  81. END
  82.  
  83. CONTROL EJECT;
  84.  
  85. BEGIN # NBADBSN #
  86.  
  87. CONTROL IFEQ DEBUG,1;
  88. XTRACE("NBBSN"); # TRACE CALL #
  89. CONTROL FI; # END OF DEBUG CODE #
  90.  
  91. IF KNAMDB[0]
  92. THEN # ABORT NAM ON BAD BSNS FROM NETWORK #
  93. BEGIN
  94. ABORT(MSG$BADBSN,0); # ABORT NAM #
  95. END
  96.  
  97. P<NCNB> = PARAMS1; # NCNB ADDRESS #
  98. BSN = PARAMS2; # UPLINE BSN #
  99. OUTPTR = NCNBAKOU[0]; # ACKQ OUT POINTER #
  100. ACKHDR = OUTPTR+ACKHSIZE; # FIRST ACKQ ENTRY #
  101. MATCH = FALSE; # PRESET TO NO MATCH #
  102.  
  103. FOR I=0 STEP 1 WHILE NOT MATCH
  104. AND OUTPTR NQ NCNBAKIN[0] # MORE ACKQ ENTRY #
  105. DO # SCAN FOR MATCHING BSN IN ACKQ #
  106. BEGIN
  107. P<AHEADER> = ACKHDR+OUTPTR; # CURRENT ACKQ ENTRY #
  108. IF BSN EQ ABHADR[0]
  109. THEN # BSN MATCH FOUND #
  110. MATCH = TRUE; # TERMINATE ACKQ SEARCH #
  111. ELSE # NOT MATCH FOUND #
  112. BEGIN
  113. IF (OUTPTR+1) LS NCNBDBL[0]
  114. THEN
  115. OUTPTR = OUTPTR+1;
  116. ELSE
  117. OUTPTR = 0; # RESET ACKQ OUT POINTER #
  118. END
  119. END # I CONTAINS NUMBER OF ACKQ ENTRY(S) PROCESSED #
  120.  
  121. IF MATCH
  122. THEN # BSN MATCH, SEND FC/NAK(S) AND FC/ACK TO APPLICATION #
  123. BEGIN
  124. MGETS(I+BLKHSIZE,BUFADDR,TRUE); # GET BUFFER FOR ACK/NAK #
  125. FOR J=BLKHSIZE STEP 1 WHILE J LQ I
  126. DO # FORMAT PSEUDO ACK/NAK ENTRY(S) #
  127. BEGIN
  128. P<SUPMSG> = BUFADDR+J; # PSEUDO ENTRY #
  129. P<AHEADER> = ACKHDR+NCNBAKOU[0];
  130. IF BSN EQ ABHADR[0]
  131. THEN # BSN MATCH, SEND FC/ACK #
  132. PFCSFC[0] = FCACK;
  133. ELSE # BSN MISMATCH, SEND FC/NAK #
  134. BEGIN
  135. PFCSFC[0] = FCNAK;
  136. FCRNAK[0] = 1; # REASON CODE FOR NAK #
  137. END
  138. FCABN[0] = ABHABN[0]; # SET ABN #
  139.  
  140. IF (NCNBAKOU[0]+1) GQ NCNBDBL[0]
  141. THEN
  142. NCNBAKOU[0] = 0;
  143. ELSE
  144. NCNBAKOU[0] = NCNBAKOU[0]+1;
  145. NCNBNBO[0] = NCNBNBO[0]-1; # DECREMENT NBO COUNT #
  146. END
  147.  
  148. PARAMS3 = BUFADDR; # RETURN PSEUDO ENTRY ADDRESS #
  149. END
  150.  
  151. ELSE # NO MATCHING BSN FOUND IN ACKQ, IGNORE BACK #
  152. PARAMS3 = 0; # NO PSEUDO ENTRY TO PROCESS FOR HBSTTP #
  153.  
  154. GOTO RJMAIN;
  155. END # NBADBSN #
  156. TERM
cdc/nos2.source/nam5871/nbadbsn.txt ยท Last modified: 2023/08/05 17:22 by Site Administrator