bottleneck testcase based on rubbos
[bottlenecks.git] / rubbos / app / httpd-2.0.64 / srclib / apr / include / arch / win32 / apr_arch_networkio.h
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
23 typedef struct sock_userdata_t sock_userdata_t;
24 struct sock_userdata_t {
25     sock_userdata_t *next;
26     const char *key;
27     void *data;
28 };
29
30 struct apr_socket_t {
31     apr_pool_t         *cntxt;
32     SOCKET              socketdes;
33     int                 type; /* SOCK_STREAM, SOCK_DGRAM */
34     int                 protocol;
35     apr_sockaddr_t     *local_addr;
36     apr_sockaddr_t     *remote_addr;
37     int                 timeout_ms; /* MUST MATCH if timeout > 0 */
38     apr_interval_time_t timeout;
39     apr_int32_t         disconnected;
40     int                 local_port_unknown;
41     int                 local_interface_unknown;
42     int                 remote_addr_unknown;
43     apr_int32_t         netmask;
44     apr_int32_t         inherit;
45 #if APR_HAS_SENDFILE
46     /* As of 07.20.04, the overlapped structure is only used by 
47      * apr_socket_sendfile and that's where it will be allocated 
48      * and initialized.
49      */
50     OVERLAPPED         *overlapped;
51 #endif
52     sock_userdata_t    *userdata;
53 };
54
55 #ifdef _WIN32_WCE
56 #ifndef WSABUF
57 typedef struct _WSABUF {
58     u_long      len;     /* the length of the buffer */
59     char FAR *  buf;     /* the pointer to the buffer */
60 } WSABUF, FAR * LPWSABUF;
61 #endif
62 #endif
63
64 apr_status_t status_from_res_error(int);
65
66 const char *apr_inet_ntop(int af, const void *src, char *dst, apr_size_t size);
67 int apr_inet_pton(int af, const char *src, void *dst);
68 void apr_sockaddr_vars_set(apr_sockaddr_t *, int, apr_port_t);
69
70 #define apr_is_option_set(mask, option)  ((mask & option) ==option)
71 #define apr_set_option(mask, option, on) \
72     do {                                 \
73         if (on)                          \
74             *mask |= option;             \
75         else                             \
76             *mask &= ~option;            \
77     } while (0)
78
79 #endif  /* ! NETWORK_IO_H */
80