Sophie

Sophie

distrib > Mandriva > 2010.0 > i586 > media > contrib-release > by-pkgid > 550bbe86d83a7870fdddc73c68e5d2b2 > files > 191

libunbound-devel-1.3.4-1mdv2010.0.i586.rpm

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<title>unbound: services/localzone.c File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css">
<link href="doxygen.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Generated by Doxygen 1.5.9 -->
<div class="navigation" id="top">
  <div class="tabs">
    <ul>
      <li><a href="index.html"><span>Main&nbsp;Page</span></a></li>
      <li><a href="annotated.html"><span>Data&nbsp;Structures</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
      <li><a href="dirs.html"><span>Directories</span></a></li>
    </ul>
  </div>
  <div class="tabs">
    <ul>
      <li><a href="files.html"><span>File&nbsp;List</span></a></li>
      <li><a href="globals.html"><span>Globals</span></a></li>
    </ul>
  </div>
  <div class="navpath"><a class="el" href="dir_d1ccb6fd7b4f0b6c4993c4e5b9d49242.html">services</a>
  </div>
</div>
<div class="contents">
<h1>localzone.c File Reference</h1>This file contains functions to enable local zone authority service.  
<a href="#_details">More...</a>
<p>
<code>#include &quot;config.h&quot;</code><br>
<code>#include &quot;<a class="el" href="localzone_8h.html">services/localzone.h</a>&quot;</code><br>
<code>#include &quot;<a class="el" href="regional_8h.html">util/regional.h</a>&quot;</code><br>
<code>#include &quot;<a class="el" href="config__file_8h.html">util/config_file.h</a>&quot;</code><br>
<code>#include &quot;<a class="el" href="dname_8h.html">util/data/dname.h</a>&quot;</code><br>
<code>#include &quot;<a class="el" href="packed__rrset_8h.html">util/data/packed_rrset.h</a>&quot;</code><br>
<code>#include &quot;<a class="el" href="msgencode_8h.html">util/data/msgencode.h</a>&quot;</code><br>
<code>#include &quot;<a class="el" href="net__help_8h.html">util/net_help.h</a>&quot;</code><br>
<code>#include &quot;<a class="el" href="msgreply_8h.html">util/data/msgreply.h</a>&quot;</code><br>
<code>#include &quot;<a class="el" href="msgparse_8h.html">util/data/msgparse.h</a>&quot;</code><br>
<table border="0" cellpadding="0" cellspacing="0">
<tr><td></td></tr>
<tr><td colspan="2"><br><h2>Functions</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">struct <a class="el" href="structlocal__zones.html">local_zones</a> *&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="localzone_8c.html#be0079ce5f5767b445e249cba189dbb4">local_zones_create</a> ()</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Create local zones storage.  <a href="#be0079ce5f5767b445e249cba189dbb4"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="442292f739a57d0df9d97ed76b5bcf0c"></a><!-- doxytag: member="localzone.c::lzdel" ref="442292f739a57d0df9d97ed76b5bcf0c" args="(rbnode_t *n, void *arg)" -->
static void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="localzone_8c.html#442292f739a57d0df9d97ed76b5bcf0c">lzdel</a> (<a class="el" href="structrbnode__t.html">rbnode_t</a> *n, void *arg)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">helper traverse to delete zones <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="localzone_8c.html#df073878a30aeab95cc1e542d170c631">local_zones_delete</a> (struct <a class="el" href="structlocal__zones.html">local_zones</a> *zones)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Delete local zones storage.  <a href="#df073878a30aeab95cc1e542d170c631"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="localzone_8c.html#5b7730ed6458175db41eb5aae8d5a651">local_zone_delete</a> (struct <a class="el" href="structlocal__zone.html">local_zone</a> *z)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Delete one zone.  <a href="#5b7730ed6458175db41eb5aae8d5a651"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="localzone_8c.html#78c04d021dcfb32c69a5c243b160e8d8">local_zone_cmp</a> (const void *z1, const void *z2)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Compare two <a class="el" href="structlocal__zone.html" title="Local zone.">local_zone</a> entries in rbtree.  <a href="#78c04d021dcfb32c69a5c243b160e8d8"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="localzone_8c.html#e0f2c2a5dd3782244b032e6fff6bebc7">local_data_cmp</a> (const void *d1, const void *d2)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Compare two <a class="el" href="structlocal__data.html" title="Local data.">local_data</a> entries in rbtree.  <a href="#e0f2c2a5dd3782244b032e6fff6bebc7"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="localzone_8c.html#144df1bdefcb26cc781b6f916b3ab1f8">parse_dname</a> (const char *str, uint8_t **res, size_t *len, int *labs)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Form wireformat from text format domain name.  <a href="#144df1bdefcb26cc781b6f916b3ab1f8"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="2947fcc581b52f744e98630dc8e7c354"></a><!-- doxytag: member="localzone.c::local_zone_create" ref="2947fcc581b52f744e98630dc8e7c354" args="(uint8_t *nm, size_t len, int labs, enum localzone_type t, uint16_t dclass)" -->
static struct <a class="el" href="structlocal__zone.html">local_zone</a> *&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="localzone_8c.html#2947fcc581b52f744e98630dc8e7c354">local_zone_create</a> (uint8_t *nm, size_t len, int labs, enum <a class="el" href="localzone_8h.html#d4936d63a4fd091d968d5331e1592e2d">localzone_type</a> t, uint16_t dclass)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">create a new localzone <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="2cd436670c37a4f08b25b6934eb28bbf"></a><!-- doxytag: member="localzone.c::lz_enter_zone_dname" ref="2cd436670c37a4f08b25b6934eb28bbf" args="(struct local_zones *zones, uint8_t *nm, size_t len, int labs, enum localzone_type t, uint16_t c)" -->
static struct <a class="el" href="structlocal__zone.html">local_zone</a> *&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="localzone_8c.html#2cd436670c37a4f08b25b6934eb28bbf">lz_enter_zone_dname</a> (struct <a class="el" href="structlocal__zones.html">local_zones</a> *zones, uint8_t *nm, size_t len, int labs, enum <a class="el" href="localzone_8h.html#d4936d63a4fd091d968d5331e1592e2d">localzone_type</a> t, uint16_t c)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">enter a new zone with allocated dname returns with WRlock <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="5e8e52f56744fdb170643b60c6423867"></a><!-- doxytag: member="localzone.c::lz_enter_zone" ref="5e8e52f56744fdb170643b60c6423867" args="(struct local_zones *zones, const char *name, const char *type, uint16_t dclass)" -->
static struct <a class="el" href="structlocal__zone.html">local_zone</a> *&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="localzone_8c.html#5e8e52f56744fdb170643b60c6423867">lz_enter_zone</a> (struct <a class="el" href="structlocal__zones.html">local_zones</a> *zones, const char *name, const char *type, uint16_t dclass)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">enter a new zone <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="27f878f7174dfcf26529434a26ecb577"></a><!-- doxytag: member="localzone.c::get_rr_content" ref="27f878f7174dfcf26529434a26ecb577" args="(const char *str, uint8_t **nm, uint16_t *type, uint16_t *dclass, uint32_t *ttl, ldns_buffer *rdata)" -->
static int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="localzone_8c.html#27f878f7174dfcf26529434a26ecb577">get_rr_content</a> (const char *str, uint8_t **nm, uint16_t *type, uint16_t *dclass, uint32_t *ttl, ldns_buffer *rdata)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">return name and class and rdata of rr; parses string <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="7306e828f5efc7002b4e591aea2feb4e"></a><!-- doxytag: member="localzone.c::get_rr_nameclass" ref="7306e828f5efc7002b4e591aea2feb4e" args="(const char *str, uint8_t **nm, uint16_t *dclass)" -->
static int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="localzone_8c.html#7306e828f5efc7002b4e591aea2feb4e">get_rr_nameclass</a> (const char *str, uint8_t **nm, uint16_t *dclass)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">return name and class of rr; parses string <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">struct <a class="el" href="structlocal__rrset.html">local_rrset</a> *&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="localzone_8c.html#f33ea3c5ad3085b24b911d0b596abfb1">local_data_find_type</a> (struct <a class="el" href="structlocal__data.html">local_data</a> *data, uint16_t type)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Find an rrset in local data structure.  <a href="#f33ea3c5ad3085b24b911d0b596abfb1"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="4d40c3209a9b372ec7808eb46f94eb5a"></a><!-- doxytag: member="localzone.c::rr_is_duplicate" ref="4d40c3209a9b372ec7808eb46f94eb5a" args="(struct packed_rrset_data *pd, ldns_buffer *buf)" -->
static int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="localzone_8c.html#4d40c3209a9b372ec7808eb46f94eb5a">rr_is_duplicate</a> (struct <a class="el" href="structpacked__rrset__data.html">packed_rrset_data</a> *pd, ldns_buffer *buf)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">check for RR duplicates <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="f18f0117ce0a90931397fc244788532b"></a><!-- doxytag: member="localzone.c::new_local_rrset" ref="f18f0117ce0a90931397fc244788532b" args="(struct regional *region, struct local_data *node, uint16_t rrtype, uint16_t rrclass)" -->
static struct <a class="el" href="structlocal__rrset.html">local_rrset</a> *&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="localzone_8c.html#f18f0117ce0a90931397fc244788532b">new_local_rrset</a> (struct <a class="el" href="structregional.html">regional</a> *region, struct <a class="el" href="structlocal__data.html">local_data</a> *node, uint16_t rrtype, uint16_t rrclass)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">new <a class="el" href="structlocal__rrset.html" title="A local data RRset.">local_rrset</a> <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="1d95d7a5a56ca6ddeaf99ff818dbd29b"></a><!-- doxytag: member="localzone.c::insert_rr" ref="1d95d7a5a56ca6ddeaf99ff818dbd29b" args="(struct regional *region, struct packed_rrset_data *pd, ldns_buffer *buf, uint32_t ttl)" -->
static int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="localzone_8c.html#1d95d7a5a56ca6ddeaf99ff818dbd29b">insert_rr</a> (struct <a class="el" href="structregional.html">regional</a> *region, struct <a class="el" href="structpacked__rrset__data.html">packed_rrset_data</a> *pd, ldns_buffer *buf, uint32_t ttl)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">insert RR into RRset data structure; Wastes a couple of bytes <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="8fac0e2c2fbba335514bf237603fac1a"></a><!-- doxytag: member="localzone.c::lz_find_node" ref="8fac0e2c2fbba335514bf237603fac1a" args="(struct local_zone *z, uint8_t *nm, size_t nmlen, int nmlabs)" -->
static struct <a class="el" href="structlocal__data.html">local_data</a> *&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="localzone_8c.html#8fac0e2c2fbba335514bf237603fac1a">lz_find_node</a> (struct <a class="el" href="structlocal__zone.html">local_zone</a> *z, uint8_t *nm, size_t nmlen, int nmlabs)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">find a data node by exact name <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="89b46b183c3c69d83dd9340e6cb72aa2"></a><!-- doxytag: member="localzone.c::lz_find_create_node" ref="89b46b183c3c69d83dd9340e6cb72aa2" args="(struct local_zone *z, uint8_t *nm, size_t nmlen, int nmlabs, struct local_data **res)" -->
static int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="localzone_8c.html#89b46b183c3c69d83dd9340e6cb72aa2">lz_find_create_node</a> (struct <a class="el" href="structlocal__zone.html">local_zone</a> *z, uint8_t *nm, size_t nmlen, int nmlabs, struct <a class="el" href="structlocal__data.html">local_data</a> **res)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">find a node, create it if not and all its empty nonterminal parents <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="e8808757b401927e152466b9f9e50c93"></a><!-- doxytag: member="localzone.c::lz_enter_rr_into_zone" ref="e8808757b401927e152466b9f9e50c93" args="(struct local_zone *z, ldns_buffer *buf, const char *rrstr)" -->
static int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="localzone_8c.html#e8808757b401927e152466b9f9e50c93">lz_enter_rr_into_zone</a> (struct <a class="el" href="structlocal__zone.html">local_zone</a> *z, ldns_buffer *buf, const char *rrstr)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">enter data RR into auth zone <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="583e98870216e067b32b4ecf76b11e09"></a><!-- doxytag: member="localzone.c::lz_enter_rr_str" ref="583e98870216e067b32b4ecf76b11e09" args="(struct local_zones *zones, const char *rr, ldns_buffer *buf)" -->
static int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="localzone_8c.html#583e98870216e067b32b4ecf76b11e09">lz_enter_rr_str</a> (struct <a class="el" href="structlocal__zones.html">local_zones</a> *zones, const char *rr, ldns_buffer *buf)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">enter a data RR into auth data; a zone for it must exist <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="40ee687625d6adbd0301ad6397b90489"></a><!-- doxytag: member="localzone.c::lz_enter_zones" ref="40ee687625d6adbd0301ad6397b90489" args="(struct local_zones *zones, struct config_file *cfg)" -->
static int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="localzone_8c.html#40ee687625d6adbd0301ad6397b90489">lz_enter_zones</a> (struct <a class="el" href="structlocal__zones.html">local_zones</a> *zones, struct <a class="el" href="structconfig__file.html">config_file</a> *cfg)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">parse local-zone: statements <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="e064b487076c141a4de350ba52736e2c"></a><!-- doxytag: member="localzone.c::lz_exists" ref="e064b487076c141a4de350ba52736e2c" args="(struct local_zones *zones, const char *name)" -->
static int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="localzone_8c.html#e064b487076c141a4de350ba52736e2c">lz_exists</a> (struct <a class="el" href="structlocal__zones.html">local_zones</a> *zones, const char *name)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">lookup a zone in rbtree; exact match only; SLOW due to parse <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="c3406995fe0780392f51273d953f297a"></a><!-- doxytag: member="localzone.c::lz_nodefault" ref="c3406995fe0780392f51273d953f297a" args="(struct config_file *cfg, const char *name)" -->
static int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="localzone_8c.html#c3406995fe0780392f51273d953f297a">lz_nodefault</a> (struct <a class="el" href="structconfig__file.html">config_file</a> *cfg, const char *name)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">lookup a zone in cfg-&gt;nodefault list <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="44e5fd8abbaaea181dc375a280df42e5"></a><!-- doxytag: member="localzone.c::add_as112_default" ref="44e5fd8abbaaea181dc375a280df42e5" args="(struct local_zones *zones, struct config_file *cfg, ldns_buffer *buf, const char *name)" -->
static int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="localzone_8c.html#44e5fd8abbaaea181dc375a280df42e5">add_as112_default</a> (struct <a class="el" href="structlocal__zones.html">local_zones</a> *zones, struct <a class="el" href="structconfig__file.html">config_file</a> *cfg, ldns_buffer *buf, const char *name)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">enter AS112 default zone <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="c0c29c0f3ff09aaa233758596e1de0a1"></a><!-- doxytag: member="localzone.c::lz_enter_defaults" ref="c0c29c0f3ff09aaa233758596e1de0a1" args="(struct local_zones *zones, struct config_file *cfg, ldns_buffer *buf)" -->
static int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="localzone_8c.html#c0c29c0f3ff09aaa233758596e1de0a1">lz_enter_defaults</a> (struct <a class="el" href="structlocal__zones.html">local_zones</a> *zones, struct <a class="el" href="structconfig__file.html">config_file</a> *cfg, ldns_buffer *buf)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">enter default zones <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="b019a8a52b3f3d45e6f7cd8f5f2105e1"></a><!-- doxytag: member="localzone.c::init_parents" ref="b019a8a52b3f3d45e6f7cd8f5f2105e1" args="(struct local_zones *zones)" -->
static void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="localzone_8c.html#b019a8a52b3f3d45e6f7cd8f5f2105e1">init_parents</a> (struct <a class="el" href="structlocal__zones.html">local_zones</a> *zones)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">setup parent pointers, so that a lookup can be done for closest match <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="799ba23438269b50a117d6d4ca0ba137"></a><!-- doxytag: member="localzone.c::lz_setup_implicit" ref="799ba23438269b50a117d6d4ca0ba137" args="(struct local_zones *zones, struct config_file *cfg)" -->
static int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="localzone_8c.html#799ba23438269b50a117d6d4ca0ba137">lz_setup_implicit</a> (struct <a class="el" href="structlocal__zones.html">local_zones</a> *zones, struct <a class="el" href="structconfig__file.html">config_file</a> *cfg)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">enter implicit transparent zone for local-data: without local-zone: <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="6d1d545290e89fc1acdd335f20e79f64"></a><!-- doxytag: member="localzone.c::lz_enter_data" ref="6d1d545290e89fc1acdd335f20e79f64" args="(struct local_zones *zones, struct config_file *cfg, ldns_buffer *buf)" -->
static int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="localzone_8c.html#6d1d545290e89fc1acdd335f20e79f64">lz_enter_data</a> (struct <a class="el" href="structlocal__zones.html">local_zones</a> *zones, struct <a class="el" href="structconfig__file.html">config_file</a> *cfg, ldns_buffer *buf)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">enter auth data <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="1c1444b16a795caca099e01d99935c21"></a><!-- doxytag: member="localzone.c::lz_freeup_cfg" ref="1c1444b16a795caca099e01d99935c21" args="(struct config_file *cfg)" -->
static void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="localzone_8c.html#1c1444b16a795caca099e01d99935c21">lz_freeup_cfg</a> (struct <a class="el" href="structconfig__file.html">config_file</a> *cfg)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">free memory from config <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="localzone_8c.html#c526fc30822ac19bfe2cd5f966406efb">local_zones_apply_cfg</a> (struct <a class="el" href="structlocal__zones.html">local_zones</a> *zones, struct <a class="el" href="structconfig__file.html">config_file</a> *cfg)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Apply config settings; setup the local authoritative data.  <a href="#c526fc30822ac19bfe2cd5f966406efb"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">struct <a class="el" href="structlocal__zone.html">local_zone</a> *&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="localzone_8c.html#3295c2691a9164be24763c5497e90c3c">local_zones_lookup</a> (struct <a class="el" href="structlocal__zones.html">local_zones</a> *zones, uint8_t *name, size_t len, int labs, uint16_t dclass)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Lookup zone that contains the given name, class.  <a href="#3295c2691a9164be24763c5497e90c3c"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">struct <a class="el" href="structlocal__zone.html">local_zone</a> *&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="localzone_8c.html#39d3a3f67eff004b5d0161bc856a0f14">local_zones_find</a> (struct <a class="el" href="structlocal__zones.html">local_zones</a> *zones, uint8_t *name, size_t len, int labs, uint16_t dclass)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Find zone that with exactly given name, class.  <a href="#39d3a3f67eff004b5d0161bc856a0f14"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="98479ab4bf6a4a24fef03ef84a9b5017"></a><!-- doxytag: member="localzone.c::local_zone_out" ref="98479ab4bf6a4a24fef03ef84a9b5017" args="(struct local_zone *z)" -->
static void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="localzone_8c.html#98479ab4bf6a4a24fef03ef84a9b5017">local_zone_out</a> (struct <a class="el" href="structlocal__zone.html">local_zone</a> *z)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">print all RRsets in local zone <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="localzone_8c.html#d5ced71f49ee204aab226adb04febf61">local_zones_print</a> (struct <a class="el" href="structlocal__zones.html">local_zones</a> *zones)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Debug helper.  <a href="#d5ced71f49ee204aab226adb04febf61"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="9a9bc1ffa54cde51d55418ba39f78ebb"></a><!-- doxytag: member="localzone.c::local_encode" ref="9a9bc1ffa54cde51d55418ba39f78ebb" args="(struct query_info *qinfo, struct edns_data *edns, ldns_buffer *buf, struct regional *temp, struct ub_packed_rrset_key *rrset, int ansec, int rcode)" -->
static int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="localzone_8c.html#9a9bc1ffa54cde51d55418ba39f78ebb">local_encode</a> (struct <a class="el" href="structquery__info.html">query_info</a> *qinfo, struct <a class="el" href="structedns__data.html">edns_data</a> *edns, ldns_buffer *buf, struct <a class="el" href="structregional.html">regional</a> *temp, struct <a class="el" href="structub__packed__rrset__key.html">ub_packed_rrset_key</a> *rrset, int ansec, int rcode)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">encode answer consisting of 1 rrset <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="c89618a740076c30e3f6b8db9d775bf2"></a><!-- doxytag: member="localzone.c::local_data_answer" ref="c89618a740076c30e3f6b8db9d775bf2" args="(struct local_zone *z, struct query_info *qinfo, struct edns_data *edns, ldns_buffer *buf, struct regional *temp, int labs, struct local_data **ldp)" -->
static int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="localzone_8c.html#c89618a740076c30e3f6b8db9d775bf2">local_data_answer</a> (struct <a class="el" href="structlocal__zone.html">local_zone</a> *z, struct <a class="el" href="structquery__info.html">query_info</a> *qinfo, struct <a class="el" href="structedns__data.html">edns_data</a> *edns, ldns_buffer *buf, struct <a class="el" href="structregional.html">regional</a> *temp, int labs, struct <a class="el" href="structlocal__data.html">local_data</a> **ldp)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">answer local data match <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">static int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="localzone_8c.html#65c0e7b4194c93cb512ca9255e9b6c21">lz_zone_answer</a> (struct <a class="el" href="structlocal__zone.html">local_zone</a> *z, struct <a class="el" href="structquery__info.html">query_info</a> *qinfo, struct <a class="el" href="structedns__data.html">edns_data</a> *edns, ldns_buffer *buf, struct <a class="el" href="structregional.html">regional</a> *temp, struct <a class="el" href="structlocal__data.html">local_data</a> *ld)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">answer in case where no exact match is found  <a href="#65c0e7b4194c93cb512ca9255e9b6c21"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="localzone_8c.html#36a07e930476dd763ebc45465db05db5">local_zones_answer</a> (struct <a class="el" href="structlocal__zones.html">local_zones</a> *zones, struct <a class="el" href="structquery__info.html">query_info</a> *qinfo, struct <a class="el" href="structedns__data.html">edns_data</a> *edns, ldns_buffer *buf, struct <a class="el" href="structregional.html">regional</a> *temp)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Answer authoritatively for local zones.  <a href="#36a07e930476dd763ebc45465db05db5"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="localzone_8c.html#680f13cb884fc79cc558e7898785bd14">local_zone_str2type</a> (const char *type, enum <a class="el" href="localzone_8h.html#d4936d63a4fd091d968d5331e1592e2d">localzone_type</a> *t)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Parse the string into localzone type.  <a href="#680f13cb884fc79cc558e7898785bd14"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="89f15f80a0d3887552f2d8ab58a96e52"></a><!-- doxytag: member="localzone.c::set_kiddo_parents" ref="89f15f80a0d3887552f2d8ab58a96e52" args="(struct local_zone *z, struct local_zone *match, struct local_zone *newp)" -->
static void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="localzone_8c.html#89f15f80a0d3887552f2d8ab58a96e52">set_kiddo_parents</a> (struct <a class="el" href="structlocal__zone.html">local_zone</a> *z, struct <a class="el" href="structlocal__zone.html">local_zone</a> *match, struct <a class="el" href="structlocal__zone.html">local_zone</a> *newp)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">iterate over the kiddies of the given name and set their parent ptr <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">struct <a class="el" href="structlocal__zone.html">local_zone</a> *&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="localzone_8c.html#6796f4a9e36f41333c008c881d02bd75">local_zones_add_zone</a> (struct <a class="el" href="structlocal__zones.html">local_zones</a> *zones, uint8_t *name, size_t len, int labs, uint16_t dclass, enum <a class="el" href="localzone_8h.html#d4936d63a4fd091d968d5331e1592e2d">localzone_type</a> tp)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Add a new zone.  <a href="#6796f4a9e36f41333c008c881d02bd75"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="localzone_8c.html#d4f418a4c15b7dd69bc5d4e925b9baf6">local_zones_del_zone</a> (struct <a class="el" href="structlocal__zones.html">local_zones</a> *zones, struct <a class="el" href="structlocal__zone.html">local_zone</a> *z)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Delete a zone.  <a href="#d4f418a4c15b7dd69bc5d4e925b9baf6"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="localzone_8c.html#2f222b2744f769d34725d8e2cd50c101">local_zones_add_RR</a> (struct <a class="el" href="structlocal__zones.html">local_zones</a> *zones, const char *rr, ldns_buffer *buf)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Add RR data into the localzone data.  <a href="#2f222b2744f769d34725d8e2cd50c101"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="24eb04384a2769ac340f712816d5dd82"></a><!-- doxytag: member="localzone.c::is_terminal" ref="24eb04384a2769ac340f712816d5dd82" args="(struct local_data *d)" -->
static int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="localzone_8c.html#24eb04384a2769ac340f712816d5dd82">is_terminal</a> (struct <a class="el" href="structlocal__data.html">local_data</a> *d)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">returns true if the node is terminal so no deeper domain names exist <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="7328f751edffde312a3772077d13614e"></a><!-- doxytag: member="localzone.c::del_empty_term" ref="7328f751edffde312a3772077d13614e" args="(struct local_zone *z, struct local_data *d, uint8_t *name, size_t len, int labs)" -->
static void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="localzone_8c.html#7328f751edffde312a3772077d13614e">del_empty_term</a> (struct <a class="el" href="structlocal__zone.html">local_zone</a> *z, struct <a class="el" href="structlocal__data.html">local_data</a> *d, uint8_t *name, size_t len, int labs)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">delete empty terminals from tree when final data is deleted <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="localzone_8c.html#864ca1da34f4a68e4d74e9ce8fecf3e4">local_zones_del_data</a> (struct <a class="el" href="structlocal__zones.html">local_zones</a> *zones, uint8_t *name, size_t len, int labs, uint16_t dclass)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Remove data from domain name in the tree.  <a href="#864ca1da34f4a68e4d74e9ce8fecf3e4"></a><br></td></tr>
</table>
<hr><h2>Detailed Description</h2>
This file contains functions to enable local zone authority service. 
<p>
<hr><h2>Function Documentation</h2>
<a class="anchor" name="be0079ce5f5767b445e249cba189dbb4"></a><!-- doxytag: member="localzone.c::local_zones_create" ref="be0079ce5f5767b445e249cba189dbb4" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">struct <a class="el" href="structlocal__zones.html">local_zones</a>* local_zones_create           </td>
          <td>(</td>
          <td class="paramname">          </td>
          <td>&nbsp;)&nbsp;</td>
          <td><code> [read]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Create local zones storage. 
