1eac58b9emaste/*
2eac58b9emaste * Copyright (c) 2009-2012 Niels Provos and Nick Mathewson
3eac58b9emaste *
4eac58b9emaste * Redistribution and use in source and binary forms, with or without
5eac58b9emaste * modification, are permitted provided that the following conditions
6eac58b9emaste * are met:
7eac58b9emaste * 1. Redistributions of source code must retain the above copyright
8eac58b9emaste *    notice, this list of conditions and the following disclaimer.
9eac58b9emaste * 2. Redistributions in binary form must reproduce the above copyright
10eac58b9emaste *    notice, this list of conditions and the following disclaimer in the
11eac58b9emaste *    documentation and/or other materials provided with the distribution.
12eac58b9emaste * 3. The name of the author may not be used to endorse or promote products
13eac58b9emaste *    derived from this software without specific prior written permission.
14eac58b9emaste *
15eac58b9emaste * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
16eac58b9emaste * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
17eac58b9emaste * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
18eac58b9emaste * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
19eac58b9emaste * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
20eac58b9emaste * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
21eac58b9emaste * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
22eac58b9emaste * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23eac58b9emaste * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
24eac58b9emaste * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25eac58b9emaste */
26eac58b9emaste
27eac58b9emaste/* Internal use only: Fake IPv6 structures and values on platforms that
28eac58b9emaste * do not have them */
29eac58b9emaste
30eac58b9emaste#ifndef IPV6_INTERNAL_H_INCLUDED_
31eac58b9emaste#define IPV6_INTERNAL_H_INCLUDED_
32eac58b9emaste
33eac58b9emaste#include "event2/event-config.h"
34eac58b9emaste#include "evconfig-private.h"
35eac58b9emaste
36eac58b9emaste#include <sys/types.h>
37eac58b9emaste#ifdef EVENT__HAVE_SYS_SOCKET_H
38eac58b9emaste#include <sys/socket.h>
39eac58b9emaste#endif
40eac58b9emaste#include "event2/util.h"
41eac58b9emaste
42eac58b9emaste#ifdef __cplusplus
43eac58b9emasteextern "C" {
44eac58b9emaste#endif
45eac58b9emaste
46eac58b9emaste/** @file ipv6-internal.h
47eac58b9emaste *
48eac58b9emaste * Replacement types and functions for platforms that don't support ipv6
49eac58b9emaste * properly.
50eac58b9emaste */
51eac58b9emaste
52eac58b9emaste#ifndef EVENT__HAVE_STRUCT_IN6_ADDR
53eac58b9emastestruct in6_addr {
54eac58b9emaste	ev_uint8_t s6_addr[16];
55eac58b9emaste};
56eac58b9emaste#endif
57eac58b9emaste
58eac58b9emaste#ifndef EVENT__HAVE_SA_FAMILY_T
59eac58b9emastetypedef int sa_family_t;
60eac58b9emaste#endif
61eac58b9emaste
62eac58b9emaste#ifndef EVENT__HAVE_STRUCT_SOCKADDR_IN6
63eac58b9emastestruct sockaddr_in6 {
64eac58b9emaste	/* This will fail if we find a struct sockaddr that doesn't have
65eac58b9emaste	 * sa_family as the first element. */
66eac58b9emaste	sa_family_t sin6_family;
67eac58b9emaste	ev_uint16_t sin6_port;
68eac58b9emaste	struct in6_addr sin6_addr;
69eac58b9emaste};
70eac58b9emaste#endif
71eac58b9emaste
72eac58b9emaste#ifndef AF_INET6
73eac58b9emaste#define AF_INET6 3333
74eac58b9emaste#endif
75eac58b9emaste#ifndef PF_INET6
76eac58b9emaste#define PF_INET6 AF_INET6
77eac58b9emaste#endif
78eac58b9emaste
79eac58b9emaste#ifdef __cplusplus
80eac58b9emaste}
81eac58b9emaste#endif
82eac58b9emaste
83eac58b9emaste#endif
84