/*	$OpenBSD: netdb.h,v 1.9 2000/02/09 12:22:08 itojun Exp $	*/

/*
 * ++Copyright++ 1980, 1983, 1988, 1993
 * -
 * Copyright (c) 1980, 1983, 1988, 1993
 *	The Regents of the University of California.  All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 * 1. Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 * 2. Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in the
 *    documentation and/or other materials provided with the distribution.
 * 3. All advertising materials mentioning features or use of this software
 *    must display the following acknowledgement:
 *	This product includes software developed by the University of
 *	California, Berkeley and its contributors.
 * 4. Neither the name of the University nor the names of its contributors
 *    may be used to endorse or promote products derived from this software
 *    without specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 * SUCH DAMAGE.
 * -
 * Portions Copyright (c) 1993 by Digital Equipment Corporation.
 *
 * Permission to use, copy, modify, and distribute this software for any
 * purpose with or without fee is hereby granted, provided that the above
 * copyright notice and this permission notice appear in all copies, and that
 * the name of Digital Equipment Corporation not be used in advertising or
 * publicity pertaining to distribution of the document or software without
 * specific, written prior permission.
 *
 * THE SOFTWARE IS PROVIDED "AS IS" AND DIGITAL EQUIPMENT CORP. DISCLAIMS ALL
 * WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES
 * OF MERCHANTABILITY AND FITNESS.   IN NO EVENT SHALL DIGITAL EQUIPMENT
 * CORPORATION BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
 * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
 * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
 * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
 * SOFTWARE.
 * -
 * --Copyright--
 */

/*
 * %%% portions-copyright-cmetz-96
 * Portions of this software are Copyright 1996-1998 by Craig Metz, All Rights
 * Reserved. The Inner Net License Version 2 applies to these portions of
 * the software.
 * You should have received a copy of the license with this software. If
 * you didn't get a copy, you may request one from <license@inner.net>.
 */

/*
 *      @(#)netdb.h	8.1 (Berkeley) 6/2/93
 *	$From: netdb.h,v 8.7 1996/05/09 05:59:09 vixie Exp $
 */

#ifndef _GETNAMEINFO_H_
#define _GETNAMEINFO_H_

#include <sys/param.h>
#if (!defined(BSD)) || (BSD < 199306)
# ifdef HAVE_SYS_BITYPES_H
# include <sys/bitypes.h>
# endif /* HAVE_SYS_BITYPES_H */
#endif
#ifdef HAVE_SYS_CDEFS_H
#include <sys/cdefs.h>
#endif /* HAVE_SYS_CDEFS_H */

#ifndef EAI_BADFLAGS
#define EAI_BADFLAGS	-1	/* invalid value for ai_flags */
#endif /* !EAI_BADFLAGS */

#ifndef EAI_NONAME
#define EAI_NONAME	-2	/* name or service is not known */
#endif /* !EAI_NONAME */

#ifndef EAI_AGAIN
#define EAI_AGAIN	-3	/* temporary failure in name resolution */
#endif /* !EAI_AGAIN */

#ifndef EAI_FAIL
#define EAI_FAIL	-4	/* non-recoverable failure in name resolution */
#endif /* !EAI_FAIL */

#ifndef EAI_NODATA
#define EAI_NODATA	-5	/* no address associated with name */
#endif /* !EAI_NODATA */

#ifndef EAI_FAMILY
#define EAI_FAMILY	-6	/* ai_family not supported */
#endif /* !EAI_FAMILY */

#ifndef EAI_SOCKTYPE
#define EAI_SOCKTYPE	-7	/* ai_socktype not supported */
#endif /* !EAI_SOCKTYPE */

#ifndef EAI_SERVICE
#define EAI_SERVICE	-8	/* service not supported for ai_socktype */
#endif /* !EAI_SERVICE */

#ifndef EAI_ADDRFAMILY
#define EAI_ADDRFAMILY	-9	/* address family for name not supported */
#endif /* !EAI_ADDRFAMILY */

#ifndef EAI_MEMORY
#define EAI_MEMORY	-10	/* memory allocation failure */
#endif /* !EAI_MEMORY */

#ifndef EAI_SYSTEM
#define EAI_SYSTEM	-11	/* system error (code indicated in errno) */
#endif /* !EAI_SYSTEM */

#ifndef EAI_BADHINTS
#define EAI_BADHINTS	-12	/* invalid value for hints */
#endif /* !EAI_BADHINTS */

#ifndef EAI_PROTOCOL
#define EAI_PROTOCOL	-13	/* resolved protocol is unknown */
#endif /* !EAI_PROTOCOL */


#ifndef NI_NUMERICHOST
#define NI_NUMERICHOST	1	/* return the host address, not the name */
#endif /* !NI_NUMERICHOST */

#ifndef NI_NUMERICSERV
#define NI_NUMERICSERV	2	/* return the service address, not the name */
#endif /* !NI_NUMERICSERV */

#ifndef NI_NOFQDN
#define NI_NOFQDN	4	/* return a short name if in the local domain */
#endif /* !NI_NOFQDN */

#ifndef NI_NAMEREQD
#define NI_NAMEREQD	8	/* fail if either host or service name is unknown */
#endif /* !NI_NAMEREQD */

#ifndef NI_DGRAM
#define NI_DGRAM	16	/* look up datagram service instead of stream */
#endif /* !NI_DGRAM */

#ifndef NI_WITHSCOPEID
#define NI_WITHSCOPEID	32	/* KAME hack: attach scopeid to host portion */
#endif /* !NI_WITHSCOPEID */


#ifndef NI_MAXHOST
#define NI_MAXHOST	MAXHOSTNAMELEN	/* max host name returned by getnameinfo */
#endif /* !NI_MAXHOST */

#ifndef NI_MAXSERV
#define NI_MAXSERV	32	/* max serv. name length returned by getnameinfo */
#endif /* !NI_MAXSERV */


#ifndef __BEGIN_DECLS
#define __BEGIN_DECLS
#endif /* !__BEGIN_DECLS */
#ifndef __END_DECLS
#define __END_DECLS
#endif /* !__END_DECLS */
#ifndef __P
#define __P(x) x
#endif /* !__P */

__BEGIN_DECLS
int		getnameinfo __P((const struct sockaddr *sa, size_t addrlen,
		    char *host, size_t hostlen, char *serv, size_t servlen,
		    int flags));
char		*gai_strerror __P((int ecode));
__END_DECLS

#endif /* !_GETNAMEINFO_H_ */


syntax highlighted by Code2HTML, v. 0.9.1