Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
freebsd
GitHub Repository: freebsd/freebsd-ports
Path: blob/main/japanese/FreeWnn-lib/files/patch-Wnn-include-fake-rfc2553.h
18157 views
1
Index: Wnn/include/fake-rfc2553.h
2
===================================================================
3
RCS file: Wnn/include/fake-rfc2553.h
4
diff -N Wnn/include/fake-rfc2553.h
5
--- /dev/null 1 Jan 1970 00:00:00 -0000
6
+++ Wnn/include/fake-rfc2553.h 2 Jan 2009 21:09:34 -0000 1.1
7
@@ -0,0 +1,172 @@
8
+/* $Id: fake-rfc2553.h,v 1.13 2006/07/24 03:51:52 djm 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 without
15
+ * modification, are permitted provided that the following conditions
16
+ * are met:
17
+ * 1. Redistributions of source code must retain the above copyright
18
+ * notice, this list of conditions and the following disclaimer.
19
+ * 2. Redistributions in binary form must reproduce the above copyright
20
+ * notice, this list of conditions and the following disclaimer in the
21
+ * documentation and/or other materials provided with the distribution.
22
+ * 3. Neither the name of the project nor the names of its contributors
23
+ * may be used to endorse or promote products derived from this software
24
+ * without specific prior written permission.
25
+ *
26
+ * THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
27
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
28
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
29
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
30
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
31
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
32
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
33
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
34
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
35
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
36
+ * SUCH DAMAGE.
37
+ */
38
+
39
+/*
40
+ * Pseudo-implementation of RFC2553 name / address resolution functions
41
+ *
42
+ * But these functions are not implemented correctly. The minimum subset
43
+ * is implemented for ssh use only. For example, this routine assumes
44
+ * that ai_family is AF_INET. Don't use it for another purpose.
45
+ */
46
+
47
+#ifndef _FAKE_RFC2553_H
48
+#define _FAKE_RFC2553_H
49
+
50
+#include "config.h"
51
+
52
+#include <sys/types.h>
53
+#if defined(HAVE_NETDB_H)
54
+# include <netdb.h>
55
+#endif
56
+
57
+/*
58
+ * First, socket and INET6 related definitions
59
+ */
60
+#ifndef HAVE_STRUCT_SOCKADDR_STORAGE
61
+# 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_family
68
+#endif /* !HAVE_STRUCT_SOCKADDR_STORAGE */
69
+
70
+#ifndef IN6_IS_ADDR_LOOPBACK
71
+# 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_ADDR
77
+struct in6_addr {
78
+ u_int8_t s6_addr[16];
79
+};
80
+#endif /* !HAVE_STRUCT_IN6_ADDR */
81
+
82
+#ifndef HAVE_STRUCT_SOCKADDR_IN6
83
+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_INET6
92
+/* Define it to something that should never appear */
93
+#define AF_INET6 AF_MAX
94
+#endif
95
+
96
+/*
97
+ * Next, RFC2553 name / address resolution API
98
+ */
99
+
100
+#ifndef NI_NUMERICHOST
101
+# define NI_NUMERICHOST (1)
102
+#endif
103
+#ifndef NI_NAMEREQD
104
+# define NI_NAMEREQD (1<<1)
105
+#endif
106
+#ifndef NI_NUMERICSERV
107
+# define NI_NUMERICSERV (1<<2)
108
+#endif
109
+
110
+#ifndef AI_PASSIVE
111
+# define AI_PASSIVE (1)
112
+#endif
113
+#ifndef AI_CANONNAME
114
+# define AI_CANONNAME (1<<1)
115
+#endif
116
+#ifndef AI_NUMERICHOST
117
+# define AI_NUMERICHOST (1<<2)
118
+#endif
119
+
120
+#ifndef NI_MAXSERV
121
+# define NI_MAXSERV 32
122
+#endif /* !NI_MAXSERV */
123
+#ifndef NI_MAXHOST
124
+# define NI_MAXHOST 1025
125
+#endif /* !NI_MAXHOST */
126
+
127
+#ifndef EAI_NODATA
128
+# define EAI_NODATA (INT_MAX - 1)
129
+#endif
130
+#ifndef EAI_MEMORY
131
+# define EAI_MEMORY (INT_MAX - 2)
132
+#endif
133
+#ifndef EAI_NONAME
134
+# define EAI_NONAME (INT_MAX - 3)
135
+#endif
136
+#ifndef EAI_SYSTEM
137
+# define EAI_SYSTEM (INT_MAX - 4)
138
+#endif
139
+
140
+#ifndef HAVE_STRUCT_ADDRINFO
141
+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_GETADDRINFO
154
+#ifdef getaddrinfo
155
+# undef getaddrinfo
156
+#endif
157
+#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_FREEADDRINFO
168
+#define freeaddrinfo(a) (ssh_freeaddrinfo(a))
169
+void freeaddrinfo(struct addrinfo *);
170
+#endif /* !HAVE_FREEADDRINFO */
171
+
172
+#ifndef HAVE_GETNAMEINFO
173
+#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
+
180
181