17 #ifndef APR_NETWORK_IO_H
18 #define APR_NETWORK_IO_H
31 #if APR_HAVE_NETINET_IN_H
32 #include <netinet/in.h>
48 #ifndef APR_MAX_SECS_TO_LINGER
50 #define APR_MAX_SECS_TO_LINGER 30
55 #define APRMAXHOSTLEN 256
60 #define APR_ANYADDR "0.0.0.0"
67 #define APR_SO_LINGER 1
68 #define APR_SO_KEEPALIVE 2
69 #define APR_SO_DEBUG 4
70 #define APR_SO_NONBLOCK 8
71 #define APR_SO_REUSEADDR 16
72 #define APR_SO_SNDBUF 64
73 #define APR_SO_RCVBUF 128
74 #define APR_SO_DISCONNECTED 256
75 #define APR_TCP_NODELAY 512
78 #define APR_TCP_NOPUSH 1024
79 #define APR_RESET_NODELAY 2048
85 #define APR_INCOMPLETE_READ 4096
96 #define APR_INCOMPLETE_WRITE 8192
99 #define APR_IPV6_V6ONLY 16384
102 #define APR_TCP_DEFER_ACCEPT 32768
106 #define APR_SO_BROADCAST 65536
108 #define APR_SO_FREEBIND 131072
121 #define APR_IPV4_ADDR_OK 0x01
122 #define APR_IPV6_ADDR_OK 0x02
124 #if (!APR_HAVE_IN_ADDR)
139 #define APR_INADDR_NONE INADDR_NONE
141 #define APR_INADDR_NONE ((unsigned int) 0xffffffff)
149 #define APR_INET AF_INET
154 #define APR_UNSPEC AF_UNSPEC
163 #define APR_INET6 AF_INET6
166 #if APR_HAVE_SOCKADDR_UN
167 #if defined (AF_UNIX)
168 #define APR_UNIX AF_UNIX
169 #elif defined(AF_LOCAL)
170 #define APR_UNIX AF_LOCAL
172 #error "Neither AF_UNIX nor AF_LOCAL is defined"
175 #if defined (AF_UNIX)
176 #define APR_UNIX AF_UNIX
177 #elif defined(AF_LOCAL)
178 #define APR_UNIX AF_LOCAL
181 #define APR_UNIX 1234
189 #define APR_PROTO_TCP 6
190 #define APR_PROTO_UDP 17
191 #define APR_PROTO_SCTP 132
208 #if APR_HAVE_INET_ADDR
209 #define apr_inet_addr inet_addr
210 #elif APR_HAVE_INET_NETWORK
215 #define apr_inet_addr inet_network
266 struct sockaddr_in
sin;
269 struct sockaddr_in6
sin6;
271 #if APR_HAVE_SA_STORAGE
274 struct sockaddr_storage
sas;
276 #if APR_HAVE_SOCKADDR_UN
278 struct sockaddr_un
unx;
313 int family,
int type,
423 const char *hostname,
447 const char *zone_id);
583 const struct iovec *vec,
616 #if APR_HAS_SENDFILE || defined(DOXYGEN)
824 const char *servname);
835 const char *mask_or_numbits,
847 #if APR_HAS_SO_ACCEPTFILTER || defined(DOXYGEN)
APR Platform Definitions.
#define socket
Definition: apr_arch_os2calls.h:41
APR File Handle Inheritance Helpers.
APR Process Locking Routines.
dav_resource int dav_locktoken dav_response int flags
Definition: mod_dav.h:1458
dav_buffer const char * str
Definition: mod_dav.h:465
dav_error * src
Definition: mod_dav.h:186
const char * name
Definition: mod_dav.h:805
int apr_status_t
Definition: apr_errno.h:44
apr_wait_type_t
Definition: apr_general.h:71
apr_status_t apr_mcast_hops(apr_socket_t *sock, apr_byte_t ttl)
apr_status_t apr_mcast_join(apr_socket_t *sock, apr_sockaddr_t *join, apr_sockaddr_t *iface, apr_sockaddr_t *source)
apr_status_t apr_mcast_loopback(apr_socket_t *sock, apr_byte_t opt)
apr_status_t apr_mcast_interface(apr_socket_t *sock, apr_sockaddr_t *iface)
apr_status_t apr_mcast_leave(apr_socket_t *sock, apr_sockaddr_t *addr, apr_sockaddr_t *iface, apr_sockaddr_t *source)
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)
apr_status_t apr_socket_opt_set(apr_socket_t *sock, apr_int32_t opt, apr_int32_t on)
apr_status_t apr_sockaddr_zone_set(apr_sockaddr_t *sa, const char *zone_id)
APR_DECLARE_INHERIT_UNSET(socket)
apr_status_t apr_socket_listen(apr_socket_t *sock, apr_int32_t backlog)
apr_status_t apr_socket_opt_get(apr_socket_t *sock, apr_int32_t opt, apr_int32_t *on)
apr_interface_e
Definition: apr_network_io.h:198
int apr_sockaddr_equal(const apr_sockaddr_t *addr1, const apr_sockaddr_t *addr2)
apr_status_t apr_socket_accept_filter(apr_socket_t *sock, const char *name, const char *args)
apr_status_t apr_socket_accept(apr_socket_t **new_sock, apr_socket_t *sock, apr_pool_t *connection_pool)
apr_status_t apr_socket_atmark(apr_socket_t *sock, int *atmark)
apr_status_t apr_socket_wait(apr_socket_t *sock, apr_wait_type_t direction)
apr_status_t apr_ipsubnet_create(apr_ipsubnet_t **ipsub, const char *ipstr, const char *mask_or_numbits, apr_pool_t *p)
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)
apr_status_t apr_sockaddr_info_copy(apr_sockaddr_t **dst, const apr_sockaddr_t *src, apr_pool_t *p)
apr_status_t apr_socket_create(apr_socket_t **new_sock, int family, int type, int protocol, apr_pool_t *cont)
apr_status_t apr_socket_bind(apr_socket_t *sock, apr_sockaddr_t *sa)
apr_status_t apr_gethostname(char *buf, int len, apr_pool_t *cont)
apr_status_t apr_getnameinfo(char **hostname, apr_sockaddr_t *sa, apr_int32_t flags)
apr_status_t apr_socket_recvfrom(apr_sockaddr_t *from, apr_socket_t *sock, apr_int32_t flags, char *buf, apr_size_t *len)
apr_status_t apr_socket_close(apr_socket_t *thesocket)
apr_status_t apr_sockaddr_ip_getbuf(char *buf, apr_size_t buflen, apr_sockaddr_t *sockaddr)
apr_status_t apr_socket_type_get(apr_socket_t *sock, int *type)
apr_status_t apr_socket_connect(apr_socket_t *sock, apr_sockaddr_t *sa)
apr_status_t apr_parse_addr_port(char **addr, char **scope_id, apr_port_t *port, const char *str, apr_pool_t *p)
apr_status_t apr_socket_send(apr_socket_t *sock, const char *buf, apr_size_t *len)
apr_status_t apr_socket_timeout_set(apr_socket_t *sock, apr_interval_time_t t)
apr_status_t apr_socket_sendv(apr_socket_t *sock, const struct iovec *vec, apr_int32_t nvec, apr_size_t *len)
APR_PERMS_SET_IMPLEMENT(socket)
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)
apr_status_t apr_socket_timeout_get(apr_socket_t *sock, apr_interval_time_t *t)
apr_status_t apr_sockaddr_zone_get(const apr_sockaddr_t *sa, const char **name, apr_uint32_t *id, apr_pool_t *p)
apr_uint16_t apr_port_t
Definition: apr_network_io.h:230
apr_status_t apr_socket_recv(apr_socket_t *sock, char *buf, apr_size_t *len)
APR_POOL_DECLARE_ACCESSOR(socket)
int apr_ipsubnet_test(apr_ipsubnet_t *ipsub, apr_sockaddr_t *sa)
apr_status_t apr_sockaddr_ip_get(char **addr, apr_sockaddr_t *sockaddr)
int apr_sockaddr_is_wildcard(const apr_sockaddr_t *addr)
apr_status_t apr_socket_atreadeof(apr_socket_t *sock, int *atreadeof)
apr_status_t apr_socket_protocol_get(apr_socket_t *sock, int *protocol)
apr_status_t apr_socket_shutdown(apr_socket_t *thesocket, apr_shutdown_how_e how)
struct apr_ipsubnet_t apr_ipsubnet_t
Definition: apr_network_io.h:227
apr_status_t apr_socket_addr_get(apr_sockaddr_t **sa, apr_interface_e which, apr_socket_t *sock)
struct in_addr apr_in_addr_t
Definition: apr_network_io.h:225
apr_status_t apr_getservbyname(apr_sockaddr_t *sockaddr, const char *servname)
apr_shutdown_how_e
Definition: apr_network_io.h:115
apr_status_t apr_socket_data_get(void **data, const char *key, apr_socket_t *sock)
APR_DECLARE_INHERIT_SET(socket)
apr_status_t apr_socket_data_set(apr_socket_t *sock, void *data, const char *key, apr_status_t(*cleanup)(void *))
@ APR_LOCAL
Definition: apr_network_io.h:199
@ APR_REMOTE
Definition: apr_network_io.h:200
@ APR_SHUTDOWN_WRITE
Definition: apr_network_io.h:117
@ APR_SHUTDOWN_READ
Definition: apr_network_io.h:116
@ APR_SHUTDOWN_READWRITE
Definition: apr_network_io.h:118
struct apr_pool_t apr_pool_t
Definition: apr_pools.h:60
apr_int64_t apr_interval_time_t
Definition: apr_time.h:55
#define APR_DECLARE(x)
Definition: macros.h:6
Definition: apr_arch_file_io.h:107
Definition: apr_network_io.h:288
struct iovec * trailers
Definition: apr_network_io.h:294
int numheaders
Definition: apr_network_io.h:292
int numtrailers
Definition: apr_network_io.h:296
struct iovec * headers
Definition: apr_network_io.h:290
Definition: apr_network_io.h:239
apr_port_t port
Definition: apr_network_io.h:247
apr_pool_t * pool
Definition: apr_network_io.h:241
char * servname
Definition: apr_network_io.h:245
void * ipaddr_ptr
Definition: apr_network_io.h:259
apr_sockaddr_t * next
Definition: apr_network_io.h:262
struct sockaddr_in sin
Definition: apr_network_io.h:266
int ipaddr_len
Definition: apr_network_io.h:253
char * hostname
Definition: apr_network_io.h:243
int addr_str_len
Definition: apr_network_io.h:256
union apr_sockaddr_t::@18 sa
struct sockaddr_in6 sin6
Definition: apr_network_io.h:269
struct sockaddr_un unx
Definition: apr_network_io.h:278
apr_int32_t family
Definition: apr_network_io.h:249
struct sockaddr_storage sas
Definition: apr_network_io.h:274
apr_socklen_t salen
Definition: apr_network_io.h:251
Definition: apr_arch_networkio.h:37