GSS_S_PROMPTING_NEEDED is a bit
[cyrus-sasl.git] / include / gai.h
1 /*
2  * Mar  8, 2000 by Hajimu UMEMOTO <ume@mahoroba.org>
3  * $Id: gai.h,v 1.8 2006/04/10 13:36:20 mel Exp $
4  *
5  * This module is besed on ssh-1.2.27-IPv6-1.5 written by
6  * KIKUCHI Takahiro <kick@kyoto.wide.ad.jp>
7  */
8 /* 
9  * Copyright (c) 1998-2003 Carnegie Mellon University.  All rights reserved.
10  *
11  * Redistribution and use in source and binary forms, with or without
12  * modification, are permitted provided that the following conditions
13  * are met:
14  *
15  * 1. Redistributions of source code must retain the above copyright
16  *    notice, this list of conditions and the following disclaimer. 
17  *
18  * 2. Redistributions in binary form must reproduce the above copyright
19  *    notice, this list of conditions and the following disclaimer in
20  *    the documentation and/or other materials provided with the
21  *    distribution.
22  *
23  * 3. The name "Carnegie Mellon University" must not be used to
24  *    endorse or promote products derived from this software without
25  *    prior written permission. For permission or any other legal
26  *    details, please contact  
27  *      Office of Technology Transfer
28  *      Carnegie Mellon University
29  *      5000 Forbes Avenue
30  *      Pittsburgh, PA  15213-3890
31  *      (412) 268-4387, fax: (412) 268-7395
32  *      tech-transfer@andrew.cmu.edu
33  *
34  * 4. Redistributions of any form whatsoever must retain the following
35  *    acknowledgment:
36  *    "This product includes software developed by Computing Services
37  *     at Carnegie Mellon University (http://www.cmu.edu/computing/)."
38  *
39  * CARNEGIE MELLON UNIVERSITY DISCLAIMS ALL WARRANTIES WITH REGARD TO
40  * THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
41  * AND FITNESS, IN NO EVENT SHALL CARNEGIE MELLON UNIVERSITY BE LIABLE
42  * FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
43  * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN
44  * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
45  * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
46  */
47 /*
48  * fake library for ssh
49  *
50  * This file is included in getaddrinfo.c and getnameinfo.c.
51  * See getaddrinfo.c and getnameinfo.c.
52  */
53
54 #ifndef _GAI_H_
55 #define _GAI_H_
56
57 #ifndef NI_MAXHOST
58 #define NI_MAXHOST      1025
59 #endif
60 #ifndef NI_MAXSERV
61 #define NI_MAXSERV      32
62 #endif
63
64 /* for old netdb.h */
65 #ifndef EAI_NODATA
66 #define EAI_NODATA      1
67 #define EAI_MEMORY      2
68 #define EAI_FAMILY      5       /* ai_family not supported */
69 #define EAI_SERVICE     9       /* servname not supported for ai_socktype */
70 #endif
71
72 /* dummy value for old netdb.h */
73 #ifndef AI_PASSIVE
74 #define AI_PASSIVE      1
75 #define AI_CANONNAME    2
76 struct addrinfo {
77         int     ai_flags;       /* AI_PASSIVE, AI_CANONNAME */
78         int     ai_family;      /* PF_xxx */
79         int     ai_socktype;    /* SOCK_xxx */
80         int     ai_protocol;    /* 0 or IPPROTO_xxx for IPv4 and IPv6 */
81         size_t  ai_addrlen;     /* length of ai_addr */
82         char    *ai_canonname;  /* canonical name for hostname */
83         struct sockaddr *ai_addr;       /* binary address */
84         struct addrinfo *ai_next;       /* next structure in linked list */
85 };
86 #endif
87
88 #ifdef __cplusplus
89 extern "C" {
90 #endif
91
92 #ifndef HAVE_GETNAMEINFO
93 int     getnameinfo(const struct sockaddr *, socklen_t, char *,
94                     size_t, char *, size_t, int);
95 #endif
96
97 #ifndef HAVE_GETADDRINFO
98 int     getaddrinfo(const char *, const char *,
99                     const struct addrinfo *, struct addrinfo **);
100 void    freeaddrinfo(struct addrinfo *);
101 char    *gai_strerror(int);
102 #endif
103
104 #ifdef __cplusplus
105 }
106 #endif
107
108 #endif