"Fossies" - the Fresh Open Source Software Archive

Member "bind-9.16.7/lib/irs/include/irs/resconf.h" (4 Sep 2020, 2700 Bytes) of package /linux/misc/dns/bind9/9.16.7/bind-9.16.7.tar.xz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "resconf.h" see the Fossies "Dox" file reference documentation.

    1 /*
    2  * Copyright (C) Internet Systems Consortium, Inc. ("ISC")
    3  *
    4  * This Source Code Form is subject to the terms of the Mozilla Public
    5  * License, v. 2.0. If a copy of the MPL was not distributed with this
    6  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
    7  *
    8  * See the COPYRIGHT file distributed with this work for additional
    9  * information regarding copyright ownership.
   10  */
   11 
   12 #ifndef IRS_RESCONF_H
   13 #define IRS_RESCONF_H 1
   14 
   15 /*! \file
   16  *
   17  * \brief
   18  * The IRS resconf module parses the legacy "/etc/resolv.conf" file and
   19  * creates the corresponding configuration objects for the DNS library
   20  * modules.
   21  */
   22 
   23 #include <irs/types.h>
   24 
   25 /*%
   26  * A DNS search list specified in the 'domain' or 'search' statements
   27  * in the "resolv.conf" file.
   28  */
   29 typedef struct irs_resconf_search {
   30     char *domain;
   31     ISC_LINK(struct irs_resconf_search) link;
   32 } irs_resconf_search_t;
   33 
   34 typedef ISC_LIST(irs_resconf_search_t) irs_resconf_searchlist_t;
   35 
   36 ISC_LANG_BEGINDECLS
   37 
   38 isc_result_t
   39 irs_resconf_load(isc_mem_t *mctx, const char *filename, irs_resconf_t **confp);
   40 /*%<
   41  * Load the resolver configuration file 'filename' in the "resolv.conf" format,
   42  * and create a new irs_resconf_t object from the configuration.  If the file
   43  * is not found ISC_R_FILENOTFOUND is returned with the structure initialized
   44  * as if file contained only:
   45  *
   46  *  nameserver ::1
   47  *  nameserver 127.0.0.1
   48  *
   49  * Notes:
   50  *
   51  *\li   Currently, only the following options are supported:
   52  *  nameserver, domain, search, sortlist, ndots, and options.
   53  *  In addition, 'sortlist' is not actually effective; it's parsed, but
   54  *  the application cannot use the configuration.
   55  *
   56  * Returns:
   57  * \li  ISC_R_SUCCESS on success
   58  * \li  ISC_R_FILENOTFOUND if the file was not found. *confp will be valid.
   59  * \li  other on error.
   60  *
   61  * Requires:
   62  *
   63  *\li   'mctx' is a valid memory context.
   64  *
   65  *\li   'filename' != NULL
   66  *
   67  *\li   'confp' != NULL && '*confp' == NULL
   68  */
   69 
   70 void
   71 irs_resconf_destroy(irs_resconf_t **confp);
   72 /*%<
   73  * Destroy the resconf object.
   74  *
   75  * Requires:
   76  *
   77  *\li   '*confp' is a valid resconf object.
   78  *
   79  * Ensures:
   80  *
   81  *\li   *confp == NULL
   82  */
   83 
   84 isc_sockaddrlist_t *
   85 irs_resconf_getnameservers(irs_resconf_t *conf);
   86 /*%<
   87  * Return a list of name server addresses stored in 'conf'.
   88  *
   89  * Requires:
   90  *
   91  *\li   'conf' is a valid resconf object.
   92  */
   93 
   94 irs_resconf_searchlist_t *
   95 irs_resconf_getsearchlist(irs_resconf_t *conf);
   96 /*%<
   97  * Return the search list stored in 'conf'.
   98  *
   99  * Requires:
  100  *
  101  *\li   'conf' is a valid resconf object.
  102  */
  103 
  104 unsigned int
  105 irs_resconf_getndots(irs_resconf_t *conf);
  106 /*%<
  107  * Return the 'ndots' value stored in 'conf'.
  108  *
  109  * Requires:
  110  *
  111  *\li   'conf' is a valid resconf object.
  112  */
  113 
  114 ISC_LANG_ENDDECLS
  115 
  116 #endif /* IRS_RESCONF_H */