Sophie

Sophie

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

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: pythonmod/pythonmod_utils.h 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_c174c9fff4b3cb93696db8ab0b7b74e5.html">pythonmod</a>
  </div>
</div>
<div class="contents">
<h1>pythonmod_utils.h File Reference</h1>Utility functions for the python module that perform stores and loads and conversions.  
<a href="#_details">More...</a>
<p>
<code>#include &quot;<a class="el" href="module_8h.html">util/module.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">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="pythonmod__utils_8h.html#bcbb6d02a86a92e5569d53a347538213">storeQueryInCache</a> (struct <a class="el" href="structmodule__qstate.html">module_qstate</a> *qstate, struct <a class="el" href="structquery__info.html">query_info</a> *qinfo, struct <a class="el" href="structreply__info.html">reply_info</a> *msgrep, int is_referral)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Store the <a class="el" href="structreply__info.html" title="Structure to store DNS query and the reply packet.">reply_info</a> and <a class="el" href="structquery__info.html" title="Structure to store query information that makes answers to queries different.">query_info</a> pair in message cache (qstate-&gt;msg_cache).  <a href="#bcbb6d02a86a92e5569d53a347538213"></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="pythonmod__utils_8h.html#2516e3c597db605fd5ad8c293fe5c26d">invalidateQueryInCache</a> (struct <a class="el" href="structmodule__qstate.html">module_qstate</a> *qstate, struct <a class="el" href="structquery__info.html">query_info</a> *qinfo)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Invalidate the message associated with <a class="el" href="structquery__info.html" title="Structure to store query information that makes answers to queries different.">query_info</a> stored in message cache.  <a href="#2516e3c597db605fd5ad8c293fe5c26d"></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="pythonmod__utils_8h.html#744cd4e02f4c2d3da4522d762f91ab0f">createResponse</a> (struct <a class="el" href="structmodule__qstate.html">module_qstate</a> *qstate, ldns_buffer *pkt)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Create response according to the ldns packet content.  <a href="#744cd4e02f4c2d3da4522d762f91ab0f"></a><br></td></tr>
</table>
<hr><h2>Detailed Description</h2>
Utility functions for the python module that perform stores and loads and conversions. 
<p>
<hr><h2>Function Documentation</h2>
<a class="anchor" name="bcbb6d02a86a92e5569d53a347538213"></a><!-- doxytag: member="pythonmod_utils.h::storeQueryInCache" ref="bcbb6d02a86a92e5569d53a347538213" args="(struct module_qstate *qstate, struct query_info *qinfo, struct reply_info *msgrep, int is_referral)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int storeQueryInCache           </td>
          <td>(</td>
          <td class="paramtype">struct <a class="el" href="structmodule__qstate.html">module_qstate</a> *&nbsp;</td>
          <td class="paramname"> <em>qstate</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="structreply__info.html">reply_info</a> *&nbsp;</td>
          <td class="paramname"> <em>msgrep</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&nbsp;</td>
          <td class="paramname"> <em>is_referral</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Store the <a class="el" href="structreply__info.html" title="Structure to store DNS query and the reply packet.">reply_info</a> and <a class="el" href="structquery__info.html" title="Structure to store query information that makes answers to queries different.">query_info</a> pair in message cache (qstate-&gt;msg_cache). 
<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>qstate,:</em>&nbsp;</td><td>module environment </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>qinfo,:</em>&nbsp;</td><td>query info, the query for which answer is stored. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>msgrep,:</em>&nbsp;</td><td>reply in <a class="el" href="structdns__msg.html" title="Region allocated message reply.">dns_msg</a> </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>is_referral,:</em>&nbsp;</td><td>If true, then the given message to be stored is a referral. The cache implementation may use this as a hint. It will store only the RRsets, not the message. </td></tr>
  </table>
</dl>
<dl class="return" compact><dt><b>Returns:</b></dt><dd>0 on alloc error (out of memory). </dd></dl>

<p>References <a class="el" href="msgreply_8h_source.html#l00105">reply_info::authoritative</a>, <a class="el" href="dns_8c_source.html#l00668">dns_cache_store()</a>, and <a class="el" href="module_8h_source.html#l00286">module_qstate::env</a>.</p>

</div>
</div><p>
<a class="anchor" name="2516e3c597db605fd5ad8c293fe5c26d"></a><!-- doxytag: member="pythonmod_utils.h::invalidateQueryInCache" ref="2516e3c597db605fd5ad8c293fe5c26d" args="(struct module_qstate *qstate, struct query_info *qinfo)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void invalidateQueryInCache           </td>
          <td>(</td>
          <td class="paramtype">struct <a class="el" href="structmodule__qstate.html">module_qstate</a> *&nbsp;</td>
          <td class="paramname"> <em>qstate</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><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Invalidate the message associated with <a class="el" href="structquery__info.html" title="Structure to store query information that makes answers to queries different.">query_info</a> stored in message cache. 
<p>
This function invalidates the record in message cache associated with the given query only if such a record exists.<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>qstate,:</em>&nbsp;</td><td>module environment </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>qinfo,:</em>&nbsp;</td><td>query info, the query for which answer is stored. </td></tr>
  </table>
</dl>

<p>References <a class="el" href="packed__rrset_8h_source.html#l00211">packed_rrset_data::count</a>, <a class="el" href="lruhash_8h_source.html#l00222">lruhash_entry::data</a>, <a class="el" href="packed__rrset_8h_source.html#l00094">ub_packed_rrset_key::entry</a>, <a class="el" href="module_8h_source.html#l00286">module_qstate::env</a>, <a class="el" href="msgreply_8h_source.html#l00078">rrset_ref::key</a>, <a class="el" href="lruhash_8h_source.html#l00210">lruhash_entry::lock</a>, <a class="el" href="log_8c_source.html#l00228">log_info()</a>, <a class="el" href="module_8h_source.html#l00075">module_env::msg_cache</a>, <a class="el" href="module_8h_source.html#l00198">module_env::now</a>, <a class="el" href="msgreply_8c_source.html#l00586">query_info_hash()</a>, <a class="el" href="msgreply_8h_source.html#l00168">reply_info::ref</a>, <a class="el" href="packed__rrset_8h_source.html#l00221">packed_rrset_data::rr_ttl</a>, <a class="el" href="rrset_8c_source.html#l00258">rrset_array_lock()</a>, <a class="el" href="rrset_8c_source.html#l00277">rrset_array_unlock()</a>, <a class="el" href="msgreply_8h_source.html#l00141">reply_info::rrset_count</a>, <a class="el" href="packed__rrset_8h_source.html#l00213">packed_rrset_data::rrsig_count</a>, <a class="el" href="slabhash_8c_source.html#l00122">slabhash_lookup()</a>, <a class="el" href="packed__rrset_8h_source.html#l00209">packed_rrset_data::ttl</a>, and <a class="el" href="msgreply_8h_source.html#l00120">reply_info::ttl</a>.</p>

</div>
</div><p>
<a class="anchor" name="744cd4e02f4c2d3da4522d762f91ab0f"></a><!-- doxytag: member="pythonmod_utils.h::createResponse" ref="744cd4e02f4c2d3da4522d762f91ab0f" args="(struct module_qstate *qstate, ldns_buffer *pkt)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int createResponse           </td>
          <td>(</td>
          <td class="paramtype">struct <a class="el" href="structmodule__qstate.html">module_qstate</a> *&nbsp;</td>
          <td class="paramname"> <em>qstate</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">ldns_buffer *&nbsp;</td>
          <td class="paramname"> <em>pkt</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Create response according to the ldns packet content. 
<p>
This function fills qstate.return_msg up with data of a given packet<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>qstate,:</em>&nbsp;</td><td>module environment </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>pkt,:</em>&nbsp;</td><td>a ldns_buffer which contains ldns_packet data </td></tr>
  </table>
</dl>

<p>References <a class="el" href="net__help_8h_source.html#l00054">BIT_CD</a>, <a class="el" href="module_8h_source.html#l00286">module_qstate::env</a>, <a class="el" href="msgreply_8c_source.html#l00755">log_dns_msg()</a>, <a class="el" href="log_8c_source.html#l00241">log_err()</a>, <a class="el" href="msgreply_8c_source.html#l00397">parse_create_msg()</a>, <a class="el" href="msgparse_8c_source.html#l00896">parse_extract_edns()</a>, <a class="el" href="msgparse_8c_source.html#l00863">parse_packet()</a>, <a class="el" href="dns_8h_source.html#l00057">dns_msg::qinfo</a>, <a class="el" href="module_8h_source.html#l00277">module_qstate::region</a>, <a class="el" href="regional_8c_source.html#l00116">regional_alloc()</a>, <a class="el" href="dns_8h_source.html#l00059">dns_msg::rep</a>, <a class="el" href="module_8h_source.html#l00273">module_qstate::return_msg</a>, <a class="el" href="module_8h_source.html#l00186">module_env::scratch</a>, <a class="el" href="log_8h_source.html#l00058">VERB_ALGO</a>, <a class="el" href="ldns-testpkts_8c.html#a557e5b23b2833d7c1ec0415a1bdd2b1">verbose()</a>, and <a class="el" href="log_8c_source.html#l00062">verbosity</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>