upload http
[bottlenecks.git] / rubbos / app / httpd-2.0.64 / srclib / apr / include / arch / os2 / 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_private.h"
21 #include "apr_network_io.h"
22 #include "apr_general.h"
23 #include "apr_arch_os2calls.h"
24 #if APR_HAVE_NETDB_H
25 #include <netdb.h>
26 #endif
27
28 typedef struct sock_userdata_t sock_userdata_t;
29 struct sock_userdata_t {
30     sock_userdata_t *next;
31     const char *key;
32     void *data;
33 };
34
35 struct apr_socket_t {
36     apr_pool_t *cntxt;
37     int socketdes;
38     int type;
39     int protocol;
40     apr_sockaddr_t *local_addr;
41     apr_sockaddr_t *remote_addr;
42     apr_interval_time_t timeout;
43     int nonblock;
44     int local_port_unknown;
45     int local_interface_unknown;
46     int remote_addr_unknown;
47     apr_int32_t netmask;
48     apr_int32_t inherit;
49     sock_userdata_t *userdata;
50 };
51
52 /* Error codes returned from sock_errno() */
53 #define SOCBASEERR              10000
54 #define SOCEPERM                (SOCBASEERR+1)             /* Not owner */
55 #define SOCESRCH                (SOCBASEERR+3)             /* No such process */
56 #define SOCEINTR                (SOCBASEERR+4)             /* Interrupted system call */
57 #define SOCENXIO                (SOCBASEERR+6)             /* No such device or address */
58 #define SOCEBADF                (SOCBASEERR+9)             /* Bad file number */
59 #define SOCEACCES               (SOCBASEERR+13)            /* Permission denied */
60 #define SOCEFAULT               (SOCBASEERR+14)            /* Bad address */
61 #define SOCEINVAL               (SOCBASEERR+22)            /* Invalid argument */
62 #define SOCEMFILE               (SOCBASEERR+24)            /* Too many open files */
63 #define SOCEPIPE                (SOCBASEERR+32)            /* Broken pipe */
64 #define SOCEOS2ERR              (SOCBASEERR+100)            /* OS/2 Error */
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 #endif  /* ! NETWORK_IO_H */
71