Record CVE-2018-6551 in NEWS and ChangeLog [BZ #22774]
[glibc.git] / resolv / res_hconf.h
blob49096b1f901971e171ea3fe743449d8c23e269ad
1 /* Copyright (C) 1993-2018 Free Software Foundation, Inc.
2 This file is part of the GNU C Library.
3 Contributed by David Mosberger (davidm@azstarnet.com).
5 The GNU C Library is free software; you can redistribute it and/or
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.
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
13 Lesser General Public License for more details.
15 You should have received a copy of the GNU Lesser General Public
16 License along with the GNU C Library; if not, see
17 <http://www.gnu.org/licenses/>. */
19 #ifndef _RES_HCONF_H_
20 #define _RES_HCONF_H_
22 #include <netdb.h>
24 #define TRIMDOMAINS_MAX 4
26 struct hconf
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. */
37 int initialized;
38 int unused1;
39 int unused2[4];
40 int num_trimdomains;
41 const char *trimdomain[TRIMDOMAINS_MAX];
42 unsigned int flags;
43 # define HCONF_FLAG_INITED (1 << 0) /* initialized? */
44 # define HCONF_FLAG_REORDER (1 << 3) /* list best address first */
45 # define HCONF_FLAG_MULTI (1 << 4) /* see comments for gethtbyname() */
47 extern struct hconf _res_hconf;
49 extern void _res_hconf_init (void) attribute_hidden;
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);
54 #endif /* _RES_HCONF_H_ */