Path: blob/main/japanese/FreeWnn-lib/files/patch-Wnn-include-fake-rfc2553.h
18157 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,172 @@7+/* $Id: fake-rfc2553.h,v 1.13 2006/07/24 03:51:52 djm Exp $ */8+9+/*10+ * Copyright (C) 2000-2003 Damien Miller. All rights reserved.11+ * Copyright (C) 1999 WIDE Project. All rights reserved.12+ *13+ * Redistribution and use in source and binary forms, with or without14+ * modification, are permitted provided that the following conditions15+ * are met:16+ * 1. Redistributions of source code must retain the above copyright17+ * notice, this list of conditions and the following disclaimer.18+ * 2. Redistributions in binary form must reproduce the above copyright19+ * notice, this list of conditions and the following disclaimer in the20+ * documentation and/or other materials provided with the distribution.21+ * 3. Neither the name of the project nor the names of its contributors22+ * may be used to endorse or promote products derived from this software23+ * without specific prior written permission.24+ *25+ * THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND26+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE27+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE28+ * ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE29+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL30+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS31+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)32+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT33+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY34+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF35+ * SUCH DAMAGE.36+ */37+38+/*39+ * Pseudo-implementation of RFC2553 name / address resolution functions40+ *41+ * But these functions are not implemented correctly. The minimum subset42+ * is implemented for ssh use only. For example, this routine assumes43+ * that ai_family is AF_INET. Don't use it for another purpose.44+ */45+46+#ifndef _FAKE_RFC2553_H47+#define _FAKE_RFC2553_H48+49+#include "config.h"50+51+#include <sys/types.h>52+#if defined(HAVE_NETDB_H)53+# include <netdb.h>54+#endif55+56+/*57+ * First, socket and INET6 related definitions58+ */59+#ifndef HAVE_STRUCT_SOCKADDR_STORAGE60+# define _SS_MAXSIZE 128 /* Implementation specific max size */61+# define _SS_PADSIZE (_SS_MAXSIZE - sizeof (struct sockaddr))62+struct sockaddr_storage {63+ struct sockaddr ss_sa;64+ char __ss_pad2[_SS_PADSIZE];65+};66+# define ss_family ss_sa.sa_family67+#endif /* !HAVE_STRUCT_SOCKADDR_STORAGE */68+69+#ifndef IN6_IS_ADDR_LOOPBACK70+# define IN6_IS_ADDR_LOOPBACK(a) \71+ (((u_int32_t *)(a))[0] == 0 && ((u_int32_t *)(a))[1] == 0 && \72+ ((u_int32_t *)(a))[2] == 0 && ((u_int32_t *)(a))[3] == htonl(1))73+#endif /* !IN6_IS_ADDR_LOOPBACK */74+75+#ifndef HAVE_STRUCT_IN6_ADDR76+struct in6_addr {77+ u_int8_t s6_addr[16];78+};79+#endif /* !HAVE_STRUCT_IN6_ADDR */80+81+#ifndef HAVE_STRUCT_SOCKADDR_IN682+struct sockaddr_in6 {83+ unsigned short sin6_family;84+ u_int16_t sin6_port;85+ u_int32_t sin6_flowinfo;86+ struct in6_addr sin6_addr;87+};88+#endif /* !HAVE_STRUCT_SOCKADDR_IN6 */89+90+#ifndef AF_INET691+/* Define it to something that should never appear */92+#define AF_INET6 AF_MAX93+#endif94+95+/*96+ * Next, RFC2553 name / address resolution API97+ */98+99+#ifndef NI_NUMERICHOST100+# define NI_NUMERICHOST (1)101+#endif102+#ifndef NI_NAMEREQD103+# define NI_NAMEREQD (1<<1)104+#endif105+#ifndef NI_NUMERICSERV106+# define NI_NUMERICSERV (1<<2)107+#endif108+109+#ifndef AI_PASSIVE110+# define AI_PASSIVE (1)111+#endif112+#ifndef AI_CANONNAME113+# define AI_CANONNAME (1<<1)114+#endif115+#ifndef AI_NUMERICHOST116+# define AI_NUMERICHOST (1<<2)117+#endif118+119+#ifndef NI_MAXSERV120+# define NI_MAXSERV 32121+#endif /* !NI_MAXSERV */122+#ifndef NI_MAXHOST123+# define NI_MAXHOST 1025124+#endif /* !NI_MAXHOST */125+126+#ifndef EAI_NODATA127+# define EAI_NODATA (INT_MAX - 1)128+#endif129+#ifndef EAI_MEMORY130+# define EAI_MEMORY (INT_MAX - 2)131+#endif132+#ifndef EAI_NONAME133+# define EAI_NONAME (INT_MAX - 3)134+#endif135+#ifndef EAI_SYSTEM136+# define EAI_SYSTEM (INT_MAX - 4)137+#endif138+139+#ifndef HAVE_STRUCT_ADDRINFO140+struct addrinfo {141+ int ai_flags; /* AI_PASSIVE, AI_CANONNAME */142+ int ai_family; /* PF_xxx */143+ int ai_socktype; /* SOCK_xxx */144+ int ai_protocol; /* 0 or IPPROTO_xxx for IPv4 and IPv6 */145+ size_t ai_addrlen; /* length of ai_addr */146+ char *ai_canonname; /* canonical name for hostname */147+ struct sockaddr *ai_addr; /* binary address */148+ struct addrinfo *ai_next; /* next structure in linked list */149+};150+#endif /* !HAVE_STRUCT_ADDRINFO */151+152+#ifndef HAVE_GETADDRINFO153+#ifdef getaddrinfo154+# undef getaddrinfo155+#endif156+#define getaddrinfo(a,b,c,d) (ssh_getaddrinfo(a,b,c,d))157+int getaddrinfo(const char *, const char *,158+ const struct addrinfo *, struct addrinfo **);159+#endif /* !HAVE_GETADDRINFO */160+161+#if !defined(HAVE_GAI_STRERROR) && !defined(HAVE_CONST_GAI_STRERROR_PROTO)162+#define gai_strerror(a) (ssh_gai_strerror(a))163+char *gai_strerror(int);164+#endif /* !HAVE_GAI_STRERROR */165+166+#ifndef HAVE_FREEADDRINFO167+#define freeaddrinfo(a) (ssh_freeaddrinfo(a))168+void freeaddrinfo(struct addrinfo *);169+#endif /* !HAVE_FREEADDRINFO */170+171+#ifndef HAVE_GETNAMEINFO172+#define getnameinfo(a,b,c,d,e,f,g) (ssh_getnameinfo(a,b,c,d,e,f,g))173+int getnameinfo(const struct sockaddr *, size_t, char *, size_t,174+ char *, size_t, int);175+#endif /* !HAVE_GETNAMEINFO */176+177+#endif /* !_FAKE_RFC2553_H */178+179180181