Path: blob/main/japanese/FreeWnn-server/files/patch-Wnn-include-fake-rfc2553.h
16461 views
Index: Wnn/include/fake-rfc2553.h1===================================================================2RCS file: Wnn/include/fake-rfc2553.h3diff -N Wnn/include/fake-rfc2553.h4--- /dev/null 1 Jan 1970 00:00:00 -00005+++ Wnn/include/fake-rfc2553.h 2 Jan 2009 21:09:34 -0000 1.16@@ -0,0 +1,173 @@7+/* $Id: fake-rfc2553.h,v 1.13 2006/07/24 03:51:52 djm Exp $ */8+/* $FreeBSD: /tmp/pcvs/ports/japanese/FreeWnn-server/files/patch-Wnn-include-fake-rfc2553.h,v 1.2 2010-01-02 14:47:19 hrs Exp $ */9+10+/*11+ * Copyright (C) 2000-2003 Damien Miller. All rights reserved.12+ * Copyright (C) 1999 WIDE Project. All rights reserved.13+ *14+ * Redistribution and use in source and binary forms, with or without15+ * modification, are permitted provided that the following conditions16+ * are met:17+ * 1. Redistributions of source code must retain the above copyright18+ * notice, this list of conditions and the following disclaimer.19+ * 2. Redistributions in binary form must reproduce the above copyright20+ * notice, this list of conditions and the following disclaimer in the21+ * documentation and/or other materials provided with the distribution.22+ * 3. Neither the name of the project nor the names of its contributors23+ * may be used to endorse or promote products derived from this software24+ * without specific prior written permission.25+ *26+ * THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND27+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE28+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE29+ * ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE30+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL31+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS32+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)33+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT34+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY35+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF36+ * SUCH DAMAGE.37+ */38+39+/*40+ * Pseudo-implementation of RFC2553 name / address resolution functions41+ *42+ * But these functions are not implemented correctly. The minimum subset43+ * is implemented for ssh use only. For example, this routine assumes44+ * that ai_family is AF_INET. Don't use it for another purpose.45+ */46+47+#ifndef _FAKE_RFC2553_H48+#define _FAKE_RFC2553_H49+50+#include "config.h"51+52+#include <sys/types.h>53+#if defined(HAVE_NETDB_H)54+# include <netdb.h>55+#endif56+57+/*58+ * First, socket and INET6 related definitions59+ */60+#ifndef HAVE_STRUCT_SOCKADDR_STORAGE61+# define _SS_MAXSIZE 128 /* Implementation specific max size */62+# define _SS_PADSIZE (_SS_MAXSIZE - sizeof (struct sockaddr))63+struct sockaddr_storage {64+ struct sockaddr ss_sa;65+ char __ss_pad2[_SS_PADSIZE];66+};67+# define ss_family ss_sa.sa_family68+#endif /* !HAVE_STRUCT_SOCKADDR_STORAGE */69+70+#ifndef IN6_IS_ADDR_LOOPBACK71+# define IN6_IS_ADDR_LOOPBACK(a) \72+ (((u_int32_t *)(a))[0] == 0 && ((u_int32_t *)(a))[1] == 0 && \73+ ((u_int32_t *)(a))[2] == 0 && ((u_int32_t *)(a))[3] == htonl(1))74+#endif /* !IN6_IS_ADDR_LOOPBACK */75+76+#ifndef HAVE_STRUCT_IN6_ADDR77+struct in6_addr {78+ u_int8_t s6_addr[16];79+};80+#endif /* !HAVE_STRUCT_IN6_ADDR */81+82+#ifndef HAVE_STRUCT_SOCKADDR_IN683+struct sockaddr_in6 {84+ unsigned short sin6_family;85+ u_int16_t sin6_port;86+ u_int32_t sin6_flowinfo;87+ struct in6_addr sin6_addr;88+};89+#endif /* !HAVE_STRUCT_SOCKADDR_IN6 */90+91+#ifndef AF_INET692+/* Define it to something that should never appear */93+#define AF_INET6 AF_MAX94+#endif95+96+/*97+ * Next, RFC2553 name / address resolution API98+ */99+100+#ifndef NI_NUMERICHOST101+# define NI_NUMERICHOST (1)102+#endif103+#ifndef NI_NAMEREQD104+# define NI_NAMEREQD (1<<1)105+#endif106+#ifndef NI_NUMERICSERV107+# define NI_NUMERICSERV (1<<2)108+#endif109+110+#ifndef AI_PASSIVE111+# define AI_PASSIVE (1)112+#endif113+#ifndef AI_CANONNAME114+# define AI_CANONNAME (1<<1)115+#endif116+#ifndef AI_NUMERICHOST117+# define AI_NUMERICHOST (1<<2)118+#endif119+120+#ifndef NI_MAXSERV121+# define NI_MAXSERV 32122+#endif /* !NI_MAXSERV */123+#ifndef NI_MAXHOST124+# define NI_MAXHOST 1025125+#endif /* !NI_MAXHOST */126+127+#ifndef EAI_NODATA128+# define EAI_NODATA (INT_MAX - 1)129+#endif130+#ifndef EAI_MEMORY131+# define EAI_MEMORY (INT_MAX - 2)132+#endif133+#ifndef EAI_NONAME134+# define EAI_NONAME (INT_MAX - 3)135+#endif136+#ifndef EAI_SYSTEM137+# define EAI_SYSTEM (INT_MAX - 4)138+#endif139+140+#ifndef HAVE_STRUCT_ADDRINFO141+struct addrinfo {142+ int ai_flags; /* AI_PASSIVE, AI_CANONNAME */143+ int ai_family; /* PF_xxx */144+ int ai_socktype; /* SOCK_xxx */145+ int ai_protocol; /* 0 or IPPROTO_xxx for IPv4 and IPv6 */146+ size_t ai_addrlen; /* length of ai_addr */147+ char *ai_canonname; /* canonical name for hostname */148+ struct sockaddr *ai_addr; /* binary address */149+ struct addrinfo *ai_next; /* next structure in linked list */150+};151+#endif /* !HAVE_STRUCT_ADDRINFO */152+153+#ifndef HAVE_GETADDRINFO154+#ifdef getaddrinfo155+# undef getaddrinfo156+#endif157+#define getaddrinfo(a,b,c,d) (ssh_getaddrinfo(a,b,c,d))158+int getaddrinfo(const char *, const char *,159+ const struct addrinfo *, struct addrinfo **);160+#endif /* !HAVE_GETADDRINFO */161+162+#if !defined(HAVE_GAI_STRERROR) && !defined(HAVE_CONST_GAI_STRERROR_PROTO)163+#define gai_strerror(a) (ssh_gai_strerror(a))164+char *gai_strerror(int);165+#endif /* !HAVE_GAI_STRERROR */166+167+#ifndef HAVE_FREEADDRINFO168+#define freeaddrinfo(a) (ssh_freeaddrinfo(a))169+void freeaddrinfo(struct addrinfo *);170+#endif /* !HAVE_FREEADDRINFO */171+172+#ifndef HAVE_GETNAMEINFO173+#define getnameinfo(a,b,c,d,e,f,g) (ssh_getnameinfo(a,b,c,d,e,f,g))174+int getnameinfo(const struct sockaddr *, size_t, char *, size_t,175+ char *, size_t, int);176+#endif /* !HAVE_GETNAMEINFO */177+178+#endif /* !_FAKE_RFC2553_H */179+180181182