1*75e1de3cSAugustin Cavalier /* $NetBSD: resolv_mt.h,v 1.1.1.3 2009/04/12 16:35:44 christos Exp $ */ 2*75e1de3cSAugustin Cavalier 3aa6411e2SAugustin Cavalier #ifndef _RESOLV_MT_H 4aa6411e2SAugustin Cavalier #define _RESOLV_MT_H 5aa6411e2SAugustin Cavalier 6aa6411e2SAugustin Cavalier #include <sys/types.h> 7aa6411e2SAugustin Cavalier #include <netinet/in.h> 8aa6411e2SAugustin Cavalier #include <arpa/nameser.h> 9aa6411e2SAugustin Cavalier #include <resolv.h> 10aa6411e2SAugustin Cavalier 11aa6411e2SAugustin Cavalier /* Access functions for the libresolv private interface */ 12aa6411e2SAugustin Cavalier 13aa6411e2SAugustin Cavalier int __res_enable_mt(void); 14aa6411e2SAugustin Cavalier int __res_disable_mt(void); 15aa6411e2SAugustin Cavalier 16aa6411e2SAugustin Cavalier /* Per-thread context */ 17aa6411e2SAugustin Cavalier 18aa6411e2SAugustin Cavalier typedef struct { 19aa6411e2SAugustin Cavalier int no_hosts_fallback_private; 20aa6411e2SAugustin Cavalier int retry_save; 21aa6411e2SAugustin Cavalier int retry_private; 22aa6411e2SAugustin Cavalier char inet_nsap_ntoa_tmpbuf[255*3]; 23aa6411e2SAugustin Cavalier char sym_ntos_unname[20]; 24aa6411e2SAugustin Cavalier char sym_ntop_unname[20]; 25aa6411e2SAugustin Cavalier char p_option_nbuf[40]; 26aa6411e2SAugustin Cavalier char p_time_nbuf[40]; 27aa6411e2SAugustin Cavalier char precsize_ntoa_retbuf[sizeof "90000000.00"]; 28aa6411e2SAugustin Cavalier char loc_ntoa_tmpbuf[sizeof 29aa6411e2SAugustin Cavalier "1000 60 60.000 N 1000 60 60.000 W -12345678.00m 90000000.00m 90000000.00m 90000000.00m"]; 30aa6411e2SAugustin Cavalier char p_secstodate_output[15]; 31aa6411e2SAugustin Cavalier } mtctxres_t; 32aa6411e2SAugustin Cavalier 33aa6411e2SAugustin Cavalier /* Thread-specific data (TSD) */ 34aa6411e2SAugustin Cavalier 35aa6411e2SAugustin Cavalier mtctxres_t *___mtctxres(void); 36aa6411e2SAugustin Cavalier #define mtctxres (___mtctxres()) 37aa6411e2SAugustin Cavalier 38aa6411e2SAugustin Cavalier /* Various static data that should be TSD */ 39aa6411e2SAugustin Cavalier 40aa6411e2SAugustin Cavalier #define sym_ntos_unname (mtctxres->sym_ntos_unname) 41aa6411e2SAugustin Cavalier #define sym_ntop_unname (mtctxres->sym_ntop_unname) 42aa6411e2SAugustin Cavalier #define inet_nsap_ntoa_tmpbuf (mtctxres->inet_nsap_ntoa_tmpbuf) 43aa6411e2SAugustin Cavalier #define p_option_nbuf (mtctxres->p_option_nbuf) 44aa6411e2SAugustin Cavalier #define p_time_nbuf (mtctxres->p_time_nbuf) 45aa6411e2SAugustin Cavalier #define precsize_ntoa_retbuf (mtctxres->precsize_ntoa_retbuf) 46aa6411e2SAugustin Cavalier #define loc_ntoa_tmpbuf (mtctxres->loc_ntoa_tmpbuf) 47aa6411e2SAugustin Cavalier #define p_secstodate_output (mtctxres->p_secstodate_output) 48aa6411e2SAugustin Cavalier 49aa6411e2SAugustin Cavalier #endif /* _RESOLV_MT_H */ 50