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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
21 #include "apr_private.h"
22 #include "apr_network_io.h"
23 #include "apr_errno.h"
24 #include "apr_general.h"
27 /* System headers the network I/O library needs */
28 #if APR_HAVE_SYS_TYPES_H
29 #include <sys/types.h>
31 #if APR_HAVE_SYS_UIO_H
34 #ifdef HAVE_SYS_SELECT_H
35 #include <sys/select.h>
40 #if APR_HAVE_SYS_TIME_H
49 #if APR_HAVE_NETINET_TCP_H
50 #include <netinet/tcp.h>
52 #if APR_HAVE_NETINET_SCTP_UIO_H
53 #include <netinet/sctp_uio.h>
55 #if APR_HAVE_NETINET_SCTP_H
56 #include <netinet/sctp.h>
58 #if APR_HAVE_NETINET_IN_H
59 #include <netinet/in.h>
61 #if APR_HAVE_ARPA_INET_H
62 #include <arpa/inet.h>
64 #if APR_HAVE_SYS_SOCKET_H
65 #include <sys/socket.h>
67 #if APR_HAVE_SYS_SOCKIO_H
68 #include <sys/sockio.h>
76 #if APR_HAVE_SYS_SENDFILE_H
77 #include <sys/sendfile.h>
79 #if APR_HAVE_SYS_IOCTL_H
80 #include <sys/ioctl.h>
82 /* End System Headers */
93 typedef struct sock_userdata_t sock_userdata_t;
94 struct sock_userdata_t {
95 sock_userdata_t *next;
100 struct apr_socket_t {
105 apr_sockaddr_t *local_addr;
106 apr_sockaddr_t *remote_addr;
107 apr_interval_time_t timeout;
111 int local_port_unknown;
112 int local_interface_unknown;
113 int remote_addr_unknown;
116 sock_userdata_t *userdata;
119 const char *apr_inet_ntop(int af, const void *src, char *dst, apr_size_t size);
120 int apr_inet_pton(int af, const char *src, void *dst);
121 void apr_sockaddr_vars_set(apr_sockaddr_t *, int, apr_port_t);
123 #define apr_is_option_set(mask, option) ((mask & option) ==option)
125 #define apr_set_option(mask, option, on) \
133 #endif /* ! NETWORK_IO_H */