"Fossies" - the Fresh Open Source Software Archive

Member "bind-9.16.7/lib/dns/include/dns/lookup.h" (4 Sep 2020, 2917 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 "lookup.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_LOOKUP_H
   13 #define DNS_LOOKUP_H 1
   14 
   15 /*****
   16 ***** Module Info
   17 *****/
   18 
   19 /*! \file dns/lookup.h
   20  * \brief
   21  * The lookup module performs simple DNS lookups.  It implements
   22  * the full resolver algorithm, both looking for local data and
   23  * resolving external names as necessary.
   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   TBS
   34  *
   35  * Security:
   36  *\li   No anticipated impact.
   37  *
   38  * Standards:
   39  *\li   RFCs:   1034, 1035, 2181, TBS
   40  *\li   Drafts: TBS
   41  */
   42 
   43 #include <isc/event.h>
   44 #include <isc/lang.h>
   45 
   46 #include <dns/types.h>
   47 
   48 ISC_LANG_BEGINDECLS
   49 
   50 /*%
   51  * A 'dns_lookupevent_t' is returned when a lookup completes.
   52  * The sender field will be set to the lookup that completed.  If 'result'
   53  * is ISC_R_SUCCESS, then 'names' will contain a list of names associated
   54  * with the address.  The recipient of the event must not change the list
   55  * and must not refer to any of the name data after the event is freed.
   56  */
   57 typedef struct dns_lookupevent {
   58     ISC_EVENT_COMMON(struct dns_lookupevent);
   59     isc_result_t    result;
   60     dns_name_t *    name;
   61     dns_rdataset_t *rdataset;
   62     dns_rdataset_t *sigrdataset;
   63     dns_db_t *  db;
   64     dns_dbnode_t *  node;
   65 } dns_lookupevent_t;
   66 
   67 isc_result_t
   68 dns_lookup_create(isc_mem_t *mctx, const dns_name_t *name, dns_rdatatype_t type,
   69           dns_view_t *view, unsigned int options, isc_task_t *task,
   70           isc_taskaction_t action, void *arg, dns_lookup_t **lookupp);
   71 /*%<
   72  * Finds the rrsets matching 'name' and 'type'.
   73  *
   74  * Requires:
   75  *
   76  *\li   'mctx' is a valid mctx.
   77  *
   78  *\li   'name' is a valid name.
   79  *
   80  *\li   'view' is a valid view which has a resolver.
   81  *
   82  *\li   'task' is a valid task.
   83  *
   84  *\li   lookupp != NULL && *lookupp == NULL
   85  *
   86  * Returns:
   87  *
   88  *\li   ISC_R_SUCCESS
   89  *\li   ISC_R_NOMEMORY
   90  *
   91  *\li   Any resolver-related error (e.g. ISC_R_SHUTTINGDOWN) may also be
   92  *  returned.
   93  */
   94 
   95 void
   96 dns_lookup_cancel(dns_lookup_t *lookup);
   97 /*%<
   98  * Cancel 'lookup'.
   99  *
  100  * Notes:
  101  *
  102  *\li   If 'lookup' has not completed, post its LOOKUPDONE event with a
  103  *  result code of ISC_R_CANCELED.
  104  *
  105  * Requires:
  106  *
  107  *\li   'lookup' is a valid lookup.
  108  */
  109 
  110 void
  111 dns_lookup_destroy(dns_lookup_t **lookupp);
  112 /*%<
  113  * Destroy 'lookup'.
  114  *
  115  * Requires:
  116  *
  117  *\li   '*lookupp' is a valid lookup.
  118  *
  119  *\li   The caller has received the LOOKUPDONE event (either because the
  120  *  lookup completed or because dns_lookup_cancel() was called).
  121  *
  122  * Ensures:
  123  *
  124  *\li   *lookupp == NULL.
  125  */
  126 
  127 ISC_LANG_ENDDECLS
  128 
  129 #endif /* DNS_LOOKUP_H */