annotate fake-rfc2553.h @ 1156:a8f4dade70e5

avoid getpass when not used some systems (like android's bionic) do not provide getpass. you can disable ENABLE_CLI_PASSWORD_AUTH & ENABLE_CLI_INTERACT_AUTH to avoid its use (and rely on pubkey auth), but the link still fails because the support file calls getpass. do not define this func if both of those auth methods are not used.
author Mike Frysinger <vapier@gentoo.org>
date Wed, 21 Oct 2015 22:39:55 +0800
parents deed0571cacc
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
589
9fd27bc37807 - Update fake-rfc2553.{c,h} from OpenSSH 5.5p1
Matt Johnston <matt@ucc.asn.au>
parents: 67
diff changeset
1 /* Taken for Dropbear from OpenSSH 5.5p1 */
67
86725004a0ea fake-rfc stuff
Matt Johnston <matt@ucc.asn.au>
parents: 64
diff changeset
2
589
9fd27bc37807 - Update fake-rfc2553.{c,h} from OpenSSH 5.5p1
Matt Johnston <matt@ucc.asn.au>
parents: 67
diff changeset
3 /* $Id: fake-rfc2553.h,v 1.16 2008/07/14 11:37:37 djm Exp $ */
64
efb5e0b335cf TCP forwarding works.
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
4
efb5e0b335cf TCP forwarding works.
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
5 /*
efb5e0b335cf TCP forwarding works.
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
6 * Copyright (C) 2000-2003 Damien Miller. All rights reserved.
efb5e0b335cf TCP forwarding works.
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
7 * Copyright (C) 1999 WIDE Project. All rights reserved.
efb5e0b335cf TCP forwarding works.
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
8 *
efb5e0b335cf TCP forwarding works.
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
9 * Redistribution and use in source and binary forms, with or without
efb5e0b335cf TCP forwarding works.
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
10 * modification, are permitted provided that the following conditions
efb5e0b335cf TCP forwarding works.
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
11 * are met:
efb5e0b335cf TCP forwarding works.
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
12 * 1. Redistributions of source code must retain the above copyright
efb5e0b335cf TCP forwarding works.
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
13 * notice, this list of conditions and the following disclaimer.
efb5e0b335cf TCP forwarding works.
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
14 * 2. Redistributions in binary form must reproduce the above copyright
efb5e0b335cf TCP forwarding works.
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
15 * notice, this list of conditions and the following disclaimer in the
efb5e0b335cf TCP forwarding works.
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
16 * documentation and/or other materials provided with the distribution.
efb5e0b335cf TCP forwarding works.
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
17 * 3. Neither the name of the project nor the names of its contributors
efb5e0b335cf TCP forwarding works.
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
18 * may be used to endorse or promote products derived from this software
efb5e0b335cf TCP forwarding works.
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
19 * without specific prior written permission.
efb5e0b335cf TCP forwarding works.
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
20 *
efb5e0b335cf TCP forwarding works.
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
21 * THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
efb5e0b335cf TCP forwarding works.
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
22 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
efb5e0b335cf TCP forwarding works.
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
23 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
efb5e0b335cf TCP forwarding works.
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
24 * ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
efb5e0b335cf TCP forwarding works.
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
25 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
efb5e0b335cf TCP forwarding works.
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
26 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
efb5e0b335cf TCP forwarding works.
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
27 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
efb5e0b335cf TCP forwarding works.
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
28 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
efb5e0b335cf TCP forwarding works.
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
29 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
efb5e0b335cf TCP forwarding works.
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
30 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
efb5e0b335cf TCP forwarding works.
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
31 * SUCH DAMAGE.
efb5e0b335cf TCP forwarding works.
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
32 */
efb5e0b335cf TCP forwarding works.
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
33
efb5e0b335cf TCP forwarding works.
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
34 /*
efb5e0b335cf TCP forwarding works.
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
35 * Pseudo-implementation of RFC2553 name / address resolution functions
efb5e0b335cf TCP forwarding works.
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
36 *
efb5e0b335cf TCP forwarding works.
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
37 * But these functions are not implemented correctly. The minimum subset
efb5e0b335cf TCP forwarding works.
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
38 * is implemented for ssh use only. For example, this routine assumes
efb5e0b335cf TCP forwarding works.
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
39 * that ai_family is AF_INET. Don't use it for another purpose.
efb5e0b335cf TCP forwarding works.
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
40 */
efb5e0b335cf TCP forwarding works.
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
41
1036
deed0571cacc DROPBEAR_ prefix for include guards to avoid collisions
Thorsten Horstmann <thorsten.horstmann@web.de>
parents: 589
diff changeset
42 #ifndef DROPBEAR_FAKE_RFC2553_H
deed0571cacc DROPBEAR_ prefix for include guards to avoid collisions
Thorsten Horstmann <thorsten.horstmann@web.de>
parents: 589
diff changeset
43 #define DROPBEAR_FAKE_RFC2553_H
64
efb5e0b335cf TCP forwarding works.
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
44
efb5e0b335cf TCP forwarding works.
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
45 #include "includes.h"
589
9fd27bc37807 - Update fake-rfc2553.{c,h} from OpenSSH 5.5p1
Matt Johnston <matt@ucc.asn.au>
parents: 67
diff changeset
46 #include <sys/types.h>
9fd27bc37807 - Update fake-rfc2553.{c,h} from OpenSSH 5.5p1
Matt Johnston <matt@ucc.asn.au>
parents: 67
diff changeset
47 #if defined(HAVE_NETDB_H)
9fd27bc37807 - Update fake-rfc2553.{c,h} from OpenSSH 5.5p1
Matt Johnston <matt@ucc.asn.au>
parents: 67
diff changeset
48 # include <netdb.h>
9fd27bc37807 - Update fake-rfc2553.{c,h} from OpenSSH 5.5p1
Matt Johnston <matt@ucc.asn.au>
parents: 67
diff changeset
49 #endif
64
efb5e0b335cf TCP forwarding works.
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
50
efb5e0b335cf TCP forwarding works.
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
51 /*
efb5e0b335cf TCP forwarding works.
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
52 * First, socket and INET6 related definitions
efb5e0b335cf TCP forwarding works.
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
53 */
efb5e0b335cf TCP forwarding works.
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
54 #ifndef HAVE_STRUCT_SOCKADDR_STORAGE
efb5e0b335cf TCP forwarding works.
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
55 # define _SS_MAXSIZE 128 /* Implementation specific max size */
efb5e0b335cf TCP forwarding works.
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
56 # define _SS_PADSIZE (_SS_MAXSIZE - sizeof (struct sockaddr))
efb5e0b335cf TCP forwarding works.
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
57 struct sockaddr_storage {
efb5e0b335cf TCP forwarding works.
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
58 struct sockaddr ss_sa;
efb5e0b335cf TCP forwarding works.
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
59 char __ss_pad2[_SS_PADSIZE];
efb5e0b335cf TCP forwarding works.
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
60 };
efb5e0b335cf TCP forwarding works.
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
61 # define ss_family ss_sa.sa_family
efb5e0b335cf TCP forwarding works.
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
62 #endif /* !HAVE_STRUCT_SOCKADDR_STORAGE */
efb5e0b335cf TCP forwarding works.
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
63
efb5e0b335cf TCP forwarding works.
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
64 #ifndef IN6_IS_ADDR_LOOPBACK
efb5e0b335cf TCP forwarding works.
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
65 # define IN6_IS_ADDR_LOOPBACK(a) \
efb5e0b335cf TCP forwarding works.
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
66 (((u_int32_t *)(a))[0] == 0 && ((u_int32_t *)(a))[1] == 0 && \
efb5e0b335cf TCP forwarding works.
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
67 ((u_int32_t *)(a))[2] == 0 && ((u_int32_t *)(a))[3] == htonl(1))
efb5e0b335cf TCP forwarding works.
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
68 #endif /* !IN6_IS_ADDR_LOOPBACK */
efb5e0b335cf TCP forwarding works.
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
69
efb5e0b335cf TCP forwarding works.
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
70 #ifndef HAVE_STRUCT_IN6_ADDR
efb5e0b335cf TCP forwarding works.
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
71 struct in6_addr {
efb5e0b335cf TCP forwarding works.
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
72 u_int8_t s6_addr[16];
efb5e0b335cf TCP forwarding works.
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
73 };
efb5e0b335cf TCP forwarding works.
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
74 #endif /* !HAVE_STRUCT_IN6_ADDR */
efb5e0b335cf TCP forwarding works.
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
75
efb5e0b335cf TCP forwarding works.
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
76 #ifndef HAVE_STRUCT_SOCKADDR_IN6
efb5e0b335cf TCP forwarding works.
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
77 struct sockaddr_in6 {
efb5e0b335cf TCP forwarding works.
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
78 unsigned short sin6_family;
efb5e0b335cf TCP forwarding works.
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
79 u_int16_t sin6_port;
efb5e0b335cf TCP forwarding works.
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
80 u_int32_t sin6_flowinfo;
efb5e0b335cf TCP forwarding works.
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
81 struct in6_addr sin6_addr;
589
9fd27bc37807 - Update fake-rfc2553.{c,h} from OpenSSH 5.5p1
Matt Johnston <matt@ucc.asn.au>
parents: 67
diff changeset
82 u_int32_t sin6_scope_id;
64
efb5e0b335cf TCP forwarding works.
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
83 };
efb5e0b335cf TCP forwarding works.
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
84 #endif /* !HAVE_STRUCT_SOCKADDR_IN6 */
efb5e0b335cf TCP forwarding works.
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
85
efb5e0b335cf TCP forwarding works.
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
86 #ifndef AF_INET6
efb5e0b335cf TCP forwarding works.
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
87 /* Define it to something that should never appear */
efb5e0b335cf TCP forwarding works.
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
88 #define AF_INET6 AF_MAX
efb5e0b335cf TCP forwarding works.
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
89 #endif
efb5e0b335cf TCP forwarding works.
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
90
efb5e0b335cf TCP forwarding works.
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
91 /*
efb5e0b335cf TCP forwarding works.
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
92 * Next, RFC2553 name / address resolution API
efb5e0b335cf TCP forwarding works.
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
93 */
efb5e0b335cf TCP forwarding works.
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
94
efb5e0b335cf TCP forwarding works.
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
95 #ifndef NI_NUMERICHOST
efb5e0b335cf TCP forwarding works.
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
96 # define NI_NUMERICHOST (1)
efb5e0b335cf TCP forwarding works.
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
97 #endif
efb5e0b335cf TCP forwarding works.
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
98 #ifndef NI_NAMEREQD
efb5e0b335cf TCP forwarding works.
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
99 # define NI_NAMEREQD (1<<1)
efb5e0b335cf TCP forwarding works.
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
100 #endif
efb5e0b335cf TCP forwarding works.
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
101 #ifndef NI_NUMERICSERV
efb5e0b335cf TCP forwarding works.
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
102 # define NI_NUMERICSERV (1<<2)
efb5e0b335cf TCP forwarding works.
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
103 #endif
efb5e0b335cf TCP forwarding works.
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
104
efb5e0b335cf TCP forwarding works.
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
105 #ifndef AI_PASSIVE
efb5e0b335cf TCP forwarding works.
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
106 # define AI_PASSIVE (1)
efb5e0b335cf TCP forwarding works.
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
107 #endif
efb5e0b335cf TCP forwarding works.
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
108 #ifndef AI_CANONNAME
efb5e0b335cf TCP forwarding works.
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
109 # define AI_CANONNAME (1<<1)
efb5e0b335cf TCP forwarding works.
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
110 #endif
efb5e0b335cf TCP forwarding works.
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
111 #ifndef AI_NUMERICHOST
efb5e0b335cf TCP forwarding works.
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
112 # define AI_NUMERICHOST (1<<2)
efb5e0b335cf TCP forwarding works.
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
113 #endif
efb5e0b335cf TCP forwarding works.
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
114
efb5e0b335cf TCP forwarding works.
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
115 #ifndef NI_MAXSERV
efb5e0b335cf TCP forwarding works.
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
116 # define NI_MAXSERV 32
efb5e0b335cf TCP forwarding works.
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
117 #endif /* !NI_MAXSERV */
efb5e0b335cf TCP forwarding works.
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
118 #ifndef NI_MAXHOST
efb5e0b335cf TCP forwarding works.
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
119 # define NI_MAXHOST 1025
efb5e0b335cf TCP forwarding works.
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
120 #endif /* !NI_MAXHOST */
efb5e0b335cf TCP forwarding works.
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
121
efb5e0b335cf TCP forwarding works.
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
122 #ifndef EAI_NODATA
589
9fd27bc37807 - Update fake-rfc2553.{c,h} from OpenSSH 5.5p1
Matt Johnston <matt@ucc.asn.au>
parents: 67
diff changeset
123 # define EAI_NODATA (INT_MAX - 1)
9fd27bc37807 - Update fake-rfc2553.{c,h} from OpenSSH 5.5p1
Matt Johnston <matt@ucc.asn.au>
parents: 67
diff changeset
124 #endif
9fd27bc37807 - Update fake-rfc2553.{c,h} from OpenSSH 5.5p1
Matt Johnston <matt@ucc.asn.au>
parents: 67
diff changeset
125 #ifndef EAI_MEMORY
9fd27bc37807 - Update fake-rfc2553.{c,h} from OpenSSH 5.5p1
Matt Johnston <matt@ucc.asn.au>
parents: 67
diff changeset
126 # define EAI_MEMORY (INT_MAX - 2)
9fd27bc37807 - Update fake-rfc2553.{c,h} from OpenSSH 5.5p1
Matt Johnston <matt@ucc.asn.au>
parents: 67
diff changeset
127 #endif
9fd27bc37807 - Update fake-rfc2553.{c,h} from OpenSSH 5.5p1
Matt Johnston <matt@ucc.asn.au>
parents: 67
diff changeset
128 #ifndef EAI_NONAME
9fd27bc37807 - Update fake-rfc2553.{c,h} from OpenSSH 5.5p1
Matt Johnston <matt@ucc.asn.au>
parents: 67
diff changeset
129 # define EAI_NONAME (INT_MAX - 3)
9fd27bc37807 - Update fake-rfc2553.{c,h} from OpenSSH 5.5p1
Matt Johnston <matt@ucc.asn.au>
parents: 67
diff changeset
130 #endif
9fd27bc37807 - Update fake-rfc2553.{c,h} from OpenSSH 5.5p1
Matt Johnston <matt@ucc.asn.au>
parents: 67
diff changeset
131 #ifndef EAI_SYSTEM
9fd27bc37807 - Update fake-rfc2553.{c,h} from OpenSSH 5.5p1
Matt Johnston <matt@ucc.asn.au>
parents: 67
diff changeset
132 # define EAI_SYSTEM (INT_MAX - 4)
9fd27bc37807 - Update fake-rfc2553.{c,h} from OpenSSH 5.5p1
Matt Johnston <matt@ucc.asn.au>
parents: 67
diff changeset
133 #endif
9fd27bc37807 - Update fake-rfc2553.{c,h} from OpenSSH 5.5p1
Matt Johnston <matt@ucc.asn.au>
parents: 67
diff changeset
134 #ifndef EAI_FAMILY
9fd27bc37807 - Update fake-rfc2553.{c,h} from OpenSSH 5.5p1
Matt Johnston <matt@ucc.asn.au>
parents: 67
diff changeset
135 # define EAI_FAMILY (INT_MAX - 5)
64
efb5e0b335cf TCP forwarding works.
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
136 #endif
efb5e0b335cf TCP forwarding works.
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
137
efb5e0b335cf TCP forwarding works.
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
138 #ifndef HAVE_STRUCT_ADDRINFO
efb5e0b335cf TCP forwarding works.
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
139 struct addrinfo {
efb5e0b335cf TCP forwarding works.
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
140 int ai_flags; /* AI_PASSIVE, AI_CANONNAME */
efb5e0b335cf TCP forwarding works.
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
141 int ai_family; /* PF_xxx */
efb5e0b335cf TCP forwarding works.
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
142 int ai_socktype; /* SOCK_xxx */
efb5e0b335cf TCP forwarding works.
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
143 int ai_protocol; /* 0 or IPPROTO_xxx for IPv4 and IPv6 */
efb5e0b335cf TCP forwarding works.
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
144 size_t ai_addrlen; /* length of ai_addr */
efb5e0b335cf TCP forwarding works.
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
145 char *ai_canonname; /* canonical name for hostname */
efb5e0b335cf TCP forwarding works.
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
146 struct sockaddr *ai_addr; /* binary address */
efb5e0b335cf TCP forwarding works.
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
147 struct addrinfo *ai_next; /* next structure in linked list */
efb5e0b335cf TCP forwarding works.
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
148 };
efb5e0b335cf TCP forwarding works.
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
149 #endif /* !HAVE_STRUCT_ADDRINFO */
efb5e0b335cf TCP forwarding works.
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
150
efb5e0b335cf TCP forwarding works.
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
151 #ifndef HAVE_GETADDRINFO
efb5e0b335cf TCP forwarding works.
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
152 #ifdef getaddrinfo
efb5e0b335cf TCP forwarding works.
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
153 # undef getaddrinfo
efb5e0b335cf TCP forwarding works.
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
154 #endif
efb5e0b335cf TCP forwarding works.
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
155 #define getaddrinfo(a,b,c,d) (ssh_getaddrinfo(a,b,c,d))
efb5e0b335cf TCP forwarding works.
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
156 int getaddrinfo(const char *, const char *,
efb5e0b335cf TCP forwarding works.
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
157 const struct addrinfo *, struct addrinfo **);
efb5e0b335cf TCP forwarding works.
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
158 #endif /* !HAVE_GETADDRINFO */
efb5e0b335cf TCP forwarding works.
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
159
efb5e0b335cf TCP forwarding works.
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
160 #if !defined(HAVE_GAI_STRERROR) && !defined(HAVE_CONST_GAI_STRERROR_PROTO)
589
9fd27bc37807 - Update fake-rfc2553.{c,h} from OpenSSH 5.5p1
Matt Johnston <matt@ucc.asn.au>
parents: 67
diff changeset
161 #define gai_strerror(a) (_ssh_compat_gai_strerror(a))
64
efb5e0b335cf TCP forwarding works.
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
162 char *gai_strerror(int);
efb5e0b335cf TCP forwarding works.
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
163 #endif /* !HAVE_GAI_STRERROR */
efb5e0b335cf TCP forwarding works.
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
164
efb5e0b335cf TCP forwarding works.
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
165 #ifndef HAVE_FREEADDRINFO
efb5e0b335cf TCP forwarding works.
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
166 #define freeaddrinfo(a) (ssh_freeaddrinfo(a))
efb5e0b335cf TCP forwarding works.
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
167 void freeaddrinfo(struct addrinfo *);
efb5e0b335cf TCP forwarding works.
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
168 #endif /* !HAVE_FREEADDRINFO */
efb5e0b335cf TCP forwarding works.
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
169
efb5e0b335cf TCP forwarding works.
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
170 #ifndef HAVE_GETNAMEINFO
efb5e0b335cf TCP forwarding works.
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
171 #define getnameinfo(a,b,c,d,e,f,g) (ssh_getnameinfo(a,b,c,d,e,f,g))
efb5e0b335cf TCP forwarding works.
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
172 int getnameinfo(const struct sockaddr *, size_t, char *, size_t,
efb5e0b335cf TCP forwarding works.
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
173 char *, size_t, int);
efb5e0b335cf TCP forwarding works.
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
174 #endif /* !HAVE_GETNAMEINFO */
efb5e0b335cf TCP forwarding works.
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
175
efb5e0b335cf TCP forwarding works.
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
176 #endif /* !_FAKE_RFC2553_H */
efb5e0b335cf TCP forwarding works.
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
177