xref: /titanic_50/usr/src/lib/libresolv2/include/irs.h (revision 7c478bd95313f5f23a4c958a745db2134aa03244)
1*7c478bd9Sstevel@tonic-gate /*
2*7c478bd9Sstevel@tonic-gate  * Copyright 2003 Sun Microsystems, Inc.  All rights reserved.
3*7c478bd9Sstevel@tonic-gate  * Use is subject to license terms.
4*7c478bd9Sstevel@tonic-gate  */
5*7c478bd9Sstevel@tonic-gate 
6*7c478bd9Sstevel@tonic-gate /*
7*7c478bd9Sstevel@tonic-gate  * Copyright (c) 1996,1999 by Internet Software Consortium.
8*7c478bd9Sstevel@tonic-gate  *
9*7c478bd9Sstevel@tonic-gate  * Permission to use, copy, modify, and distribute this software for any
10*7c478bd9Sstevel@tonic-gate  * purpose with or without fee is hereby granted, provided that the above
11*7c478bd9Sstevel@tonic-gate  * copyright notice and this permission notice appear in all copies.
12*7c478bd9Sstevel@tonic-gate  *
13*7c478bd9Sstevel@tonic-gate  * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS
14*7c478bd9Sstevel@tonic-gate  * ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
15*7c478bd9Sstevel@tonic-gate  * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE
16*7c478bd9Sstevel@tonic-gate  * CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
17*7c478bd9Sstevel@tonic-gate  * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
18*7c478bd9Sstevel@tonic-gate  * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
19*7c478bd9Sstevel@tonic-gate  * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
20*7c478bd9Sstevel@tonic-gate  * SOFTWARE.
21*7c478bd9Sstevel@tonic-gate  */
22*7c478bd9Sstevel@tonic-gate 
23*7c478bd9Sstevel@tonic-gate #pragma ident	"%Z%%M%	%I%	%E% SMI"
24*7c478bd9Sstevel@tonic-gate 
25*7c478bd9Sstevel@tonic-gate /*
26*7c478bd9Sstevel@tonic-gate  * $Id: irs.h,v 8.9 2003/04/29 05:51:13 marka Exp $
27*7c478bd9Sstevel@tonic-gate  */
28*7c478bd9Sstevel@tonic-gate 
29*7c478bd9Sstevel@tonic-gate #ifndef _IRS_H_INCLUDED
30*7c478bd9Sstevel@tonic-gate #define _IRS_H_INCLUDED
31*7c478bd9Sstevel@tonic-gate 
32*7c478bd9Sstevel@tonic-gate #include <sys/types.h>
33*7c478bd9Sstevel@tonic-gate 
34*7c478bd9Sstevel@tonic-gate #include <arpa/nameser.h>
35*7c478bd9Sstevel@tonic-gate 
36*7c478bd9Sstevel@tonic-gate #include <grp.h>
37*7c478bd9Sstevel@tonic-gate #include <netdb.h>
38*7c478bd9Sstevel@tonic-gate #include <resolv.h>
39*7c478bd9Sstevel@tonic-gate #include <pwd.h>
40*7c478bd9Sstevel@tonic-gate 
41*7c478bd9Sstevel@tonic-gate /*
42*7c478bd9Sstevel@tonic-gate  * This is the group map class.
43*7c478bd9Sstevel@tonic-gate  */
44*7c478bd9Sstevel@tonic-gate struct irs_gr {
45*7c478bd9Sstevel@tonic-gate 	void *		private;
46*7c478bd9Sstevel@tonic-gate 	void		(*close) __P((struct irs_gr *));
47*7c478bd9Sstevel@tonic-gate 	struct group *	(*next) __P((struct irs_gr *));
48*7c478bd9Sstevel@tonic-gate 	struct group *	(*byname) __P((struct irs_gr *, const char *));
49*7c478bd9Sstevel@tonic-gate 	struct group *	(*bygid) __P((struct irs_gr *, gid_t));
50*7c478bd9Sstevel@tonic-gate 	int		(*list) __P((struct irs_gr *, const char *,
51*7c478bd9Sstevel@tonic-gate 				     gid_t, gid_t *, int *));
52*7c478bd9Sstevel@tonic-gate 	void		(*rewind) __P((struct irs_gr *));
53*7c478bd9Sstevel@tonic-gate 	void		(*minimize) __P((struct irs_gr *));
54*7c478bd9Sstevel@tonic-gate 	struct __res_state * (*res_get) __P((struct irs_gr *));
55*7c478bd9Sstevel@tonic-gate 	void		(*res_set) __P((struct irs_gr *, res_state,
56*7c478bd9Sstevel@tonic-gate 					void (*)(void *)));
57*7c478bd9Sstevel@tonic-gate };
58*7c478bd9Sstevel@tonic-gate 
59*7c478bd9Sstevel@tonic-gate /*
60*7c478bd9Sstevel@tonic-gate  * This is the password map class.
61*7c478bd9Sstevel@tonic-gate  */
62*7c478bd9Sstevel@tonic-gate struct irs_pw {
63*7c478bd9Sstevel@tonic-gate 	void *		private;
64*7c478bd9Sstevel@tonic-gate 	void		(*close) __P((struct irs_pw *));
65*7c478bd9Sstevel@tonic-gate 	struct passwd *	(*next) __P((struct irs_pw *));
66*7c478bd9Sstevel@tonic-gate 	struct passwd *	(*byname) __P((struct irs_pw *, const char *));
67*7c478bd9Sstevel@tonic-gate 	struct passwd *	(*byuid) __P((struct irs_pw *, uid_t));
68*7c478bd9Sstevel@tonic-gate 	void		(*rewind) __P((struct irs_pw *));
69*7c478bd9Sstevel@tonic-gate 	void		(*minimize) __P((struct irs_pw *));
70*7c478bd9Sstevel@tonic-gate 	struct __res_state * (*res_get) __P((struct irs_pw *));
71*7c478bd9Sstevel@tonic-gate 	void		(*res_set) __P((struct irs_pw *, res_state,
72*7c478bd9Sstevel@tonic-gate 					void (*)(void *)));
73*7c478bd9Sstevel@tonic-gate };
74*7c478bd9Sstevel@tonic-gate 
75*7c478bd9Sstevel@tonic-gate /*
76*7c478bd9Sstevel@tonic-gate  * This is the service map class.
77*7c478bd9Sstevel@tonic-gate  */
78*7c478bd9Sstevel@tonic-gate struct irs_sv {
79*7c478bd9Sstevel@tonic-gate 	void *		private;
80*7c478bd9Sstevel@tonic-gate 	void		(*close) __P((struct irs_sv *));
81*7c478bd9Sstevel@tonic-gate 	struct servent *(*byname) __P((struct irs_sv *,
82*7c478bd9Sstevel@tonic-gate 				       const char *, const char *));
83*7c478bd9Sstevel@tonic-gate 	struct servent *(*byport) __P((struct irs_sv *, int, const char *));
84*7c478bd9Sstevel@tonic-gate 	struct servent *(*next) __P((struct irs_sv *));
85*7c478bd9Sstevel@tonic-gate 	void		(*rewind) __P((struct irs_sv *));
86*7c478bd9Sstevel@tonic-gate 	void		(*minimize) __P((struct irs_sv *));
87*7c478bd9Sstevel@tonic-gate 	struct __res_state * (*res_get) __P((struct irs_sv *));
88*7c478bd9Sstevel@tonic-gate 	void		(*res_set) __P((struct irs_sv *, res_state,
89*7c478bd9Sstevel@tonic-gate 					void (*)(void *)));
90*7c478bd9Sstevel@tonic-gate };
91*7c478bd9Sstevel@tonic-gate 
92*7c478bd9Sstevel@tonic-gate /*
93*7c478bd9Sstevel@tonic-gate  * This is the protocols map class.
94*7c478bd9Sstevel@tonic-gate  */
95*7c478bd9Sstevel@tonic-gate struct irs_pr {
96*7c478bd9Sstevel@tonic-gate 	void *		private;
97*7c478bd9Sstevel@tonic-gate 	void		(*close) __P((struct irs_pr *));
98*7c478bd9Sstevel@tonic-gate 	struct protoent	*(*byname) __P((struct irs_pr *, const char *));
99*7c478bd9Sstevel@tonic-gate 	struct protoent	*(*bynumber) __P((struct irs_pr *, int));
100*7c478bd9Sstevel@tonic-gate 	struct protoent	*(*next) __P((struct irs_pr *));
101*7c478bd9Sstevel@tonic-gate 	void		(*rewind) __P((struct irs_pr *));
102*7c478bd9Sstevel@tonic-gate 	void		(*minimize) __P((struct irs_pr *));
103*7c478bd9Sstevel@tonic-gate 	struct __res_state * (*res_get) __P((struct irs_pr *));
104*7c478bd9Sstevel@tonic-gate 	void		(*res_set) __P((struct irs_pr *, res_state,
105*7c478bd9Sstevel@tonic-gate 					void (*)(void *)));
106*7c478bd9Sstevel@tonic-gate };
107*7c478bd9Sstevel@tonic-gate 
108*7c478bd9Sstevel@tonic-gate /*
109*7c478bd9Sstevel@tonic-gate  * This is the hosts map class.
110*7c478bd9Sstevel@tonic-gate  */
111*7c478bd9Sstevel@tonic-gate struct irs_ho {
112*7c478bd9Sstevel@tonic-gate 	void *		private;
113*7c478bd9Sstevel@tonic-gate 	void		(*close) __P((struct irs_ho *));
114*7c478bd9Sstevel@tonic-gate 	struct hostent *(*byname) __P((struct irs_ho *, const char *));
115*7c478bd9Sstevel@tonic-gate 	struct hostent *(*byname2) __P((struct irs_ho *, const char *, int));
116*7c478bd9Sstevel@tonic-gate 	struct hostent *(*byaddr) __P((struct irs_ho *,
117*7c478bd9Sstevel@tonic-gate 				       const void *, int, int));
118*7c478bd9Sstevel@tonic-gate 	struct hostent *(*next) __P((struct irs_ho *));
119*7c478bd9Sstevel@tonic-gate 	void		(*rewind) __P((struct irs_ho *));
120*7c478bd9Sstevel@tonic-gate 	void		(*minimize) __P((struct irs_ho *));
121*7c478bd9Sstevel@tonic-gate 	struct __res_state * (*res_get) __P((struct irs_ho *));
122*7c478bd9Sstevel@tonic-gate 	void		(*res_set) __P((struct irs_ho *, res_state,
123*7c478bd9Sstevel@tonic-gate 					void (*)(void *)));
124*7c478bd9Sstevel@tonic-gate 	struct addrinfo *(*addrinfo) __P((struct irs_ho *, const char *,
125*7c478bd9Sstevel@tonic-gate 					  const struct addrinfo *));
126*7c478bd9Sstevel@tonic-gate };
127*7c478bd9Sstevel@tonic-gate 
128*7c478bd9Sstevel@tonic-gate /*
129*7c478bd9Sstevel@tonic-gate  * This is the networks map class.
130*7c478bd9Sstevel@tonic-gate  */
131*7c478bd9Sstevel@tonic-gate struct irs_nw {
132*7c478bd9Sstevel@tonic-gate 	void *		private;
133*7c478bd9Sstevel@tonic-gate 	void		(*close) __P((struct irs_nw *));
134*7c478bd9Sstevel@tonic-gate 	struct nwent *	(*byname) __P((struct irs_nw *, const char *, int));
135*7c478bd9Sstevel@tonic-gate 	struct nwent *	(*byaddr) __P((struct irs_nw *, void *, int, int));
136*7c478bd9Sstevel@tonic-gate 	struct nwent *	(*next) __P((struct irs_nw *));
137*7c478bd9Sstevel@tonic-gate 	void		(*rewind) __P((struct irs_nw *));
138*7c478bd9Sstevel@tonic-gate 	void		(*minimize) __P((struct irs_nw *));
139*7c478bd9Sstevel@tonic-gate 	struct __res_state * (*res_get) __P((struct irs_nw *));
140*7c478bd9Sstevel@tonic-gate 	void		(*res_set) __P((struct irs_nw *, res_state,
141*7c478bd9Sstevel@tonic-gate 					void (*)(void *)));
142*7c478bd9Sstevel@tonic-gate };
143*7c478bd9Sstevel@tonic-gate 
144*7c478bd9Sstevel@tonic-gate /*
145*7c478bd9Sstevel@tonic-gate  * This is the netgroups map class.
146*7c478bd9Sstevel@tonic-gate  */
147*7c478bd9Sstevel@tonic-gate struct irs_ng {
148*7c478bd9Sstevel@tonic-gate 	void *		private;
149*7c478bd9Sstevel@tonic-gate 	void		(*close) __P((struct irs_ng *));
150*7c478bd9Sstevel@tonic-gate 	int		(*next) __P((struct irs_ng *, const char **,
151*7c478bd9Sstevel@tonic-gate 				     const char **, const char **));
152*7c478bd9Sstevel@tonic-gate 	int		(*test) __P((struct irs_ng *, const char *,
153*7c478bd9Sstevel@tonic-gate 				     const char *, const char *,
154*7c478bd9Sstevel@tonic-gate 				     const char *));
155*7c478bd9Sstevel@tonic-gate 	void		(*rewind) __P((struct irs_ng *, const char *));
156*7c478bd9Sstevel@tonic-gate 	void		(*minimize) __P((struct irs_ng *));
157*7c478bd9Sstevel@tonic-gate };
158*7c478bd9Sstevel@tonic-gate 
159*7c478bd9Sstevel@tonic-gate /*
160*7c478bd9Sstevel@tonic-gate  * This is the generic map class, which copies the front of all others.
161*7c478bd9Sstevel@tonic-gate  */
162*7c478bd9Sstevel@tonic-gate struct irs_map {
163*7c478bd9Sstevel@tonic-gate 	void *		private;
164*7c478bd9Sstevel@tonic-gate 	void		(*close) __P((void *));
165*7c478bd9Sstevel@tonic-gate };
166*7c478bd9Sstevel@tonic-gate 
167*7c478bd9Sstevel@tonic-gate /*
168*7c478bd9Sstevel@tonic-gate  * This is the accessor class.  It contains pointers to all of the
169*7c478bd9Sstevel@tonic-gate  * initializers for the map classes for a particular accessor.
170*7c478bd9Sstevel@tonic-gate  */
171*7c478bd9Sstevel@tonic-gate struct irs_acc {
172*7c478bd9Sstevel@tonic-gate 	void *		private;
173*7c478bd9Sstevel@tonic-gate 	void		(*close) __P((struct irs_acc *));
174*7c478bd9Sstevel@tonic-gate 	struct irs_gr *	(*gr_map) __P((struct irs_acc *));
175*7c478bd9Sstevel@tonic-gate 	struct irs_pw *	(*pw_map) __P((struct irs_acc *));
176*7c478bd9Sstevel@tonic-gate 	struct irs_sv *	(*sv_map) __P((struct irs_acc *));
177*7c478bd9Sstevel@tonic-gate 	struct irs_pr *	(*pr_map) __P((struct irs_acc *));
178*7c478bd9Sstevel@tonic-gate 	struct irs_ho *	(*ho_map) __P((struct irs_acc *));
179*7c478bd9Sstevel@tonic-gate 	struct irs_nw *	(*nw_map) __P((struct irs_acc *));
180*7c478bd9Sstevel@tonic-gate 	struct irs_ng *	(*ng_map) __P((struct irs_acc *));
181*7c478bd9Sstevel@tonic-gate 	struct __res_state * (*res_get) __P((struct irs_acc *));
182*7c478bd9Sstevel@tonic-gate 	void		(*res_set) __P((struct irs_acc *, res_state,
183*7c478bd9Sstevel@tonic-gate 					void (*)(void *)));
184*7c478bd9Sstevel@tonic-gate };
185*7c478bd9Sstevel@tonic-gate 
186*7c478bd9Sstevel@tonic-gate /*
187*7c478bd9Sstevel@tonic-gate  * This is because the official definition of "struct netent" has no
188*7c478bd9Sstevel@tonic-gate  * concept of CIDR even though it allows variant address families (on
189*7c478bd9Sstevel@tonic-gate  * output but not input).  The compatibility stubs convert the structs
190*7c478bd9Sstevel@tonic-gate  * below into "struct netent"'s.
191*7c478bd9Sstevel@tonic-gate  */
192*7c478bd9Sstevel@tonic-gate struct nwent {
193*7c478bd9Sstevel@tonic-gate 	char		*n_name;	/* official name of net */
194*7c478bd9Sstevel@tonic-gate 	char		**n_aliases;	/* alias list */
195*7c478bd9Sstevel@tonic-gate 	int		n_addrtype;	/* net address type */
196*7c478bd9Sstevel@tonic-gate 	void		*n_addr;	/* network address */
197*7c478bd9Sstevel@tonic-gate 	int		n_length;	/* address length, in bits */
198*7c478bd9Sstevel@tonic-gate };
199*7c478bd9Sstevel@tonic-gate 
200*7c478bd9Sstevel@tonic-gate /*
201*7c478bd9Sstevel@tonic-gate  * Hide external function names from POSIX.
202*7c478bd9Sstevel@tonic-gate  */
203*7c478bd9Sstevel@tonic-gate #define	irs_gen_acc	__irs_gen_acc
204*7c478bd9Sstevel@tonic-gate #define	irs_lcl_acc	__irs_lcl_acc
205*7c478bd9Sstevel@tonic-gate #define	irs_dns_acc	__irs_dns_acc
206*7c478bd9Sstevel@tonic-gate #define	irs_nis_acc	__irs_nis_acc
207*7c478bd9Sstevel@tonic-gate #define	irs_irp_acc	__irs_irp_acc
208*7c478bd9Sstevel@tonic-gate #ifdef	ORIGINAL_ISC_CODE
209*7c478bd9Sstevel@tonic-gate #define	irs_destroy	__irs_destroy
210*7c478bd9Sstevel@tonic-gate #else
211*7c478bd9Sstevel@tonic-gate #endif
212*7c478bd9Sstevel@tonic-gate #define	irs_dns_gr	__irs_dns_gr
213*7c478bd9Sstevel@tonic-gate #define	irs_dns_ho	__irs_dns_ho
214*7c478bd9Sstevel@tonic-gate #define	irs_dns_nw	__irs_dns_nw
215*7c478bd9Sstevel@tonic-gate #define	irs_dns_pr	__irs_dns_pr
216*7c478bd9Sstevel@tonic-gate #define	irs_dns_pw	__irs_dns_pw
217*7c478bd9Sstevel@tonic-gate #define	irs_dns_sv	__irs_dns_sv
218*7c478bd9Sstevel@tonic-gate #define	irs_gen_gr	__irs_gen_gr
219*7c478bd9Sstevel@tonic-gate #define	irs_gen_ho	__irs_gen_ho
220*7c478bd9Sstevel@tonic-gate #define	irs_gen_ng	__irs_gen_ng
221*7c478bd9Sstevel@tonic-gate #define	irs_gen_nw	__irs_gen_nw
222*7c478bd9Sstevel@tonic-gate #define	irs_gen_pr	__irs_gen_pr
223*7c478bd9Sstevel@tonic-gate #define	irs_gen_pw	__irs_gen_pw
224*7c478bd9Sstevel@tonic-gate #define	irs_gen_sv	__irs_gen_sv
225*7c478bd9Sstevel@tonic-gate #define	irs_irp_get_full_response	__irs_irp_get_full_response
226*7c478bd9Sstevel@tonic-gate #define	irs_irp_gr	__irs_irp_gr
227*7c478bd9Sstevel@tonic-gate #define	irs_irp_ho	__irs_irp_ho
228*7c478bd9Sstevel@tonic-gate #define	irs_irp_is_connected	__irs_irp_is_connected
229*7c478bd9Sstevel@tonic-gate #define	irs_irp_ng	__irs_irp_ng
230*7c478bd9Sstevel@tonic-gate #define	irs_irp_nw	__irs_irp_nw
231*7c478bd9Sstevel@tonic-gate #define	irs_irp_pr	__irs_irp_pr
232*7c478bd9Sstevel@tonic-gate #define	irs_irp_pw	__irs_irp_pw
233*7c478bd9Sstevel@tonic-gate #define	irs_irp_read_line	__irs_irp_read_line
234*7c478bd9Sstevel@tonic-gate #define	irs_irp_sv	__irs_irp_sv
235*7c478bd9Sstevel@tonic-gate #define	irs_lcl_gr	__irs_lcl_gr
236*7c478bd9Sstevel@tonic-gate #define	irs_lcl_ho	__irs_lcl_ho
237*7c478bd9Sstevel@tonic-gate #define	irs_lcl_ng	__irs_lcl_ng
238*7c478bd9Sstevel@tonic-gate #define	irs_lcl_nw	__irs_lcl_nw
239*7c478bd9Sstevel@tonic-gate #define	irs_lcl_pr	__irs_lcl_pr
240*7c478bd9Sstevel@tonic-gate #define	irs_lcl_pw	__irs_lcl_pw
241*7c478bd9Sstevel@tonic-gate #define	irs_lcl_sv	__irs_lcl_sv
242*7c478bd9Sstevel@tonic-gate #define	irs_nis_gr	__irs_nis_gr
243*7c478bd9Sstevel@tonic-gate #define	irs_nis_ho	__irs_nis_ho
244*7c478bd9Sstevel@tonic-gate #define	irs_nis_ng	__irs_nis_ng
245*7c478bd9Sstevel@tonic-gate #define	irs_nis_nw	__irs_nis_nw
246*7c478bd9Sstevel@tonic-gate #define	irs_nis_pr	__irs_nis_pr
247*7c478bd9Sstevel@tonic-gate #define	irs_nis_pw	__irs_nis_pw
248*7c478bd9Sstevel@tonic-gate #define	irs_nis_sv	__irs_nis_sv
249*7c478bd9Sstevel@tonic-gate #define	net_data_create	__net_data_create
250*7c478bd9Sstevel@tonic-gate #define	net_data_destroy	__net_data_destroy
251*7c478bd9Sstevel@tonic-gate #ifdef	ORIGINAL_ISC_CODE
252*7c478bd9Sstevel@tonic-gate #define	net_data_minimize	__net_data_minimize
253*7c478bd9Sstevel@tonic-gate #else
254*7c478bd9Sstevel@tonic-gate #endif
255*7c478bd9Sstevel@tonic-gate 
256*7c478bd9Sstevel@tonic-gate /*
257*7c478bd9Sstevel@tonic-gate  * Externs.
258*7c478bd9Sstevel@tonic-gate  */
259*7c478bd9Sstevel@tonic-gate extern struct irs_acc *	irs_gen_acc __P((const char *options,
260*7c478bd9Sstevel@tonic-gate 					 const char *conf_file));
261*7c478bd9Sstevel@tonic-gate extern struct irs_acc *	irs_lcl_acc __P((const char *options));
262*7c478bd9Sstevel@tonic-gate extern struct irs_acc *	irs_dns_acc __P((const char *options));
263*7c478bd9Sstevel@tonic-gate extern struct irs_acc *	irs_nis_acc __P((const char *options));
264*7c478bd9Sstevel@tonic-gate extern struct irs_acc *	irs_irp_acc __P((const char *options));
265*7c478bd9Sstevel@tonic-gate 
266*7c478bd9Sstevel@tonic-gate extern void		irs_destroy(void);
267*7c478bd9Sstevel@tonic-gate 
268*7c478bd9Sstevel@tonic-gate /*
269*7c478bd9Sstevel@tonic-gate  * These forward declarations are for the semi-private functions in
270*7c478bd9Sstevel@tonic-gate  * the get*.c files. Each of these funcs implements the real get*
271*7c478bd9Sstevel@tonic-gate  * functionality and the standard versions are just wrappers that
272*7c478bd9Sstevel@tonic-gate  * call these. Apart from the wrappers, only irpd is expected to
273*7c478bd9Sstevel@tonic-gate  * call these directly, hence these decls are put here and not in
274*7c478bd9Sstevel@tonic-gate  * the /usr/include replacements.
275*7c478bd9Sstevel@tonic-gate  */
276*7c478bd9Sstevel@tonic-gate 
277*7c478bd9Sstevel@tonic-gate struct net_data;			/* forward */
278*7c478bd9Sstevel@tonic-gate 
279*7c478bd9Sstevel@tonic-gate /*
280*7c478bd9Sstevel@tonic-gate  * net_data_create gets a singleton net_data object.  net_data_init
281*7c478bd9Sstevel@tonic-gate  * creates as many net_data objects as times it is called.  Clients using
282*7c478bd9Sstevel@tonic-gate  * the default interface will use net_data_create by default.  Servers will
283*7c478bd9Sstevel@tonic-gate  * probably want net_data_init (one call per client)
284*7c478bd9Sstevel@tonic-gate  */
285*7c478bd9Sstevel@tonic-gate struct net_data *net_data_create(const char *conf_file);
286*7c478bd9Sstevel@tonic-gate struct net_data *net_data_init(const char *conf_file);
287*7c478bd9Sstevel@tonic-gate void		net_data_destroy(void *p);
288*7c478bd9Sstevel@tonic-gate 
289*7c478bd9Sstevel@tonic-gate extern struct group    *getgrent_p __P((struct net_data *net_data));
290*7c478bd9Sstevel@tonic-gate extern struct group    *getgrnam_p __P((const char *name,
291*7c478bd9Sstevel@tonic-gate 					struct net_data *net_data));
292*7c478bd9Sstevel@tonic-gate extern struct group    *getgrgid_p __P((gid_t gid,
293*7c478bd9Sstevel@tonic-gate 					struct net_data *net_data));
294*7c478bd9Sstevel@tonic-gate extern int 		setgroupent_p __P((int stayopen,
295*7c478bd9Sstevel@tonic-gate 					   struct net_data *net_data));
296*7c478bd9Sstevel@tonic-gate extern void 		endgrent_p __P((struct net_data *net_data));
297*7c478bd9Sstevel@tonic-gate extern int		getgrouplist_p __P((const char *name,
298*7c478bd9Sstevel@tonic-gate 					    gid_t basegid,
299*7c478bd9Sstevel@tonic-gate 					    gid_t *groups,
300*7c478bd9Sstevel@tonic-gate 					    int *ngroups,
301*7c478bd9Sstevel@tonic-gate 					    struct net_data *net_data));
302*7c478bd9Sstevel@tonic-gate 
303*7c478bd9Sstevel@tonic-gate #ifdef SETGRENT_VOID
304*7c478bd9Sstevel@tonic-gate extern void 		setgrent_p __P((struct net_data *net_data));
305*7c478bd9Sstevel@tonic-gate #else
306*7c478bd9Sstevel@tonic-gate extern int 		setgrent_p __P((struct net_data *net_data));
307*7c478bd9Sstevel@tonic-gate #endif
308*7c478bd9Sstevel@tonic-gate 
309*7c478bd9Sstevel@tonic-gate extern struct hostent 	*gethostbyname_p __P((const char *name,
310*7c478bd9Sstevel@tonic-gate 					      struct net_data *net_data));
311*7c478bd9Sstevel@tonic-gate extern struct hostent 	*gethostbyname2_p __P((const char *name, int af,
312*7c478bd9Sstevel@tonic-gate 					       struct net_data *net_data));
313*7c478bd9Sstevel@tonic-gate extern struct hostent 	*gethostbyaddr_p __P((const char *addr, int len,
314*7c478bd9Sstevel@tonic-gate 					      int af,
315*7c478bd9Sstevel@tonic-gate 					      struct net_data *net_data));
316*7c478bd9Sstevel@tonic-gate extern struct hostent 	*gethostent_p __P((struct net_data *net_data));
317*7c478bd9Sstevel@tonic-gate extern void 		sethostent_p __P((int stayopen,
318*7c478bd9Sstevel@tonic-gate 					  struct net_data *net_data));
319*7c478bd9Sstevel@tonic-gate extern void 		endhostent_p __P((struct net_data *net_data));
320*7c478bd9Sstevel@tonic-gate extern struct hostent 	*getipnodebyname_p __P((const char *name, int af,
321*7c478bd9Sstevel@tonic-gate 					       int flags, int *errp,
322*7c478bd9Sstevel@tonic-gate 					       struct net_data *net_data));
323*7c478bd9Sstevel@tonic-gate extern struct hostent 	*getipnodebyaddr_p __P((const void *addr, size_t len,
324*7c478bd9Sstevel@tonic-gate 					      int af, int *errp,
325*7c478bd9Sstevel@tonic-gate 					      struct net_data *net_data));
326*7c478bd9Sstevel@tonic-gate 
327*7c478bd9Sstevel@tonic-gate extern struct netent 	*getnetent_p __P((struct net_data *net_data));
328*7c478bd9Sstevel@tonic-gate extern struct netent 	*getnetbyname_p __P((const char *name,
329*7c478bd9Sstevel@tonic-gate 					     struct net_data *net_data));
330*7c478bd9Sstevel@tonic-gate extern struct netent 	*getnetbyaddr_p __P((unsigned long net, int type,
331*7c478bd9Sstevel@tonic-gate 					     struct net_data *net_data));
332*7c478bd9Sstevel@tonic-gate extern void		setnetent_p __P((int stayopen,
333*7c478bd9Sstevel@tonic-gate 					 struct net_data *net_data));
334*7c478bd9Sstevel@tonic-gate extern void		endnetent_p __P((struct net_data *net_data));
335*7c478bd9Sstevel@tonic-gate 
336*7c478bd9Sstevel@tonic-gate extern void		setnetgrent_p __P((const char *netgroup,
337*7c478bd9Sstevel@tonic-gate 					   struct net_data *net_data));
338*7c478bd9Sstevel@tonic-gate extern void		endnetgrent_p __P((struct net_data *net_data));
339*7c478bd9Sstevel@tonic-gate extern int		innetgr_p __P((const char *netgroup,
340*7c478bd9Sstevel@tonic-gate 				       const char *host,
341*7c478bd9Sstevel@tonic-gate 				       const char *user,
342*7c478bd9Sstevel@tonic-gate 				       const char *domain,
343*7c478bd9Sstevel@tonic-gate 				       struct net_data *net_data));
344*7c478bd9Sstevel@tonic-gate extern int		getnetgrent_p __P((const char **host, const char **user,
345*7c478bd9Sstevel@tonic-gate 						const char **domain,
346*7c478bd9Sstevel@tonic-gate 						struct net_data *net_data));
347*7c478bd9Sstevel@tonic-gate 
348*7c478bd9Sstevel@tonic-gate extern struct protoent  *getprotoent_p __P((struct net_data *net_data));
349*7c478bd9Sstevel@tonic-gate extern struct protoent  *getprotobyname_p __P((const char *name,
350*7c478bd9Sstevel@tonic-gate 					       struct net_data *net_data));
351*7c478bd9Sstevel@tonic-gate extern struct protoent	*getprotobynumber_p __P((int proto,
352*7c478bd9Sstevel@tonic-gate 						 struct net_data *net_data));
353*7c478bd9Sstevel@tonic-gate extern void		setprotoent_p __P((int stayopen,
354*7c478bd9Sstevel@tonic-gate 					   struct net_data *net_data));
355*7c478bd9Sstevel@tonic-gate extern void		endprotoent_p __P((struct net_data *net_data));
356*7c478bd9Sstevel@tonic-gate 
357*7c478bd9Sstevel@tonic-gate 
358*7c478bd9Sstevel@tonic-gate extern struct passwd 	*getpwent_p __P((struct net_data *net_data));
359*7c478bd9Sstevel@tonic-gate extern struct passwd 	*getpwnam_p __P((const char *name,
360*7c478bd9Sstevel@tonic-gate 					 struct net_data *net_data));
361*7c478bd9Sstevel@tonic-gate extern struct passwd 	*getpwuid_p __P((uid_t uid,
362*7c478bd9Sstevel@tonic-gate 					 struct net_data *net_data));
363*7c478bd9Sstevel@tonic-gate extern int		setpassent_p __P((int stayopen,
364*7c478bd9Sstevel@tonic-gate 					  struct net_data *net_data));
365*7c478bd9Sstevel@tonic-gate extern void		endpwent_p __P((struct net_data *net_data));
366*7c478bd9Sstevel@tonic-gate 
367*7c478bd9Sstevel@tonic-gate #ifdef SETPWENT_VOID
368*7c478bd9Sstevel@tonic-gate extern void		setpwent_p __P((struct net_data *net_data));
369*7c478bd9Sstevel@tonic-gate #else
370*7c478bd9Sstevel@tonic-gate extern int		setpwent_p __P((struct net_data *net_data));
371*7c478bd9Sstevel@tonic-gate #endif
372*7c478bd9Sstevel@tonic-gate 
373*7c478bd9Sstevel@tonic-gate extern struct servent 	*getservent_p __P((struct net_data *net_data));
374*7c478bd9Sstevel@tonic-gate extern struct servent 	*getservbyname_p __P((const char *name,
375*7c478bd9Sstevel@tonic-gate 					      const char *proto,
376*7c478bd9Sstevel@tonic-gate 					      struct net_data *net_data));
377*7c478bd9Sstevel@tonic-gate extern struct servent 	*getservbyport_p __P((int port, const char *proto,
378*7c478bd9Sstevel@tonic-gate 					      struct net_data *net_data));
379*7c478bd9Sstevel@tonic-gate extern void		setservent_p __P((int stayopen,
380*7c478bd9Sstevel@tonic-gate 					  struct net_data *net_data));
381*7c478bd9Sstevel@tonic-gate extern void		endservent_p __P((struct net_data *net_data));
382*7c478bd9Sstevel@tonic-gate 
383*7c478bd9Sstevel@tonic-gate #endif /*_IRS_H_INCLUDED*/
384