Blame resolv/netdb.h

Packit 6c4009
  /* Copyright (C) 1996-2018 Free Software Foundation, Inc.
Packit 6c4009
   This file is part of the GNU C Library.
Packit 6c4009
Packit 6c4009
   The GNU C Library is free software; you can redistribute it and/or
Packit 6c4009
   modify it under the terms of the GNU Lesser General Public
Packit 6c4009
   License as published by the Free Software Foundation; either
Packit 6c4009
   version 2.1 of the License, or (at your option) any later version.
Packit 6c4009
Packit 6c4009
   The GNU C Library is distributed in the hope that it will be useful,
Packit 6c4009
   but WITHOUT ANY WARRANTY; without even the implied warranty of
Packit 6c4009
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Packit 6c4009
   Lesser General Public License for more details.
Packit 6c4009
Packit 6c4009
   You should have received a copy of the GNU Lesser General Public
Packit 6c4009
   License along with the GNU C Library; if not, see
Packit 6c4009
   <http://www.gnu.org/licenses/>.  */
Packit 6c4009
Packit 6c4009
/* All data returned by the network data base library are supplied in
Packit 6c4009
   host order and returned in network order (suitable for use in
Packit 6c4009
   system calls).  */
Packit 6c4009
Packit 6c4009
#ifndef	_NETDB_H
Packit 6c4009
#define	_NETDB_H	1
Packit 6c4009
Packit 6c4009
#include <features.h>
Packit 6c4009
Packit 6c4009
#include <netinet/in.h>
Packit 6c4009
#include <bits/stdint-uintn.h>
Packit 6c4009
#ifdef __USE_MISC
Packit 6c4009
/* This is necessary to make this include file properly replace the
Packit 6c4009
   Sun version.  */
Packit 6c4009
# include <rpc/netdb.h>
Packit 6c4009
#endif
Packit 6c4009
Packit 6c4009
#ifdef __USE_GNU
Packit 6c4009
# include <bits/types/sigevent_t.h>
Packit 6c4009
# include <bits/types/struct_timespec.h>
Packit 6c4009
#endif
Packit 6c4009
Packit 6c4009
#include <bits/netdb.h>
Packit 6c4009
Packit 6c4009
/* Absolute file name for network data base files.  */
Packit 6c4009
#define	_PATH_HEQUIV		"/etc/hosts.equiv"
Packit 6c4009
#define	_PATH_HOSTS		"/etc/hosts"
Packit 6c4009
#define	_PATH_NETWORKS		"/etc/networks"
Packit 6c4009
#define	_PATH_NSSWITCH_CONF	"/etc/nsswitch.conf"
Packit 6c4009
#define	_PATH_PROTOCOLS		"/etc/protocols"
Packit 6c4009
#define	_PATH_SERVICES		"/etc/services"
Packit 6c4009
Packit 6c4009
Packit 6c4009
__BEGIN_DECLS
Packit 6c4009
Packit 6c4009
#if defined __USE_MISC || !defined __USE_XOPEN2K8
Packit 6c4009
/* Error status for non-reentrant lookup functions.
Packit 6c4009
   We use a macro to access always the thread-specific `h_errno' variable.  */
Packit 6c4009
# define h_errno (*__h_errno_location ())
Packit 6c4009
Packit 6c4009
/* Function to get address of global `h_errno' variable.  */
Packit 6c4009
extern int *__h_errno_location (void) __THROW __attribute__ ((__const__));
Packit 6c4009
Packit 6c4009
Packit 6c4009
/* Possible values left in `h_errno'.  */
Packit 6c4009
# define HOST_NOT_FOUND	1	/* Authoritative Answer Host not found.  */
Packit 6c4009
# define TRY_AGAIN	2	/* Non-Authoritative Host not found,
Packit 6c4009
				   or SERVERFAIL.  */
Packit 6c4009
# define NO_RECOVERY	3	/* Non recoverable errors, FORMERR, REFUSED,
Packit 6c4009
				   NOTIMP.  */
Packit 6c4009
# define NO_DATA	4	/* Valid name, no data record of requested
Packit 6c4009
				   type.  */
Packit 6c4009
#endif
Packit 6c4009
#ifdef __USE_MISC
Packit 6c4009
# define NETDB_INTERNAL	-1	/* See errno.  */
Packit 6c4009
# define NETDB_SUCCESS	0	/* No problem.  */
Packit 6c4009
# define NO_ADDRESS	NO_DATA	/* No address, look for MX record.  */
Packit 6c4009
#endif
Packit 6c4009
Packit 6c4009
#if defined __USE_XOPEN2K || defined __USE_XOPEN_EXTENDED
Packit 6c4009
/* Highest reserved Internet port number.  */
Packit 6c4009
# define IPPORT_RESERVED	1024
Packit 6c4009
#endif
Packit 6c4009
Packit 6c4009
#ifdef __USE_GNU
Packit 6c4009
/* Scope delimiter for getaddrinfo(), getnameinfo().  */
Packit 6c4009
# define SCOPE_DELIMITER	'%'
Packit 6c4009
#endif
Packit 6c4009
Packit 6c4009
#ifdef __USE_MISC
Packit 6c4009
/* Print error indicated by `h_errno' variable on standard error.  STR
Packit 6c4009
   if non-null is printed before the error string.  */
