/*
* Copyright 2014 Garrett D'Amore <garrett@damore.org>
*
* Copyright 2009 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
/* Copyright (c) 1983, 1984, 1985, 1986, 1987, 1988, 1989 AT&T */
/* All Rights Reserved */
/*
* BIND 4.9.3:
*
* 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
* 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--
*
* End BIND 4.9.3
*/
/*
* Structures returned by network data base library.
* All addresses are supplied in host order, and
* returned in network order (suitable for use in system calls).
*/
#ifndef _NETDB_H
#define _NETDB_H
#endif /* !defined(_XPG4_2) || defined(_XPG6) || defined(__EXTENSIONS__) */
#include <sys/feature_tests.h>
#ifdef __cplusplus
extern "C" {
#endif
struct hostent {
};
/*
* addrinfo introduced with IPv6 for Protocol-Independent Hostname
* and Service Name Translation.
*/
struct addrinfo {
#ifdef __sparcv9
#endif /* __sparcv9 */
};
/*
* The flag 0x8000 is currently reserved for private use between libnsl and
* libsocket. See lib/libsocket/inet/getaddrinfo.c for more information.
*/
/* addrinfo flags */
/* getipnodebyname() flags */
/*
* These were defined in RFC 2553 but not SUSv3
* or RFC 3493 which obsoleted 2553.
*/
#if !defined(_XPG6) || defined(__EXTENSIONS__)
/* addrinfo errors */
#endif /* !defined(_XPG6) || defined(__EXTENSIONS__) */
/* getnameinfo flags */
#if !defined(_XPG6) || defined(__EXTENSIONS__)
/* Not listed in any standards document */
/* getnameinfo max sizes as defined in RFC 2553 obsoleted in RFC 3493 */
#endif /* !defined(_XPG6) || defined(__EXTENSIONS__) */
#endif /* !defined(_XPG4_2) || defined(_XPG6) || defined(__EXTENSIONS__) */
/*
* Scope delimit character
*/
/*
* and algorithms.
*/
#if !defined(_XPG4_2) || defined(__EXTENSIONS__)
typedef struct ipsecalgent {
/* well-known IPsec protocol numbers */
#endif /* !defined(_XPG4_2) || defined(__EXTENSIONS__) */
/*
* Assumption here is that a network number
* fits in 32 bits -- probably a poor one.
*/
struct netent {
};
struct protoent {
};
struct servent {
};
#if !defined(_XPG4_2) || defined(__EXTENSIONS__)
struct hostent *gethostbyname_r
struct hostent *gethostbyaddr_r
struct hostent *getipnodebyname(const char *, int, int, int *);
void freehostent(struct hostent *);
struct servent *getservbyname_r
struct servent *getservbyport_r
struct netent *getnetbyname_r
(const char *, struct netent *, char *, int);
struct protoent *getprotobyname_r
(const char *, struct protoent *, char *, int);
struct protoent *getprotobynumber_r
(int, struct protoent *, char *, int);
int getnetgrent_r(char **, char **, char **, char *, int);
int innetgr(const char *, const char *, const char *, const char *);
#endif /* !defined(_XPG4_2) || defined(__EXTENSIONS__) */
/* Old interfaces that return a pointer to a static area; MT-unsafe */
struct hostent *gethostbyname(const char *);
struct hostent *gethostent(void);
struct netent *getnetbyname(const char *);
struct protoent *getprotobyname(const char *);
struct protoent *getprotobynumber(int);
struct protoent *getprotoent(void);
struct servent *getservbyname(const char *, const char *);
struct servent *getservbyport(int, const char *);
struct servent *getservent(void);
#else
#endif /* !defined(_XPG4_2) || defined(_XPG6) || defined(__EXTENSIONS__) */
#if !defined(_XPG4_2) || defined(__EXTENSIONS__)
int endhostent(void);
int endnetent(void);
int endprotoent(void);
int endservent(void);
int sethostent(int);
int setnetent(int);
int setprotoent(int);
int setservent(int);
#else
void endhostent(void);
void endnetent(void);
void endprotoent(void);
void endservent(void);
void sethostent(int);
void setnetent(int);
void setprotoent(int);
void setservent(int);
#endif /* !defined(_XPG4_2) || defined(__EXTENSIONS__) */
#ifdef _XPG6
#ifdef __PRAGMA_REDEFINE_EXTNAME
#else /* __PRAGMA_REDEFINE_EXTNAME */
#endif /* __PRAGMA_REDEFINE_EXTNAME */
#endif /* _XPG6 */
int getaddrinfo(const char *_RESTRICT_KYWD,
const char *_RESTRICT_KYWD,
const struct addrinfo *_RESTRICT_KYWD,
struct addrinfo **_RESTRICT_KYWD);
void freeaddrinfo(struct addrinfo *);
const char *gai_strerror(int);
char *_RESTRICT_KYWD, socklen_t, int);
#endif /* !defined(_XPG4_2) || defined(_XPG6) || defined(__EXTENSIONS__) */
#if !defined(_XPG4_2) || defined(__EXTENSIONS__)
int getnetgrent(char **, char **, char **);
int setnetgrent(const char *);
int endnetgrent(void);
int rcmd(char **, unsigned short,
const char *, const char *, const char *, int *);
int rcmd_af(char **, unsigned short,
const char *, const char *, const char *, int *, int);
int rresvport_af(int *, int);
int rresvport_addr(int *, struct sockaddr_storage *);
int rexec(char **, unsigned short,
const char *, const char *, const char *, int *);
int rexec_af(char **, unsigned short,
const char *, const char *, const char *, int *, int);
int rresvport(int *);
int ruserok(const char *, int, const char *, const char *);
/* BIND */
struct hostent *gethostbyname2(const char *, int);
void herror(const char *);
const char *hstrerror(int);
/* End BIND */
/* IPsec algorithm prototype definitions */
struct ipsecalgent *getipsecalgbyname(const char *, int, int *);
struct ipsecalgent *getipsecalgbynum(int, int, int *);
int getipsecprotobyname(const char *doi_name);
char *getipsecprotobynum(int doi_domain);
/* END IPsec algorithm prototype definitions */
#endif /* !defined(_XPG4_2) || defined(__EXTENSIONS__) */
/*
* Error return codes from gethostbyname() and gethostbyaddr()
* (when using the resolver)
*/
extern int h_errno;
#ifdef _REENTRANT
extern int *__h_errno(void);
/* Only #define h_errno if there is no conflict with other use */
#ifdef H_ERRNO_IS_FUNCTION
#endif /* NO_H_ERRNO_DEFINE */
#endif /* _REENTRANT */
/*
* Error return codes from gethostbyname() and gethostbyaddr()
* (left in extern int h_errno).
*/
#if !defined(_XPG4_2) || defined(__EXTENSIONS__)
/* BIND */
/* End BIND */
#endif /* !defined(_XPG4_2) || defined(__EXTENSIONS__) */
#ifdef __cplusplus
}
#endif
#endif /* _NETDB_H */