"Fossies" - the Fresh Open Source Software Archive

Member "bind-9.17.5/lib/dns/include/dns/dbtable.h" (4 Sep 2020, 3166 Bytes) of package /linux/misc/dns/bind9/9.17.5/bind-9.17.5.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 "dbtable.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 DNS_DBTABLE_H
   13 #define DNS_DBTABLE_H 1
   14 
   15 /*****
   16 ***** Module Info
   17 *****/
   18 
   19 /*! \file dns/dbtable.h
   20  * \brief
   21  * DNS DB Tables
   22  *
   23  * XXX TBS XXX
   24  *
   25  * MP:
   26  *\li   The module ensures appropriate synchronization of data structures it
   27  *  creates and manipulates.
   28  *
   29  * Reliability:
   30  *\li   No anticipated impact.
   31  *
   32  * Resources:
   33  *\li   None.
   34  *
   35  * Security:
   36  *\li   No anticipated impact.
   37  *
   38  * Standards:
   39  *\li   None.
   40  */
   41 
   42 #include <isc/lang.h>
   43 
   44 #include <dns/types.h>
   45 
   46 #define DNS_DBTABLEFIND_NOEXACT 0x01
   47 
   48 ISC_LANG_BEGINDECLS
   49 
   50 isc_result_t
   51 dns_dbtable_create(isc_mem_t *mctx, dns_rdataclass_t rdclass,
   52            dns_dbtable_t **dbtablep);
   53 /*%<
   54  * Make a new dbtable of class 'rdclass'
   55  *
   56  * Requires:
   57  *\li   mctx != NULL
   58  * \li  dbtablep != NULL && *dptablep == NULL
   59  *\li   'rdclass' is a valid class
   60  *
   61  * Returns:
   62  *\li   #ISC_R_SUCCESS
   63  *\li   #ISC_R_NOMEMORY
   64  *\li   #ISC_R_UNEXPECTED
   65  */
   66 
   67 void
   68 dns_dbtable_attach(dns_dbtable_t *source, dns_dbtable_t **targetp);
   69 /*%<
   70  * Attach '*targetp' to 'source'.
   71  *
   72  * Requires:
   73  *
   74  *\li   'source' is a valid dbtable.
   75  *
   76  *\li   'targetp' points to a NULL dns_dbtable_t *.
   77  *
   78  * Ensures:
   79  *
   80  *\li   *targetp is attached to source.
   81  */
   82 
   83 void
   84 dns_dbtable_detach(dns_dbtable_t **dbtablep);
   85 /*%<
   86  * Detach *dbtablep from its dbtable.
   87  *
   88  * Requires:
   89  *
   90  *\li   '*dbtablep' points to a valid dbtable.
   91  *
   92  * Ensures:
   93  *
   94  *\li   *dbtablep is NULL.
   95  *
   96  *\li   If '*dbtablep' is the last reference to the dbtable,
   97  *      all resources used by the dbtable will be freed
   98  */
   99 
  100 isc_result_t
  101 dns_dbtable_add(dns_dbtable_t *dbtable, dns_db_t *db);
  102 /*%<
  103  * Add 'db' to 'dbtable'.
  104  *
  105  * Requires:
  106  *\li   'dbtable' is a valid dbtable.
  107  *
  108  *\li   'db' is a valid database with the same class as 'dbtable'
  109  */
  110 
  111 void
  112 dns_dbtable_remove(dns_dbtable_t *dbtable, dns_db_t *db);
  113 /*%<
  114  * Remove 'db' from 'dbtable'.
  115  *
  116  * Requires:
  117  *\li   'db' was previously added to 'dbtable'.
  118  */
  119 
  120 void
  121 dns_dbtable_adddefault(dns_dbtable_t *dbtable, dns_db_t *db);
  122 /*%<
  123  * Use 'db' as the result of a dns_dbtable_find() if no better match is
  124  * available.
  125  */
  126 
  127 void
  128 dns_dbtable_getdefault(dns_dbtable_t *dbtable, dns_db_t **db);
  129 /*%<
  130  * Get the 'db' used as the result of a dns_dbtable_find()
  131  * if no better match is available.
  132  */
  133 
  134 void
  135 dns_dbtable_removedefault(dns_dbtable_t *dbtable);
  136 /*%<
  137  * Remove the default db from 'dbtable'.
  138  */
  139 
  140 isc_result_t
  141 dns_dbtable_find(dns_dbtable_t *dbtable, const dns_name_t *name,
  142          unsigned int options, dns_db_t **dbp);
  143 /*%<
  144  * Find the deepest match to 'name' in the dbtable, and return it
  145  *
  146  * Notes:
  147  *\li   If the DNS_DBTABLEFIND_NOEXACT option is set, the best partial
  148  *  match (if any) to 'name' will be returned.
  149  *
  150  * Returns:
  151  * \li #ISC_R_SUCCESS       on success
  152  *\li        something else:        no default and match
  153  */
  154 
  155 ISC_LANG_ENDDECLS
  156 
  157 #endif /* DNS_DBTABLE_H */