Packit 6c4009
extern void herror (const char *__str) __THROW;
Packit 6c4009
Packit 6c4009
/* Return string associated with error ERR_NUM.  */
Packit 6c4009
extern const char *hstrerror (int __err_num) __THROW;
Packit 6c4009
#endif
Packit 6c4009
Packit 6c4009
Packit 6c4009
/* Description of data base entry for a single host.  */
Packit 6c4009
struct hostent
Packit 6c4009
{
Packit 6c4009
  char *h_name;			/* Official name of host.  */
Packit 6c4009
  char **h_aliases;		/* Alias list.  */
Packit 6c4009
  int h_addrtype;		/* Host address type.  */
Packit 6c4009
  int h_length;			/* Length of address.  */
Packit 6c4009
  char **h_addr_list;		/* List of addresses from name server.  */
Packit 6c4009
#ifdef __USE_MISC
Packit 6c4009
# define	h_addr	h_addr_list[0] /* Address, for backward compatibility.*/
Packit 6c4009
#endif
Packit 6c4009
};
Packit 6c4009
Packit 6c4009
/* Open host data base files and mark them as staying open even after
Packit 6c4009
   a later search if STAY_OPEN is non-zero.
Packit 6c4009
Packit 6c4009
   This function is a possible cancellation point and therefore not
Packit 6c4009
   marked with __THROW.  */
Packit 6c4009
extern void sethostent (int __stay_open);
Packit 6c4009
Packit 6c4009
/* Close host data base files and clear `stay open' flag.
Packit 6c4009
Packit 6c4009
   This function is a possible cancellation point and therefore not
Packit 6c4009
   marked with __THROW.  */
Packit 6c4009
extern void endhostent (void);
Packit 6c4009
Packit 6c4009
/* Get next entry from host data base file.  Open data base if
Packit 6c4009
   necessary.
Packit 6c4009
Packit 6c4009
   This function is a possible cancellation point and therefore not
Packit 6c4009
   marked with __THROW.  */
Packit 6c4009
extern struct hostent *gethostent (void);
Packit 6c4009
Packit 6c4009
/* Return entry from host data base which address match ADDR with
Packit 6c4009
   length LEN and type TYPE.
Packit 6c4009
Packit 6c4009
   This function is a possible cancellation point and therefore not
Packit 6c4009
   marked with __THROW.  */
Packit 6c4009
extern struct hostent *gethostbyaddr (const void *__addr, __socklen_t __len,
Packit 6c4009
				      int __type);
Packit 6c4009
Packit 6c4009
/* Return entry from host data base for host with NAME.
Packit 6c4009
Packit 6c4009
   This function is a possible cancellation point and therefore not
Packit 6c4009
   marked with __THROW.  */
Packit 6c4009
extern struct hostent *gethostbyname (const char *__name);
Packit 6c4009
Packit 6c4009
#ifdef __USE_MISC
Packit 6c4009
/* Return entry from host data base for host with NAME.  AF must be
Packit 6c4009
   set to the address type which is `AF_INET' for IPv4 or `AF_INET6'
Packit 6c4009
   for IPv6.
Packit 6c4009
Packit 6c4009
   This function is not part of POSIX and therefore no official
Packit 6c4009
   cancellation point.  But due to similarity with an POSIX interface
Packit 6c4009
   or due to the implementation it is a cancellation point and
Packit 6c4009
   therefore not marked with __THROW.  */
Packit 6c4009
extern struct hostent *gethostbyname2 (const char *__name, int __af);
Packit 6c4009
Packit 6c4009
/* Reentrant versions of the functions above.  The additional
Packit 6c4009
   arguments specify a buffer of BUFLEN starting at BUF.  The last
Packit 6c4009
   argument is a pointer to a variable which gets the value which
Packit 6c4009
   would be stored in the global variable `herrno' by the
Packit 6c4009
   non-reentrant functions.
Packit 6c4009
Packit 6c4009
   These functions are not part of POSIX and therefore no official
Packit 6c4009
   cancellation point.  But due to similarity with an POSIX interface
Packit 6c4009
   or due to the implementation they are cancellation points and
Packit 6c4009
   therefore not marked with __THROW.  */
Packit 6c4009
extern int gethostent_r (struct hostent *__restrict __result_buf,
Packit 6c4009
			 char *__restrict __buf, size_t __buflen,
Packit 6c4009
			 struct hostent **__restrict __result,
Packit 6c4009
			 int *__restrict __h_errnop);
Packit 6c4009
Packit 6c4009
extern int gethostbyaddr_r (const void *__restrict __addr, __socklen_t __len,
Packit 6c4009
			    int __type,
Packit 6c4009
			    struct hostent *__restrict __result_buf,
Packit 6c4009
			    char *__restrict __buf, size_t __buflen,
Packit 6c4009
			    struct hostent **__restrict __result,
Packit 6c4009
			    int *__restrict __h_errnop);
Packit 6c4009
Packit 6c4009
extern int gethostbyname_r (const char *__restrict __name,
Packit 6c4009
			    struct hostent *__restrict __result_buf,
Packit 6c4009
			    char *__restrict __buf, size_t __buflen,
Packit 6c4009
			    struct hostent **__restrict __result,
Packit 6c4009
			    int *__restrict __h_errnop);
Packit 6c4009
Packit 6c4009
extern int gethostbyname2_r (const char *__restrict __name, int __af,
Packit 6c4009
			     struct hostent *__restrict __result_buf,
Packit 6c4009
			     char *__restrict __buf, size_t __buflen,
Packit 6c4009
			     struct hostent **__restrict __result,
Packit 6c4009
			     int *__restrict __h_errnop);
