User Tools

Site Tools


cdc:nos2.source:nam5871:ipipidb

IPIPIDB

Table Of Contents

  • [00003] PROC IPIPIDB
  • [00005] IPIPIDB - PROCESS INPUT DATA BLOCK.
  • [00044] PROC IPIAIPA
  • [00045] PROC IPIDOSM

Source Code

IPIPIDB.txt
  1. *DECK IPIPIDB
  2. USETEXT TEXTIPL
  3. PROC IPIPIDB;
  4. *CALL COPYRITE CDCNET - COPYRIGHT CONTROL DATA. 1992.
  5. # TITLE IPIPIDB - PROCESS INPUT DATA BLOCK. #
  6.  
  7. BEGIN # IPIPIDB #
  8. #
  9. **** IPIPIDB PROCESS INPUT DATA BLOCK.
  10. *
  11. * THIS PROCEDURE PROCESSES ALL NON-SUPERVISORY MESSAGES RECEIVED BY
  12. * SOCKET LIBRARY. THE DATA IS STORED IN A QUEUE ARRAY BASED ON THE
  13. * CONNECTION NUMBER.
  14. *
  15. * PROC IPIPIDB
  16. *
  17. * ENTRY INPBUF = ARRAY CONTAINING INPUT DATA BLOCK.
  18. * P<ABH> = PTR TO INPUT APPLICATION BLOCK HEADER.
  19. *
  20. * EXIT QUE$BUF = ARRAY CONTAINS THE INPUT DATA BLOCK.
  21. *
  22. * METHOD IF THE CONNECTION STATE IS NOT *CONNECTED* OR *IDLE*
  23. * THEN TREAT AS A NAM PROTOCOL ERROR.
  24. *
  25. * IF THE STATE IS NOT *OPEN* OR *BOUND* THE DATA IS
  26. * DISCARDED.
  27. *
  28. * IF THE BLOCK TYPE IS *APPBLK* OR *APMSG* THEN THE
  29. * DATA IS MOVED INTO THE CONNECTIONS QUEUE STORAGE AREA.
  30. * A LST/OFF SUPERVISORY MESSAGE IS SENT SO NO MORE DATA
  31. * WILL BE RECEIVED ON THE CONNECTION UNTIL THE APPLICATION
  32. * PROCESSES IT.
  33. *
  34. * IF THE BLOCK TYPE IS NOT *APPBLK* OR *APMSG*, THEN THE
  35. * CONNECTION IS TERMINATED.
  36. *
  37. #
  38.  
  39. #
  40. **** PROC IPIPIDB - XREF LIST
  41. #
  42. XREF
  43. BEGIN
  44. PROC IPIAIPA; # ABORT THE IP APPLICATION #
  45. PROC IPIDOSM; # DISPATCH OUTPUT SUPERVISORY MESSAGE #
  46. END
  47. #
  48. **
  49. #
  50. ITEM DATALNTH I; # RECEIVED DATA LENGTH IN WORDS #
  51. ITEM LOOP I; # DATA ARRAY LOOP COUNTER #
  52. CONTROL EJECT;
  53.  
  54. #
  55. **** START MAIN PROCEDURE
  56. #
  57.  
  58. CURACN = ABHADR [0]; # DETERMINE CONNECTION NUMBER #
  59.  
  60. #
  61. **** IF CONNECTION STATE IS *CONNECTED* OR *IDLE*, THEN TREAT AS A NAM
  62. * PROTOCOL ERROR.
  63. #
  64. IF (ACN$STATE [CURACN] EQ S"IDLE") OR
  65. (ACN$STATE [CURACN] EQ S"CONNECTED")
  66. THEN
  67. BEGIN
  68. IPIAIPA (NDATA$); # NAM PROTOCOL ERROR #
  69. RETURN;
  70. END;
  71. #
  72. **** IF CONNECTION OPEN, THEN ACCEPT DATA. ALL OTHER STATES
  73. * ARE IGNORED. ONLY *BLK* AND *MSG* TYPE BLOCK ARE ACCEPTED,
  74. * ALL OTHERS ARE TREATED AS A CONNECTION PROTOCOL ERROR AND THE
  75. * CONNECTION IS TERMINATED.
  76. *
  77. #
  78. IF (ACN$CONNECT [CURACN])
  79. THEN
  80. BEGIN
  81. IF (ABHABT [0] NQ APPBLK)
  82. AND (ABHABT [0] NQ APMSG)
  83. THEN
  84. BEGIN
  85. ACN$ABORT [CURACN] = TRUE;
  86. RETURN;
  87. END
  88.  
  89. #
  90. **** MOVE THE RECEIVED BUFFER INTO THE INPUT QUEUE STORAGE AREA.
  91. *
  92. #
  93. P<REA$BUF> = ACN$BUFFER [CURACN];
  94. ACN$DATAV [CURACN] = TRUE;
  95. ACN$DATALNTH [CURACN] = ABHTLC [0];# RECEIVED BLOCK LENGTH #
  96. DATALNTH = ABHTLC [0] * 10 / 75 - 1; # BLOCK LENGTH IN WORDS #
  97. ACN$MORE [CURACN] = (ABHABT [0] EQ APPBLK);
  98.  
  99. FOR LOOP = 0 STEP 1 UNTIL (ACN$DATALNTH [CURACN] - 1)
  100. DO
  101. BEGIN
  102. REA$WORD [LOOP] = INP$WORD [LOOP];
  103. END
  104.  
  105. #
  106. **** SET FLOW CONTROL ON THIS CONNECTION UNTIL THE DATA HAS BEEN
  107. * PROCESSED.
  108. *
  109. #
  110. P<APSM> = LOC(OUTBUF);
  111. SPMSG0 [0] = 0;
  112. LSTACN [0] = CURACN;
  113. IPIDOSM (LSTOFF, LLST); # ISSUE LST/OFF/R SM #
  114. END
  115.  
  116. RETURN; # RETURN TO CALLER #
  117.  
  118. END # IPIPIDB #
  119.  
  120. TERM
cdc/nos2.source/nam5871/ipipidb.txt ยท Last modified: 2023/08/05 17:22 by Site Administrator