1047f369cy/*
2047f369cy * Copyright (c) 2009-2012 Niels Provos and Nick Mathewson
3047f369cy *
4047f369cy * Redistribution and use in source and binary forms, with or without
5047f369cy * modification, are permitted provided that the following conditions
6047f369cy * are met:
7047f369cy * 1. Redistributions of source code must retain the above copyright
8047f369cy *    notice, this list of conditions and the following disclaimer.
9047f369cy * 2. Redistributions in binary form must reproduce the above copyright
10047f369cy *    notice, this list of conditions and the following disclaimer in the
11047f369cy *    documentation and/or other materials provided with the distribution.
12047f369cy * 3. The name of the author may not be used to endorse or promote products
13047f369cy *    derived from this software without specific prior written permission.
14047f369cy *
15047f369cy * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
16047f369cy * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
17047f369cy * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
18047f369cy * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
19047f369cy * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
20047f369cy * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
21047f369cy * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
22047f369cy * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23047f369cy * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
24047f369cy * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25047f369cy */
26047f369cy
27047f369cy/* Internal use only: Fake IPv6 structures and values on platforms that
28047f369cy * do not have them */
29047f369cy
30047f369cy#ifndef IPV6_INTERNAL_H_INCLUDED_
31047f369cy#define IPV6_INTERNAL_H_INCLUDED_
32047f369cy
33047f369cy#include "event2/event-config.h"
34047f369cy#include "evconfig-private.h"
35047f369cy
36047f369cy#include <sys/types.h>
37047f369cy#ifdef EVENT__HAVE_SYS_SOCKET_H
38047f369cy#include <sys/socket.h>
39047f369cy#endif
40047f369cy#include "event2/util.h"
41047f369cy
42047f369cy#ifdef __cplusplus
43047f369cyextern "C" {
44047f369cy#endif
45047f369cy
46047f369cy/** @file ipv6-internal.h
47047f369cy *
48047f369cy * Replacement types and functions for platforms that don't support ipv6
49047f369cy * properly.
50047f369cy */
51047f369cy
52047f369cy#ifndef EVENT__HAVE_STRUCT_IN6_ADDR
53047f369cystruct in6_addr {
54047f369cy	ev_uint8_t s6_addr[16];
55047f369cy};
56047f369cy#endif
57047f369cy
58047f369cy#ifndef EVENT__HAVE_SA_FAMILY_T
59047f369cytypedef int sa_family_t;
60047f369cy#endif
61047f369cy
62047f369cy#ifndef EVENT__HAVE_STRUCT_SOCKADDR_IN6
63047f369cystruct sockaddr_in6 {
64047f369cy	/* This will fail if we find a struct sockaddr that doesn't have
65047f369cy	 * sa_family as the first element. */
66047f369cy	sa_family_t sin6_family;
67047f369cy	ev_uint16_t sin6_port;
68047f369cy	struct in6_addr sin6_addr;
69047f369cy};
70047f369cy#endif
71047f369cy
72047f369cy#ifndef AF_INET6
73047f369cy#define AF_INET6 3333
74047f369cy#endif
75047f369cy#ifndef PF_INET6
76047f369cy#define PF_INET6 AF_INET6
77047f369cy#endif
78047f369cy
79047f369cy#ifdef __cplusplus
80047f369cy}
81047f369cy#endif
82047f369cy
83047f369cy#endif
84