Packit 6c4009
#endif	/* misc */
Packit 6c4009
Packit 6c4009
Packit 6c4009
/* Open network data base files and mark them as staying open even
Packit 6c4009
   after a later search if STAY_OPEN is non-zero.
Packit 6c4009
Packit 6c4009
   This function is a possible cancellation point and therefore not
Packit 6c4009
   marked with __THROW.  */
Packit 6c4009
extern void setnetent (int __stay_open);
Packit 6c4009
Packit 6c4009
/* Close network data base files and clear `stay open' flag.
Packit 6c4009
Packit 6c4009
   This function is a possible cancellation point and therefore not
Packit 6c4009
   marked with __THROW.  */
Packit 6c4009
extern void endnetent (void);
Packit 6c4009
Packit 6c4009
/* Get next entry from network data base file.  Open data base if
Packit 6c4009
   necessary.
Packit 6c4009
Packit 6c4009
   This function is a possible cancellation point and therefore not
Packit 6c4009
   marked with __THROW.  */
Packit 6c4009
extern struct netent *getnetent (void);
Packit 6c4009
Packit 6c4009
/* Return entry from network data base which address match NET and
Packit 6c4009
   type TYPE.
Packit 6c4009
Packit 6c4009
   This function is a possible cancellation point and therefore not
Packit 6c4009
   marked with __THROW.  */
Packit 6c4009
extern struct netent *getnetbyaddr (uint32_t __net, int __type);
Packit 6c4009
Packit 6c4009
/* Return entry from network data base for network with NAME.
Packit 6c4009
Packit 6c4009
   This function is a possible cancellation point and therefore not
Packit 6c4009
   marked with __THROW.  */
Packit 6c4009
extern struct netent *getnetbyname (const char *__name);
Packit 6c4009
Packit 6c4009
#ifdef	__USE_MISC
Packit 6c4009
/* Reentrant versions of the functions above.  The additional
Packit 6c4009
   arguments specify a buffer of BUFLEN starting at BUF.  The last
Packit 6c4009
   argument is a pointer to a variable which gets the value which
Packit 6c4009
   would be stored in the global variable `herrno' by the
Packit 6c4009
   non-reentrant functions.
Packit 6c4009
Packit 6c4009
   These functions are not part of POSIX and therefore no official
Packit 6c4009
   cancellation point.  But due to similarity with an POSIX interface
Packit 6c4009
   or due to the implementation they are cancellation points and
Packit 6c4009
   therefore not marked with __THROW.  */
Packit 6c4009
extern int getnetent_r (struct netent *__restrict __result_buf,
Packit 6c4009
			char *__restrict __buf, size_t __buflen,
Packit 6c4009
			struct netent **__restrict __result,
Packit 6c4009
			int *__restrict __h_errnop);
Packit 6c4009
Packit 6c4009
extern int getnetbyaddr_r (uint32_t __net, int __type,
Packit 6c4009
			   struct netent *__restrict __result_buf,
Packit 6c4009
			   char *__restrict __buf, size_t __buflen,
Packit 6c4009
			   struct netent **__restrict __result,
Packit 6c4009
			   int *__restrict __h_errnop);
Packit 6c4009
Packit 6c4009
extern int getnetbyname_r (const char *__restrict __name,
Packit 6c4009
			   struct netent *__restrict __result_buf,
Packit 6c4009
			   char *__restrict __buf, size_t __buflen,
Packit 6c4009
			   struct netent **__restrict __result,
Packit 6c4009
			   int *__restrict __h_errnop);
Packit 6c4009
#endif	/* misc */
Packit 6c4009
Packit 6c4009
Packit 6c4009
/* Description of data base entry for a single service.  */
Packit 6c4009
struct servent
Packit 6c4009
{
Packit 6c4009
  char *s_name;			/* Official service name.  */
Packit 6c4009
  char **s_aliases;		/* Alias list.  */
Packit 6c4009
  int s_port;			/* Port number.  */
Packit 6c4009
  char *s_proto;		/* Protocol to use.  */
Packit 6c4009
};
Packit 6c4009
Packit 6c4009
/* Open service data base files and mark them as staying open even
Packit 6c4009
   after a later search if STAY_OPEN is non-zero.
Packit 6c4009
Packit 6c4009
   This function is a possible cancellation point and therefore not
Packit 6c4009
   marked with __THROW.  */
Packit 6c4009
extern void setservent (int __stay_open);
Packit 6c4009
Packit 6c4009
/* Close service data base files and clear `stay open' flag.
Packit 6c4009
Packit 6c4009
   This function is a possible cancellation point and therefore not
Packit 6c4009
   marked with __THROW.  */
Packit 6c4009
extern void endservent (void);
Packit 6c4009
Packit 6c4009
/* Get next entry from service data base file.  Open data base if
Packit 6c4009
   necessary.
Packit 6c4009
Packit 6c4009
   This function is a possible cancellation point and therefore not
Packit 6c4009
   marked with __THROW.  */
Packit 6c4009
extern struct servent *getservent (void);
Packit 6c4009
Packit 6c4009
/* Return entry from network data base for network with NAME and
Packit 6c4009
   protocol PROTO.
Packit 6c4009
Packit 6c4009
   This function is a possible cancellation point and therefore not
Packit 6c4009
   marked with __THROW.  */
