Blame libevent/ipv6-internal.h

Packit e9ba0d
/*
Packit e9ba0d
 * Copyright (c) 2009-2012 Niels Provos and Nick Mathewson
Packit e9ba0d
 *
Packit e9ba0d
 * Redistribution and use in source and binary forms, with or without
Packit e9ba0d
 * modification, are permitted provided that the following conditions
Packit e9ba0d
 * are met:
Packit e9ba0d
 * 1. Redistributions of source code must retain the above copyright
Packit e9ba0d
 *    notice, this list of conditions and the following disclaimer.
Packit e9ba0d
 * 2. Redistributions in binary form must reproduce the above copyright
Packit e9ba0d
 *    notice, this list of conditions and the following disclaimer in the
Packit e9ba0d
 *    documentation and/or other materials provided with the distribution.
Packit e9ba0d
 * 3. The name of the author may not be used to endorse or promote products
Packit e9ba0d
 *    derived from this software without specific prior written permission.
Packit e9ba0d
 *
Packit e9ba0d
 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
Packit e9ba0d
 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
Packit e9ba0d
 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
Packit e9ba0d
 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
Packit e9ba0d
 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
Packit e9ba0d
 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
Packit e9ba0d
 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
Packit e9ba0d
 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
Packit e9ba0d
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
Packit e9ba0d
 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Packit e9ba0d
 */
Packit e9ba0d
Packit e9ba0d
/* Internal use only: Fake IPv6 structures and values on platforms that
Packit e9ba0d
 * do not have them */
Packit e9ba0d
Packit e9ba0d
#ifndef _EVENT_IPV6_INTERNAL_H
Packit e9ba0d
#define _EVENT_IPV6_INTERNAL_H
Packit e9ba0d
Packit e9ba0d
#include <sys/types.h>
Packit e9ba0d
#ifdef _EVENT_HAVE_SYS_SOCKET_H
Packit e9ba0d
#include <sys/socket.h>
Packit e9ba0d
#endif
Packit e9ba0d
#include "event2/event-config.h"
Packit e9ba0d
#include "event2/util.h"
Packit e9ba0d
Packit e9ba0d
#ifdef __cplusplus
Packit e9ba0d
extern "C" {
Packit e9ba0d
#endif
Packit e9ba0d
Packit e9ba0d
/** @file ipv6-internal.h
Packit e9ba0d
 *
Packit e9ba0d
 * Replacement types and functions for platforms that don't support ipv6
Packit e9ba0d
 * properly.
Packit e9ba0d
 */
Packit e9ba0d
Packit e9ba0d
#ifndef _EVENT_HAVE_STRUCT_IN6_ADDR
Packit e9ba0d
struct in6_addr {
Packit e9ba0d
	ev_uint8_t s6_addr[16];
Packit e9ba0d
};
Packit e9ba0d
#endif
Packit e9ba0d
Packit e9ba0d
#ifndef _EVENT_HAVE_SA_FAMILY_T
Packit e9ba0d
typedef int sa_family_t;
Packit e9ba0d
#endif
Packit e9ba0d
Packit e9ba0d
#ifndef _EVENT_HAVE_STRUCT_SOCKADDR_IN6
Packit e9ba0d
struct sockaddr_in6 {
Packit e9ba0d
	/* This will fail if we find a struct sockaddr that doesn't have
Packit e9ba0d
	 * sa_family as the first element. */
Packit e9ba0d
	sa_family_t sin6_family;
Packit e9ba0d
	ev_uint16_t sin6_port;
Packit e9ba0d
	struct in6_addr sin6_addr;
Packit e9ba0d
};
Packit e9ba0d
#endif
Packit e9ba0d
Packit e9ba0d
#ifndef AF_INET6
Packit e9ba0d
#define AF_INET6 3333
Packit e9ba0d
#endif
Packit e9ba0d
#ifndef PF_INET6
Packit e9ba0d
#define PF_INET6 AF_INET6
Packit e9ba0d
#endif
Packit e9ba0d
Packit e9ba0d
#ifdef __cplusplus
Packit e9ba0d
}
Packit e9ba0d
#endif
Packit e9ba0d
Packit e9ba0d
#endif