"Fossies" - the Fresh Open Source Software Archive

Member "libspf2-1.2.10/src/include/spf_dns_zone.h" (28 Jan 2012, 2923 Bytes) of package /linux/privat/libspf2-1.2.10.tar.gz:


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 "spf_dns_zone.h" see the Fossies "Dox" file reference documentation.

    1 /* 
    2  * This program is free software; you can redistribute it and/or modify
    3  * it under the terms of either:
    4  * 
    5  *   a) The GNU Lesser General Public License as published by the Free
    6  *      Software Foundation; either version 2.1, or (at your option) any
    7  *      later version,
    8  * 
    9  *   OR
   10  * 
   11  *   b) The two-clause BSD license.
   12  *
   13  * These licenses can be found with the distribution in the file LICENSES
   14  */
   15 
   16 
   17 
   18 
   19 #ifndef INC_SPF_DNS_ZONE
   20 #define INC_SPF_DNS_ZONE
   21 
   22 /**
   23  * @file
   24  * @brief A local DNS zone layer.
   25  *
   26  * The zone DNS layer allows you to create DNS zone information from
   27  * scratch, without calling some sort of external DNS resolver.
   28  *
   29  * The primary use is to either override real DNS information, or to
   30  * provide fallbacks when no DNS information is available.  The zone
   31  * will override the real DNS information if it is above the resolving
   32  * DNS layer in the stack.  It will provide a fallback if it is
   33  * layered below.
   34  *
   35  * The zone DNS layer supports wildcard domain names, but not in the
   36  * way that wilcards are supported in real DNS zones.  Unlike real DNS
   37  * zones, a wildcard in the zone layer will match even if there are
   38  * other records of a different RR type in the same zone.  This makes
   39  * wildcarding much more useful, but could cause confusion.
   40  *
   41  * When using wildcards, it is important to add the most specific DNS
   42  * zone data first, and the most general data last.  Otherwise, the
   43  * more general information will always be returned.  This should
   44  * probably be considered a bug and may be fixed in the future.
   45  *
   46  * For example, if you want to add entries with the same RR type for
   47  * "foo.foo.example.com", "*.foo.example.com" and "*.example.com", you
   48  * should add them in this order.
   49  *
   50  * You can also add entries with the RR type of ns_t_any, which will
   51  * match any type of RR query.  This is most useful when you want to
   52  * wildcard HOST_NOT_FOUND entries to prevent queries of any type from
   53  * being fetched from a lower DNS layer.
   54  *
   55  *
   56  * For an overview of the DNS layer system, see spf_dns.h
   57  */
   58 
   59 
   60 /**
   61  * These routines take care of creating/destroying/etc. the objects
   62  * that hold the DNS layer configuration. SPF_dns_server_t objects contain
   63  * malloc'ed data, so they must be destroyed when you are finished
   64  * with them, or you will leak memory. 
   65  *
   66  * The "name" will be used when displaying debugging information so
   67  * that you can tell which zone layer in the stack of DNS layers
   68  * generated the output.
   69  */
   70 SPF_dns_server_t    *SPF_dns_zone_new(SPF_dns_server_t *layer_below,
   71                 const char *name, int debug);
   72 
   73 /**
   74  * Adds an entry to a DNS zone.
   75  *
   76  * If a given domain name has multiple records of a given RR type, you
   77  * can call the add routine multiple times to add to the RR set.
   78  */
   79 SPF_errcode_t        SPF_dns_zone_add_str(SPF_dns_server_t *spf_dns_server,
   80                 const char *domain, ns_type rr_type,
   81                 SPF_dns_stat_t herrno, const char *data);
   82 
   83 
   84 #endif