Packit 6c4009
extern struct servent *getservbyname (const char *__name, const char *__proto);
Packit 6c4009
Packit 6c4009
/* Return entry from service data base which matches port PORT and
Packit 6c4009
   protocol PROTO.
Packit 6c4009
Packit 6c4009
   This function is a possible cancellation point and therefore not
Packit 6c4009
   marked with __THROW.  */
Packit 6c4009
extern struct servent *getservbyport (int __port, const char *__proto);
Packit 6c4009
Packit 6c4009
Packit 6c4009
#ifdef	__USE_MISC
Packit 6c4009
/* Reentrant versions of the functions above.  The additional
Packit 6c4009
   arguments specify a buffer of BUFLEN starting at BUF.
Packit 6c4009
Packit 6c4009
   These functions are not part of POSIX and therefore no official
Packit 6c4009
   cancellation point.  But due to similarity with an POSIX interface
Packit 6c4009
   or due to the implementation they are cancellation points and
Packit 6c4009
   therefore not marked with __THROW.  */
Packit 6c4009
extern int getservent_r (struct servent *__restrict __result_buf,
Packit 6c4009
			 char *__restrict __buf, size_t __buflen,
Packit 6c4009
			 struct servent **__restrict __result);
Packit 6c4009
Packit 6c4009
extern int getservbyname_r (const char *__restrict __name,
Packit 6c4009
			    const char *__restrict __proto,
Packit 6c4009
			    struct servent *__restrict __result_buf,
Packit 6c4009
			    char *__restrict __buf, size_t __buflen,
Packit 6c4009
			    struct servent **__restrict __result);
Packit 6c4009
Packit 6c4009
extern int getservbyport_r (int __port, const char *__restrict __proto,
Packit 6c4009
			    struct servent *__restrict __result_buf,
Packit 6c4009
			    char *__restrict __buf, size_t __buflen,
Packit 6c4009
			    struct servent **__restrict __result);
Packit 6c4009
#endif	/* misc */
Packit 6c4009
Packit 6c4009
Packit 6c4009
/* Description of data base entry for a single service.  */
Packit 6c4009
struct protoent
Packit 6c4009
{
Packit 6c4009
  char *p_name;			/* Official protocol name.  */
Packit 6c4009
  char **p_aliases;		/* Alias list.  */
Packit 6c4009
  int p_proto;			/* Protocol number.  */
Packit 6c4009
};
Packit 6c4009
Packit 6c4009
/* Open protocol data base files and mark them as staying open even
Packit 6c4009
   after a later search if STAY_OPEN is non-zero.
Packit 6c4009
Packit 6c4009
   This function is a possible cancellation point and therefore not
Packit 6c4009
   marked with __THROW.  */
Packit 6c4009
extern void setprotoent (int __stay_open);
Packit 6c4009
Packit 6c4009
/* Close protocol data base files and clear `stay open' flag.
Packit 6c4009
Packit 6c4009
   This function is a possible cancellation point and therefore not
Packit 6c4009
   marked with __THROW.  */
Packit 6c4009
extern void endprotoent (void);
Packit 6c4009
Packit 6c4009
/* Get next entry from protocol data base file.  Open data base if
Packit 6c4009
   necessary.
Packit 6c4009
Packit 6c4009
   This function is a possible cancellation point and therefore not
Packit 6c4009
   marked with __THROW.  */
Packit 6c4009
extern struct protoent *getprotoent (void);
Packit 6c4009
Packit 6c4009
/* Return entry from protocol data base for network with NAME.
Packit 6c4009
Packit 6c4009
   This function is a possible cancellation point and therefore not
Packit 6c4009
   marked with __THROW.  */
Packit 6c4009
extern struct protoent *getprotobyname (const char *__name);
Packit 6c4009
Packit 6c4009
/* Return entry from protocol data base which number is PROTO.
Packit 6c4009
Packit 6c4009
   This function is a possible cancellation point and therefore not
Packit 6c4009
   marked with __THROW.  */
Packit 6c4009
extern struct protoent *getprotobynumber (int __proto);
Packit 6c4009
Packit 6c4009
Packit 6c4009
#ifdef	__USE_MISC
Packit 6c4009
/* Reentrant versions of the functions above.  The additional
Packit 6c4009
   arguments specify a buffer of BUFLEN starting at BUF.
Packit 6c4009
Packit 6c4009
   These functions are not part of POSIX and therefore no official
Packit 6c4009
   cancellation point.  But due to similarity with an POSIX interface
Packit 6c4009
   or due to the implementation they are cancellation points and
Packit 6c4009
   therefore not marked with __THROW.  */
Packit 6c4009
extern int getprotoent_r (struct protoent *__restrict __result_buf,
Packit 6c4009
			  char *__restrict __buf, size_t __buflen,
Packit 6c4009
			  struct protoent **__restrict __result);
Packit 6c4009
Packit 6c4009
extern int getprotobyname_r (const char *__restrict __name,
Packit 6c4009
			     struct protoent *__restrict __result_buf,
Packit 6c4009
			     char *__restrict __buf, size_t __buflen,
Packit 6c4009
			     struct protoent **__restrict __result);
Packit 6c4009
Packit 6c4009
extern int getprotobynumber_r (int __proto,
Packit 6c4009
			       struct protoent *__restrict __result_buf,
Packit 6c4009
			       char *__restrict __buf, size_t __buflen,
Packit 6c4009
			       struct protoent **__restrict __result);
