Apache2
apr_arch_networkio.h
Go to the documentation of this file.
1 /* Licensed to the Apache Software Foundation (ASF) under one or more
2  * contributor license agreements. See the NOTICE file distributed with
3  * this work for additional information regarding copyright ownership.
4  * The ASF licenses this file to You under the Apache License, Version 2.0
5  * (the "License"); you may not use this file except in compliance with
6  * the License. You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 #ifndef NETWORK_IO_H
18 #define NETWORK_IO_H
19 
20 #include "apr_network_io.h"
21 #include "apr_general.h"
22 #include "apr_poll.h"
23 
24 typedef struct sock_userdata_t sock_userdata_t;
25 struct sock_userdata_t {
27  const char *key;
28  void *data;
29 };
30 
31 struct apr_socket_t {
33  SOCKET socketdes;
34  int type; /* SOCK_STREAM, SOCK_DGRAM */
35  int protocol;
38  int timeout_ms; /* MUST MATCH if timeout > 0 */
46 #if APR_HAS_SENDFILE
47  /* As of 07.20.04, the overlapped structure is only used by
48  * apr_socket_sendfile and that's where it will be allocated
49  * and initialized.
50  */
51  OVERLAPPED *overlapped;
52 #endif
54 
55  /* if there is a timeout set, then this pollset is used */
57 };
58 
59 #ifdef _MSC_VER
60 #define HAVE_STRUCT_IPMREQ
61 #endif
62 
63 const char *apr_inet_ntop(int af, const void *src, char *dst, apr_size_t size);
64 int apr_inet_pton(int af, const char *src, void *dst);
66 
67 #define apr_is_option_set(skt, option) \
68  (((skt)->options & (option)) == (option))
69 
70 #define apr_set_option(skt, option, on) \
71  do { \
72  if (on) \
73  (skt)->options |= (option); \
74  else \
75  (skt)->options &= ~(option); \
76  } while (0)
77 
78 extern apr_status_t
80  apr_socket_t **out,
81  apr_pool_t *p);
82 
83 extern apr_status_t
85 
86 #endif /* ! NETWORK_IO_H */
87 
#define socket
Definition: apr_arch_os2calls.h:41
APR Miscellaneous library routines.
APR Network library.
APR Poll interface.
dav_buffer apr_size_t size
Definition: mod_dav.h:461
dav_error * src
Definition: mod_dav.h:186
int apr_status_t
Definition: apr_errno.h:44
apr_uint16_t apr_port_t
Definition: apr_network_io.h:230
int apr_int32_t
Definition: apr.h:347
size_t apr_size_t
Definition: apr.h:394
struct apr_pool_t apr_pool_t
Definition: apr_pools.h:60
apr_int64_t apr_interval_time_t
Definition: apr_time.h:55
void apr_sockaddr_vars_set(apr_sockaddr_t *, int, apr_port_t)
int apr_inet_pton(int af, const char *src, void *dst)
const char * apr_inet_ntop(int af, const void *src, char *dst, apr_size_t size)
Definition: apr_arch_poll_private.h:124
Definition: apr_network_io.h:239
Definition: apr_arch_networkio.h:37
apr_pool_t * pool
Definition: apr_arch_networkio.h:38
sock_userdata_t * userdata
Definition: apr_arch_networkio.h:51
int local_port_unknown
Definition: apr_arch_networkio.h:46
apr_interval_time_t timeout
Definition: apr_arch_networkio.h:44
apr_int32_t disconnected
Definition: apr_arch_networkio.h:40
int local_interface_unknown
Definition: apr_arch_networkio.h:47
apr_sockaddr_t * remote_addr
Definition: apr_arch_networkio.h:43
int timeout_ms
Definition: apr_arch_networkio.h:38
int type
Definition: apr_arch_networkio.h:40
apr_pollset_t * pollset
Definition: apr_arch_networkio.h:54
apr_int32_t options
Definition: apr_arch_networkio.h:49
int protocol
Definition: apr_arch_networkio.h:41
apr_int32_t inherit
Definition: apr_arch_networkio.h:50
OVERLAPPED * overlapped
Definition: apr_arch_networkio.h:51
SOCKET socketdes
Definition: apr_arch_networkio.h:33
apr_sockaddr_t * local_addr
Definition: apr_arch_networkio.h:42
int remote_addr_unknown
Definition: apr_arch_networkio.h:48
Definition: apr_arch_networkio.h:31
const char * key
Definition: apr_arch_networkio.h:33
sock_userdata_t * next
Definition: apr_arch_networkio.h:32
void * data
Definition: apr_arch_networkio.h:34
apr_pool_t * p
apr_status_t apr_socket_pipe_create(apr_socket_t **in, apr_socket_t **out, apr_pool_t *p)
apr_status_t apr_socket_pipe_close(apr_socket_t *socket)