<p>
<dl class="return" compact><dt><b>Returns:</b></dt><dd>new struct or NULL on error. </dd></dl>

<p>References <a class="el" href="localzone_8c_source.html#l00097">local_zone_cmp()</a>, <a class="el" href="localzone_8h_source.html#l00078">local_zones::lock</a>, <a class="el" href="rbtree_8c_source.html#l00094">rbtree_init()</a>, and <a class="el" href="localzone_8h_source.html#l00080">local_zones::ztree</a>.</p>

<p>Referenced by <a class="el" href="context_8c_source.html#l00054">context_finalize()</a>, <a class="el" href="daemon_8c_source.html#l00397">daemon_fork()</a>, and <a class="el" href="unbound-checkconf_8c_source.html#l00233">localzonechecks()</a>.</p>

</div>
</div><p>
<a class="anchor" name="df073878a30aeab95cc1e542d170c631"></a><!-- doxytag: member="localzone.c::local_zones_delete" ref="df073878a30aeab95cc1e542d170c631" args="(struct local_zones *zones)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void local_zones_delete           </td>
          <td>(</td>
          <td class="paramtype">struct <a class="el" href="structlocal__zones.html">local_zones</a> *&nbsp;</td>
          <td class="paramname"> <em>zones</em>          </td>
          <td>&nbsp;)&nbsp;</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Delete local zones storage. 
