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
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;
289 #define APR_SENDFILE_DISCONNECT_SOCKET 1
318 int family,
int type,
362 apr_int32_t backlog);
428 const
char *hostname,
561 const struct iovec *vec,
562 apr_int32_t nvec, apr_size_t *len);
573 apr_int32_t flags, const
char *buf,
591 apr_int32_t flags,
char *buf,
594 #if APR_HAS_SENDFILE || defined(DOXYGEN)
643 char *buf, apr_size_t *len);
653 apr_wait_type_t direction);
679 apr_int32_t opt, apr_int32_t on);
715 apr_int32_t opt, apr_int32_t *on);
801 const
char *servname);
812 const
char *mask_or_numbits,
824 #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:246
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)
APR Process Locking Routines.
struct sockaddr_in sin
Definition: apr_network_io.h:293
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:254
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:142
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:144
APR_PERMS_SET_IMPLEMENT(socket)
apr_int64_t apr_interval_time_t
Definition: apr_time.h:55
union apr_sockaddr_t::@1 sa
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:272
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:276
struct apr_file_t apr_file_t
Definition: apr_file_io.h:216
apr_status_t apr_socket_recv(apr_socket_t *sock, char *buf, apr_size_t *len)
Definition: apr_network_io.h:143
int apr_sockaddr_equal(const apr_sockaddr_t *addr1, const apr_sockaddr_t *addr2)
apr_sockaddr_t * next
Definition: apr_network_io.h:289
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:328
int addr_str_len
Definition: apr_network_io.h:283
Definition: apr_network_io.h:156
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_sockaddr_info_copy(apr_sockaddr_t **dst, const apr_sockaddr_t *src, apr_pool_t *p)
APR Platform Definitions.
apr_interface_e
Definition: apr_network_io.h:225
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:270
#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_accept_filter(apr_socket_t *sock, const char *name, const char *args)
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:286
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:326
struct apr_pool_t apr_pool_t
Definition: apr_pools.h:60
int apr_status_t
Definition: apr_errno.h:44
apr_uint32_t s_addr
Definition: apr_network_io.h:157
struct iovec * headers
Definition: apr_network_io.h:322
int ipaddr_len
Definition: apr_network_io.h:280
apr_uint16_t apr_port_t
Definition: apr_network_io.h:257
apr_status_t apr_socket_atmark(apr_socket_t *sock, int *atmark)
apr_pool_t * pool
Definition: apr_network_io.h:268
apr_status_t apr_socket_connect(apr_socket_t *sock, apr_sockaddr_t *sa)
apr_status_t apr_socket_wait(apr_socket_t *sock, apr_wait_type_t direction)
Definition: apr_network_io.h:227
apr_port_t port
Definition: apr_network_io.h:274
apr_status_t apr_mcast_interface(apr_socket_t *sock, apr_sockaddr_t *iface)
Definition: apr_network_io.h:145
Definition: apr_network_io.h:320
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:324
Definition: apr_network_io.h:266
apr_socklen_t salen
Definition: apr_network_io.h:278
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:226