xref: /titanic_50/usr/src/lib/libresolv2/include/port_netdb.h (revision 3d729aecc03ea6ebb9bd5d56b8dccd24f57daa41)
1 /*
2  * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
3  * Use is subject to license terms.
4  */
5 
6 
7 #ifndef _PORT_NETDB_H
8 #define	_PORT_NETDB_H
9 
10 #ifdef	__cplusplus
11 extern "C" {
12 #endif
13 
14 /* AI_NUMERICSERV is not a valid flag for getaddrinfo */
15 #define	AI_MASK		0x0038	/* mask of valid flags */
16 
17 /* EAI_OVERFLOW was removed from ISC */
18 #define	EAI_BADHINTS  12
19 
20 /*
21  * these are libresolv2 functions that were renamed in previous versions to
22  * res_* because they conflict with libnsl or libsocket
23  */
24 
25 #define	endhostent res_endhostent /* libnsl */
26 void endhostent __P((void));
27 #define	endnetent res_endnetent  /* libsocket */
28 void endnetent __P((void));
29 #define	freeaddrinfo res_freeaddrinfo /* libsocket */
30 void freeaddrinfo __P((struct addrinfo *));
31 #define	freehostent res_freehostent  /* libsocket and libnsl */
32 void freehostent __P((struct hostent *));
33 #define	getaddrinfo res_getaddrinfo  /* libsocket */
34 int getaddrinfo __P((const char *, const char *,
35 				const struct addrinfo *, struct addrinfo **));
36 #define	gethostbyaddr res_gethostbyaddr /* libnsl */
37 struct hostent *gethostbyaddr __P((const char *, int, int));
38 #define	gethostbyname res_gethostbyname /* libnsl */
39 struct hostent *gethostbyname __P((const char *));
40 #define	gethostbyname2 res_gethostbyname2 /* lib/nsswitch/dns */
41 struct hostent *gethostbyname2 __P((const char *, int));
42 #define	gethostent res_gethostent  /* libnsl */
43 struct hostent *gethostent __P((void));
44 #define	getipnodebyaddr res_getipnodebyaddr  /* libnsl and libsocket */
45 struct hostent *getipnodebyaddr __P((const void *, size_t, int, int *));
46 #define	getipnodebyname res_getipnodebyname  /* libnsl and libsocket */
47 struct hostent *getipnodebyname __P((const char *, int, int, int *));
48 
49 #define	getnetbyaddr res_getnetbyaddr /* libsocket */
50 struct netent *getnetbyaddr __P((unsigned long, int));
51 #define	getnetbyname res_getnetbyname /* libsocket */
52 struct netent *getnetbyname __P((const char *));
53 #define	getnetent res_getnetent /* libsocket */
54 struct netent *getnetent __P((void));
55 #define	sethostent res_sethostent /* libnsl */
56 void sethostent __P((int));
57 #define	setnetent res_setnetent /* libsocket */
58 void setnetent __P((int));
59 
60 /*
61  * these are other irs functions now included in libresolv.so.2. We rename the
62  * ones that overlap with libsocket or libnsl
63  */
64 
65 /* endprotoent is in libsocket.so.1 */
66 #define	endprotoent res_endprotoent
67 void		endprotoent __P((void));
68 
69 /* endservent is in libsocket.so.1 */
70 #define	endservent res_endservent
71 void		endservent __P((void));
72 
73 /* note: the next two symbols are variables, not functions */
74 
75 /* gai_errlist is in libsocket.so.1 */
76 #define	gai_errlist res_gai_errlist
77 
78 /* gai_nerr is in libsocket.so.1 */
79 #define	gai_nerr res_gai_nerr
80 
81 /* gai_strerror is in libsocket.so.1 */
82 #define	gai_strerror res_gai_strerror
83 const char *gai_strerror __P((int ecode));
84 
85 /* gethostbyaddr_r is in libnsl.so.1 */
86 #define	gethostbyaddr_r res_gethostbyaddr_r
87 struct hostent *gethostbyaddr_r __P((const char *addr, int len, int type,
88 				struct hostent *hptr, char *buf,
89 				int buflen, int *h_errnop));
90 
91 /* gethostbyname_r is in libnsl.so.1 */
92 #define	gethostbyname_r res_gethostbyname_r
93 struct hostent *gethostbyname_r __P((const char *name,	 struct hostent *hptr,
94 				char *buf, int buflen, int *h_errnop));
95 
96 /* gethostent_r is in libnsl.so.1 */
97 #define	gethostent_r res_gethostent_r
98 struct hostent *gethostent_r __P((struct hostent *hptr, char *buf, int buflen,
99 				int *h_errnop));
100 
101 /* getnameinfo is in libsocket.so.1 */
102 #define	getnameinfo res_getnameinfo
103 int getnameinfo __P((const struct sockaddr *, size_t, char *,
104 				size_t, char *, size_t, int));
105 
106 /* getnetbyaddr_r is in libsocket.so.1 */
107 #define	getnetbyaddr_r res_getnetbyaddr_r
108 struct netent *getnetbyaddr_r __P((long, int, struct netent *, char *, int));
109 
110 /* getnetbyname_r is in libsocket.so.1 */
111 #define	getnetbyname_r res_getnetbyname_r
112 struct netent *getnetbyname_r __P((const char *, struct netent *, char *, int));
113 
114 /* getnetent_r is in libsocket.so.1 */
115 #define	getnetent_r res_getnetent_r
116 struct netent *getnetent_r __P((struct netent *, char *, int));
117 
118 /* getprotobyname is in libsocket.so.1 */
119 #define	getprotobyname res_getprotobyname
120 struct protoent	*getprotobyname __P((const char *));
121 
122 /* getprotobyname_r is in libsocket.so.1 */
123 #define	getprotobyname_r res_getprotobyname_r
124 struct protoent	*getprotobyname_r __P((const char *, struct protoent *,
125 				char *, int));
126 
127 /* getprotobynumber is in libsocket.so.1 */
128 #define	getprotobynumber res_getprotobynumber
129 struct protoent	*getprotobynumber __P((int));
130 
131 /* getprotobynumber_r is in libsocket.so.1 */
132 #define	getprotobynumber_r res_getprotobynumber_r
133 struct protoent	*getprotobynumber_r __P((int,
134 				struct protoent *, char *, int));
135 
136 /* getprotoent is in libsocket.so.1 */
137 #define	getprotoent res_getprotoent
138 struct protoent	*getprotoent __P((void));
139 
140 /* getprotoent_r is in libsocket.so.1 */
141 #define	getprotoent_r res_getprotoent_r
142 struct protoent	*getprotoent_r __P((struct protoent *, char *, int));
143 
144 /* getservbyname is in libsocket.so.1 and libnsl.so.1 */
145 #define	getservbyname res_getservbyname
146 struct servent *getservbyname __P((const char *, const char *));
147 
148 /* getservbyname_r is in libsocket.so.1 and libnsl.so.1 */
149 #define	getservbyname_r res_getservbyname_r
150 struct servent *getservbyname_r __P((const char *name, const char *,
151 				struct servent *, char *, int));
152 
153 /* getservbyport is in libsocket.so.1 and libnsl.so.1 */
154 #define	getservbyport res_getservbyport
155 struct servent *getservbyport __P((int, const char *));
156 
157 /* getservbyport_r is in libsocket.so.1 and libnsl.so.1 */
158 #define	getservbyport_r res_getservbyport_r
159 struct servent *getservbyport_r __P((int port, const char *,
160 				struct servent *, char *, int));
161 
162 /* getservent is in libsocket.so.1 */
163 #define	getservent res_getservent
164 struct servent *getservent __P((void));
165 
166 /* getservent_r is in libsocket.so.1 */
167 #define	getservent_r res_getservent_r
168 struct servent *getservent_r __P((struct servent *, char *, int));
169 
170 /* innetgr is in libsocket.so.1 */
171 #define	innetgr res_innetgr
172 int innetgr __P((const char *, const char *, const char *, const char *));
173 
174 /* setprotoent is in libsocket.so.1 */
175 #define	setprotoent res_setprotoent
176 void setprotoent __P((int));
177 
178 /* setservent is in libsocket.so.1 */
179 #define	setservent res_setservent
180 void setservent __P((int));
181 
182 
183 
184 #ifdef	__cplusplus
185 }
186 #endif
187 
188 #endif /* _PORT_NETDB_H */
189