1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/ipc/chromium/src/third_party/libevent/ipv6-internal.h Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,81 @@ 1.4 +/* 1.5 + * Copyright (c) 2009-2012 Niels Provos and Nick Mathewson 1.6 + * 1.7 + * Redistribution and use in source and binary forms, with or without 1.8 + * modification, are permitted provided that the following conditions 1.9 + * are met: 1.10 + * 1. Redistributions of source code must retain the above copyright 1.11 + * notice, this list of conditions and the following disclaimer. 1.12 + * 2. Redistributions in binary form must reproduce the above copyright 1.13 + * notice, this list of conditions and the following disclaimer in the 1.14 + * documentation and/or other materials provided with the distribution. 1.15 + * 3. The name of the author may not be used to endorse or promote products 1.16 + * derived from this software without specific prior written permission. 1.17 + * 1.18 + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 1.19 + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 1.20 + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 1.21 + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 1.22 + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 1.23 + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 1.24 + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 1.25 + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 1.26 + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 1.27 + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 1.28 + */ 1.29 + 1.30 +/* Internal use only: Fake IPv6 structures and values on platforms that 1.31 + * do not have them */ 1.32 + 1.33 +#ifndef _EVENT_IPV6_INTERNAL_H 1.34 +#define _EVENT_IPV6_INTERNAL_H 1.35 + 1.36 +#include <sys/types.h> 1.37 +#ifdef _EVENT_HAVE_SYS_SOCKET_H 1.38 +#include <sys/socket.h> 1.39 +#endif 1.40 +#include "event2/event-config.h" 1.41 +#include "event2/util.h" 1.42 + 1.43 +#ifdef __cplusplus 1.44 +extern "C" { 1.45 +#endif 1.46 + 1.47 +/** @file ipv6-internal.h 1.48 + * 1.49 + * Replacement types and functions for platforms that don't support ipv6 1.50 + * properly. 1.51 + */ 1.52 + 1.53 +#ifndef _EVENT_HAVE_STRUCT_IN6_ADDR 1.54 +struct in6_addr { 1.55 + ev_uint8_t s6_addr[16]; 1.56 +}; 1.57 +#endif 1.58 + 1.59 +#ifndef _EVENT_HAVE_SA_FAMILY_T 1.60 +typedef int sa_family_t; 1.61 +#endif 1.62 + 1.63 +#ifndef _EVENT_HAVE_STRUCT_SOCKADDR_IN6 1.64 +struct sockaddr_in6 { 1.65 + /* This will fail if we find a struct sockaddr that doesn't have 1.66 + * sa_family as the first element. */ 1.67 + sa_family_t sin6_family; 1.68 + ev_uint16_t sin6_port; 1.69 + struct in6_addr sin6_addr; 1.70 +}; 1.71 +#endif 1.72 + 1.73 +#ifndef AF_INET6 1.74 +#define AF_INET6 3333 1.75 +#endif 1.76 +#ifndef PF_INET6 1.77 +#define PF_INET6 AF_INET6 1.78 +#endif 1.79 + 1.80 +#ifdef __cplusplus 1.81 +} 1.82 +#endif 1.83 + 1.84 +#endif