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