Blame resolv/res_hconf.h

Packit 6c4009
/* Copyright (C) 1993-2018 Free Software Foundation, Inc.
Packit 6c4009
   This file is part of the GNU C Library.
Packit 6c4009
   Contributed by David Mosberger (davidm@azstarnet.com).
Packit 6c4009
Packit 6c4009
   The GNU C Library is free software; you can redistribute it and/or
Packit 6c4009
   modify it under the terms of the GNU Lesser General Public
Packit 6c4009
   License as published by the Free Software Foundation; either
Packit 6c4009
   version 2.1 of the License, or (at your option) any later version.
Packit 6c4009
Packit 6c4009
   The GNU C Library is distributed in the hope that it will be useful,
Packit 6c4009
   but WITHOUT ANY WARRANTY; without even the implied warranty of
Packit 6c4009
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Packit 6c4009
   Lesser General Public License for more details.
Packit 6c4009
Packit 6c4009
   You should have received a copy of the GNU Lesser General Public
Packit 6c4009
   License along with the GNU C Library; if not, see
Packit 6c4009
   <http://www.gnu.org/licenses/>.  */
Packit 6c4009
Packit 6c4009
#ifndef _RES_HCONF_H_
Packit 6c4009
#define _RES_HCONF_H_
Packit 6c4009
Packit 6c4009
#include <netdb.h>
Packit 6c4009
Packit 6c4009
#define TRIMDOMAINS_MAX	4
Packit 6c4009
Packit 6c4009
struct hconf
Packit 6c4009
{
Packit 6c4009
  /* We keep the INITIALIZED member only for backwards compatibility.  New
Packit 6c4009
     code should just call _res_hconf_init unconditionally.  For this field
Packit 6c4009
     to be used safely, users must ensure that either (1) a call to
Packit 6c4009
     _res_hconf_init happens-before any load from INITIALIZED, or (2) an
Packit 6c4009
     assignment of zero to INITIALIZED happens-before any load from it, and
Packit 6c4009
     these loads use acquire MO if the intent is to skip calling
Packit 6c4009
     _res_hconf_init if the load returns a nonzero value.  Such acquire MO
Packit 6c4009
     loads will then synchronize with the release MO store to INITIALIZED
Packit 6c4009
     in do_init in res_hconf.c; see pthread_once for more detail.  */
Packit 6c4009
  int initialized;
Packit 6c4009
  int unused1;
Packit 6c4009
  int unused2[4];
Packit 6c4009
  int num_trimdomains;
Packit 6c4009
  const char *trimdomain[TRIMDOMAINS_MAX];
Packit 6c4009
  unsigned int flags;
Packit 6c4009
#  define HCONF_FLAG_INITED	(1 << 0) /* initialized? */
Packit 6c4009
#  define HCONF_FLAG_REORDER	(1 << 3) /* list best address first */
Packit 6c4009
#  define HCONF_FLAG_MULTI	(1 << 4) /* see comments for gethtbyname() */
Packit 6c4009
};
Packit 6c4009
extern struct hconf _res_hconf;
Packit 6c4009
Packit 6c4009
extern void _res_hconf_init (void) attribute_hidden;
Packit 6c4009
extern void _res_hconf_trim_domain (char *domain);
Packit 6c4009
extern void _res_hconf_trim_domains (struct hostent *hp);
Packit 6c4009
extern void _res_hconf_reorder_addrs (struct hostent *hp);
Packit 6c4009
Packit 6c4009
#endif /* _RES_HCONF_H_ */