Update.
[glibc.git] / resolv / res_hconf.h
blobc2aeefbcd5be311c9bd28234417a42613db72ce5
1 /* Copyright (C) 1993, 1995, 1996, 1997 Free Software Foundation, Inc.
2 Contributed by David Mosberger (davidm@azstarnet.com).
4 The GNU C Library is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Library General Public License as
6 published by the Free Software Foundation; either version 2 of the
7 License, or (at your option) any later version.
9 The GNU C Library is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 Library General Public License for more details.
14 You should have received a copy of the GNU Library General Public
15 License along with the GNU C Library; see the file COPYING.LIB. If not,
16 write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17 Boston, MA 02111-1307, USA. */
19 #ifndef _RES_HCONF_H_
20 #define _RES_HCONF_H_
22 #include <netdb.h>
24 #define TRIMDOMAINS_MAX 4
26 enum Name_Service {
27 SERVICE_NONE = 0,
28 SERVICE_BIND, SERVICE_HOSTS, SERVICE_NIS,
29 SERVICE_MAX
32 struct hconf {
33 int num_services;
34 enum Name_Service service[SERVICE_MAX];
35 int num_trimdomains;
36 const char * trimdomain[TRIMDOMAINS_MAX];
37 unsigned flags;
38 # define HCONF_FLAG_INITED (1 << 0) /* initialized? */
39 # define HCONF_FLAG_SPOOF (1 << 1) /* refuse spoofed addresses */
40 # define HCONF_FLAG_SPOOFALERT (1 << 2) /* syslog warning of spoofed */
41 # define HCONF_FLAG_REORDER (1 << 3) /* list best address first */
42 # define HCONF_FLAG_MULTI (1 << 4) /* see comments for gethtbyname() */
43 } _res_hconf;
45 extern void _res_hconf_init (void);
46 extern void _res_hconf_trim_domain (char * domain);
47 extern void _res_hconf_trim_domains (struct hostent * hp);
48 extern void _res_hconf_reorder_addrs (struct hostent * hp);
50 #endif /* _RES_HCONF_H_ */