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