Packit 6c4009
Packit 6c4009
Packit 6c4009
/* Establish network group NETGROUP for enumeration.
Packit 6c4009
Packit 6c4009
   This function is not part of POSIX and therefore no official
Packit 6c4009
   cancellation point.  But due to similarity with an POSIX interface
Packit 6c4009
   or due to the implementation it is a cancellation point and
Packit 6c4009
   therefore not marked with __THROW.  */
Packit 6c4009
extern int setnetgrent (const char *__netgroup);
Packit 6c4009
Packit 6c4009
/* Free all space allocated by previous `setnetgrent' call.
Packit 6c4009
Packit 6c4009
   This function is not part of POSIX and therefore no official
Packit 6c4009
   cancellation point.  But due to similarity with an POSIX interface
Packit 6c4009
   or due to the implementation it is a cancellation point and
Packit 6c4009
   therefore not marked with __THROW.  */
Packit 6c4009
extern void endnetgrent (void);
Packit 6c4009
Packit 6c4009
/* Get next member of netgroup established by last `setnetgrent' call
Packit 6c4009
   and return pointers to elements in HOSTP, USERP, and DOMAINP.
Packit 6c4009
Packit 6c4009
   This function is not part of POSIX and therefore no official
Packit 6c4009
   cancellation point.  But due to similarity with an POSIX interface
Packit 6c4009
   or due to the implementation it is a cancellation point and
Packit 6c4009
   therefore not marked with __THROW.  */
Packit 6c4009
extern int getnetgrent (char **__restrict __hostp,
Packit 6c4009
			char **__restrict __userp,
Packit 6c4009
			char **__restrict __domainp);
Packit 6c4009
Packit 6c4009
Packit 6c4009
/* Test whether NETGROUP contains the triple (HOST,USER,DOMAIN).
Packit 6c4009
Packit 6c4009
   This function is not part of POSIX and therefore no official
Packit 6c4009
   cancellation point.  But due to similarity with an POSIX interface
Packit 6c4009
   or due to the implementation it is a cancellation point and
Packit 6c4009
   therefore not marked with __THROW.  */
Packit 6c4009
extern int innetgr (const char *__netgroup, const char *__host,
Packit 6c4009
		    const char *__user, const char *__domain);
Packit 6c4009
Packit 6c4009
/* Reentrant version of `getnetgrent' where result is placed in BUFFER.
Packit 6c4009
Packit 6c4009
   This function is not part of POSIX and therefore no official
Packit 6c4009
   cancellation point.  But due to similarity with an POSIX interface
Packit 6c4009
   or due to the implementation it is a cancellation point and
Packit 6c4009
   therefore not marked with __THROW.  */
Packit 6c4009
extern int getnetgrent_r (char **__restrict __hostp,
Packit 6c4009
			  char **__restrict __userp,
Packit 6c4009
			  char **__restrict __domainp,
Packit 6c4009
			  char *__restrict __buffer, size_t __buflen);
Packit 6c4009
#endif	/* misc */
Packit 6c4009
Packit 6c4009
Packit 6c4009
#ifdef __USE_MISC
Packit 6c4009
/* Call `rshd' at port RPORT on remote machine *AHOST to execute CMD.
Packit 6c4009
   The local user is LOCUSER, on the remote machine the command is
Packit 6c4009
   executed as REMUSER.  In *FD2P the descriptor to the socket for the
Packit 6c4009
   connection is returned.  The caller must have the right to use a
Packit 6c4009
   reserved port.  When the function returns *AHOST contains the
Packit 6c4009
   official host name.
Packit 6c4009
Packit 6c4009
   This function is not part of POSIX and therefore no official
Packit 6c4009
   cancellation point.  But due to similarity with an POSIX interface
Packit 6c4009
   or due to the implementation it is a cancellation point and
Packit 6c4009
   therefore not marked with __THROW.  */
Packit 6c4009
extern int rcmd (char **__restrict __ahost, unsigned short int __rport,
Packit 6c4009
		 const char *__restrict __locuser,
Packit 6c4009
		 const char *__restrict __remuser,
Packit 6c4009
		 const char *__restrict __cmd, int *__restrict __fd2p);
Packit 6c4009
Packit 6c4009
/* This is the equivalent function where the protocol can be selected
Packit 6c4009
   and which therefore can be used for IPv6.
Packit 6c4009
Packit 6c4009
   This function is not part of POSIX and therefore no official
Packit 6c4009
   cancellation point.  But due to similarity with an POSIX interface
Packit 6c4009
   or due to the implementation it is a cancellation point and
Packit 6c4009
   therefore not marked with __THROW.  */
Packit 6c4009
extern int rcmd_af (char **__restrict __ahost, unsigned short int __rport,
Packit 6c4009
		    const char *__restrict __locuser,
Packit 6c4009
		    const char *__restrict __remuser,
Packit 6c4009
		    const char *__restrict __cmd, int *__restrict __fd2p,
Packit 6c4009
		    sa_family_t __af);
Packit 6c4009
Packit 6c4009
/* Call `rexecd' at port RPORT on remote machine *AHOST to execute
Packit 6c4009
   CMD.  The process runs at the remote machine using the ID of user
Packit 6c4009
   NAME whose cleartext password is PASSWD.  In *FD2P the descriptor
Packit 6c4009
   to the socket for the connection is returned.  When the function
Packit 6c4009
   returns *AHOST contains the official host name.
Packit 6c4009
Packit 6c4009
   This function is not part of POSIX and therefore no official
Packit 6c4009
   cancellation point.  But due to similarity with an POSIX interface
Packit 6c4009
   or due to the implementation it is a cancellation point and
Packit 6c4009
   therefore not marked with __THROW.  */
