|
@@ -1,4 +1,4 @@
|
|
-/* Copyright (C) 1996-2002, 2003, 2004 Free Software Foundation, Inc.
|
|
+/* Copyright (C) 1996-2002, 2003, 2004, 2009 Free Software Foundation, Inc.
|
|
This file is part of the GNU C Library.
|
|
This file is part of the GNU C Library.
|
|
|
|
|
|
The GNU C Library is free software; you can redistribute it and/or
|
|
The GNU C Library is free software; you can redistribute it and/or
|
|
@@ -88,8 +88,6 @@ extern int h_errno;
|
|
#endif /* _LIBC */
|
|
#endif /* _LIBC */
|
|
|
|
|
|
/* Possible values left in `h_errno'. */
|
|
/* Possible values left in `h_errno'. */
|
|
-#define NETDB_INTERNAL -1 /* See errno. */
|
|
|
|
-#define NETDB_SUCCESS 0 /* No problem. */
|
|
|
|
#define HOST_NOT_FOUND 1 /* Authoritative Answer Host not found. */
|
|
#define HOST_NOT_FOUND 1 /* Authoritative Answer Host not found. */
|
|
#define TRY_AGAIN 2 /* Non-Authoritative Host not found,
|
|
#define TRY_AGAIN 2 /* Non-Authoritative Host not found,
|
|
or SERVERFAIL. */
|
|
or SERVERFAIL. */
|
|
@@ -97,7 +95,11 @@ extern int h_errno;
|
|
NOTIMP. */
|
|
NOTIMP. */
|
|
#define NO_DATA 4 /* Valid name, no data record of requested
|
|
#define NO_DATA 4 /* Valid name, no data record of requested
|
|
type. */
|
|
type. */
|
|
-#define NO_ADDRESS NO_DATA /* No address, look for MX record. */
|
|
+#if defined __USE_MISC || defined __USE_GNU
|
|
|
|
+# define NETDB_INTERNAL -1 /* See errno. */
|
|
|
|
+# define NETDB_SUCCESS 0 /* No problem. */
|
|
|
|
+# define NO_ADDRESS NO_DATA /* No address, look for MX record. */
|
|
|
|
+#endif
|
|
|
|
|
|
#ifdef __USE_XOPEN2K
|
|
#ifdef __USE_XOPEN2K
|
|
/* Highest reserved Internet port number. */
|
|
/* Highest reserved Internet port number. */
|
|
@@ -109,6 +111,7 @@ extern int h_errno;
|
|
# define SCOPE_DELIMITER '%'
|
|
# define SCOPE_DELIMITER '%'
|
|
#endif
|
|
#endif
|
|
|
|
|
|
|
|
+#if defined __USE_MISC || defined __USE_GNU
|
|
/* Print error indicated by `h_errno' variable on standard error. STR
|
|
/* Print error indicated by `h_errno' variable on standard error. STR
|
|
if non-null is printed before the error string. */
|
|
if non-null is printed before the error string. */
|
|
extern void herror (__const char *__str) __THROW;
|
|
extern void herror (__const char *__str) __THROW;
|
|
@@ -116,6 +119,7 @@ libc_hidden_proto(herror)
|
|
|
|
|
|
/* Return string associated with error ERR_NUM. */
|
|
/* Return string associated with error ERR_NUM. */
|
|
extern __const char *hstrerror (int __err_num) __THROW;
|
|
extern __const char *hstrerror (int __err_num) __THROW;
|
|
|
|
+#endif
|
|
|
|
|
|
|
|
|
|
/* Description of data base entry for a single host. */
|
|
/* Description of data base entry for a single host. */
|
|
@@ -126,7 +130,9 @@ struct hostent
|
|
int h_addrtype; /* Host address type. */
|
|
int h_addrtype; /* Host address type. */
|
|
int h_length; /* Length of address. */
|
|
int h_length; /* Length of address. */
|
|
char **h_addr_list; /* List of addresses from name server. */
|
|
char **h_addr_list; /* List of addresses from name server. */
|
|
-#define h_addr h_addr_list[0] /* Address, for backward compatibility. */
|
|
+#if defined __USE_MISC || defined __USE_GNU
|
|
|
|
+# define h_addr h_addr_list[0] /* Address, for backward compatibility.*/
|
|
|
|
+#endif
|
|
};
|
|
};
|
|
|
|
|
|
/* Open host data base files and mark them as staying open even after
|
|
/* Open host data base files and mark them as staying open even after
|
|
@@ -268,12 +274,14 @@ extern int getnetent_r (struct netent *__restrict __result_buf,
|
|
struct netent **__restrict __result,
|
|
struct netent **__restrict __result,
|
|
int *__restrict __h_errnop);
|
|
int *__restrict __h_errnop);
|
|
libc_hidden_proto(getnetent_r)
|
|
libc_hidden_proto(getnetent_r)
|
|
|
|
+
|
|
extern int getnetbyaddr_r (uint32_t __net, int __type,
|
|
extern int getnetbyaddr_r (uint32_t __net, int __type,
|
|
struct netent *__restrict __result_buf,
|
|
struct netent *__restrict __result_buf,
|
|
char *__restrict __buf, size_t __buflen,
|
|
char *__restrict __buf, size_t __buflen,
|
|
struct netent **__restrict __result,
|
|
struct netent **__restrict __result,
|
|
int *__restrict __h_errnop);
|
|
int *__restrict __h_errnop);
|
|
libc_hidden_proto(getnetbyaddr_r)
|
|
libc_hidden_proto(getnetbyaddr_r)
|
|
|
|
+
|
|
extern int getnetbyname_r (__const char *__restrict __name,
|
|
extern int getnetbyname_r (__const char *__restrict __name,
|
|
struct netent *__restrict __result_buf,
|
|
struct netent *__restrict __result_buf,
|
|
char *__restrict __buf, size_t __buflen,
|
|
char *__restrict __buf, size_t __buflen,
|
|
@@ -464,7 +472,7 @@ extern int getnetgrent (char **__restrict __hostp,
|
|
or due to the implementation it is a cancellation point and
|
|
or due to the implementation it is a cancellation point and
|
|
therefore not marked with __THROW. */
|
|
therefore not marked with __THROW. */
|
|
extern int innetgr (__const char *__netgroup, __const char *__host,
|
|
extern int innetgr (__const char *__netgroup, __const char *__host,
|
|
- __const char *__user, __const char *domain);
|
|
+ __const char *__user, __const char *__domain);
|
|
|
|
|
|
/* Reentrant version of `getnetgrent' where result is placed in BUFFER.
|
|
/* Reentrant version of `getnetgrent' where result is placed in BUFFER.
|
|
|
|
|
|
@@ -479,12 +487,12 @@ extern int getnetgrent_r (char **__restrict __hostp,
|
|
#endif /* UCLIBC_HAS_NETGROUP */
|
|
#endif /* UCLIBC_HAS_NETGROUP */
|
|
#endif /* misc */
|
|
#endif /* misc */
|
|
|
|
|
|
-
|
|
+#ifdef __UCLIBC__
|
|
/* ruserpass - remote password check.
|
|
/* ruserpass - remote password check.
|
|
This function also exists in glibc but is undocumented */
|
|
This function also exists in glibc but is undocumented */
|
|
extern int ruserpass(const char *host, const char **aname, const char **apass);
|
|
extern int ruserpass(const char *host, const char **aname, const char **apass);
|
|
libc_hidden_proto(ruserpass)
|
|
libc_hidden_proto(ruserpass)
|
|
-
|
|
+#endif
|
|
|
|
|
|
#ifdef __USE_BSD
|
|
#ifdef __USE_BSD
|
|
/* Call `rshd' at port RPORT on remote machine *AHOST to execute CMD.
|
|
/* Call `rshd' at port RPORT on remote machine *AHOST to execute CMD.
|
|
@@ -638,15 +646,15 @@ struct addrinfo
|
|
# define EAI_NONAME -2 /* NAME or SERVICE is unknown. */
|
|
# define EAI_NONAME -2 /* NAME or SERVICE is unknown. */
|
|
# define EAI_AGAIN -3 /* Temporary failure in name resolution. */
|
|
# define EAI_AGAIN -3 /* Temporary failure in name resolution. */
|
|
# define EAI_FAIL -4 /* Non-recoverable failure in name res. */
|
|
# define EAI_FAIL -4 /* Non-recoverable failure in name res. */
|
|
-# define EAI_NODATA -5 /* No address associated with NAME. */
|
|
|
|
# define EAI_FAMILY -6 /* `ai_family' not supported. */
|
|
# define EAI_FAMILY -6 /* `ai_family' not supported. */
|
|
# define EAI_SOCKTYPE -7 /* `ai_socktype' not supported. */
|
|
# define EAI_SOCKTYPE -7 /* `ai_socktype' not supported. */
|
|
# define EAI_SERVICE -8 /* SERVICE not supported for `ai_socktype'. */
|
|
# define EAI_SERVICE -8 /* SERVICE not supported for `ai_socktype'. */
|
|
-# define EAI_ADDRFAMILY -9 /* Address family for NAME not supported. */
|
|
|
|
# define EAI_MEMORY -10 /* Memory allocation failure. */
|
|
# define EAI_MEMORY -10 /* Memory allocation failure. */
|
|
# define EAI_SYSTEM -11 /* System error returned in `errno'. */
|
|
# define EAI_SYSTEM -11 /* System error returned in `errno'. */
|
|
# define EAI_OVERFLOW -12 /* Argument buffer overflow. */
|
|
# define EAI_OVERFLOW -12 /* Argument buffer overflow. */
|
|
# ifdef __USE_GNU
|
|
# ifdef __USE_GNU
|
|
|
|
+# define EAI_NODATA -5 /* No address associated with NAME. */
|
|
|
|
+# define EAI_ADDRFAMILY -9 /* Address family for NAME not supported. */
|
|
# define EAI_INPROGRESS -100 /* Processing request in progress. */
|
|
# define EAI_INPROGRESS -100 /* Processing request in progress. */
|
|
# define EAI_CANCELED -101 /* Request canceled. */
|
|
# define EAI_CANCELED -101 /* Request canceled. */
|
|
# define EAI_NOTCANCELED -102 /* Request not canceled. */
|
|
# define EAI_NOTCANCELED -102 /* Request not canceled. */
|
|
@@ -655,8 +663,10 @@ struct addrinfo
|
|
# define EAI_IDN_ENCODE -105 /* IDN encoding failed. */
|
|
# define EAI_IDN_ENCODE -105 /* IDN encoding failed. */
|
|
# endif
|
|
# endif
|
|
|
|
|
|
-# define NI_MAXHOST 1025
|
|
+# ifdef __USE_MISC
|
|
-# define NI_MAXSERV 32
|
|
+# define NI_MAXHOST 1025
|
|
|
|
+# define NI_MAXSERV 32
|
|
|
|
+# endif
|
|
|
|
|
|
# define NI_NUMERICHOST 1 /* Don't try to look up hostname. */
|
|
# define NI_NUMERICHOST 1 /* Don't try to look up hostname. */
|
|
# define NI_NUMERICSERV 2 /* Don't convert port number to name. */
|
|
# define NI_NUMERICSERV 2 /* Don't convert port number to name. */
|