|
1 /* |
|
2 * This version of this file is derived from Android 2.3 "Gingerbread", |
|
3 * which contains uncredited changes by Android/Google developers. It has |
|
4 * been modified in 2011 for use in the Android build of Mozilla Firefox by |
|
5 * Mozilla contributors (including Michael Edwards <m.k.edwards@gmail.com>, |
|
6 * and Steve Workman <sjhworkman@gmail.com>). |
|
7 * These changes are offered under the same license as the original NetBSD |
|
8 * file, whose copyright and license are unchanged above. |
|
9 */ |
|
10 |
|
11 #ifndef _RESOLV_STATIC_H |
|
12 #define _RESOLV_STATIC_H |
|
13 |
|
14 #include <netdb.h> |
|
15 |
|
16 /* this structure contains all the variables that were declared |
|
17 * 'static' in the original NetBSD resolver code. |
|
18 * |
|
19 * this caused vast amounts of crashes and memory corruptions |
|
20 * when the resolver was being used by multiple threads. |
|
21 * |
|
22 * (note: the OpenBSD/FreeBSD resolver has similar 'issues') |
|
23 */ |
|
24 |
|
25 #define MAXALIASES 35 |
|
26 #define MAXADDRS 35 |
|
27 |
|
28 typedef struct res_static { |
|
29 char* h_addr_ptrs[MAXADDRS + 1]; |
|
30 char* host_aliases[MAXALIASES]; |
|
31 char hostbuf[8*1024]; |
|
32 u_int32_t host_addr[16 / sizeof(u_int32_t)]; /* IPv4 or IPv6 */ |
|
33 FILE* hostf; |
|
34 int stayopen; |
|
35 const char* servent_ptr; |
|
36 struct servent servent; |
|
37 struct hostent host; |
|
38 } *res_static; |
|
39 |
|
40 extern res_static __res_get_static(void); |
|
41 |
|
42 #endif /* _RESOLV_STATIC_H */ |