User Tools

Site Tools


cdc:nos2.source:nam5871:ippopes

IPPOPES

Table Of Contents

  • [00003] PROC IPPOPES (SOCKID, SOCKTYPE, SOCKSTATUS)
  • [00005] IPPOPES - OPEN SOCKET
  • [00032] PROC IPIDOSM
  • [00033] PROC IPINITH

Source Code

IPPOPES.txt
  1. *DECK IPPOPES
  2. USETEXT TEXTIPL
  3. PROC IPPOPES (SOCKID, SOCKTYPE, SOCKSTATUS);
  4. *CALL COPYRITE CDCNET - COPYRIGHT CONTROL DATA. 1992.
  5. # TITLE IPPOPES - OPEN SOCKET #
  6.  
  7. BEGIN # IPPOPES #
  8. #
  9. **** IPPOPES OPEN SOCKET
  10. *
  11. * THIS PROCEDURE OPENS A SOCKET TO THE TCP/IP GATEWAY.
  12. *
  13. * PROC IPPOPES
  14. *
  15. * ENTRY SOCKTYPE = 0 - UDP, 1 - TCP.
  16. *
  17. * EXIT SOCKID = INTEGER VALUE OF SOCKET
  18. * SOCKSTATUS = COMPLETION STATUS
  19. *
  20. * METHOD IF THIS IS A *UDP* SOCKET THEN A SINGLE *NAM* CONNECTION
  21. * IS CREATED. IF THIS IS A *TCP* SOCKET, THEN TWO *NAM*
  22. * CONNECTIONS ARE CREATED, A CONTROL AND A DATA CONNECTION.
  23. * CURRENTLY ONLY *UDP* WILL BE SUPPORTED.
  24. *
  25. #
  26.  
  27. #
  28. **** PROC IPPOPES - XREF LIST
  29. #
  30. XREF
  31. BEGIN
  32. PROC IPIDOSM; # DISPATCH OUTPUT SUPERVISORY MESSAGE #
  33. PROC IPINITH; # NAM INPUT TRAFFIC HANDLER #
  34. END
  35. #
  36. **
  37. #
  38.  
  39. ITEM LOOP I; # LOOP COUNTER #
  40. ITEM SOCKTYPE S:PTYPE; # SOCKET TYPE #
  41. ITEM SOCKID I; # SOCKET IDENTIFIER #
  42. ITEM SOCKSTATUS S:SOCKSTAT; # RETURNED SOCKET STATUS #
  43. CONTROL EJECT;
  44. #
  45. **** START MAIN PROCEDURE
  46. #
  47.  
  48.  
  49. SWITCH SOCK$:PTYPE SOCK$UDP:SOCKETUDP,
  50. SOCK$TCP:SOCKETTCP;
  51.  
  52. GOTO SOCK$ [SOCKTYPE];
  53. BEGIN # SOCKET TYPE #
  54.  
  55. SOCK$UDP:
  56. P<ABH> = LOC (SABH); # BASE ABH POINTER #
  57. ABHABN [0] = CONNECTABN$; # DEFINE BLOCK NUMBER FOR ACRQ #
  58.  
  59. P<APSM> = LOC (OUTBUF); # BASE SUPERVISORY MESSAGE PTR #
  60. SPMSG0 [0] = 0;
  61. SPMSG1 [0] = 0;
  62. CONANM [0] = TGW$BASENAME [0]; # TCP/IP GATEWAY NAME #
  63. CONANM2 [0] = TGW$MID [0];
  64.  
  65. IPIDOSM (CONACR, LCONAC); # SEND CON/ACRQ SM #
  66.  
  67. ABHABN [0] = 0; # CLEAR APPLICATION BLOCK NUMBER#
  68. ISS$WORD [0] = 0; # CLEAR CONNECTION STATUS WORD #
  69. ISS$STATUS [0] = SOCKSTAT"WAIT";
  70.  
  71. BLOCK = TRUE; # DEFAULT NETWAIT TIMER 2 SEC #
  72. FOR LOOP = 0
  73. WHILE (ISS$STATUS EQ SOCKSTAT"WAIT") DO
  74. BEGIN
  75. IPINITH; # NAM INPUT TRAFFIC HANDLER #
  76. END
  77.  
  78. GOTO OPEN$END;
  79.  
  80. SOCK$TCP:
  81. END # SOCKET TYPE #
  82.  
  83. OPEN$END:
  84. SOCKSTATUS = ISS$STATUS [0];
  85. SOCKID = ISS$ACN [0];
  86.  
  87. RETURN; # RETURN TO CALLER #
  88.  
  89. END # IPPOPES #
  90.  
  91. TERM
cdc/nos2.source/nam5871/ippopes.txt ยท Last modified: 2023/08/05 17:22 by Site Administrator