Packit 6c4009
extern int rexec (char **__restrict __ahost, int __rport,
Packit 6c4009
		  const char *__restrict __name,
Packit 6c4009
		  const char *__restrict __pass,
Packit 6c4009
		  const char *__restrict __cmd, int *__restrict __fd2p);
Packit 6c4009
Packit 6c4009
/* This is the equivalent function where the protocol can be selected
Packit 6c4009
   and which therefore can be used for IPv6.
Packit 6c4009
Packit 6c4009
   This function is not part of POSIX and therefore no official
Packit 6c4009
   cancellation point.  But due to similarity with an POSIX interface
Packit 6c4009
   or due to the implementation it is a cancellation point and
Packit 6c4009
   therefore not marked with __THROW.  */
Packit 6c4009
extern int rexec_af (char **__restrict __ahost, int __rport,
Packit 6c4009
		     const char *__restrict __name,
Packit 6c4009
		     const char *__restrict __pass,
Packit 6c4009
		     const char *__restrict __cmd, int *__restrict __fd2p,
Packit 6c4009
		     sa_family_t __af);
Packit 6c4009
Packit 6c4009
/* Check whether user REMUSER on system RHOST is allowed to login as LOCUSER.
Packit 6c4009
   If SUSER is not zero the user tries to become superuser.  Return 0 if
Packit 6c4009
   it is possible.
Packit 6c4009
Packit 6c4009
   This function is not part of POSIX and therefore no official
Packit 6c4009
   cancellation point.  But due to similarity with an POSIX interface
Packit 6c4009
   or due to the implementation it is a cancellation point and
Packit 6c4009
   therefore not marked with __THROW.  */
Packit 6c4009
extern int ruserok (const char *__rhost, int __suser,
Packit 6c4009
		    const char *__remuser, const char *__locuser);
Packit 6c4009
Packit 6c4009
/* This is the equivalent function where the protocol can be selected
Packit 6c4009
   and which therefore can be used for IPv6.
Packit 6c4009
Packit 6c4009
   This function is not part of POSIX and therefore no official
Packit 6c4009
   cancellation point.  But due to similarity with an POSIX interface
Packit 6c4009
   or due to the implementation it is a cancellation point and
Packit 6c4009
   therefore not marked with __THROW.  */
Packit 6c4009
extern int ruserok_af (const char *__rhost, int __suser,
Packit 6c4009
		       const char *__remuser, const char *__locuser,
Packit 6c4009
		       sa_family_t __af);
Packit 6c4009
Packit 6c4009
/* Check whether user REMUSER on system indicated by IPv4 address
Packit 6c4009
   RADDR is allowed to login as LOCUSER.  Non-IPv4 (e.g., IPv6) are
Packit 6c4009
   not supported.  If SUSER is not zero the user tries to become
Packit 6c4009
   superuser.  Return 0 if it is possible.
Packit 6c4009
Packit 6c4009
   This function is not part of POSIX and therefore no official
Packit 6c4009
   cancellation point.  But due to similarity with an POSIX interface
Packit 6c4009
   or due to the implementation it is a cancellation point and
Packit 6c4009
   therefore not marked with __THROW.  */
Packit 6c4009
extern int iruserok (uint32_t __raddr, int __suser,
Packit 6c4009
		     const char *__remuser, const char *__locuser);
Packit 6c4009
Packit 6c4009
/* This is the equivalent function where the pfamiliy if the address
Packit 6c4009
   pointed to by RADDR is determined by the value of AF.  It therefore
Packit 6c4009
   can be used for IPv6
Packit 6c4009
Packit 6c4009
   This function is not part of POSIX and therefore no official
Packit 6c4009
   cancellation point.  But due to similarity with an POSIX interface
Packit 6c4009
   or due to the implementation it is a cancellation point and
Packit 6c4009
   therefore not marked with __THROW.  */
Packit 6c4009
extern int iruserok_af (const void *__raddr, int __suser,
Packit 6c4009
			const char *__remuser, const char *__locuser,
Packit 6c4009
			sa_family_t __af);
Packit 6c4009
Packit 6c4009
/* Try to allocate reserved port, returning a descriptor for a socket opened
Packit 6c4009
   at this port or -1 if unsuccessful.  The search for an available port
Packit 6c4009
   will start at ALPORT and continues with lower numbers.
Packit 6c4009
Packit 6c4009
   This function is not part of POSIX and therefore no official
Packit 6c4009
   cancellation point.  But due to similarity with an POSIX interface
Packit 6c4009
   or due to the implementation it is a cancellation point and
Packit 6c4009
   therefore not marked with __THROW.  */
Packit 6c4009
extern int rresvport (int *__alport);
Packit 6c4009
Packit 6c4009
/* This is the equivalent function where the protocol can be selected
Packit 6c4009
   and which therefore can be used for IPv6.
Packit 6c4009
Packit 6c4009
   This function is not part of POSIX and therefore no official
Packit 6c4009
   cancellation point.  But due to similarity with an POSIX interface
Packit 6c4009
   or due to the implementation it is a cancellation point and
Packit 6c4009
   therefore not marked with __THROW.  */