<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>zones,:</em>&nbsp;</td><td>to delete. </td></tr>
  </table>
</dl>

<p>References <a class="el" href="localzone_8h_source.html#l00078">local_zones::lock</a>, <a class="el" href="localzone_8c_source.html#l00068">lzdel()</a>, <a class="el" href="rbtree_8c_source.html#l00617">traverse_postorder()</a>, and <a class="el" href="localzone_8h_source.html#l00080">local_zones::ztree</a>.</p>

<p>Referenced by <a class="el" href="daemon_8c_source.html#l00448">daemon_cleanup()</a>, <a class="el" href="unbound-checkconf_8c_source.html#l00233">localzonechecks()</a>, and <a class="el" href="libunbound_8c_source.html#l00153">ub_ctx_delete()</a>.</p>

</div>
</div><p>
<a class="anchor" name="5b7730ed6458175db41eb5aae8d5a651"></a><!-- doxytag: member="localzone.c::local_zone_delete" ref="5b7730ed6458175db41eb5aae8d5a651" args="(struct local_zone *z)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void local_zone_delete           </td>
          <td>(</td>
          <td class="paramtype">struct <a class="el" href="structlocal__zone.html">local_zone</a> *&nbsp;</td>
          <td class="paramname"> <em>z</em>          </td>
          <td>&nbsp;)&nbsp;</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Delete one zone. 
