]>
Commit | Line | Data |
---|---|---|
04277e02 | 1 | /* Copyright (C) 1993-2019 Free Software Foundation, Inc. |
41bdb6e2 | 2 | This file is part of the GNU C Library. |
fa0bc87c RM |
3 | Contributed by David Mosberger (davidm@azstarnet.com). |
4 | ||
c84142e8 | 5 | The GNU C Library is free software; you can redistribute it and/or |
41bdb6e2 AJ |
6 | modify it under the terms of the GNU Lesser General Public |
7 | License as published by the Free Software Foundation; either | |
8 | version 2.1 of the License, or (at your option) any later version. | |
fa0bc87c | 9 | |
c84142e8 UD |
10 | The GNU C Library is distributed in the hope that it will be useful, |
11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
41bdb6e2 | 13 | Lesser General Public License for more details. |
fa0bc87c | 14 | |
41bdb6e2 | 15 | You should have received a copy of the GNU Lesser General Public |
59ba27a6 PE |
16 | License along with the GNU C Library; if not, see |
17 | <http://www.gnu.org/licenses/>. */ | |
fa0bc87c RM |
18 | |
19 | #ifndef _RES_HCONF_H_ | |
20 | #define _RES_HCONF_H_ | |
21 | ||
22 | #include <netdb.h> | |
23 | ||
24 | #define TRIMDOMAINS_MAX 4 | |
25 | ||
5edb9387 UD |
26 | struct hconf |
27 | { | |
6f9d4f59 TR |
28 | /* We keep the INITIALIZED member only for backwards compatibility. New |
29 | code should just call _res_hconf_init unconditionally. For this field | |
30 | to be used safely, users must ensure that either (1) a call to | |
31 | _res_hconf_init happens-before any load from INITIALIZED, or (2) an | |
32 | assignment of zero to INITIALIZED happens-before any load from it, and | |
33 | these loads use acquire MO if the intent is to skip calling | |
34 | _res_hconf_init if the load returns a nonzero value. Such acquire MO | |
35 | loads will then synchronize with the release MO store to INITIALIZED | |
36 | in do_init in res_hconf.c; see pthread_once for more detail. */ | |
5edb9387 | 37 | int initialized; |
b9c65d09 UD |
38 | int unused1; |
39 | int unused2[4]; | |
5edb9387 UD |
40 | int num_trimdomains; |
41 | const char *trimdomain[TRIMDOMAINS_MAX]; | |
42 | unsigned int flags; | |
fa0bc87c | 43 | # define HCONF_FLAG_INITED (1 << 0) /* initialized? */ |
fa0bc87c RM |
44 | # define HCONF_FLAG_REORDER (1 << 3) /* list best address first */ |
45 | # define HCONF_FLAG_MULTI (1 << 4) /* see comments for gethtbyname() */ | |
5edb9387 UD |
46 | }; |
47 | extern struct hconf _res_hconf; | |
fa0bc87c | 48 | |
e6b4e2de | 49 | extern void _res_hconf_init (void) attribute_hidden; |
5edb9387 UD |
50 | extern void _res_hconf_trim_domain (char *domain); |
51 | extern void _res_hconf_trim_domains (struct hostent *hp); | |
52 | extern void _res_hconf_reorder_addrs (struct hostent *hp); | |
fa0bc87c RM |
53 | |
54 | #endif /* _RES_HCONF_H_ */ |