Packit 6c4009
extern int rresvport_af (int *__alport, sa_family_t __af);
Packit 6c4009
#endif
Packit 6c4009
Packit 6c4009
Packit 6c4009
/* Extension from POSIX.1:2001.  */
Packit 6c4009
#ifdef __USE_XOPEN2K
Packit 6c4009
/* Structure to contain information about address of a service provider.  */
Packit 6c4009
struct addrinfo
Packit 6c4009
{
Packit 6c4009
  int ai_flags;			/* Input flags.  */
Packit 6c4009
  int ai_family;		/* Protocol family for socket.  */
Packit 6c4009
  int ai_socktype;		/* Socket type.  */
Packit 6c4009
  int ai_protocol;		/* Protocol for socket.  */
Packit 6c4009
  socklen_t ai_addrlen;		/* Length of socket address.  */
Packit 6c4009
  struct sockaddr *ai_addr;	/* Socket address for socket.  */
Packit 6c4009
  char *ai_canonname;		/* Canonical name for service location.  */
Packit 6c4009
  struct addrinfo *ai_next;	/* Pointer to next in list.  */
Packit 6c4009
};
Packit 6c4009
Packit 6c4009
# ifdef __USE_GNU
Packit 6c4009
/* Structure used as control block for asynchronous lookup.  */
Packit 6c4009
struct gaicb
Packit 6c4009
{
Packit 6c4009
  const char *ar_name;		/* Name to look up.  */
Packit 6c4009
  const char *ar_service;	/* Service name.  */
Packit 6c4009
  const struct addrinfo *ar_request; /* Additional request specification.  */
Packit 6c4009
  struct addrinfo *ar_result;	/* Pointer to result.  */
Packit 6c4009
  /* The following are internal elements.  */
Packit 6c4009
  int __return;
Packit 6c4009
  int __glibc_reserved[5];
Packit 6c4009
};
Packit 6c4009
Packit 6c4009
/* Lookup mode.  */
Packit 6c4009
#  define GAI_WAIT	0
Packit 6c4009
#  define GAI_NOWAIT	1
Packit 6c4009
# endif
Packit 6c4009
Packit 6c4009
/* Possible values for `ai_flags' field in `addrinfo' structure.  */
Packit 6c4009
# define AI_PASSIVE	0x0001	/* Socket address is intended for `bind'.  */
Packit 6c4009
# define AI_CANONNAME	0x0002	/* Request for canonical name.  */
Packit 6c4009
# define AI_NUMERICHOST	0x0004	/* Don't use name resolution.  */
Packit 6c4009
# define AI_V4MAPPED	0x0008	/* IPv4 mapped addresses are acceptable.  */
Packit 6c4009
# define AI_ALL		0x0010	/* Return IPv4 mapped and IPv6 addresses.  */
Packit 6c4009
# define AI_ADDRCONFIG	0x0020	/* Use configuration of this host to choose
Packit 6c4009
				   returned address type..  */
Packit 6c4009
# ifdef __USE_GNU
Packit 6c4009
#  define AI_IDN	0x0040	/* IDN encode input (assuming it is encoded
Packit 6c4009
				   in the current locale's character set)
Packit 6c4009
				   before looking it up. */
Packit 6c4009
#  define AI_CANONIDN	0x0080	/* Translate canonical name from IDN format. */
Packit 6c4009
#  define AI_IDN_ALLOW_UNASSIGNED \
Packit 6c4009
  __glibc_macro_warning ("AI_IDN_ALLOW_UNASSIGNED is deprecated") 0x0100
Packit 6c4009
#  define AI_IDN_USE_STD3_ASCII_RULES \
Packit 6c4009
  __glibc_macro_warning ("AI_IDN_USE_STD3_ASCII_RULES is deprecated") 0x0200
Packit 6c4009
# endif
Packit 6c4009
# define AI_NUMERICSERV	0x0400	/* Don't use name resolution.  */
Packit 6c4009
Packit 6c4009
/* Error values for `getaddrinfo' function.  */
Packit 6c4009
# define EAI_BADFLAGS	  -1	/* Invalid value for `ai_flags' field.  */
Packit 6c4009
# define EAI_NONAME	  -2	/* NAME or SERVICE is unknown.  */
Packit 6c4009
# define EAI_AGAIN	  -3	/* Temporary failure in name resolution.  */
Packit 6c4009
# define EAI_FAIL	  -4	/* Non-recoverable failure in name res.  */
Packit 6c4009
# define EAI_FAMILY	  -6	/* `ai_family' not supported.  */
Packit 6c4009
# define EAI_SOCKTYPE	  -7	/* `ai_socktype' not supported.  */
Packit 6c4009
# define EAI_SERVICE	  -8	/* SERVICE not supported for `ai_socktype'.  */
Packit 6c4009
# define EAI_MEMORY	  -10	/* Memory allocation failure.  */
Packit 6c4009
# define EAI_SYSTEM	  -11	/* System error returned in `errno'.  */
Packit 6c4009
# define EAI_OVERFLOW	  -12	/* Argument buffer overflow.  */
Packit 6c4009
# ifdef __USE_GNU
Packit 6c4009
#  define EAI_NODATA	  -5	/* No address associated with NAME.  */
Packit 6c4009
#  define EAI_ADDRFAMILY  -9	/* Address family for NAME not supported.  */
Packit 6c4009
#  define EAI_INPROGRESS  -100	/* Processing request in progress.  */
Packit 6c4009
#  define EAI_CANCELED	  -101	/* Request canceled.  */
Packit 6c4009
#  define EAI_NOTCANCELED -102	/* Request not canceled.  */
Packit 6c4009
#  define EAI_ALLDONE	  -103	/* All requests done.  */
Packit 6c4009
#  define EAI_INTR	  -104	/* Interrupted by a signal.  */
Packit 6c4009
#  define EAI_IDN_ENCODE  -105	/* IDN encoding failed.  */
Packit 6c4009
# endif
Packit 6c4009
Packit 6c4009
# ifdef __USE_MISC
Packit 6c4009
#  define NI_MAXHOST      1025
Packit 6c4009
#  define NI_MAXSERV      32
Packit 6c4009
# endif
Packit 6c4009
Packit 6c4009
# define NI_NUMERICHOST	1	/* Don't try to look up hostname.  */
Packit 6c4009
# define NI_NUMERICSERV 2	/* Don't convert port number to name.  */
Packit 6c4009
# define NI_NOFQDN	4	/* Only return nodename portion.  */
Packit 6c4009
# define NI_NAMEREQD	8	/* Don't return numeric addresses.  */
Packit 6c4009
# define NI_DGRAM	16	/* Look up UDP service rather than TCP.  */
Packit 6c4009
# ifdef __USE_GNU
Packit 6c4009
#  define NI_IDN	32	/* Convert name from IDN format.  */
Packit 6c4009
#  define NI_IDN_ALLOW_UNASSIGNED \
Packit 6c4009
  __glibc_macro_warning ("NI_IDN_ALLOW_UNASSIGNED is deprecated") 64
