User Tools

Site Tools


cdc:nos2.source:nam5871:ippgeti

IPPGETI

Table Of Contents

  • [00003] PROC IPPGETI (SOCKID, ADDRESS, SOCKSTATUS)
  • [00005] IPPGETI - GET SOCKET INFORMATION

Source Code

IPPGETI.txt
  1. *DECK IPPGETI
  2. USETEXT TEXTIPL
  3. PROC IPPGETI (SOCKID, ADDRESS, SOCKSTATUS);
  4. *CALL COPYRITE CDCNET - COPYRIGHT CONTROL DATA. 1992.
  5. # TITLE IPPGETI - GET SOCKET INFORMATION #
  6.  
  7. BEGIN # IPPGETI #
  8. #
  9. **** IPPGETI GET SOCKET INFORMATION.
  10. *
  11. * THIS PROCEDURE OBTAINS THE IP ADDRESS AND PORT NUMBER OF A SOCKET
  12. * WHICH HAS BEEN BOUND.
  13. *
  14. * PROC IPPGETI
  15. *
  16. * ENTRY SOCKID = INTEGER VALUE OF A SOCKET.
  17. *
  18. * EXIT ADDRESS = 4 WORD ARRAY OF ADDRESS.
  19. * SOCKSTATUS = COMPLETION STATUS
  20. *
  21. * METHOD VERIFY THE SOCKET IS CONNECTED AND THAT IT IS IN THE
  22. * BOUND STATE. IF THE SOCKET HAS DISCONNECTED, RETURN AN
  23. * ABORT STATUS FOR CONNECTION. COPY THE IP ADDRESS FROM
  24. * THE SOCKET TO *ADDRESS*.
  25. #
  26.  
  27. #
  28. **
  29. #
  30. ITEM SOCKID I; # SOCKET IDENTIFIER #
  31. ARRAY ADDRESS [00:00] S(1);; # IP ADDRESS/PORT OF SOCKET #
  32. ITEM SOCKSTATUS S:SOCKSTAT; # RETURNED SOCKET STATUS #
  33. CONTROL EJECT;
  34. #
  35. **** START MAIN PROCEDURE
  36. #
  37.  
  38. IF (ACN$ABORT [SOCKID])
  39. THEN
  40. BEGIN # CONNECTION ABORTED #
  41. SOCKSTATUS = S"ABORT";
  42. RETURN;
  43. END
  44.  
  45. IF ACN$STATE [SOCKID] NQ S"BOUND"
  46. THEN
  47. BEGIN
  48. SOCKSTATUS = S"INVALIDST";
  49. RETURN;
  50. END
  51.  
  52. P<IP$ADDR$REC> = LOC (ADDRESS);
  53. IP$IPFIU [0] = ACN$SIPFIU [SOCKID];
  54. IP$IPNET [0] = ACN$SIPNET [SOCKID];
  55. IP$IPHOST [0] = ACN$SIPHOST [SOCKID];
  56. IP$UDPORT [0] = ACN$SIUPORT [SOCKID];
  57.  
  58. SOCKSTATUS = S"OK";
  59.  
  60. RETURN; # RETURN TO CALLER #
  61.  
  62. END # IPPGETI #
  63.  
  64. TERM
cdc/nos2.source/nam5871/ippgeti.txt ยท Last modified: 2023/08/05 17:22 by Site Administrator