GME
13
|
#define APR_ANYADDR "0.0.0.0" |
Default 'any' address
Definition at line 56 of file apr_network_io.h.
#define APR_INADDR_NONE ((unsigned int) 0xffffffff) |
Not all platforms have a real INADDR_NONE. This macro replaces INADDR_NONE on all platforms.
Definition at line 132 of file apr_network_io.h.
#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
Definition at line 140 of file apr_network_io.h.
#define APR_IPV4_ADDR_OK 0x01 |
Definition at line 112 of file apr_network_io.h.
#define APR_IPV6_ADDR_OK 0x02 |
Definition at line 113 of file apr_network_io.h.
#define APR_MAX_SECS_TO_LINGER 30 |
Maximum seconds to linger
Definition at line 46 of file apr_network_io.h.
#define APR_UNSPEC 0 |
Let the system decide which address family to use
Definition at line 147 of file apr_network_io.h.
#define APRMAXHOSTLEN 256 |
Maximum hostname length
Definition at line 51 of file apr_network_io.h.
typedef struct apr_hdtr_t apr_hdtr_t |
A structure to encapsulate headers and trailers for apr_socket_sendfile
Definition at line 195 of file apr_network_io.h.
typedef struct in_addr apr_in_addr_t |
A structure to represent in_addr
Definition at line 197 of file apr_network_io.h.
typedef struct apr_ipsubnet_t apr_ipsubnet_t |
A structure to represent an IP subnet
Definition at line 199 of file apr_network_io.h.
typedef apr_uint16_t apr_port_t |
Definition at line 202 of file apr_network_io.h.
typedef struct apr_sockaddr_t apr_sockaddr_t |
Definition at line 207 of file apr_network_io.h.
typedef struct apr_socket_t apr_socket_t |
The specific declaration of inet_addr's ... some platforms fall back inet_network (this is not good, but necessary) A structure to represent sockets
Definition at line 191 of file apr_network_io.h.
enum apr_interface_e |
Enum used to denote either the local and remote endpoint of a connection.
APR_LOCAL |
Socket information for local end of connection |
APR_REMOTE |
Socket information for remote end of connection |
Definition at line 170 of file apr_network_io.h.
enum apr_shutdown_how_e |
Define what type of socket shutdown should occur.
APR_SHUTDOWN_READ |
no longer allow read request |
APR_SHUTDOWN_WRITE |
no longer allow write requests |
APR_SHUTDOWN_READWRITE |
no longer allow read or write requests |
Definition at line 106 of file apr_network_io.h.
Create a socket.
new_sock | The new socket that has been set up. |
family | The address family of the socket (e.g., APR_INET). |
type | The type of the socket (e.g., SOCK_STREAM). |
protocol | The protocol of the socket (e.g., APR_PROTO_TCP). |
cont | The pool for the apr_socket_t and associated storage. |
Shutdown either reading, writing, or both sides of a socket.
thesocket | The socket to close |
how | How to shutdown the socket. One of: APR_SHUTDOWN_READ no longer allow read requests APR_SHUTDOWN_WRITE no longer allow write requests APR_SHUTDOWN_READWRITE no longer allow read or write requests |
Close a socket.
thesocket | The socket to close |
Bind the socket to its associated port
sock | The socket to bind |
sa | The socket address to bind to |
Listen to a bound socket for connections.
sock | The socket to listen on |
backlog | The number of outstanding connections allowed in the sockets listen queue. If this value is less than zero, the listen queue size is set to zero. |
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. |
sock | The socket we are listening on. |
connection_pool | The pool for the new socket. |
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 |
sa | The address of the machine we wish to connect to. |
Determine whether the receive part of the socket has been closed by the peer (such that a subsequent call to apr_socket_read would return APR_EOF), if the socket's receive buffer is empty. This function does not block waiting for I/O.
sock | The socket to check |
atreadeof | If APR_SUCCESS is returned, *atreadeof is set to non-zero if a subsequent read would return APR_EOF |
Create apr_sockaddr_t from hostname, address family, and port.
sa | The new apr_sockaddr_t. |
hostname | The hostname or numeric address string to resolve/parse, or NULL to build an address that corresponds to 0.0.0.0 or :: |
family | The address family to use, or APR_UNSPEC if the system should decide. |
port | The port number. |
flags | Special processing flags: APR_IPV4_ADDR_OK first query for IPv4 addresses; only look for IPv6 addresses if the first query failed; only valid if family is APR_UNSPEC and hostname isn't NULL; mutually exclusive with APR_IPV6_ADDR_OK APR_IPV6_ADDR_OK first query for IPv6 addresses; only look for IPv4 addresses if the first query failed; only valid if family is APR_UNSPEC and hostname isn't NULL and APR_HAVE_IPV6; mutually exclusive with APR_IPV4_ADDR_OK |
p | The pool for the apr_sockaddr_t and associated storage. |
Look up the host name from an apr_sockaddr_t.
hostname | The hostname. |
sa | The apr_sockaddr_t. |
flags | Special processing flags. |
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. |
scope_id | The new buffer containing just the scope id. On output, *scope_id will be NULL if no scope id was specified. |
port | The port number. On output, *port will be 0 if no port was specified. ### FIXME: 0 is a legal port (per RFC 1700). this should ### return something besides zero if the port is missing. |
str | The input string to be parsed. |
p | The pool from which *addr and *scope_id are allocated. |
Get name of the current machine
buf | A buffer to store the hostname in. |
len | The maximum length of the hostname that can be stored in the buffer provided. The suggested length is APRMAXHOSTLEN + 1. |
cont | The pool to use. |
Return the data associated with the current socket
data | The user data associated with the socket. |
key | The key to associate with the user data. |
sock | The currently open socket. |
Set the data associated with the current socket.
sock | The currently open socket. |
data | The user data to associate with the socket. |
key | The key to associate with the data. |
cleanup | The cleanup to call when the socket is destroyed. |
Send data over a network.
sock | The socket to send the data over. |
buf | The buffer which contains the data to be sent. |
len | On entry, the number of bytes to send; on exit, the number of bytes sent. |
This functions acts like a blocking write by default. To change this behavior, use apr_socket_timeout_set() or the APR_SO_NONBLOCK socket option.
It is possible for both bytes to be sent and an error to be returned.
APR_EINTR is never returned.
Send multiple packets of data over a network.
sock | The socket to send the data over. |
vec | The array of iovec structs containing the data to send |
nvec | The number of iovec structs in the array |
len | Receives the number of bytes actually written |
This functions acts like a blocking write by default. To change this behavior, use apr_socket_timeout_set() or the APR_SO_NONBLOCK socket option. The number of bytes actually sent is stored in argument 3.
It is possible for both bytes to be sent and an error to be returned.
APR_EINTR is never returned.
sock | The socket to send from |
where | The apr_sockaddr_t describing where to send the data |
flags | The flags to use |
buf | The data to send |
len | The length of the data to send |
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 len parameter is updated to give the number of bytes written to buf.
from | Updated with the address from which the data was received |
sock | The socket to use |
flags | The flags to use |
buf | The buffer to use |
len | The length of the available buffer |
Read data from a network.
sock | The socket to read the data from. |
buf | The buffer to store the data in. |
len | On entry, the number of bytes to receive; on exit, the number of bytes received. |
This functions acts like a blocking read by default. To change this behavior, use apr_socket_timeout_set() or the APR_SO_NONBLOCK socket option. The number of bytes actually received is stored in argument 3.
It is possible for both bytes to be received and an APR_EOF or other error to be returned.
APR_EINTR is never returned.
Setup socket options for the specified socket
sock | The socket to set up. |
opt | The option we would like to configure. One of: APR_SO_DEBUG -- turn on debugging information APR_SO_KEEPALIVE -- keep connections active APR_SO_LINGER -- lingers on close if data is present APR_SO_NONBLOCK -- Turns blocking on/off for socket When this option is enabled, use the APR_STATUS_IS_EAGAIN() macro to see if a send or receive function could not transfer data without blocking. APR_SO_REUSEADDR -- The rules used in validating addresses supplied to bind should allow reuse of local addresses. APR_SO_SNDBUF -- Set the SendBufferSize APR_SO_RCVBUF -- Set the ReceiveBufferSize |
on | Value for the option. |
Setup socket timeout for the specified socket
sock | The socket to set up. |
t | Value for the timeout. t > 0 -- read and write calls return APR_TIMEUP if specified time elapsess with no data read or written t == 0 -- read and write calls never block t < 0 -- read and write calls block |
Query socket options for the specified socket
sock | The socket to query |
opt | The option we would like to query. One of: APR_SO_DEBUG -- turn on debugging information APR_SO_KEEPALIVE -- keep connections active APR_SO_LINGER -- lingers on close if data is present APR_SO_NONBLOCK -- Turns blocking on/off for socket APR_SO_REUSEADDR -- The rules used in validating addresses supplied to bind should allow reuse of local addresses. APR_SO_SNDBUF -- Set the SendBufferSize APR_SO_RCVBUF -- Set the ReceiveBufferSize APR_SO_DISCONNECTED -- Query the disconnected state of the socket. (Currently only used on Windows) |
on | Socket option returned on the call. |
Query socket timeout for the specified socket
sock | The socket to query |
t | Socket timeout returned from the query. |
Query the specified socket if at the OOB/Urgent data mark
sock | The socket to query |
atmark | Is set to true if socket is at the OOB/urgent mark, otherwise is set to false. |
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. |
which | Whether to retrieve the local or remote address |
sock | The socket to use |
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. |
sockaddr | The socket address to reference. |
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. |
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. |
addr2 | The other APR socket address. |
Return the type of the socket.
sock | The socket to query. |
type | The returned type (e.g., SOCK_STREAM). |
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 |
servname | The name of the service you wish to use |
Build an ip-subnet representation from an IP address and optional netmask or number-of-bits.
ipsub | The new ip-subnet representation |
ipstr | The input IP address string |
mask_or_numbits | The input netmask or number-of-bits string, or NULL |
p | The pool to allocate from |
Test the IP address in an apr_sockaddr_t against a pre-built ip-subnet representation.
ipsub | The ip-subnet representation |
sa | The socket address to test |
Return the protocol of the socket.
sock | The socket to query. |
protocol | The returned protocol (e.g., APR_PROTO_TCP). |
Join a Multicast Group
sock | The socket to join a multicast group |
join | The address of the multicast group to join |
iface | Address of the interface to use. If NULL is passed, the default multicast interface will be used. (OS Dependent) |
source | Source Address to accept transmissions from (non-NULL implies Source-Specific Multicast) |
Leave a Multicast Group. All arguments must be the same as apr_mcast_join.
sock | The socket to leave a multicast group |
addr | The address of the multicast group to leave |
iface | Address of the interface to use. If NULL is passed, the default multicast interface will be used. (OS Dependent) |
source | Source Address to accept transmissions from (non-NULL implies Source-Specific Multicast) |
Set the Multicast Time to Live (ttl) for a multicast transmission.
sock | The socket to set the multicast ttl |
ttl | Time to live to Assign. 0-255, default=1 |
Toggle IP Multicast Loopback
sock | The socket to set multicast loopback |
opt | 0=disable, 1=enable |
Set the Interface to be used for outgoing Multicast Transmissions.
sock | The socket to set the multicast interface on |
iface | Address of the interface to use for Multicast |
Set a socket to be inherited by child processes.
Unset a socket from being inherited by child processes.
Get the pool used by the socket.
const apr_sockaddr_t* addr2 |
Definition at line 713 of file apr_network_io.h.
Definition at line 670 of file apr_network_io.h.
Definition at line 363 of file apr_network_io.h.
apr_int32_t backlog |
Definition at line 327 of file apr_network_io.h.
char* buf |
Definition at line 488 of file apr_network_io.h.
apr_size_t buflen |
Definition at line 699 of file apr_network_io.h.
void const char apr_status_t(* cleanup)(void *)) |
Definition at line 469 of file apr_network_io.h.
Definition at line 338 of file apr_network_io.h.
Definition at line 283 of file apr_network_io.h.
void* data |
Definition at line 467 of file apr_network_io.h.
const char apr_int32_t family |
Definition at line 283 of file apr_network_io.h.
apr_socket_t apr_int32_t flags |
Definition at line 389 of file apr_network_io.h.
const char* hostname |
Definition at line 389 of file apr_network_io.h.
Definition at line 301 of file apr_network_io.h.
const char* ipstr |
Definition at line 739 of file apr_network_io.h.
void const char* key |
Definition at line 457 of file apr_network_io.h.
char apr_size_t* len |
Definition at line 449 of file apr_network_io.h.
const char const char* mask_or_numbits |
Definition at line 739 of file apr_network_io.h.
struct iovec apr_int32_t nvec |
Definition at line 510 of file apr_network_io.h.
apr_int32_t apr_int32_t * on |
Definition at line 617 of file apr_network_io.h.
apr_byte_t opt |
Definition at line 617 of file apr_network_io.h.
const char const char apr_pool_t* p |
Definition at line 389 of file apr_network_io.h.
const char apr_port_t port |
Definition at line 389 of file apr_network_io.h.
Definition at line 283 of file apr_network_io.h.
Definition at line 317 of file apr_network_io.h.
char** scope_id |
Definition at line 436 of file apr_network_io.h.
const char* servname |
Definition at line 729 of file apr_network_io.h.
Definition at line 338 of file apr_network_io.h.
apr_size_t apr_sockaddr_t * sockaddr |
Definition at line 692 of file apr_network_io.h.
apr_brigade_flush void const char * str |
Definition at line 436 of file apr_network_io.h.
Definition at line 631 of file apr_network_io.h.
Definition at line 283 of file apr_network_io.h.
struct iovec* vec |
Definition at line 510 of file apr_network_io.h.
Definition at line 521 of file apr_network_io.h.
Definition at line 681 of file apr_network_io.h.