17 #ifndef APR_NETWORK_IO_H
18 #define APR_NETWORK_IO_H
30 #if APR_HAVE_NETINET_IN_H
31 #include <netinet/in.h>
44 #ifndef APR_MAX_SECS_TO_LINGER
46 #define APR_MAX_SECS_TO_LINGER 30
51 #define APRMAXHOSTLEN 256
56 #define APR_ANYADDR "0.0.0.0"
63 #define APR_SO_LINGER 1
64 #define APR_SO_KEEPALIVE 2
65 #define APR_SO_DEBUG 4
66 #define APR_SO_NONBLOCK 8
67 #define APR_SO_REUSEADDR 16
68 #define APR_SO_SNDBUF 64
69 #define APR_SO_RCVBUF 128
70 #define APR_SO_DISCONNECTED 256
71 #define APR_TCP_NODELAY 512
74 #define APR_TCP_NOPUSH 1024
75 #define APR_RESET_NODELAY 2048
81 #define APR_INCOMPLETE_READ 4096
92 #define APR_INCOMPLETE_WRITE 8192
95 #define APR_IPV6_V6ONLY 16384
98 #define APR_TCP_DEFER_ACCEPT 32768
102 #define APR_SO_BROADCAST 65536
114 #define APR_IPV4_ADDR_OK 0x01
115 #define APR_IPV6_ADDR_OK 0x02
117 #if (!APR_HAVE_IN_ADDR)
132 #define APR_INADDR_NONE INADDR_NONE
134 #define APR_INADDR_NONE ((unsigned int) 0xffffffff)
142 #define APR_INET AF_INET
147 #define APR_UNSPEC AF_UNSPEC
156 #define APR_INET6 AF_INET6
163 #define APR_PROTO_TCP 6
164 #define APR_PROTO_UDP 17
165 #define APR_PROTO_SCTP 132
182 #if APR_HAVE_INET_ADDR
183 #define apr_inet_addr inet_addr
184 #elif APR_HAVE_INET_NETWORK
189 #define apr_inet_addr inet_network
243 struct sockaddr_in6 sin6;
245 #if APR_HAVE_SA_STORAGE
248 struct sockaddr_storage sas;
259 #define APR_SENDFILE_DISCONNECT_SOCKET 1
288 int family,
int type,
332 apr_int32_t backlog);
397 const
char *hostname,
520 const struct iovec *vec,
521 apr_int32_t nvec, apr_size_t *len);
532 apr_int32_t flags, const
char *buf,
550 apr_int32_t flags,
char *buf,
553 #if APR_HAS_SENDFILE || defined(DOXYGEN)
602 char *buf, apr_size_t *len);
627 apr_int32_t opt, apr_int32_t on);
663 apr_int32_t opt, apr_int32_t *on);
749 const
char *servname);
760 const
char *mask_or_numbits,
772 #if APR_HAS_SO_ACCEPTFILTER || defined(DOXYGEN)
apr_status_t apr_mcast_hops(apr_socket_t *sock, apr_byte_t ttl)
apr_status_t apr_socket_close(apr_socket_t *thesocket)
struct apr_socket_t apr_socket_t
Definition: apr_network_io.h:218
apr_status_t apr_socket_timeout_get(apr_socket_t *sock, apr_interval_time_t *t)
int apr_sockaddr_is_wildcard(const apr_sockaddr_t *addr)
apr_status_t apr_sockaddr_ip_get(char **addr, apr_sockaddr_t *sockaddr)
struct sockaddr_in sin
Definition: apr_network_io.h:265
apr_status_t apr_socket_opt_get(apr_socket_t *sock, apr_int32_t opt, apr_int32_t *on)
apr_status_t apr_socket_opt_set(apr_socket_t *sock, apr_int32_t opt, apr_int32_t on)
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_sendv(apr_socket_t *sock, const struct iovec *vec, apr_int32_t nvec, apr_size_t *len)
apr_status_t apr_socket_listen(apr_socket_t *sock, apr_int32_t backlog)
struct apr_ipsubnet_t apr_ipsubnet_t
Definition: apr_network_io.h:226
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 File Handle Inheritance Helpers.
apr_shutdown_how_e
Definition: apr_network_io.h:133
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_socket_addr_get(apr_sockaddr_t **sa, apr_interface_e which, apr_socket_t *sock)
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)
int apr_ipsubnet_test(apr_ipsubnet_t *ipsub, apr_sockaddr_t *sa)
apr_status_t apr_socket_data_get(void **data, const char *key, apr_socket_t *sock)
Definition: apr_network_io.h:135
apr_int64_t apr_interval_time_t
Definition: apr_time.h:56
apr_status_t apr_socket_send(apr_socket_t *sock, const char *buf, apr_size_t *len)
apr_status_t apr_gethostname(char *buf, int len, apr_pool_t *cont)
#define APR_DECLARE_INHERIT_SET(type)
Definition: apr_inherit.h:35
char * servname
Definition: apr_network_io.h:244
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_bind(apr_socket_t *sock, apr_sockaddr_t *sa)
apr_int32_t family
Definition: apr_network_io.h:248
struct apr_file_t apr_file_t
Definition: apr_file_io.h:209
apr_status_t apr_socket_recv(apr_socket_t *sock, char *buf, apr_size_t *len)
Definition: apr_network_io.h:134
int apr_sockaddr_equal(const apr_sockaddr_t *addr1, const apr_sockaddr_t *addr2)
union apr_sockaddr_t::@0 sa
apr_sockaddr_t * next
Definition: apr_network_io.h:261
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_timeout_set(apr_socket_t *sock, apr_interval_time_t t)
int numtrailers
Definition: apr_network_io.h:296
int addr_str_len
Definition: apr_network_io.h:255
Definition: apr_network_io.h:147
apr_status_t apr_mcast_leave(apr_socket_t *sock, apr_sockaddr_t *addr, apr_sockaddr_t *iface, apr_sockaddr_t *source)
APR Platform Definitions.
apr_interface_e
Definition: apr_network_io.h:197
apr_status_t apr_socket_data_set(apr_socket_t *sock, void *data, const char *key, apr_status_t(*cleanup)(void *))
apr_status_t apr_sockaddr_ip_getbuf(char *buf, apr_size_t buflen, apr_sockaddr_t *sockaddr)
apr_status_t apr_ipsubnet_create(apr_ipsubnet_t **ipsub, const char *ipstr, const char *mask_or_numbits, apr_pool_t *p)
char * hostname
Definition: apr_network_io.h:242
#define APR_DECLARE_INHERIT_UNSET(type)
Definition: apr_inherit.h:47
apr_status_t apr_mcast_loopback(apr_socket_t *sock, apr_byte_t opt)
apr_status_t apr_socket_recvfrom(apr_sockaddr_t *from, apr_socket_t *sock, apr_int32_t flags, char *buf, apr_size_t *len)
void * ipaddr_ptr
Definition: apr_network_io.h:258
apr_status_t apr_socket_type_get(apr_socket_t *sock, int *type)
apr_status_t apr_getservbyname(apr_sockaddr_t *sockaddr, const char *servname)
struct iovec * trailers
Definition: apr_network_io.h:294
struct apr_pool_t apr_pool_t
Definition: apr_pools.h:60
apr_status_t apr_socket_accept_filter(apr_socket_t *sock, char *name, char *args)
int apr_status_t
Definition: apr_errno.h:44
apr_uint32_t s_addr
Definition: apr_network_io.h:148
struct iovec * headers
Definition: apr_network_io.h:290
int ipaddr_len
Definition: apr_network_io.h:252
apr_uint16_t apr_port_t
Definition: apr_network_io.h:229
apr_status_t apr_socket_atmark(apr_socket_t *sock, int *atmark)
apr_pool_t * pool
Definition: apr_network_io.h:240
apr_status_t apr_socket_connect(apr_socket_t *sock, apr_sockaddr_t *sa)
Definition: apr_network_io.h:199
apr_port_t port
Definition: apr_network_io.h:246
apr_status_t apr_mcast_interface(apr_socket_t *sock, apr_sockaddr_t *iface)
Definition: apr_network_io.h:136
Definition: apr_network_io.h:288
apr_status_t apr_getnameinfo(char **hostname, apr_sockaddr_t *sa, apr_int32_t flags)
#define APR_POOL_DECLARE_ACCESSOR(type)
Definition: apr_pools.h:81
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)
int numheaders
Definition: apr_network_io.h:292
Definition: apr_network_io.h:238
apr_socklen_t salen
Definition: apr_network_io.h:250
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_socket_shutdown(apr_socket_t *thesocket, apr_shutdown_how_e how)
Definition: apr_network_io.h:198