2 #include <glibc-compat/include/rpc/netdb.h>
3 #include <resolv/netdb.h>
5 /* Macros for accessing h_errno from inside libc. */
6 # ifdef _LIBC_REENTRANT
11 # define h_errno __libc_h_errno
13 # define h_errno h_errno /* For #ifndef h_errno tests. */
15 extern __thread
int h_errno attribute_tls_model_ie
;
16 # define __set_h_errno(x) (h_errno = (x))
19 __set_h_errno (int __err
)
21 return *__h_errno_location () = __err
;
26 # define __set_h_errno(x) (h_errno = (x))
28 # endif /* _LIBC_REENTRANT */
30 /* Document internal interfaces. */
31 extern int __gethostent_r (struct hostent
*__restrict __result_buf
,
32 char *__restrict __buf
, size_t __buflen
,
33 struct hostent
**__restrict __result
,
34 int *__restrict __h_errnop
);
35 extern int __old_gethostent_r (struct hostent
*__restrict __result_buf
,
36 char *__restrict __buf
, size_t __buflen
,
37 struct hostent
**__restrict __result
,
38 int *__restrict __h_errnop
);
40 extern int __gethostbyaddr_r (__const
void *__restrict __addr
,
41 socklen_t __len
, int __type
,
42 struct hostent
*__restrict __result_buf
,
43 char *__restrict __buf
, size_t __buflen
,
44 struct hostent
**__restrict __result
,
45 int *__restrict __h_errnop
);
46 extern int __old_gethostbyaddr_r (__const
void *__restrict __addr
,
47 socklen_t __len
, int __type
,
48 struct hostent
*__restrict __result_buf
,
49 char *__restrict __buf
, size_t __buflen
,
50 struct hostent
**__restrict __result
,
51 int *__restrict __h_errnop
);
53 extern int __gethostbyname_r (__const
char *__restrict __name
,
54 struct hostent
*__restrict __result_buf
,
55 char *__restrict __buf
, size_t __buflen
,
56 struct hostent
**__restrict __result
,
57 int *__restrict __h_errnop
);
58 extern int __old_gethostbyname_r (__const
char *__restrict __name
,
59 struct hostent
*__restrict __result_buf
,
60 char *__restrict __buf
, size_t __buflen
,
61 struct hostent
**__restrict __result
,
62 int *__restrict __h_errnop
);
64 extern int __gethostbyname2_r (__const
char *__restrict __name
, int __af
,
65 struct hostent
*__restrict __result_buf
,
66 char *__restrict __buf
, size_t __buflen
,
67 struct hostent
**__restrict __result
,
68 int *__restrict __h_errnop
);
69 extern int __old_gethostbyname2_r (__const
char *__restrict __name
, int __af
,
70 struct hostent
*__restrict __result_buf
,
71 char *__restrict __buf
, size_t __buflen
,
72 struct hostent
**__restrict __result
,
73 int *__restrict __h_errnop
);
75 extern int __getnetent_r (struct netent
*__restrict __result_buf
,
76 char *__restrict __buf
, size_t __buflen
,
77 struct netent
**__restrict __result
,
78 int *__restrict __h_errnop
);
79 extern int __old_getnetent_r (struct netent
*__restrict __result_buf
,
80 char *__restrict __buf
, size_t __buflen
,
81 struct netent
**__restrict __result
,
82 int *__restrict __h_errnop
);
84 extern int __getnetbyaddr_r (uint32_t __net
, int __type
,
85 struct netent
*__restrict __result_buf
,
86 char *__restrict __buf
, size_t __buflen
,
87 struct netent
**__restrict __result
,
88 int *__restrict __h_errnop
);
89 extern int __old_getnetbyaddr_r (uint32_t __net
, int __type
,
90 struct netent
*__restrict __result_buf
,
91 char *__restrict __buf
, size_t __buflen
,
92 struct netent
**__restrict __result
,
93 int *__restrict __h_errnop
);
95 extern int __getnetbyname_r (__const
char *__restrict __name
,
96 struct netent
*__restrict __result_buf
,
97 char *__restrict __buf
, size_t __buflen
,
98 struct netent
**__restrict __result
,
99 int *__restrict __h_errnop
);
100 extern int __old_getnetbyname_r (__const
char *__restrict __name
,
101 struct netent
*__restrict __result_buf
,
102 char *__restrict __buf
, size_t __buflen
,
103 struct netent
**__restrict __result
,
104 int *__restrict __h_errnop
);
106 extern int __getservent_r (struct servent
*__restrict __result_buf
,
107 char *__restrict __buf
, size_t __buflen
,
108 struct servent
**__restrict __result
);
109 extern int __old_getservent_r (struct servent
*__restrict __result_buf
,
110 char *__restrict __buf
, size_t __buflen
,
111 struct servent
**__restrict __result
);
113 extern int __getservbyname_r (__const
char *__restrict __name
,
114 __const
char *__restrict __proto
,
115 struct servent
*__restrict __result_buf
,
116 char *__restrict __buf
, size_t __buflen
,
117 struct servent
**__restrict __result
);
118 extern int __old_getservbyname_r (__const
char *__restrict __name
,
119 __const
char *__restrict __proto
,
120 struct servent
*__restrict __result_buf
,
121 char *__restrict __buf
, size_t __buflen
,
122 struct servent
**__restrict __result
);
124 extern int __getservbyport_r (int __port
,
125 __const
char *__restrict __proto
,
126 struct servent
*__restrict __result_buf
,
127 char *__restrict __buf
, size_t __buflen
,
128 struct servent
**__restrict __result
);
129 extern int __old_getservbyport_r (int __port
,
130 __const
char *__restrict __proto
,
131 struct servent
*__restrict __result_buf
,
132 char *__restrict __buf
, size_t __buflen
,
133 struct servent
**__restrict __result
);
135 extern int __getprotoent_r (struct protoent
*__restrict __result_buf
,
136 char *__restrict __buf
, size_t __buflen
,
137 struct protoent
**__restrict __result
);
138 extern int __old_getprotoent_r (struct protoent
*__restrict __result_buf
,
139 char *__restrict __buf
, size_t __buflen
,
140 struct protoent
**__restrict __result
);
142 extern int __getprotobyname_r (__const
char *__restrict __name
,
143 struct protoent
*__restrict __result_buf
,
144 char *__restrict __buf
, size_t __buflen
,
145 struct protoent
**__restrict __result
);
146 extern int __old_getprotobyname_r (__const
char *__restrict __name
,
147 struct protoent
*__restrict __result_buf
,
148 char *__restrict __buf
, size_t __buflen
,
149 struct protoent
**__restrict __result
);
151 extern int __getprotobynumber_r (int __proto
,
152 struct protoent
*__restrict __res_buf
,
153 char *__restrict __buf
, size_t __buflen
,
154 struct protoent
**__restrict __result
);
155 extern int __old_getprotobynumber_r (int __proto
,
156 struct protoent
*__restrict __res_buf
,
157 char *__restrict __buf
, size_t __buflen
,
158 struct protoent
**__restrict __result
);
160 extern int __getnetgrent_r (char **__restrict __hostp
,
161 char **__restrict __userp
,
162 char **__restrict __domainp
,
163 char *__restrict __buffer
, size_t __buflen
);
165 extern int ruserpass (const char *host
, const char **aname
,
169 /* The following declarations and definitions have been removed from
170 the public header since we don't want people to use them. */
172 #define AI_V4MAPPED 0x0008 /* IPv4-mapped addresses are acceptable. */
173 #define AI_ALL 0x0010 /* Return both IPv4 and IPv6 addresses. */
174 #define AI_ADDRCONFIG 0x0020 /* Use configuration of this host to choose
175 returned address type. */
176 #define AI_DEFAULT (AI_V4MAPPED | AI_ADDRCONFIG)
178 #endif /* !_NETDB_H */