Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 91 lines (72 sloc) 2.025 kB
85a296d @alobbs Solves a number of issues around the IPv6 support of the server,
alobbs authored
1 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
2
3 /* Cherokee
4 *
5 * Authors:
6 * Alvaro Lopez Ortega <alvaro@alobbs.com>
7 *
8 * Copyright (C) 2001-2011 Alvaro Lopez Ortega
9 *
10 * This program is free software; you can redistribute it and/or
11 * modify it under the terms of version 2 of the GNU General Public
12 * License as published by the Free Software Foundation.
13 *
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
18 *
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
22 * 02110-1301, USA.
23 */
24
25 #ifndef CHEROKEE_SOCKET_LOWLEVEL_H
26 #define CHEROKEE_SOCKET_LOWLEVEL_H
27
28 #include "common-internal.h"
29
30 #ifdef HAVE_SYS_TIME_H
31 #include <sys/time.h>
32 #else
33 #include <time.h>
34 #endif
35
36 #include <sys/types.h>
37 #include <netdb.h>
38
39 #ifdef HAVE_SYS_SOCKET_H
40 # include <sys/socket.h>
41 # include <sys/un.h>
42 #endif
43
44 #ifdef HAVE_NETINET_IN_H
45 # include <netinet/in.h>
46 #endif
47
48 #ifdef HAVE_ARPA_INET_H
49 # include <arpa/inet.h>
50 #endif
51
52
53
54 #ifdef INET6_ADDRSTRLEN
55 # define CHE_INET_ADDRSTRLEN INET6_ADDRSTRLEN
56 #else
57 # ifdef INET_ADDRSTRLEN
58 # define CHE_INET_ADDRSTRLEN INET_ADDRSTRLEN
59 # else
60 # define CHE_INET_ADDRSTRLEN 16
61 # endif
62 #endif
63
64 #ifndef AF_LOCAL
65 # define AF_LOCAL AF_UNIX
66 #endif
67
68 #ifndef SUN_LEN
69 #define SUN_LEN(sa) \
70 (strlen((sa)->sun_path) + \
71 (size_t)(((struct sockaddr_un*)0)->sun_path))
72 #endif
73
74 #ifndef SUN_ABSTRACT_LEN
75 #define SUN_ABSTRACT_LEN(sa) \
76 (strlen((sa)->sun_path+1) + 2 + \
77 (size_t)(((struct sockaddr_un*)0)->sun_path))
78 #endif
79
80
81 typedef struct {
82 union {
83 struct in_addr addr_ipv4;
84 struct in6_addr addr_ipv6;
85 } addr;
86 unsigned short family;
87 } cherokee_in_addr_t;
88
89
90 #endif /* CHEROKEE_SOCKET_LOWLEVEL_H */
Something went wrong with that request. Please try again.