| #define APR_ANYADDR "0.0.0.0" |
Default 'any' address
| #define APR_INADDR_NONE ((unsigned int) 0xffffffff) |
Not all platforms have a real INADDR_NONE. This macro replaces INADDR_NONE on all platforms.
| #define APR_INET AF_INET |
Not all platforms have these defined, so we'll define them here The default values come from FreeBSD 4.1.1
| #define APR_INET6 AF_INET6 |
IPv6 Address Family. Not all platforms may have this defined.
| #define apr_inet_addr inet_addr |
The specific declaration of inet_addr's ... some platforms fall back inet_network (this is not good, but necessary)
| #define APR_IPV4_ADDR_OK 0x01 |
| #define APR_IPV6_ADDR_OK 0x02 |
| #define APR_MAX_SECS_TO_LINGER 30 |
Maximum seconds to linger
| #define APR_SENDFILE_DISCONNECT_SOCKET 1 |
Support reusing the socket on platforms which support it (from disconnect, specifically Win32.
| #define APR_UNSPEC 0 |
Let the system decide which address family to use
| #define APRMAXHOSTLEN 256 |
Maximum hostname length
| typedef struct apr_hdtr_t apr_hdtr_t |
A structure to encapsulate headers and trailers for apr_socket_sendfile
| typedef struct in_addr apr_in_addr_t |
A structure to represent in_addr
| typedef struct apr_ipsubnet_t apr_ipsubnet_t |
A structure to represent an IP subnet
| typedef apr_uint16_t apr_port_t |
| typedef struct apr_sockaddr_t apr_sockaddr_t |
| typedef struct apr_socket_t apr_socket_t |
A structure to represent sockets
| enum apr_interface_e |
| enum apr_shutdown_how_e |
| apr_status_t apr_gethostname | ( | char * | buf, | |
| int | len, | |||
| apr_pool_t * | cont | |||
| ) |
Get name of the current machine
| buf | A buffer to store the hostname in.
|
| apr_status_t apr_getnameinfo | ( | char ** | hostname, | |
| apr_sockaddr_t * | sa, | |||
| apr_int32_t | flags | |||
| ) |
Look up the host name from an apr_sockaddr_t.
| hostname | The hostname.
|
| apr_status_t apr_getservbyname | ( | apr_sockaddr_t * | sockaddr, | |
| const char * | servname | |||
| ) |
Given an apr_sockaddr_t and a service name, set the port for the service
| sockaddr | The apr_sockaddr_t that will have its port set
|
| apr_status_t apr_ipsubnet_create | ( | apr_ipsubnet_t ** | ipsub, | |
| const char * | ipstr, | |||
| const char * | mask_or_numbits, | |||
| apr_pool_t * | p | |||
| ) |
Build an ip-subnet representation from an IP address and optional netmask or number-of-bits.
| ipsub | The new ip-subnet representation
|
| int apr_ipsubnet_test | ( | apr_ipsubnet_t * | ipsub, | |
| apr_sockaddr_t * | sa | |||
| ) |
Test the IP address in an apr_sockaddr_t against a pre-built ip-subnet representation.
| ipsub | The ip-subnet representation
|
| apr_status_t apr_parse_addr_port | ( | char ** | addr, | |
| char ** | scope_id, | |||
| apr_port_t * | port, | |||
| const char * | str, | |||
| apr_pool_t * | p | |||
| ) |
Parse hostname/IP address with scope id and port.
Any of the following strings are accepted: 8080 (just the port number) www.apache.org (just the hostname) www.apache.org:8080 (hostname and port number) [fe80::1]:80 (IPv6 numeric address string only) [fe80::1eth0] (IPv6 numeric address string and scope id)
Invalid strings: (empty string) [abc] (not valid IPv6 numeric address string) abc:65536 (invalid port number)
| addr | The new buffer containing just the hostname. On output, *addr will be NULL if no hostname/IP address was specfied.
|
| int apr_sockaddr_equal | ( | const apr_sockaddr_t * | addr1, | |
| const apr_sockaddr_t * | addr2 | |||
| ) |
See if the IP addresses in two APR socket addresses are equivalent. Appropriate logic is present for comparing IPv4-mapped IPv6 addresses with IPv4 addresses.
| addr1 | One of the APR socket addresses.
|
| apr_status_t apr_sockaddr_info_get | ( | apr_sockaddr_t ** | sa, | |
| const char * | hostname, | |||
| apr_int32_t | family, | |||
| apr_port_t | port, | |||
| apr_int32_t | flags, | |||
| apr_pool_t * | p | |||
| ) |
Create apr_sockaddr_t from hostname, address family, and port.
| sa | The new apr_sockaddr_t.
|
| apr_status_t apr_sockaddr_ip_get | ( | char ** | addr, | |
| apr_sockaddr_t * | sockaddr | |||
| ) |
Return the IP address (in numeric address string format) in an APR socket address. APR will allocate storage for the IP address string from the pool of the apr_sockaddr_t.
| addr | The IP address.
|
| apr_status_t apr_sockaddr_ip_getbuf | ( | char * | buf, | |
| apr_size_t | buflen, | |||
| apr_sockaddr_t * | sockaddr | |||
| ) |
Write the IP address (in numeric address string format) of the APR socket address sockaddr into the buffer buf (of size buflen).
| sockaddr | The socket address to reference. |
| apr_status_t apr_socket_accept | ( | apr_socket_t ** | new_sock, | |
| apr_socket_t * | sock, | |||
| apr_pool_t * | connection_pool | |||
| ) |
Accept a new connection request
| new_sock | A copy of the socket that is connected to the socket that made the connection request. This is the socket which should be used for all future communication.
|
| apr_status_t apr_socket_accept_filter | ( | apr_socket_t * | sock, | |
| char * | name, | |||
| char * | args | |||
| ) |
Set an OS level accept filter.
| sock | The socket to put the accept filter on.
|
| apr_status_t apr_socket_addr_get | ( | apr_sockaddr_t ** | sa, | |
| apr_interface_e | which, | |||
| apr_socket_t * | sock | |||
| ) |
Return an address associated with a socket; either the address to which the socket is bound locally or the the address of the peer to which the socket is connected.
| sa | The returned apr_sockaddr_t.
|
| apr_status_t apr_socket_atmark | ( | apr_socket_t * | sock, | |
| int * | atmark | |||
| ) |
Query the specified socket if at the OOB/Urgent data mark
| sock | The socket to query
|
| apr_status_t apr_socket_bind | ( | apr_socket_t * | sock, | |
| apr_sockaddr_t * | sa | |||
| ) |
Bind the socket to its associated port
| sock | The socket to bind
|
| apr_status_t apr_socket_close | ( | apr_socket_t * | thesocket | ) |
Close a socket.
| thesocket | The socket to close |
| apr_status_t apr_socket_connect | ( | apr_socket_t * | sock, | |
| apr_sockaddr_t * | sa | |||
| ) |
Issue a connection request to a socket either on the same machine or a different one.
| sock | The socket we wish to use for our side of the connection
|
| apr_status_t apr_socket_create | ( | apr_socket_t ** | new_sock, | |
| int | family, | |||
| int | type, | |||
| int | protocol, | |||
| apr_pool_t * | cont | |||
| ) |
Create a socket.
| new_sock | The new socket that has been set up.
|
| apr_status_t apr_socket_data_get | ( | void ** | data, | |
| const char * | key, | |||
| apr_socket_t * | sock | |||
| ) |
Return the data associated with the current socket
| data | The user data associated with the socket.
|
| apr_status_t apr_socket_data_set | ( | apr_socket_t * | sock, | |
| void * | data, | |||
| const char * | key, | |||
| apr_status_t(*)(void *) | cleanup | |||
| ) |
Set the data associated with the current socket.
| sock | The currently open socket.
|
| apr_status_t apr_socket_inherit_set | ( | apr_socket_t * | thesocket | ) |
Set a socket to be inherited by child processes.
| apr_status_t apr_socket_inherit_unset | ( | apr_socket_t * | thesocket | ) |
Unset a socket from being inherited by child processes.
| apr_status_t apr_socket_listen | ( | apr_socket_t * | sock, | |
| apr_int32_t | backlog | |||
| ) |
Listen to a bound socket for connections.
| sock | The socket to listen on
|
| apr_status_t apr_socket_opt_get | ( | apr_socket_t * | sock, | |
| apr_int32_t | opt, | |||
| apr_int32_t * | on | |||
| ) |
Query socket options for the specified socket
| sock | The socket to query
|
| apr_status_t apr_socket_opt_set | ( | apr_socket_t * | sock, | |
| apr_int32_t | opt, | |||
| apr_int32_t | on | |||
| ) |
Setup socket options for the specified socket
| sock | The socket to set up.
|
| apr_pool_t* apr_socket_pool_get | ( | const apr_socket_t * | thesocket | ) |
Get the pool used by the socket.
| apr_status_t apr_socket_protocol_get | ( | apr_socket_t * | sock, | |
| int * | protocol | |||
| ) |
Return the protocol of the socket.
| sock | The socket to query.
|
| apr_status_t apr_socket_recv | ( | apr_socket_t * | sock, | |
| char * | buf, | |||
| apr_size_t * | len | |||
| ) |
Read data from a network.
| sock | The socket to read the data from.
|
| apr_status_t apr_socket_recvfrom | ( | apr_sockaddr_t * | from, | |
| apr_socket_t * | sock, | |||
| apr_int32_t | flags, | |||
| char * | buf, | |||
| apr_size_t * | len | |||
| ) |
Read data from a socket. On success, the address of the peer from which the data was sent is copied into the
| from | parameter, and the
|
| apr_status_t apr_socket_send | ( | apr_socket_t * | sock, | |
| const char * | buf, | |||
| apr_size_t * | len | |||
| ) |
Send data over a network.
| sock | The socket to send the data over.
|
| apr_status_t apr_socket_sendfile | ( | apr_socket_t * | sock, | |
| apr_file_t * | file, | |||
| apr_hdtr_t * | hdtr, | |||
| apr_off_t * | offset, | |||
| apr_size_t * | len, | |||
| apr_int32_t | flags | |||
| ) |
Send a file from an open file descriptor to a socket, along with optional headers and trailers
| sock | The socket to which we're writing
|
| apr_status_t apr_socket_sendto | ( | apr_socket_t * | sock, | |
| apr_sockaddr_t * | where, | |||
| apr_int32_t | flags, | |||
| const char * | buf, | |||
| apr_size_t * | len | |||
| ) |
| sock | The socket to send from
|
| apr_status_t apr_socket_sendv | ( | apr_socket_t * | sock, | |
| const struct iovec * | vec, | |||
| apr_int32_t | nvec, | |||
| apr_size_t * | len | |||
| ) |
Send multiple packets of data over a network.
| sock | The socket to send the data over.
|
| apr_status_t apr_socket_shutdown | ( | apr_socket_t * | thesocket, | |
| apr_shutdown_how_e | how | |||
| ) |
Shutdown either reading, writing, or both sides of a socket.
| thesocket | The socket to close
|
| apr_status_t apr_socket_timeout_get | ( | apr_socket_t * | sock, | |
| apr_interval_time_t * | t | |||
| ) |
Query socket timeout for the specified socket
| sock | The socket to query
|
| apr_status_t apr_socket_timeout_set | ( | apr_socket_t * | sock, | |
| apr_interval_time_t | t | |||
| ) |
Setup socket timeout for the specified socket
| sock | The socket to set up.
|
| apr_status_t apr_socket_type_get | ( | apr_socket_t * | sock, | |
| int * | type | |||
| ) |
Return the type of the socket.
| sock | The socket to query.
|
1.6.3