<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>z,:</em>&nbsp;</td><td>to delete. </td></tr>
  </table>
</dl>

<p>References <a class="el" href="localzone_8h_source.html#l00106">local_zone::lock</a>, <a class="el" href="localzone_8h_source.html#l00093">local_zone::name</a>, <a class="el" href="localzone_8h_source.html#l00113">local_zone::region</a>, and <a class="el" href="regional_8c_source.html#l00108">regional_destroy()</a>.</p>

<p>Referenced by <a class="el" href="localzone_8c_source.html#l01186">local_zones_add_zone()</a>, <a class="el" href="localzone_8c_source.html#l01214">local_zones_del_zone()</a>, <a class="el" href="localzone_8c_source.html#l00174">lz_enter_zone_dname()</a>, and <a class="el" href="localzone_8c_source.html#l00068">lzdel()</a>.</p>

</div>
</div><p>
<a class="anchor" name="78c04d021dcfb32c69a5c243b160e8d8"></a><!-- doxytag: member="localzone.c::local_zone_cmp" ref="78c04d021dcfb32c69a5c243b160e8d8" args="(const void *z1, const void *z2)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int local_zone_cmp           </td>
          <td>(</td>
          <td class="paramtype">const void *&nbsp;</td>
          <td class="paramname"> <em>z1</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const void *&nbsp;</td>
          <td class="paramname"> <em>z2</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Compare two <a class="el" href="structlocal__zone.html" title="Local zone.">local_zone</a> entries in rbtree. 
<p>
Sort hierarchical but not canonical <dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>z1,:</em>&nbsp;</td><td>zone 1 </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>z2,:</em>&nbsp;</td><td>zone 2 </td></tr>
  </table>
</dl>
<dl class="return" compact><dt><b>Returns:</b></dt><dd>: -1, 0, +1 comparison value. </dd></dl>

<p>References <a class="el" href="localzone_8h_source.html#l00100">local_zone::dclass</a>, <a class="el" href="dname_8c_source.html#l00424">dname_lab_cmp()</a>, <a class="el" href="localzone_8h_source.html#l00093">local_zone::name</a>, and <a class="el" href="localzone_8h_source.html#l00097">local_zone::namelabs</a>.</p>

<p>Referenced by <a class="el" href="fptr__wlist_8c_source.html#l00164">fptr_whitelist_rbtree_cmp()</a>, and <a class="el" href="localzone_8c_source.html#l00053">local_zones_create()</a>.</p>

</div>
</div><p>
<a class="anchor" name="e0f2c2a5dd3782244b032e6fff6bebc7"></a><!-- doxytag: member="localzone.c::local_data_cmp" ref="e0f2c2a5dd3782244b032e6fff6bebc7" args="(const void *d1, const void *d2)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int local_data_cmp           </td>
          <td>(</td>
          <td class="paramtype">const void *&nbsp;</td>
          <td class="paramname"> <em>d1</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const void *&nbsp;</td>
          <td class="paramname"> <em>d2</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Compare two <a class="el" href="structlocal__data.html" title="Local data.">local_data</a> entries in rbtree. 
<p>
Sort canonical. <dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>d1,:</em>&nbsp;</td><td>data 1 </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>d2,:</em>&nbsp;</td><td>data 2 </td></tr>
  </table>
</dl>
<dl class="return" compact><dt><b>Returns:</b></dt><dd>: -1, 0, +1 comparison value. </dd></dl>

<p>References <a class="el" href="dname_8c_source.html#l00689">dname_canon_lab_cmp()</a>, <a class="el" href="localzone_8h_source.html#l00128">local_data::name</a>, and <a class="el" href="localzone_8h_source.html#l00132">local_data::namelabs</a>.</p>

<p>Referenced by <a class="el" href="fptr__wlist_8c_source.html#l00164">fptr_whitelist_rbtree_cmp()</a>, and <a class="el" href="localzone_8c_source.html#l00147">local_zone_create()</a>.</p>

</div>
</div><p>
<a class="anchor" name="144df1bdefcb26cc781b6f916b3ab1f8"></a><!-- doxytag: member="localzone.c::parse_dname" ref="144df1bdefcb26cc781b6f916b3ab1f8" args="(const char *str, uint8_t **res, size_t *len, int *labs)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int parse_dname           </td>
          <td>(</td>
          <td class="paramtype">const char *&nbsp;</td>
          <td class="paramname"> <em>str</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint8_t **&nbsp;</td>
          <td class="paramname"> <em>res</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t *&nbsp;</td>
          <td class="paramname"> <em>len</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int *&nbsp;</td>
          <td class="paramname"> <em>labs</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Form wireformat from text format domain name. 
<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>str,:</em>&nbsp;</td><td>the domain name in text "www.example.com" </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>res,:</em>&nbsp;</td><td>resulting wireformat is stored here with malloc. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>len,:</em>&nbsp;</td><td>length of resulting wireformat. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>labs,:</em>&nbsp;</td><td>number of labels in resulting wireformat. </td></tr>
  </table>
</dl>
<dl class="return" compact><dt><b>Returns:</b></dt><dd>false on error, syntax or memory. Also logged. </dd></dl>

<p>References <a class="el" href="dname_8c_source.html#l00384">dname_count_size_labels()</a>, <a class="el" href="log_8c_source.html#l00241">log_err()</a>, and <a class="el" href="net__help_8c_source.html#l00138">memdup()</a>.</p>

<p>Referenced by <a class="el" href="localzone_8c_source.html#l00199">lz_enter_zone()</a>, <a class="el" href="localzone_8c_source.html#l00541">lz_exists()</a>, <a class="el" href="libunbound_8c_source.html#l01018">ub_ctx_data_remove()</a>, <a class="el" href="libunbound_8c_source.html#l00934">ub_ctx_zone_add()</a>, and <a class="el" href="libunbound_8c_source.html#l00974">ub_ctx_zone_remove()</a>.</p>

</div>
</div><p>
<a class="anchor" name="f33ea3c5ad3085b24b911d0b596abfb1"></a><!-- doxytag: member="localzone.c::local_data_find_type" ref="f33ea3c5ad3085b24b911d0b596abfb1" args="(struct local_data *data, uint16_t type)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">struct <a class="el" href="structlocal__rrset.html">local_rrset</a>* local_data_find_type           </td>
          <td>(</td>
          <td class="paramtype">struct <a class="el" href="structlocal__data.html">local_data</a> *&nbsp;</td>
          <td class="paramname"> <em>data</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint16_t&nbsp;</td>
          <td class="paramname"> <em>type</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td><code> [read]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Find an rrset in local data structure. 
<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>data,:</em>&nbsp;</td><td>local data domain name structure. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>type,:</em>&nbsp;</td><td>type to look for (host order). </td></tr>
  </table>
</dl>
<dl class="return" compact><dt><b>Returns:</b></dt><dd>rrset pointer or NULL if not found. </dd></dl>

<p>References <a class="el" href="localzone_8h_source.html#l00143">local_rrset::next</a>, <a class="el" href="packed__rrset_8h_source.html#l00105">ub_packed_rrset_key::rk</a>, <a class="el" href="localzone_8h_source.html#l00145">local_rrset::rrset</a>, <a class="el" href="localzone_8h_source.html#l00135">local_data::rrsets</a>, and <a class="el" href="packed__rrset_8h_source.html#l00075">packed_rrset_key::type</a>.</p>

<p>Referenced by <a class="el" href="localzone_8c_source.html#l01016">local_data_answer()</a>, and <a class="el" href="localzone_8c_source.html#l00441">lz_enter_rr_into_zone()</a>.</p>

</div>
</div><p>
<a class="anchor" name="c526fc30822ac19bfe2cd5f966406efb"></a><!-- doxytag: member="localzone.c::local_zones_apply_cfg" ref="c526fc30822ac19bfe2cd5f966406efb" args="(struct local_zones *zones, struct config_file *cfg)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int local_zones_apply_cfg           </td>
          <td>(</td>
          <td class="paramtype">struct <a class="el" href="structlocal__zones.html">local_zones</a> *&nbsp;</td>
          <td class="paramname"> <em>zones</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">struct <a class="el" href="structconfig__file.html">config_file</a> *&nbsp;</td>
          <td class="paramname"> <em>cfg</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Apply config settings; setup the local authoritative data. 
<p>
Takes care of locking. <dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>zones,:</em>&nbsp;</td><td>is set up. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>cfg,:</em>&nbsp;</td><td>config data. </td></tr>
  </table>
</dl>
<dl class="return" compact><dt><b>Returns:</b></dt><dd>false on error. </dd></dl>

<p>References <a class="el" href="log_8c_source.html#l00267">fatal_exit()</a>, <a class="el" href="localzone_8c_source.html#l00706">init_parents()</a>, <a class="el" href="localzone_8c_source.html#l00822">lz_enter_data()</a>, <a class="el" href="localzone_8c_source.html#l00608">lz_enter_defaults()</a>, <a class="el" href="localzone_8c_source.html#l00526">lz_enter_zones()</a>, <a class="el" href="localzone_8c_source.html#l00835">lz_freeup_cfg()</a>, and <a class="el" href="localzone_8c_source.html#l00740">lz_setup_implicit()</a>.</p>

<p>Referenced by <a class="el" href="context_8c_source.html#l00054">context_finalize()</a>, <a class="el" href="daemon_8c_source.html#l00397">daemon_fork()</a>, and <a class="el" href="unbound-checkconf_8c_source.html#l00233">localzonechecks()</a>.</p>

</div>
</div><p>
<a class="anchor" name="3295c2691a9164be24763c5497e90c3c"></a><!-- doxytag: member="localzone.c::local_zones_lookup" ref="3295c2691a9164be24763c5497e90c3c" args="(struct local_zones *zones, uint8_t *name, size_t len, int labs, uint16_t dclass)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">struct <a class="el" href="structlocal__zone.html">local_zone</a>* local_zones_lookup           </td>
          <td>(</td>
          <td class="paramtype">struct <a class="el" href="structlocal__zones.html">local_zones</a> *&nbsp;</td>
          <td class="paramname"> <em>zones</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint8_t *&nbsp;</td>
          <td class="paramname"> <em>name</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&nbsp;</td>
          <td class="paramname"> <em>len</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&nbsp;</td>
          <td class="paramname"> <em>labs</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint16_t&nbsp;</td>
          <td class="paramname"> <em>dclass</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td><code> [read]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Lookup zone that contains the given name, class. 
<p>
User must lock the tree or result zone. <dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>zones,:</em>&nbsp;</td><td>the zones tree </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>name,:</em>&nbsp;</td><td>dname to lookup </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>len,:</em>&nbsp;</td><td>length of name. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>labs,:</em>&nbsp;</td><td>labelcount of name. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>dclass,:</em>&nbsp;</td><td>class to lookup. </td></tr>
  </table>
</dl>
<dl class="return" compact><dt><b>Returns:</b></dt><dd>closest <a class="el" href="structlocal__zone.html" title="Local zone.">local_zone</a> or NULL if no covering zone is found. </dd></dl>

<p>References <a class="el" href="localzone_8h_source.html#l00100">local_zone::dclass</a>, <a class="el" href="dname_8c_source.html#l00424">dname_lab_cmp()</a>, <a class="el" href="rbtree_8h_source.html#l00063">rbnode_t::key</a>, <a class="el" href="localzone_8h_source.html#l00093">local_zone::name</a>, <a class="el" href="localzone_8h_source.html#l00097">local_zone::namelabs</a>, <a class="el" href="localzone_8h_source.html#l00095">local_zone::namelen</a>, <a class="el" href="localzone_8h_source.html#l00088">local_zone::node</a>, <a class="el" href="localzone_8h_source.html#l00090">local_zone::parent</a>, <a class="el" href="rbtree_8c_source.html#l00507">rbtree_find_less_equal()</a>, and <a class="el" href="localzone_8h_source.html#l00080">local_zones::ztree</a>.</p>

<p>Referenced by <a class="el" href="localzone_8c_source.html#l01229">local_zones_add_RR()</a>, <a class="el" href="localzone_8c_source.html#l01115">local_zones_answer()</a>, <a class="el" href="localzone_8c_source.html#l01294">local_zones_del_data()</a>, <a class="el" href="localzone_8c_source.html#l00497">lz_enter_rr_str()</a>, and <a class="el" href="localzone_8c_source.html#l00740">lz_setup_implicit()</a>.</p>

</div>
</div><p>
<a class="anchor" name="39d3a3f67eff004b5d0161bc856a0f14"></a><!-- doxytag: member="localzone.c::local_zones_find" ref="39d3a3f67eff004b5d0161bc856a0f14" args="(struct local_zones *zones, uint8_t *name, size_t len, int labs, uint16_t dclass)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">struct <a class="el" href="structlocal__zone.html">local_zone</a>* local_zones_find           </td>
          <td>(</td>
          <td class="paramtype">struct <a class="el" href="structlocal__zones.html">local_zones</a> *&nbsp;</td>
          <td class="paramname"> <em>zones</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint8_t *&nbsp;</td>
          <td class="paramname"> <em>name</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&nbsp;</td>
          <td class="paramname"> <em>len</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&nbsp;</td>
          <td class="paramname"> <em>labs</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint16_t&nbsp;</td>
          <td class="paramname"> <em>dclass</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td><code> [read]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Find zone that with exactly given name, class. 
<p>
User must lock the tree or result zone. <dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>zones,:</em>&nbsp;</td><td>the zones tree </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>name,:</em>&nbsp;</td><td>dname to lookup </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>len,:</em>&nbsp;</td><td>length of name. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>labs,:</em>&nbsp;</td><td>labelcount of name. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>dclass,:</em>&nbsp;</td><td>class to lookup. </td></tr>
  </table>
</dl>
<dl class="return" compact><dt><b>Returns:</b></dt><dd>the exact <a class="el" href="structlocal__zone.html" title="Local zone.">local_zone</a> or NULL. </dd></dl>

<p>References <a class="el" href="localzone_8h_source.html#l00100">local_zone::dclass</a>, <a class="el" href="rbtree_8h_source.html#l00063">rbnode_t::key</a>, <a class="el" href="localzone_8h_source.html#l00093">local_zone::name</a>, <a class="el" href="localzone_8h_source.html#l00097">local_zone::namelabs</a>, <a class="el" href="localzone_8h_source.html#l00095">local_zone::namelen</a>, <a class="el" href="localzone_8h_source.html#l00088">local_zone::node</a>, <a class="el" href="rbtree_8c_source.html#l00280">rbtree_search()</a>, and <a class="el" href="localzone_8h_source.html#l00080">local_zones::ztree</a>.</p>

<p>Referenced by <a class="el" href="remote_8c_source.html#l00946">do_zone_add()</a>, <a class="el" href="remote_8c_source.html#l00987">do_zone_remove()</a>, <a class="el" href="localzone_8c_source.html#l01186">local_zones_add_zone()</a>, <a class="el" href="libunbound_8c_source.html#l00934">ub_ctx_zone_add()</a>, and <a class="el" href="libunbound_8c_source.html#l00974">ub_ctx_zone_remove()</a>.</p>

</div>
</div><p>
<a class="anchor" name="d5ced71f49ee204aab226adb04febf61"></a><!-- doxytag: member="localzone.c::local_zones_print" ref="d5ced71f49ee204aab226adb04febf61" args="(struct local_zones *zones)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void local_zones_print           </td>
          <td>(</td>
          <td class="paramtype">struct <a class="el" href="structlocal__zones.html">local_zones</a> *&nbsp;</td>
          <td class="paramname"> <em>zones</em>          </td>
          <td>&nbsp;)&nbsp;</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Debug helper. 
<p>
Print all zones Takes care of locking. <dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>zones,:</em>&nbsp;</td><td>the zones tree </td></tr>
  </table>
</dl>

<p>References <a class="el" href="rbtree_8h_source.html#l00081">rbtree_t::count</a>, <a class="el" href="localzone_8h_source.html#l00100">local_zone::dclass</a>, <a class="el" href="localzone_8h_source.html#l00059">local_zone_deny</a>, <a class="el" href="localzone_8c_source.html#l00929">local_zone_out()</a>, <a class="el" href="localzone_8h_source.html#l00067">local_zone_redirect</a>, <a class="el" href="localzone_8h_source.html#l00061">local_zone_refuse</a>, <a class="el" href="localzone_8h_source.html#l00063">local_zone_static</a>, <a class="el" href="localzone_8h_source.html#l00065">local_zone_transparent</a>, <a class="el" href="localzone_8h_source.html#l00106">local_zone::lock</a>, <a class="el" href="localzone_8h_source.html#l00078">local_zones::lock</a>, <a class="el" href="log_8c_source.html#l00228">log_info()</a>, <a class="el" href="net__help_8c_source.html#l00265">log_nametypeclass()</a>, <a class="el" href="localzone_8h_source.html#l00093">local_zone::name</a>, <a class="el" href="rbtree_8h_source.html#l00173">RBTREE_FOR</a>, <a class="el" href="localzone_8h_source.html#l00109">local_zone::type</a>, and <a class="el" href="localzone_8h_source.html#l00080">local_zones::ztree</a>.</p>

<p>Referenced by <a class="el" href="libunbound_8c_source.html#l00923">ub_ctx_print_local_zones()</a>.</p>

</div>
</div><p>
<a class="anchor" name="65c0e7b4194c93cb512ca9255e9b6c21"></a><!-- doxytag: member="localzone.c::lz_zone_answer" ref="65c0e7b4194c93cb512ca9255e9b6c21" args="(struct local_zone *z, struct query_info *qinfo, struct edns_data *edns, ldns_buffer *buf, struct regional *temp, struct local_data *ld)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">static int lz_zone_answer           </td>
          <td>(</td>
          <td class="paramtype">struct <a class="el" href="structlocal__zone.html">local_zone</a> *&nbsp;</td>
          <td class="paramname"> <em>z</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">struct <a class="el" href="structquery__info.html">query_info</a> *&nbsp;</td>
          <td class="paramname"> <em>qinfo</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">struct <a class="el" href="structedns__data.html">edns_data</a> *&nbsp;</td>
          <td class="paramname"> <em>edns</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">ldns_buffer *&nbsp;</td>
          <td class="paramname"> <em>buf</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">struct <a class="el" href="structregional.html">regional</a> *&nbsp;</td>
          <td class="paramname"> <em>temp</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">struct <a class="el" href="structlocal__data.html">local_data</a> *&nbsp;</td>
          <td class="paramname"> <em>ld</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td><code> [static]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
answer in case where no exact match is found 
<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>z,:</em>&nbsp;</td><td>zone for query </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>qinfo,:</em>&nbsp;</td><td>query </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>edns,:</em>&nbsp;</td><td>edns from query </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>buf,:</em>&nbsp;</td><td>buffer for answer. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>temp,:</em>&nbsp;</td><td>temp region for encoding </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>ld,:</em>&nbsp;</td><td>local data, if NULL, no such name exists in localdata. </td></tr>
  </table>
</dl>
<dl class="return" compact><dt><b>Returns:</b></dt><dd>1 if a reply is to be sent, 0 if not. </dd></dl>

<p>
no reply at all, signal caller by clearing buffer. 
<p>References <a class="el" href="net__help_8h_source.html#l00066">BIT_AA</a>, <a class="el" href="msgencode_8c_source.html#l00769">error_encode()</a>, <a class="el" href="localzone_8c_source.html#l00983">local_encode()</a>, <a class="el" href="localzone_8h_source.html#l00059">local_zone_deny</a>, <a class="el" href="localzone_8h_source.html#l00067">local_zone_redirect</a>, <a class="el" href="localzone_8h_source.html#l00061">local_zone_refuse</a>, <a class="el" href="localzone_8h_source.html#l00063">local_zone_static</a>, <a class="el" href="localzone_8h_source.html#l00135">local_data::rrsets</a>, <a class="el" href="localzone_8h_source.html#l00118">local_zone::soa</a>, and <a class="el" href="localzone_8h_source.html#l00109">local_zone::type</a>.</p>

<p>Referenced by <a class="el" href="localzone_8c_source.html#l01115">local_zones_answer()</a>.</p>

</div>
</div><p>
<a class="anchor" name="36a07e930476dd763ebc45465db05db5"></a><!-- doxytag: member="localzone.c::local_zones_answer" ref="36a07e930476dd763ebc45465db05db5" args="(struct local_zones *zones, struct query_info *qinfo, struct edns_data *edns, ldns_buffer *buf, struct regional *temp)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int local_zones_answer           </td>
          <td>(</td>
          <td class="paramtype">struct <a class="el" href="structlocal__zones.html">local_zones</a> *&nbsp;</td>
          <td class="paramname"> <em>zones</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">struct <a class="el" href="structquery__info.html">query_info</a> *&nbsp;</td>
          <td class="paramname"> <em>qinfo</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">struct <a class="el" href="structedns__data.html">edns_data</a> *&nbsp;</td>
          <td class="paramname"> <em>edns</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">ldns_buffer *&nbsp;</td>
          <td class="paramname"> <em>buf</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">struct <a class="el" href="structregional.html">regional</a> *&nbsp;</td>
          <td class="paramname"> <em>temp</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Answer authoritatively for local zones. 
<p>
Takes care of locking. <dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>zones,:</em>&nbsp;</td><td>the stored zones (shared, read only). </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>qinfo,:</em>&nbsp;</td><td>query info (parsed). </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>edns,:</em>&nbsp;</td><td>edns info (parsed). </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>buf,:</em>&nbsp;</td><td>buffer with query ID and flags, also for reply. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>temp,:</em>&nbsp;</td><td>temporary storage region. </td></tr>
  </table>
</dl>
<dl class="return" compact><dt><b>Returns:</b></dt><dd>true if answer is in buffer. false if query is not answered by authority data. If the reply should be dropped altogether, the return value is true, but the buffer is cleared (empty). </dd></dl>

<p>References <a class="el" href="dname_8c_source.html#l00369">dname_count_labels()</a>, <a class="el" href="localzone_8c_source.html#l01016">local_data_answer()</a>, <a class="el" href="localzone_8c_source.html#l00881">local_zones_lookup()</a>, <a class="el" href="localzone_8h_source.html#l00106">local_zone::lock</a>, <a class="el" href="localzone_8h_source.html#l00078">local_zones::lock</a>, <a class="el" href="localzone_8c_source.html#l01063">lz_zone_answer()</a>, <a class="el" href="msgreply_8h_source.html#l00070">query_info::qclass</a>, <a class="el" href="msgreply_8h_source.html#l00064">query_info::qname</a>, and <a class="el" href="msgreply_8h_source.html#l00066">query_info::qname_len</a>.</p>

<p>Referenced by <a class="el" href="libworker_8c_source.html#l00604">handle_newq()</a>, <a class="el" href="libworker_8c_source.html#l00497">libworker_fg()</a>, and <a class="el" href="worker_8c_source.html#l00681">worker_handle_request()</a>.</p>

</div>
</div><p>
<a class="anchor" name="680f13cb884fc79cc558e7898785bd14"></a><!-- doxytag: member="localzone.c::local_zone_str2type" ref="680f13cb884fc79cc558e7898785bd14" args="(const char *type, enum localzone_type *t)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int local_zone_str2type           </td>
          <td>(</td>
          <td class="paramtype">const char *&nbsp;</td>
          <td class="paramname"> <em>str</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">enum <a class="el" href="localzone_8h.html#d4936d63a4fd091d968d5331e1592e2d">localzone_type</a> *&nbsp;</td>
          <td class="paramname"> <em>t</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Parse the string into localzone type. 
<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>str,:</em>&nbsp;</td><td>string to parse </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>t,:</em>&nbsp;</td><td>local zone type returned here. </td></tr>
  </table>
</dl>
<dl class="return" compact><dt><b>Returns:</b></dt><dd>0 on parse error. </dd></dl>

<p>References <a class="el" href="localzone_8h_source.html#l00059">local_zone_deny</a>, <a class="el" href="localzone_8h_source.html#l00067">local_zone_redirect</a>, <a class="el" href="localzone_8h_source.html#l00061">local_zone_refuse</a>, <a class="el" href="localzone_8h_source.html#l00063">local_zone_static</a>, and <a class="el" href="localzone_8h_source.html#l00065">local_zone_transparent</a>.</p>

<p>Referenced by <a class="el" href="remote_8c_source.html#l00946">do_zone_add()</a>, <a class="el" href="localzone_8c_source.html#l00199">lz_enter_zone()</a>, and <a class="el" href="libunbound_8c_source.html#l00934">ub_ctx_zone_add()</a>.</p>

</div>
</div><p>
<a class="anchor" name="6796f4a9e36f41333c008c881d02bd75"></a><!-- doxytag: member="localzone.c::local_zones_add_zone" ref="6796f4a9e36f41333c008c881d02bd75" args="(struct local_zones *zones, uint8_t *name, size_t len, int labs, uint16_t dclass, enum localzone_type tp)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">struct <a class="el" href="structlocal__zone.html">local_zone</a>* local_zones_add_zone           </td>
          <td>(</td>
          <td class="paramtype">struct <a class="el" href="structlocal__zones.html">local_zones</a> *&nbsp;</td>
          <td class="paramname"> <em>zones</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint8_t *&nbsp;</td>
          <td class="paramname"> <em>name</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&nbsp;</td>
          <td class="paramname"> <em>len</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&nbsp;</td>
          <td class="paramname"> <em>labs</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint16_t&nbsp;</td>
          <td class="paramname"> <em>dclass</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">enum <a class="el" href="localzone_8h.html#d4936d63a4fd091d968d5331e1592e2d">localzone_type</a>&nbsp;</td>
          <td class="paramname"> <em>tp</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td><code> [read]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Add a new zone. 
<p>
Caller must hold the zones lock. Adjusts the other zones as well (parent pointers) after insertion. The zone must NOT exist (returns NULL and logs error). <dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>zones,:</em>&nbsp;</td><td>the zones tree </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>name,:</em>&nbsp;</td><td>dname to add </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>len,:</em>&nbsp;</td><td>length of name. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>labs,:</em>&nbsp;</td><td>labelcount of name. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>dclass,:</em>&nbsp;</td><td>class to add. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>tp,:</em>&nbsp;</td><td>type. </td></tr>
  </table>
</dl>
<dl class="return" compact><dt><b>Returns:</b></dt><dd><a class="el" href="structlocal__zone.html" title="Local zone.">local_zone</a> or NULL on error, caller must printout memory error. </dd></dl>

<p>References <a class="el" href="localzone_8c_source.html#l00147">local_zone_create()</a>, <a class="el" href="localzone_8c_source.html#l00086">local_zone_delete()</a>, <a class="el" href="localzone_8c_source.html#l00914">local_zones_find()</a>, <a class="el" href="localzone_8h_source.html#l00106">local_zone::lock</a>, <a class="el" href="log_8c_source.html#l00241">log_err()</a>, <a class="el" href="localzone_8h_source.html#l00088">local_zone::node</a>, <a class="el" href="localzone_8h_source.html#l00090">local_zone::parent</a>, <a class="el" href="rbtree_8c_source.html#l00227">rbtree_insert()</a>, <a class="el" href="localzone_8c_source.html#l01162">set_kiddo_parents()</a>, and <a class="el" href="localzone_8h_source.html#l00080">local_zones::ztree</a>.</p>

<p>Referenced by <a class="el" href="remote_8c_source.html#l00946">do_zone_add()</a>, <a class="el" href="localzone_8c_source.html#l01229">local_zones_add_RR()</a>, and <a class="el" href="libunbound_8c_source.html#l00934">ub_ctx_zone_add()</a>.</p>

</div>
</div><p>
<a class="anchor" name="d4f418a4c15b7dd69bc5d4e925b9baf6"></a><!-- doxytag: member="localzone.c::local_zones_del_zone" ref="d4f418a4c15b7dd69bc5d4e925b9baf6" args="(struct local_zones *zones, struct local_zone *z)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void local_zones_del_zone           </td>
          <td>(</td>
          <td class="paramtype">struct <a class="el" href="structlocal__zones.html">local_zones</a> *&nbsp;</td>
          <td class="paramname"> <em>zones</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">struct <a class="el" href="structlocal__zone.html">local_zone</a> *&nbsp;</td>
          <td class="paramname"> <em>zone</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Delete a zone. 
<p>
Caller must hold the zones lock. Adjusts the other zones as well (parent pointers) after insertion. <dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>zones,:</em>&nbsp;</td><td>the zones tree </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>zone,:</em>&nbsp;</td><td>the zone to delete from tree. Also deletes zone from memory. </td></tr>
  </table>
</dl>

<p>References <a class="el" href="localzone_8c_source.html#l00086">local_zone_delete()</a>, <a class="el" href="localzone_8h_source.html#l00106">local_zone::lock</a>, <a class="el" href="localzone_8h_source.html#l00090">local_zone::parent</a>, <a class="el" href="rbtree_8c_source.html#l00326">rbtree_delete()</a>, <a class="el" href="localzone_8c_source.html#l01162">set_kiddo_parents()</a>, and <a class="el" href="localzone_8h_source.html#l00080">local_zones::ztree</a>.</p>

<p>Referenced by <a class="el" href="remote_8c_source.html#l00987">do_zone_remove()</a>, and <a class="el" href="libunbound_8c_source.html#l00974">ub_ctx_zone_remove()</a>.</p>

</div>
</div><p>
<a class="anchor" name="2f222b2744f769d34725d8e2cd50c101"></a><!-- doxytag: member="localzone.c::local_zones_add_RR" ref="2f222b2744f769d34725d8e2cd50c101" args="(struct local_zones *zones, const char *rr, ldns_buffer *buf)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int local_zones_add_RR           </td>
          <td>(</td>
          <td class="paramtype">struct <a class="el" href="structlocal__zones.html">local_zones</a> *&nbsp;</td>
          <td class="paramname"> <em>zones</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char *&nbsp;</td>
          <td class="paramname"> <em>rr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">ldns_buffer *&nbsp;</td>
          <td class="paramname"> <em>buf</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Add RR data into the localzone data. 
<p>
Looks up the zone, if no covering zone, a transparent zone with the name of the RR is created. <dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>zones,:</em>&nbsp;</td><td>the zones tree. Not locked by caller. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>rr,:</em>&nbsp;</td><td>string with on RR. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>buf,:</em>&nbsp;</td><td>buffer for scratch. </td></tr>
  </table>
</dl>
<dl class="return" compact><dt><b>Returns:</b></dt><dd>false on failure. </dd></dl>

<p>References <a class="el" href="dname_8c_source.html#l00384">dname_count_size_labels()</a>, <a class="el" href="localzone_8c_source.html#l00264">get_rr_nameclass()</a>, <a class="el" href="localzone_8h_source.html#l00065">local_zone_transparent</a>, <a class="el" href="localzone_8c_source.html#l01186">local_zones_add_zone()</a>, <a class="el" href="localzone_8c_source.html#l00881">local_zones_lookup()</a>, <a class="el" href="localzone_8h_source.html#l00106">local_zone::lock</a>, <a class="el" href="localzone_8h_source.html#l00078">local_zones::lock</a>, and <a class="el" href="localzone_8c_source.html#l00441">lz_enter_rr_into_zone()</a>.</p>

<p>Referenced by <a class="el" href="remote_8c_source.html#l01008">do_data_add()</a>, and <a class="el" href="libunbound_8c_source.html#l01000">ub_ctx_data_add()</a>.</p>

</div>
</div><p>
<a class="anchor" name="864ca1da34f4a68e4d74e9ce8fecf3e4"></a><!-- doxytag: member="localzone.c::local_zones_del_data" ref="864ca1da34f4a68e4d74e9ce8fecf3e4" args="(struct local_zones *zones, uint8_t *name, size_t len, int labs, uint16_t dclass)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void local_zones_del_data           </td>
          <td>(</td>
          <td class="paramtype">struct <a class="el" href="structlocal__zones.html">local_zones</a> *&nbsp;</td>
          <td class="paramname"> <em>zones</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint8_t *&nbsp;</td>
          <td class="paramname"> <em>name</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&nbsp;</td>
          <td class="paramname"> <em>len</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&nbsp;</td>
          <td class="paramname"> <em>labs</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint16_t&nbsp;</td>
          <td class="paramname"> <em>dclass</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Remove data from domain name in the tree. 
<p>
All types are removed. No effect if zone or name does not exist. <dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>zones,:</em>&nbsp;</td><td>zones tree. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>name,:</em>&nbsp;</td><td>dname to remove </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>len,:</em>&nbsp;</td><td>length of name. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>labs,:</em>&nbsp;</td><td>labelcount of name. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>dclass,:</em>&nbsp;</td><td>class to remove. </td></tr>
  </table>
</dl>

<p>References <a class="el" href="localzone_8c_source.html#l01277">del_empty_term()</a>, <a class="el" href="localzone_8c_source.html#l00881">local_zones_lookup()</a>, <a class="el" href="localzone_8h_source.html#l00106">local_zone::lock</a>, <a class="el" href="localzone_8h_source.html#l00078">local_zones::lock</a>, <a class="el" href="localzone_8c_source.html#l00393">lz_find_node()</a>, <a class="el" href="localzone_8h_source.html#l00093">local_zone::name</a>, <a class="el" href="localzone_8h_source.html#l00128">local_data::name</a>, <a class="el" href="dname_8c_source.html#l00096">query_dname_compare()</a>, <a class="el" href="localzone_8h_source.html#l00135">local_data::rrsets</a>, and <a class="el" href="localzone_8h_source.html#l00118">local_zone::soa</a>.</p>

<p>Referenced by <a class="el" href="remote_8c_source.html#l01020">do_data_remove()</a>, and <a class="el" href="libunbound_8c_source.html#l01018">ub_ctx_data_remove()</a>.</p>

</div>
</div><p>
</div>
<hr size="1"><address style="text-align: right;"><small>Generated on Tue Oct 13 06:46:31 2009 for unbound by&nbsp;
<a href="http://www.doxygen.org/index.html">
<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.9 </small></address>
</body>
</html>