Packit 6c4009
#  define NI_IDN_USE_STD3_ASCII_RULES \
Packit 6c4009
  __glibc_macro_warning ("NI_IDN_USE_STD3_ASCII_RULES is deprecated") 128
Packit 6c4009
# endif
Packit 6c4009
Packit 6c4009
/* Translate name of a service location and/or a service name to set of
Packit 6c4009
   socket addresses.
Packit 6c4009
Packit 6c4009
   This function is a possible cancellation point and therefore not
Packit 6c4009
   marked with __THROW.  */
Packit 6c4009
extern int getaddrinfo (const char *__restrict __name,
Packit 6c4009
			const char *__restrict __service,
Packit 6c4009
			const struct addrinfo *__restrict __req,
Packit 6c4009
			struct addrinfo **__restrict __pai);
Packit 6c4009
Packit 6c4009
/* Free `addrinfo' structure AI including associated storage.  */
Packit 6c4009
extern void freeaddrinfo (struct addrinfo *__ai) __THROW;
Packit 6c4009
Packit 6c4009
/* Convert error return from getaddrinfo() to a string.  */
Packit 6c4009
extern const char *gai_strerror (int __ecode) __THROW;
Packit 6c4009
Packit 6c4009
/* Translate a socket address to a location and service name.
Packit 6c4009
Packit 6c4009
   This function is a possible cancellation point and therefore not
Packit 6c4009
   marked with __THROW.  */
Packit 6c4009
extern int getnameinfo (const struct sockaddr *__restrict __sa,
Packit 6c4009
			socklen_t __salen, char *__restrict __host,
Packit 6c4009
			socklen_t __hostlen, char *__restrict __serv,
Packit 6c4009
			socklen_t __servlen, int __flags);
Packit 6c4009
#endif	/* POSIX */
Packit 6c4009
Packit 6c4009
#ifdef __USE_GNU
Packit 6c4009
/* Enqueue ENT requests from the LIST.  If MODE is GAI_WAIT wait until all
Packit 6c4009
   requests are handled.  If WAIT is GAI_NOWAIT return immediately after
Packit 6c4009
   queueing the requests and signal completion according to SIG.
Packit 6c4009
Packit 6c4009
   This function is not part of POSIX and therefore no official
Packit 6c4009
   cancellation point.  But due to similarity with an POSIX interface
Packit 6c4009
   or due to the implementation it is a cancellation point and
Packit 6c4009
   therefore not marked with __THROW.  */
Packit 6c4009
extern int getaddrinfo_a (int __mode, struct gaicb *__list[__restrict_arr],
Packit 6c4009
			  int __ent, struct sigevent *__restrict __sig);
Packit 6c4009
Packit 6c4009
/* Suspend execution of the thread until at least one of the ENT requests
Packit 6c4009
   in LIST is handled.  If TIMEOUT is not a null pointer it specifies the
Packit 6c4009
   longest time the function keeps waiting before returning with an error.
Packit 6c4009
Packit 6c4009
   This function is not part of POSIX and therefore no official
Packit 6c4009
   cancellation point.  But due to similarity with an POSIX interface
Packit 6c4009
   or due to the implementation it is a cancellation point and
Packit 6c4009
   therefore not marked with __THROW.  */
Packit 6c4009
extern int gai_suspend (const struct gaicb *const __list[], int __ent,
Packit 6c4009
			const struct timespec *__timeout);
Packit 6c4009
Packit 6c4009
/* Get the error status of the request REQ.  */
Packit 6c4009
extern int gai_error (struct gaicb *__req) __THROW;
Packit 6c4009
Packit 6c4009
/* Cancel the requests associated with GAICBP.  */
Packit 6c4009
extern int gai_cancel (struct gaicb *__gaicbp) __THROW;
Packit 6c4009
#endif	/* GNU */
Packit 6c4009
Packit 6c4009
__END_DECLS
Packit 6c4009
Packit 6c4009
#endif	/* netdb.h */