VMS Help
CC, Socket Routines

 *Conan The Librarian (sorry for the slow response - running on an old VAX)

       Socket routines are used in writing Internet application
       programs for the DEC TCP/IP Services for OpenVMS product
       (formerly the VMS/ULTRIX Connection).

  1 - accept

    Accepts a connection on a socket.

    Syntax:

      #include  <types.h>
      #include  <socket.h>

    _DECC_V4_SOURCE defined:

      int accept(int s, struct sockaddr *addr, int *addrlen);

    _DECC_V4_SOURCE not defined:

      int accept(int s, struct sockaddr *addr, size_t *addrlen);

  2 - bind

    Binds a name to a socket.

    Syntax:

      #include  <types.h>
      #include  <socket.h>

    _DECC_V4_SOURCE defined:

      int bind(int s, struct sockaddr *name, int namelen);

    _DECC_V4_SOURCE not defined:

      int bind(int s, const struct sockaddr *name, size_t namelen);

  3 - close

    Closes a connection and deletes a socket descriptor.

    Syntax:

      #include  <unixio.h>

      int close(s);

  4 - connect

    Initiates a connection on a socket.

    Syntax:

      #include  <types.h>
      #include  <socket.h>

    _DECC_V4_SOURCE defined:

      int connect(int s, struct sockaddr *name, int namelen);

    _DECC_V4_SOURCE not defined:

      int connect(int s, const struct sockaddr *name, size_t namelen);

  5 - decc$get_sdc

    Returns the socket device channel associated with a socket
    descriptor for direct use with the DEC TCP/IP Services for
    OpenVMS product (formerly the VMS/ULTRIX Connection).
    vaxc$get_sdc is a synonym for decc$get_sdc. Either name
    invokes the same routine.

    Syntax:

      #include <socket.h>

      short int decc$get_sdc(int s);

  6 - endhostent

  Ends retrieval of network host entries and closes the network host
  file.

  Syntax:

     #include <netdb.h>

     void endhostent (void);

  7 - endnetent

  Closes the networks database file.

  Syntax:

     #include <netdb.h>

     void endnetent (void);

  8 - getpeername

    Returns the name of the connected peer.

    Syntax:

      #include  <types.h>
      #include  <socket.h>

    _DECC_V4_SOURCE defined:

      int getpeername(int s, struct sockaddr *name, int *namelen);

    _DECC_V4_SOURCE not defined:

      int getpeername(int s, struct sockaddr *name, size_t *namelen);

  9 - endprotoent

  Closes the protocols database file.

  Syntax:

     #include <netdb.h>

     void endprotoent (void);

  10 - endservent

  Closes the network services database file.

  Syntax:

     #include <netdb.h>

     void endservent (void);

  11 - gethostbyaddr

    Searches the host database sequentially from the beginning of
    the database for a host record with a given address.

    Syntax:

      #include  <netdb.h>

      struct hostent *gethostbyaddr(char *addr, int len, int type);

  12 - gethostbyname

    Searches the host database sequentially from the beginning of
    the database for a host record with a given name or alias.

    Syntax:

      #include  <netdb.h>

      struct hostent *gethostbyname(char *name);

  13 - gethostent

  Opens the network host entry by name from the network host database
  file.

  Syntax:

     #include <netdb.h>

     struct hostent *gethostent (void);

  14 - gethostname

    Returns the name currently associated to the host.

    Syntax:

      #include  <types.h>
      #include  <socket.h>

    _DECC_V4_SOURCE defined:

      int gethostname(char *name, int namelen);

    _DECC_V4_SOURCE not defined:

      int gethostname(char *name, size_t namelen);

  15 - getnetbyaddr

    Searches the network database sequentially from the beginning
    of the database for a network record with a given address.

    Syntax:

      #include  <netdb.h>

      struct netent *getnetbyaddr(long net, int type);

  16 - getnetbyname

    Searches the network database sequentially from the beginning
    of the database for a network record with a given name or alias.

    Syntax:

      #include  <netdb.h>

      struct netent *getnetbyname(char *name);

  17 - getnetent

  Gets a network file entry from the networks database file.

  Syntax:

     #include <netdb.h>

     struct netent *getnetent (void);

  18 - getprotobyname

    Searches the protocols database until a matching protocol name
    is found or until an EOF is encountered.

    Syntax:

      #include <netdb.h>

      struct protoent *getprotobyname(char *name);

  19 - getprotobynumber

    Searches the protocols database until a matching protocol number
    is found or until an EOF is encountered.

    Syntax:

      #include <netdb.h>

      struct protoent *getprotobynumber(int *proto);

  20 - getprotoent

  Gets a protocol database entry from the protocols database file.

  Syntax:

     #include <netdb.h>

     struct protoent *getprotonet (void);

  21 - getservbyname

    Gets information on the named service from the network
    services database. It searches the services database until
    a matching service name is found or until an EOF is encountered.

    If a non-null protocol name is also supplied, searches must
    also match the protocol.

    Syntax:

      #include <netdb.h>

      struct servent *getservbyname(char *name, char *proto);

  22 - getservbyport

    Gets information on the specified port from the network
    services database. It searches the services database until
    a matching port is found or until an EOF is encountered.

    If a non-null protocol name is also supplied, searches must
    also match the protocol.

    Syntax:

      #include <netdb.h>

      struct servent *getservbyport(int port, char *proto);

  23 - getservent

  Gets a services file entry from the network services database file.

  Syntax:

     #include <netdb.h>

     struct servent *getservent (void);

  24 - getsockname

    Returns the name associated with a socket.

    Syntax:

      #include  <types.h>
      #include  <socket.h>

    _DECC_V4_SOURCE defined:

      int getsockname(int s, struct sockaddr *name, int *namelen);

    _DECC_V4_SOURCE not defined:

      int getsockname(int s, struct sockaddr *name, size_t *namelen);

  25 - getsockopt

    Returns the options set on a socket.

    Syntax:

      #include  <types.h>
      #include  <socket.h>

    _DECC_V4_SOURCE defined:

      int getsockopt(int s, int level, int optname, char *optval,
                      int *optlen);

    _DECC_V4_SOURCE not defined:

      int getsockopt(int s, int level, int optname, void *optval,
                      size_t *optlen);

  26 - herror

  Writes a message explaining a routine error.

  Syntax:

     #include <netdb.h>
     extern int sys_nerr;
     extern int h_errno;

     void herror (const char *string);

  27 - hostalias

  Searches for host aliases associated with a name.

  Syntax:

     #include <types.h>
     #include <in.h>
     #include <namser.h>
     #include <resolv.h>

     char *hostalias (const char *name);

  28 - hstrerror

  Accesses message explaining routine errors.

  Syntax:

     #include <string.h>

     char *hstrerror (int errnum);

  29 - htonl

    Converts longwords from host to network byte order.

    Syntax:

      #include <in.h>

      unsigned long int htonl(unsigned long int hostlong);

  30 - htons

    Converts short integers from host to network byte order.

    Syntax:

      #include <in.h>

      unsigned short int htons(unsigned short int hostshort);

  31 - inet_addr

    Converts Internet addresses in text form into numeric (binary)
    Internet addresses.

    Syntax:

      #include <in.h>
      #include <inet.h>

      int inet_addr(char *cp);

  32 - inet_lnaof

    Returns the local network address portion of an Internet address.

    Syntax:

      #include <in.h>
      #include <inet.h>

      int inet_lnaof(struct in_addr in);

  33 - inet_makeaddr

    Returns an Internet address given a network address and a
    local address on that network.

    Syntax:

      #include <in.h>
      #include <inet.h>

      struct in_addr inet_makeaddr(int net, int lna) ;

  34 - inet_netof

    Returns the Internet network address portion of an Internet address.

    Syntax:

      #include <in.h>
      #include <inet.h>

      int inet_netof(struct in_addr in);

  35 - inet_network

    Converts a text string representing an Internet network address
    in the standard Internet "." notation into an Internet network
    address in network byte order.

    Syntax:

      #include <in.h>
      #include <inet.h>

      int inet_network(char *cp);

  36 - inet_ntoa

    Converts an Internet address into a text string representing
    the address in the standard Internet "." notation.

    Syntax:

      #include <in.h>
      #include <inet.h>

      char *inet_ntoa(struct in_addr in);

  37 - ioctl

  Controls socket operations only.

  Syntax:

     #include <ioctl.h>

     int ioctl (int d, unsigned long request, void *arg);

  38 - listen

    Sets the maximum limit of outstanding connection requests for
    a socket that is connection oriented.

    Syntax:

      int listen(int s, int backlog);

  39 - ntohl

    Converts longwords from network to host byte order.

    Syntax:

      #include <in.h>

      unsigned long int ntohl(unsigned long int netlong) ;

  40 - ntohs

    Converts short integers from network to host byte order.

    Syntax:

      #include <in.h>

      unsigned short int ntohs(unsigned short int netshort);

  41 - read

    Reads bytes from a socket or file and places them in a buffer.

    Syntax:

      #include <unixio.h>

      int read(int d, void *buffer, int nbytes);

  42 - recv

    Receives bytes from a connected socket and places them into a buffer.

    Syntax:

      #include <types.h>
      #include <socket.h>

    _DECC_V4_SOURCE defined:

      int recv(int s, char *buf, int len, int flags);

    _DECC_V4_SOURCE not defined:

      ssize_t recv(int s, void *buf, size_t len, int flags);

  43 - recvfrom

    Receives bytes from a socket from any source.

    Syntax:

      #include <types.h>
      #include <socket.h>

    _DECC_V4_SOURCE defined:

      int recvfrom(int s, char *buf, int len, int flags, struct
                    sockaddr *from, int *fromlen);

    _DECC_V4_SOURCE not defined:

      ssize_t recvfrom(int s, void *buf, size_t len, int flags,
                        struct sockaddr *from, size_t *fromlen);

  44 - recvmsg

    Receives bytes on a socket and places them into scattered buffers.

    Syntax:

      #include <types.h>
      #include <socket.h>

      int recvmsg(int s, struct msghdr msg[],  int flags);

  45 - select

    Allows you to poll or check a group of sockets for I/O
    activity. It can check what sockets are ready to be read or
    written, or what sockets have a pending exception.

    Syntax:

      #include <time.h>

    _DECC_V4_SOURCE defined:

       int select(int nfds, int *readfds, int *writefds,
                   int *exceptfds, struct timeval *timeout);

    _DECC_V4_SOURCE not defined:

       int select(int nfds, fd_set *readfds, fd_set *writefds,
                   fd_set *exceptfds, struct timeval *timeout);

  46 - send

    Sends bytes through a socket to its connected peer.

    Syntax:

      #include <types.h>
      #include <socket.h>

    _DECC_V4_SOURCE defined:

      int send(int s, char *msg, int len, int flags);

    _DECC_V4_SOURCE not defined:

      ssize_t send(int s, const void *msg, size_t len, int flags);

  47 - sendmsg

    Sends gathered bytes through a socket to any other socket.

    Syntax:

      #include <types.h>
      #include <socket.h>

      int sendmsg(int s, struct msghdr msg[],  int flags);

  48 - sendto

    Sends bytes through a socket to any other socket.

    Syntax:

      #include <types.h>
      #include <socket.h>

    _DECC_V4_SOURCE defined:

      int sendto(int s, char *msg, int len, int flags, struct
                  sockaddr *to, int tolen);

    _DECC_V4_SOURCE not defined:

      ssize_t sendto(int s, const void *msg, size_t len, int flags,
                      const struct sockaddr *to, size_t tolen);

  49 - sethostent

  Opens, rewinds, and closes the network host database file.

  Syntax:

     #include <netdb.h>

     void sethostent (int stay_open);

  50 - setnetent

  Opens, rewinds, or closes the networks database file.

  Syntax:

     #include <netdb.h>

     void setnetent (int stay_open);

  51 - setprotoent

  Opens, rewinds, or closes the protocols database file.

  Syntax:

     #include <netdb.h>

     void setprotoent (int stay_open);

  52 - setservent

  Opens, rewinds, or closes the network services database.

  Syntax:

     #include <netdb.h>

     void setservent (int stay_open);

  53 - setsockopt

    Sets options on a socket.

    Syntax:

      #include <types.h>
      #include <socket.h>

     _DECC_V4_SOURCE defined:

       int setsockopt(int s, int level, int optname, char *optval,
                       int optlen);

     _DECC_V4_SOURCE not defined:

       int setsockopt(int s, int level, int optname, const void *optval,
                       size_t optlen);

  54 - shutdown

    Shuts down all or part of a bidirectional connection on a socket.
    It can disallow further receives, further sends, or both.

    Syntax:

      #include <socket.h>

      int shutdown(int s, int how);

  55 - socket

    Creates an endpoint for communication by returning a special
    kind of file descriptor called a socket descriptor, which is
    associated with a DEC TCP/IP Services for OpenVMS socket device
    channel.

    Syntax:

      #include <types.h>
      #include <socket.h>

      int socket(int af, int type, int protocol);

  56 - decc$socket_fd

  Returns the socket descriptor associated with a Socket Device
  Channel for direct use with the Compaq C RTL.

  Syntax:

     #include <socket.h>

     int decc$socket_fd (int channel);

  57 - vaxc$get_sdc

    Returns the socket device channel associated with a socket
    descriptor for direct use with the DEC TCP/IP Services for
    OpenVMS product (formerly the VMS/ULTRIX Connection).
    vaxc$get_sdc is a synonym for decc$get_sdc. Either name
    invokes the same routine.

    Syntax:

      #include <socket.h>

      short int vaxc$get_sdc(int s);

  58 - write

    Writes a buffer of data to a socket or file.

    Syntax:

      #include <unixio.h>

      int write(int d, void *buffer, int nbytes);
  Close     HLB-list     TLB-list     Help  

[legal] [privacy] [GNU] [policy] [netiquette] [sponsors] [FAQ]
Tweet
Polarhome, production since 1999.
Member of Polarhome portal.