![]() |
![]() |
![]() |
![]() |
This chapter contains descriptions of the TCP/IP library functions, data structures, and protocols, all arranged in alphabetical order.
We've also provided summary lists of all the entries:
There's also a discussion of what you'll find in a function description.
Item | Summary |
---|---|
accept() | Accept a connection on a socket |
bind() | Bind a name to a socket |
bindresvport() | Bind a socket to a privileged IP port |
connect() | Initiate a connection on a socket |
dn_comp() | Compress an Internet domain name |
dn_expand() | Expand a compressed Internet domain name |
ds_clear() | Delete a data server variable |
ds_create() | Create a data server variable |
ds_deregister() | Deregister an application with the data server |
ds_flags() | Set the flags for a data server variable |
ds_get() | Retrieve a data server variable |
ds_register() | Register an application with the data server |
ds_set() | Set a data server variable |
endhostent() | Close the TCP connection and the hosts file |
endnetent() | Close the network name database file |
endprotoent() | Close the protocol name database file |
endservent() | Close the network services database file |
gethostbyaddr() | Get a network host entry, given an Internet address |
gethostbyaddr_r() | Get a network host entry, given an Internet address |
gethostbyname() | Get a network host entry, given a name |
gethostbyname_r() | Get a network host entry, given a name |
gethostent() | Read the next line in the host database file |
gethostent_r() | Read the next line in the host database file |
gethostname() | Get the name of the current host |
getnetbyaddr() | Get a network entry, given an address |
getnetbyname() | Get a network entry, given a name |
getnetent() | Read the next line of the network name database file |
getpeername() | Get the name of the peer connected to a socket |
getprotobyname() | Get a protocol entry, given a name |
getprotobynumber() | Get a protocol entry, given a number |
getprotoent() | Read the next line of the protocol name database file |
getservbyname() | Get a service entry, given a name |
getservbyport() | Get a service entry, given a port |
getservent() | Read the next line of the network services database file |
getsockname() | Get the name of a socket |
getsockopt() | Get options associated with a socket |
herror() | Print the message associated with the value of h_errno to standard error |
hostent | Structure that describes an Internet host |
hstrerror() | Get error message string associated with the error return status |
htonl() | Convert a 32-bit value from host-byte order to network-byte order |
htons() | Convert a 16-bit value from host-byte order to network-byte order |
ICMP | Internet Control Message Protocol |
inet_addr() | Convert a string into a numeric Internet address |
inet_aton() | Convert a string into an Internet address stored in a structure |
inet_lnaof() | Extract the local network address from an Internet address |
inet_makeaddr() | Convert a network number and a local network address into an Internet address |
inet_netof() | Extract the network number from an Internet address |
inet_network() | Convert a string into an Internet network number |
inet_ntoa() | Convert an Internet address into a string |
inet_ntoa_r() | Convert an Internet address into a string |
inet_ntop() | Convert a numeric network address to a string |
inet_pton() | Convert a text host address to a numeric network address |
ioctl() | Control a device |
IP | Internet Protocol |
isfdtype() | Determine whether a file descriptor refers to a socket |
listen() | Listen for connections on a socket |
netent | Structure for holding information from the network database |
ntohl() | Convert a 32-bit value from network-byte order to host-byte order |
ntohs() | Convert a 16-bit value from network-byte order to host-byte order |
protoent | Structure for holding information from the protocol database |
Raccept() | Accept a connection on a socket via a SOCKS server |
Rbind() | Bind a name to a socket via a SOCKS server |
rcmd() | Execute a command on a remote host |
Rconnect() | Initiate a connection on a socket via a SOCKS server |
read_main_config_file() | Read the snmpd.conf file |
recv() | Receive a message from a socket |
recvfrom() | Receive a message from the socket at a specified address |
recvmsg() | Receive a message and its header from a socket |
res_init() | Initialize the Internet domain name resolver routines |
res_mkquery() | Construct an Internet domain name query |
res_query() | Query the local Internet domain name server |
res_querydomain() | Query the local Internet domain name server |
res_search() | Query a local server, using search options |
res_send() | Send a preformatted Internet domain name query |
Rgetsockname() | Get the name of a socket via a SOCKS server |
Rlisten() | Listen for connections on a socket via a SOCKS server |
ROUTE() | System packet forwarding database |
Rrcmd() | Execute a command on a remote host via a SOCKS server |
rresvport() | Obtain a socket with a privileged address |
Rselect() | Check for descriptions that are ready for reading or writing via a SOCKS server |
ruserok() | Check the identity of a remote host |
send() | Send a message to a connected socket |
sendmsg() | Send a message and its header to a socket |
sendto() | Send a message to a socket at a specified address |
servent | Structure for holding information from the network services database |
sethostent() | Open the host database file |
sethostname() | Set the name of the current host |
setnetent() | Open the network name database file |
setprotoent() | Open the protocol name database file |
setservent() | Open the network services database file |
setsockopt() | Set options associated with a socket |
shutdown() | Shut down part of a full-duplex connection |
snmp_close() | Close an SNMP session |
snmp_free_pdu() | Free an SNMP message structure |
snmp_open() | Open an SNMP session |
snmp_pdu | Structure that describes an SNMP transaction |
snmp_pdu_create() | Create an SNMP message structure |
snmp_read() | Read an SNMP message |
snmp_select_info() | Position to a block within an SNMP message structure |
snmp_send() | Send SNMP messages |
snmp_session | Structure that defines a set of transactions with similar transport characteristics |
snmp_timeout() | Timeout during an SNMP session |
sockatmark() | Determine whether a socket is at the out-of-band mark |
socket() | Create an endpoint for communication |
socketpair() | Create a pair of connected sockets |
SOCKSinit() | Initialize a connection with a SOCKS server |
sysctl() | Get or set the system information |
TCP | Internet Transmission Control Protocol |
UDP | Internet User Datagram Protocol |
UNIX | UNIX-domain protocol family |
vp_attach() | Attach to a Virtual Packet Interface |
vp_detach() | Detach your application from the stack |
vp_getpkt() | Get a packet from the stack |
vp_ifrname() | Return the interface name |
vp_ioctl() | Send a related virtual packet ioctl command |
vp_ktom() | Convert a TCP/IP stack address to an application address |
vp_mclget() | Get a cluster |
vp_mfree() | Free a single mbuf |
vp_mfreem() | Free all the mbufs in the chain |
vp_mget() | Allocate an mbuf |
vp_mgethdr() | Allocate an mbuf and initialize it as a packet header |
vp_mtok() | Convert an application address to a TCP/IP stack address |
vp_putpkt() | Send a packet to the stack |
vp_unit() | Return the unit number of the given vpid_t |
In this chapter, you'll notice that many functions are related to other functions. This section arranges the functions into the following categories:
Item | Summary |
---|---|
gethostname() | Get the name of the current host |
sethostname() | Set the name of the current host |
Item | Summary |
---|---|
ds_clear() | Delete a data server variable |
ds_create() | Create a data server variable |
ds_deregister() | Deregister an application with the data server |
ds_flags() | Set the flags for a data server variable |
ds_get() | Retrieve a data server variable |
ds_register() | Register an application with the data server |
ds_set() | Set a data server variable |
Item | Summary |
---|---|
endhostent() | Close the TCP connection and the hosts file |
hostent | Structure that describes an Internet host |
gethostbyaddr() | Get a network host entry, given an Internet address |
gethostbyaddr() | Get a network host entry, given an Internet address |
gethostbyname() | Get a network host entry, given a name |
gethostent() | Read the next line in the host database file |
gethostent_r() | Read the next line in the host database file |
htonl() | Convert a 32-bit value from host-byte order to network-byte order |
htons() | Convert a 16-bit value from host-byte order to network-byte order |
ntohl() | Convert a 32-bit value from network-byte order to host-byte order |
ntohs() | Convert a 16-bit value from network-byte order to host-byte order |
sethostent() | Open the host database file |
Item | Summary |
---|---|
inet_addr() | Convert a string into a numeric Internet address |
inet_aton() | Convert a string into an Internet address stored in a structure |
inet_lnaof() | Extract the local network address from an Internet address |
inet_makeaddr() | Convert a network number and a local network address into an Internet address |
inet_netof() | Extract the network number from and Internet address |
inet_network() | Convert a string into an Internet network number |
inet_ntoa() | Convert an Internet address into a string |
inet_ntoa_r() | Convert an Internet address into a string |
inet_ntop() | Convert a numeric network address to a string |
inet_pton() | Convert a text host address to a numeric network address |
Item | Summary |
---|---|
herror() | Print the message associated with the value of h_errno to standard error |
hstrerror() | Get error message string associated with the error return status |
ioctl() | Control a device |
sysctl() | Get or set the system information |
Item | Summary |
---|---|
endnetent() | Close network name database file |
getnetbyaddr() | Get network entry, given an address |
getnetbyname() | Get network entry, given a name |
getnetent() | Read the next line of the network name database file |
netent | Structure for holding information from the network database |
setnetent() | Open the network name database file |
Item | Summary |
---|---|
endprotoent() | Close the protocol name database file |
getprotobyname() | Get a protocol entry, given a name |
getprotobynumber() | Get a protocol entry, given a number |
getprotoent() | Read the next line of the protocol name database file |
protoent | Structure for holding information from the protocol database |
setprotoent() | Open the protocol name database file |
Item | Summary |
---|---|
endservent() | Close network services database file |
getservbyname() | Get a service entry, given a name |
getservbyport() | Get a service entry, given a port |
getservent() | Read the next line of the network services database file |
servent | Structure for holding information from the network services database |
setservent() | Open the network services database file |
Item | Summary |
---|---|
ICMP | Internet Control Message Protocol |
IP | Internet Protocol |
ROUTE | System packet forwarding database |
TCP | Internet Transmission Control Protocol |
UDP | Internet User Datagram Protocol |
UNIX | UNIX-domain protocol family |
Item | Summary |
---|---|
rcmd() | Execute a command on a remote host |
rresvport() | Obtain a socket with a privileged address |
ruserok() | Check the identity of a remote host |
Item | Summary |
---|---|
dn_comp() | Compress an Internet domain name |
dn_expand() | Expand a compressed Internet domain name |
res_init() | Initialize the Internet domain name resolver routines |
res_mkquery() | Construct an Internet domain name query |
res_query() | Query the local Internet domain name server |
res_querydomain() | Query the local Internet domain name server |
res_search() | Query a local server, using search options |
res_send() | Send a preformatted Internet domain name query |
Item | Summary |
---|---|
read_main_config_file() | Read the snmpd.conf file |
snmp_close() | Close an SNMP session |
snmp_free_pdu() | Free an SNMP message structure |
snmp_open() | Open an SNMP session |
snmp_pdu | Structure that describes an SNMP transaction |
snmp_pdu_create() | Create an SNMP message structure |
snmp_read() | Read an SNMP message |
snmp_select_info() | Position to a block within an SNMP message structure |
snmp_send() | Send SNMP messages |
snmp_session | Structure that defines a set of transactions with similar transport characteristics |
snmp_timeout() | Timeout during an SNMP session |
Item | Summary |
---|---|
accept() | Accept a connection on a socket |
bind() | Bind a name to a socket |
bindresvport() | Bind a socket to a privileged IP port (Unix) |
connect() | Initiate a connection on a socket |
getpeername() | Get the name of the peer connected to a socket |
getsockname() | Get the name of a socket |
getsockopt() | Get options associated with a socket |
isfdtype() | Determine whether a file descriptor refers to a socket |
listen() | Listen for connections on a socket |
setsockopt() | Set options associated with a socket |
shutdown() | Shut down part of a full-duplex connection |
sockatmark() | Determine whether a socket is at the out-of-band mark |
socket() | Create an endpoint for communication |
socketpair() | Create a pair of connected sockets |
Item | Summary |
---|---|
recv() | Receive a message from a socket |
recvfrom() | Receive a message from the socket at a specified address |
recvmsg() | Receive a message and its header from a socket |
send() | Send a message to a connected socket |
sendmsg() | Send a message and its header to a socket |
sendto() | Send a message to the socket at a specified address |
Item | Summary |
---|---|
Raccept() | Accept a connection on a socket via a SOCKS server |
Rbind() | Bind a name to a socket via a SOCKS server |
Rconnect() | Initiate a connection on a socket via a SOCKS server |
Rgetsockname() | Get the name of a socket via a SOCKS server |
Rlisten() | Listen for connections on a socket via a SOCKS server |
Rrcmd() | Execute a command on a remote host via a SOCKS server |
Rselect() | Check for descriptions that are ready for reading or writing via a SOCKS server |
SOCKSinit() | Initialize a connection with a SOCKS server |
Item | Summary |
---|---|
vp_attach() | Attach to a Virtual Packet Interface |
vp_detach() | Detach your application from the stack |
vp_getpkt() | Get a packet from the stack |
vp_ifrname() | Return the interface name |
vp_ioctl() | Send a related virtual packet ioctl command |
vp_ktom() | Convert a TCP/IP stack address to an application address |
vp_mclget() | Get a cluster |
vp_mfree() | Free a single mbuf |
vp_mfreem() | Free all the mbufs in the chain |
vp_mget() | Allocate an mbuf |
vp_mgethdr() | Allocate an mbuf and initialize it as a packet header |
vp_mtok() | Convert an application address to a TCP/IP stack address |
vp_putpkt() | Send a packet to the stack |
vp_unit() | Return the unit number of the given vpid_t |
Each function page consists of a number of subsections:
Gives the header files that should be included within a source file that references the function or macro. It also shows an appropriate declaration for the function or for a function that could be substituted for a macro. This declaration isn't included in your program; only the header file(s) should be included.
When a pointer argument is passed to a function, and that function doesn't modify the item indicated by that pointer, then the argument is shown with const before the argument. For example, the following indicates that the array pointed at by string isn't changed:
const char * string
A description of the function or macro.
The return value (if any) for the function or macro.
Describes the possible values that the function might assign to the global variable errno.
Consists of one or more examples that demonstrate the use of the function. The examples are often just fragments of code (not complete programs) for illustrative purposes. This subsection is optional.
Provides an indication of where the function or macro is commonly found. The following notation is used:
We've created the following Unix categories to differentiate:
Indicates whether or not it's safe to use the TCP/IP function in:
Some of the signal-safe functions modify errno on failure. If you use any of these in a signal handler, asynchronous signals may have the side effect of modifying errno in an unpredictable way. If any of the code that can be interrupted checks the value of errno (this also applies to library calls, so you should assume that most library calls may internally check errno), make sure that your signal handler saves errno on entry and restores it on exit.
All of the above also applies to signal-unsafe functions, with one exception: if a signal handler calls a signal-unsafe function, make sure that signal doesn't interrupt a signal-unsafe function.
![]() |
The "safety" designations documented in this manual are valid for the the TCP/IP 5.0 release and could change in future versions. |
Gives warnings about the function.
Provides a list of related functions or macros, or places to look for more information. This subsection is optional.
![]() |
![]() |
![]() |
![]() |