1*7c478bd9Sstevel@tonic-gate /*
2*7c478bd9Sstevel@tonic-gate  * Copyright (c) 1998-1999 by Sun Microsystems, Inc.
3*7c478bd9Sstevel@tonic-gate  */
4*7c478bd9Sstevel@tonic-gate 
5*7c478bd9Sstevel@tonic-gate #ifndef	_RESOLV_MT_H
6*7c478bd9Sstevel@tonic-gate #define	_RESOLV_MT_H
7*7c478bd9Sstevel@tonic-gate 
8*7c478bd9Sstevel@tonic-gate #pragma ident	"%Z%%M%	%I%	%E% SMI"
9*7c478bd9Sstevel@tonic-gate 
10*7c478bd9Sstevel@tonic-gate #ifdef	__cplusplus
11*7c478bd9Sstevel@tonic-gate extern "C" {
12*7c478bd9Sstevel@tonic-gate #endif
13*7c478bd9Sstevel@tonic-gate 
14*7c478bd9Sstevel@tonic-gate #ifdef	SUNW_MT_RESOLVER
15*7c478bd9Sstevel@tonic-gate 
16*7c478bd9Sstevel@tonic-gate #include <sys/types.h>
17*7c478bd9Sstevel@tonic-gate #include <netinet/in.h>
18*7c478bd9Sstevel@tonic-gate #include <arpa/nameser.h>
19*7c478bd9Sstevel@tonic-gate #include <resolv.h>
20*7c478bd9Sstevel@tonic-gate 
21*7c478bd9Sstevel@tonic-gate /* Access functions for the libresolv private interface */
22*7c478bd9Sstevel@tonic-gate 
23*7c478bd9Sstevel@tonic-gate int			__res_enable_mt(void);
24*7c478bd9Sstevel@tonic-gate int			__res_disable_mt(void);
25*7c478bd9Sstevel@tonic-gate 
26*7c478bd9Sstevel@tonic-gate /* Per-thread context */
27*7c478bd9Sstevel@tonic-gate 
28*7c478bd9Sstevel@tonic-gate typedef struct {
29*7c478bd9Sstevel@tonic-gate #ifdef SUNW_HOSTS_FALLBACK
30*7c478bd9Sstevel@tonic-gate 	int				no_hosts_fallback_private;
31*7c478bd9Sstevel@tonic-gate #endif /* SUNW_HOSTS_FALLBACK */
32*7c478bd9Sstevel@tonic-gate #ifdef	SUNW_OVERRIDE_RETRY
33*7c478bd9Sstevel@tonic-gate 	int				retry_save;
34*7c478bd9Sstevel@tonic-gate 	int				retry_private;
35*7c478bd9Sstevel@tonic-gate #endif	/* SUNW_OVERRIDE_RETRY */
36*7c478bd9Sstevel@tonic-gate 	char				inet_nsap_ntoa_tmpbuf[255*3];
37*7c478bd9Sstevel@tonic-gate 	char				sym_ntos_unname[20];
38*7c478bd9Sstevel@tonic-gate 	char				sym_ntop_unname[20];
39*7c478bd9Sstevel@tonic-gate 	char				p_option_nbuf[40];
40*7c478bd9Sstevel@tonic-gate 	char				p_time_nbuf[40];
41*7c478bd9Sstevel@tonic-gate 	char				precsize_ntoa_retbuf[sizeof "90000000.00"];
42*7c478bd9Sstevel@tonic-gate 	char				loc_ntoa_tmpbuf[sizeof
43*7c478bd9Sstevel@tonic-gate "1000 60 60.000 N 1000 60 60.000 W -12345678.00m 90000000.00m 90000000.00m 90000000.00m"];
44*7c478bd9Sstevel@tonic-gate 	char				p_secstodate_output[15];
45*7c478bd9Sstevel@tonic-gate } mtctxres_t;
46*7c478bd9Sstevel@tonic-gate 
47*7c478bd9Sstevel@tonic-gate /* Thread-specific data (TSD) */
48*7c478bd9Sstevel@tonic-gate 
49*7c478bd9Sstevel@tonic-gate extern mtctxres_t			*___mtctxres();
50*7c478bd9Sstevel@tonic-gate #define	mtctxres			(___mtctxres())
51*7c478bd9Sstevel@tonic-gate 
52*7c478bd9Sstevel@tonic-gate /* Various static data that should be TSD */
53*7c478bd9Sstevel@tonic-gate 
54*7c478bd9Sstevel@tonic-gate #define	sym_ntos_unname			(mtctxres->sym_ntos_unname)
55*7c478bd9Sstevel@tonic-gate #define	sym_ntop_unname			(mtctxres->sym_ntop_unname)
56*7c478bd9Sstevel@tonic-gate #define	inet_nsap_ntoa_tmpbuf		(mtctxres->inet_nsap_ntoa_tmpbuf)
57*7c478bd9Sstevel@tonic-gate #define	p_option_nbuf			(mtctxres->p_option_nbuf)
58*7c478bd9Sstevel@tonic-gate #define	p_time_nbuf			(mtctxres->p_time_nbuf)
59*7c478bd9Sstevel@tonic-gate #define	precsize_ntoa_retbuf		(mtctxres->precsize_ntoa_retbuf)
60*7c478bd9Sstevel@tonic-gate #define	loc_ntoa_tmpbuf			(mtctxres->loc_ntoa_tmpbuf)
61*7c478bd9Sstevel@tonic-gate #define	p_secstodate_output		(mtctxres->p_secstodate_output)
62*7c478bd9Sstevel@tonic-gate 
63*7c478bd9Sstevel@tonic-gate #endif /* SUNW_MT_RESOLVER */
64*7c478bd9Sstevel@tonic-gate 
65*7c478bd9Sstevel@tonic-gate #ifdef	__cplusplus
66*7c478bd9Sstevel@tonic-gate }
67*7c478bd9Sstevel@tonic-gate #endif
68*7c478bd9Sstevel@tonic-gate 
69*7c478bd9Sstevel@tonic-gate #endif /* _RESOLV_MT_H */
70