The following table briefly describes each sockets utility function call supported by networking services and identifies where you can find the syntax, parameters, and other appropriate information. The network utility calls described in this section can be used to access services only for the internet communication domain.
TCP/IP Network Utility Routines Quick Reference
┌──────────────────────────────────────────────────────────────────┐ │Socket Call Description │ ├──────────────────────────────────────────────────────────────────┤ │dn_comp() Compresses the expanded domain name │ ├──────────────────────────────────────────────────────────────────┤ │dn_expand() Expands a compressed domain name to a │ │ full domain name │ ├──────────────────────────────────────────────────────────────────┤ │dn_find() Searches for an expanded name from a │ │ list of previously compressed names │ ├──────────────────────────────────────────────────────────────────┤ │dn_skipname() Skips over a compressed domain name │ ├──────────────────────────────────────────────────────────────────┤ │endhostent() Closes the ETC\HOSTS file │ ├──────────────────────────────────────────────────────────────────┤ │endnetent() Closes the ETC\NETWORKS file │ ├──────────────────────────────────────────────────────────────────┤ │endprotoent() Closes the ETC\PROTOCOL file, which │ │ contains information about known │ │ protocols │ ├──────────────────────────────────────────────────────────────────┤ │endservent() Closes the ETC\SERVICES file │ ├──────────────────────────────────────────────────────────────────┤ │gethostbyaddr() Returns a pointer to information about a│ │ host specified by an Internet address │ ├──────────────────────────────────────────────────────────────────┤ │gethostbyname() Returns a pointer to information about a│ │ host specified by a host name │ ├──────────────────────────────────────────────────────────────────┤ │gethostent() Returns a pointer to the next entry in │ │ the ETC\HOSTS file │ ├──────────────────────────────────────────────────────────────────┤ │gethostid() Returns the unique identifier of the │ │ current host │ ├──────────────────────────────────────────────────────────────────┤ │gethostname() Gets the standard host name for the │ │ local host machine │ ├──────────────────────────────────────────────────────────────────┤ │_getlong() Retrieves long byte quantities │ ├──────────────────────────────────────────────────────────────────┤ │getnetbyaddr() Returns a pointer to the ETC\NETWORKS │ │ file entry that contains the specified │ │ network address │ ├──────────────────────────────────────────────────────────────────┤ │getnetbyname() Returns a pointer to the ETC\NETWORKS │ │ file entry that contains the specified │ │ network name │ ├──────────────────────────────────────────────────────────────────┤ │getnetent() Returns a pointer to the next entry in │ │ the ETC\NETWORKS file │ ├──────────────────────────────────────────────────────────────────┤ │getprotobyname() Returns a pointer to the ETC\PROTOCOL │ │ file entry specified by a protocol name │ ├──────────────────────────────────────────────────────────────────┤ │getprotobynumber() Returns a pointer to the ETC\PROTOCOL │ │ file entry specified by a protocol │ │ number │ ├──────────────────────────────────────────────────────────────────┤ │getprotoent() Returns a pointer to the next entry in │ │ the ETC\PROTOCOL file │ ├──────────────────────────────────────────────────────────────────┤ │getservbyname() Returns a pointer to the ETC\SERVICES │ │ file entry specified by a service name │ ├──────────────────────────────────────────────────────────────────┤ │getservbyport() Returns a pointer to the ETC\SERVICES │ │ file entry specified by a port number │ ├──────────────────────────────────────────────────────────────────┤ │getservent() Returns a pointer to the next entry in │ │ the ETC\SERVICES file │ ├──────────────────────────────────────────────────────────────────┤ │_getshort() Retrieves short byte quantities │ ├──────────────────────────────────────────────────────────────────┤ │h_errno Returns the TCP/IP error code │ ├──────────────────────────────────────────────────────────────────┤ │htonl() Translates byte order from host to │ │ network for a long integer │ ├──────────────────────────────────────────────────────────────────┤ │htons() Translates byte order from host to │ │ network for a short integer │ ├──────────────────────────────────────────────────────────────────┤ │inet_addr() Constructs an internet address from │ │ character strings representing numbers │ │ expressed in standard dotted-decimal │ │ notation │ ├──────────────────────────────────────────────────────────────────┤ │inet_lnaof() Returns the local network portion of an │ │ internet address │ ├──────────────────────────────────────────────────────────────────┤ │inet_makeaddr() Constructs an internet address from a │ │ network number and a local address │ ├──────────────────────────────────────────────────────────────────┤ │inet_netof() Returns the network portion of the │ │ internet address in network-byte order │ ├──────────────────────────────────────────────────────────────────┤ │inet_network() Constructs a network number from │ │ character strings representing numbers │ │ expressed in standard dotted-decimal │ │ notation │ ├──────────────────────────────────────────────────────────────────┤ │inet_ntoa() Returns a pointer to a string in │ │ dotted-decimal notation │ ├──────────────────────────────────────────────────────────────────┤ │ntohl() Translates byte order from network to │ │ host for a long integer │ ├──────────────────────────────────────────────────────────────────┤ │ntohs() Translates byte order from network to │ │ host for a short integer │ ├──────────────────────────────────────────────────────────────────┤ │putlong() Places long byte quantities into the │ │ byte stream │ ├──────────────────────────────────────────────────────────────────┤ │putshort() Places short byte quantities into the │ │ byte stream │ ├──────────────────────────────────────────────────────────────────┤ │Raccept() Accepts a connection request from a │ │ SOCKS server │ ├──────────────────────────────────────────────────────────────────┤ │Rbind() Binds a local name to the socket │ ├──────────────────────────────────────────────────────────────────┤ │Rconnect() Requests a connection to a remote host │ ├──────────────────────────────────────────────────────────────────┤ │res_init() Reads the RESOLV file for the default │ │ domain name │ ├──────────────────────────────────────────────────────────────────┤ │res_mkquery() Makes a query message for the name │ │ servers in the internet domain │ ├──────────────────────────────────────────────────────────────────┤ │res_query() Provides an interface to the server │ │ query mechanism │ ├──────────────────────────────────────────────────────────────────┤ │res_querydomain() Queries the concatenation of name and │ │ domain │ ├──────────────────────────────────────────────────────────────────┤ │res_search() Makes a query and awaits a response │ ├──────────────────────────────────────────────────────────────────┤ │res_send() Sends a query to a local name server │ ├──────────────────────────────────────────────────────────────────┤ │rexec() Allows command processing on a remote │ │ host │ ├──────────────────────────────────────────────────────────────────┤ │Rgethostbyname() Returns a pointer to information about a│ │ host specified by a host name │ ├──────────────────────────────────────────────────────────────────┤ │Rgetsockname() Gets the socket name from the SOCKS │ │ server │ ├──────────────────────────────────────────────────────────────────┤ │Rlisten() Completes the binding necessary for a │ │ socket to accept connections and creates│ │ a connection request queue for incoming │ │ requests │ ├──────────────────────────────────────────────────────────────────┤ │sethostent() Opens and rewinds the ETC\HOSTS file │ ├──────────────────────────────────────────────────────────────────┤ │setnetent() Opens and rewinds the ETC\NETWORKS file │ ├──────────────────────────────────────────────────────────────────┤ │setprotoent() Opens and rewinds the ETC\PROTOCOL file │ ├──────────────────────────────────────────────────────────────────┤ │setservent() Opens and rewinds the ETC\SERVICES file │ └──────────────────────────────────────────────────────────────────┘