home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / tolkit45.zip / os2tk45 / som / include / somssock.idl < prev    next >
Text File  |  1999-02-22  |  8KB  |  288 lines

  1. //
  2. //   COMPONENT_NAME: somu
  3. //
  4. //   ORIGINS: 27
  5. //
  6. //
  7. //   10H9767, 10H9769  (C) COPYRIGHT International Business Machines Corp. 1992,1994
  8. //   All Rights Reserved
  9. //   Licensed Materials - Property of IBM
  10. //   US Government Users Restricted Rights - Use, duplication or
  11. //   disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
  12. //
  13. //#  @(#) 2.7 src/soms/somssock.idl, somu, som2.1 9/1/94 17:46:28 [7/30/96 14:49:46]
  14.  
  15.  
  16.  
  17. #ifndef somssock_idl
  18. #define somssock_idl
  19.  
  20. #include <somobj.idl>
  21. #include <snglicls.idl>
  22.  
  23. interface Sockets : SOMObject
  24. {
  25.     typedef SOMFOREIGN sockaddr;
  26.     #pragma modifier sockaddr : impctx="C", struct;
  27.     typedef SOMFOREIGN iovec;
  28.     #pragma modifier iovec : impctx="C", struct;
  29.     typedef SOMFOREIGN msghdr;
  30.     #pragma modifier msghdr : impctx="C", struct;
  31.     typedef SOMFOREIGN fd_set;
  32.     #pragma modifier fd_set : impctx="C", struct;
  33.     typedef SOMFOREIGN timeval;
  34.     #pragma modifier timeval : impctx="C", struct;
  35.     typedef SOMFOREIGN hostent;
  36.     #pragma modifier hostent : impctx="C", struct;
  37.     typedef SOMFOREIGN servent;
  38.     #pragma modifier servent : impctx="C", struct;
  39.     typedef SOMFOREIGN in_addr;
  40.     #pragma modifier in_addr : impctx="C", struct;
  41.  
  42.  
  43.     long somsAccept (in long s, out sockaddr name, out long namelen);
  44.  
  45.     // Accept a connection request from a client.
  46.  
  47.  
  48.     long somsBind (in long s, inout sockaddr name, in long namelen);
  49.  
  50.     // Binds a unique local name to the socket with descriptor s.
  51.  
  52.  
  53.     long somsConnect (in long s, inout sockaddr name, in long namelen);
  54.  
  55.     // For streams sockets, attempts to establish a connection between
  56.     // two sockets.  For datagram sockets, specifies the socket's peer.
  57.  
  58.  
  59.     hostent *somsGethostbyaddr (in char *addr, in long addrlen, 
  60.         in long domain);
  61.  
  62.     // Returns a hostent structure for the host address specified on
  63.     // the call.
  64.  
  65.  
  66.     hostent *somsGethostbyname (in string name);
  67.  
  68.     // Returns a hostent structure for the host name specified on 
  69.     // the call.
  70.  
  71.  
  72.     hostent *somsGethostent ();
  73.  
  74.     // Returns a pointer to the next entry in the hosts file.
  75.  
  76.  
  77.     unsigned long somsGethostid ();
  78.  
  79.     // Returns the unique identifier for the current host.
  80.  
  81.  
  82.     long somsGethostname (in string name, in long namelength);
  83.  
  84.     // Retrieves the standard host name of the local host.
  85.  
  86.  
  87.     long somsGetpeername (in long s, out sockaddr name, out long namelen);
  88.  
  89.     // Gets the name of the peer connected to socket s.
  90.  
  91.  
  92.     servent *somsGetservbyname (in string name, in string protocol);
  93.  
  94.     // Retrieves an entry from the /etc/services file using the service
  95.     // name as a search key.
  96.  
  97.  
  98.     long somsGetsockname (in long s, out sockaddr name, out long namelen);
  99.  
  100.     // Stores the current name for the socket specified by the s
  101.     // parameter into the structure pointed to by the name parameter.
  102.  
  103.  
  104.     long somsGetsockopt (in long s, in long level, in long optname,
  105.         in char *optval, out long option);
  106.  
  107.     // Returns the values of socket options at various protocol levels.
  108.  
  109.  
  110.     unsigned long somsHtonl (in unsigned long a);
  111.  
  112.     // Translates an unsigned long integer from host-byte order to
  113.     // network-byte order.
  114.  
  115.  
  116.     unsigned short somsHtons (in unsigned short a);
  117.  
  118.     // Translates an unsigned short integer from host-byte order to
  119.     // network-byte order.
  120.  
  121.  
  122.     long somsIoctl (in long s, in long cmd, in char *data, in long length);
  123.  
  124.     // Controls the operating characteristics of sockets.
  125.  
  126.  
  127.     unsigned long somsInet_addr (in string cp);
  128.  
  129.     // Interprets character strings representing numbers expressed in
  130.     // standard '.' notation and returns numbers suitable for use as
  131.     // internet addresses.
  132.  
  133.  
  134.     unsigned long somsInet_lnaof (in in_addr addr);
  135.  
  136.     // Breaks apart the internet address and returns the local network
  137.     // address portion.
  138.  
  139.  
  140.     in_addr somsInet_makeaddr (in unsigned long net, in unsigned long lna);
  141.  
  142.     // Takes a network number and a local network address and constructs
  143.     // an internet address.
  144.  
  145.  
  146.     unsigned long somsInet_netof (in in_addr addr);
  147.  
  148.     // Returns the network number portion of the given internet address.
  149.  
  150.  
  151.     unsigned long somsInet_network (in string cp);
  152.  
  153.     // Interprets character strings representing numbers expressed in
  154.     // standard '.' notation and returns numbers suitable for use as
  155.     // network numbers.
  156.  
  157.  
  158.     string somsInet_ntoa (in in_addr addr);
  159.  
  160.     // Returns a pointer to a string expressed in the dotted-decimal
  161.     // notation.
  162.  
  163.  
  164.     long somsListen (in long s, in long backlog);
  165.  
  166.     // Creates a connection request queue of length backlog to queue
  167.     // incoming connection requests, and then waits for incoming
  168.     // connection requests.
  169.  
  170.  
  171.     unsigned long somsNtohl (in unsigned long a);
  172.  
  173.     // Translates an unsigned long integer from network-byte order
  174.     // to host-byte order.
  175.  
  176.  
  177.     unsigned short somsNtohs (in unsigned short a);
  178.  
  179.     // Translates an unsigned short integer from network-byte order
  180.     // to host-byte order.
  181.  
  182.  
  183.     long somsReadv (in long s, inout iovec iov, in long iovcnt);
  184.  
  185.     // Reads data on socket s and stores it in a set of buffers 
  186.     // described by iov.
  187.  
  188.  
  189.     long somsRecv (in long s, in char *buf, in long len, in long flags);
  190.  
  191.     // Receives data on streams socket s and stores it in buf.
  192.  
  193.  
  194.     long somsRecvfrom (in long s, in char *buf, in long len, 
  195.         in long flags, out sockaddr name, out long namelen);
  196.  
  197.     // Receives data on datagram socket s and stores it in buf.
  198.  
  199.  
  200.     long somsRecvmsg (in long s, inout msghdr msg, in long flags);
  201.  
  202.     // Receives messages on a socket with descriptor s and stores them
  203.     // in an array of message headers.
  204.  
  205.  
  206.     long somsSelect (in long nfds, inout fd_set readfds,
  207.         inout fd_set writefds, inout fd_set exceptfds, 
  208.         inout timeval timeout);
  209.  
  210.     // Monitors activity on a set of different sockets until a timeout
  211.     // expires, to see if any sockets are ready for reading or writing,
  212.     // or if an exceptional condition is pending.
  213.  
  214.  
  215.     long somsSend (in long s, in char *msg, in long len, in long flags);
  216.  
  217.     // Sends msg on streams socket s.
  218.  
  219.  
  220.     long somsSendmsg (in long s, inout msghdr msg, in long flags);
  221.  
  222.     // Sends messages passed in an array of message headers on a socket
  223.     // with descriptor s.
  224.  
  225.  
  226.     long somsSendto (in long s, inout char msg, in long len, 
  227.         in long flags, inout sockaddr to, in long tolen);
  228.  
  229.     // Sends msg on datagram socket s.
  230.  
  231.  
  232.     long somsSetsockopt (in long s, in long level, in long optname,
  233.         in char *optval, in long optlen);
  234.  
  235.     // Sets options associated with a socket.
  236.  
  237.  
  238.     long somsShutdown (in long s, in long how);
  239.  
  240.     // Shuts down all or part of a full-duplex connection.
  241.  
  242.  
  243.     long somsSocket (in long domain, in long type, in long protocol);
  244.  
  245.     // Creates an endpoint for communication and returns a socket
  246.     // descriptor representing the endpoint.
  247.  
  248.  
  249.     long somsSoclose (in long s);
  250.  
  251.     // Shuts down socket s and frees resources allocated to the socket.
  252.  
  253.  
  254.     long somsWritev (in long s, inout iovec iov, in long iovcnt);
  255.  
  256.     // Writes data on socket s.  The data is gathered from the buffers
  257.     // described by iov.
  258.  
  259.     attribute long serrno;
  260.  
  261. #ifdef __SOMIDL__
  262.     implementation
  263.     {
  264.     releaseorder:somsAccept, somsBind, somsConnect, somsGethostbyaddr,
  265.         somsGethostbyname, somsGethostent, somsGethostid,
  266.         somsGethostname, somsGetpeername, somsGetsockname,
  267.         somsGetsockopt, somsHtonl, somsHtons, somsIoctl,
  268.         somsInet_addr, somsInet_lnaof, somsInet_makeaddr,
  269.         somsInet_netof, somsInet_network, somsInet_ntoa,
  270.         somsListen, somsNtohl, somsNtohs, somsReadv,
  271.         somsRecv, somsRecvfrom, somsRecvmsg, somsSelect,
  272.         somsSend, somsSendmsg, somsSendto, somsSetsockopt,
  273.         somsShutdown, somsSocket, somsSoclose, somsWritev,
  274.         _set_serrno, _get_serrno, somsGetservbyname;
  275.  
  276.     //# Class modifiers
  277.         majorversion = 2;
  278.         minorversion = 1;
  279.     callstyle=idl;
  280.     metaclass = SOMMSingleInstance;
  281.     dll="soms.dll";
  282.     };
  283. #endif /* __SOMIDL__ */
  284. };
  285.  
  286.  
  287. #endif  /* somssock_idl */
  288.