PageRenderTime 45ms CodeModel.GetById 17ms RepoModel.GetById 0ms app.codeStats 1ms

/doc/ccode/html/ccn__match_8c.html

http://ccnx-trace-interest.googlecode.com/
HTML | 249 lines | 193 code | 16 blank | 40 comment | 0 complexity | afdfec33797acf0653b9a6deeb9ff488 MD5 | raw file
Possible License(s): LGPL-2.1
  1. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
  2. <html><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
  3. <title>Content-Centric Networking in C: lib/ccn_match.c File Reference</title>
  4. <link href="doxygen.css" rel="stylesheet" type="text/css">
  5. <link href="tabs.css" rel="stylesheet" type="text/css">
  6. </head><body>
  7. <!-- Generated by Doxygen 1.5.6 -->
  8. <script type="text/javascript">
  9. <!--
  10. function changeDisplayState (e){
  11. var num=this.id.replace(/[^[0-9]/g,'');
  12. var button=this.firstChild;
  13. var sectionDiv=document.getElementById('dynsection'+num);
  14. if (sectionDiv.style.display=='none'||sectionDiv.style.display==''){
  15. sectionDiv.style.display='block';
  16. button.src='open.gif';
  17. }else{
  18. sectionDiv.style.display='none';
  19. button.src='closed.gif';
  20. }
  21. }
  22. function initDynSections(){
  23. var divs=document.getElementsByTagName('div');
  24. var sectionCounter=1;
  25. for(var i=0;i<divs.length-1;i++){
  26. if(divs[i].className=='dynheader'&&divs[i+1].className=='dynsection'){
  27. var header=divs[i];
  28. var section=divs[i+1];
  29. var button=header.firstChild;
  30. if (button!='IMG'){
  31. divs[i].insertBefore(document.createTextNode(' '),divs[i].firstChild);
  32. button=document.createElement('img');
  33. divs[i].insertBefore(button,divs[i].firstChild);
  34. }
  35. header.style.cursor='pointer';
  36. header.onclick=changeDisplayState;
  37. header.id='dynheader'+sectionCounter;
  38. button.src='closed.gif';
  39. section.id='dynsection'+sectionCounter;
  40. section.style.display='none';
  41. section.style.marginLeft='14px';
  42. sectionCounter++;
  43. }
  44. }
  45. }
  46. window.onload = initDynSections;
  47. -->
  48. </script>
  49. <div class="navigation" id="top">
  50. <div class="tabs">
  51. <ul>
  52. <li><a href="index.html"><span>Main&nbsp;Page</span></a></li>
  53. <li><a href="pages.html"><span>Related&nbsp;Pages</span></a></li>
  54. <li><a href="annotated.html"><span>Data&nbsp;Structures</span></a></li>
  55. <li class="current"><a href="files.html"><span>Files</span></a></li>
  56. <li><a href="dirs.html"><span>Directories</span></a></li>
  57. </ul>
  58. </div>
  59. <div class="navpath"><a class="el" href="dir_d294727123e4a9950cfa1260f7dd34bc.html">lib</a>
  60. </div>
  61. </div>
  62. <div class="contents">
  63. <h1>ccn_match.c File Reference</h1>Support for the match predicate between interest and content. <a href="#_details">More...</a>
  64. <p>
  65. <p>
  66. <a href="ccn__match_8c-source.html">Go to the source code of this file.</a><table border="0" cellpadding="0" cellspacing="0">
  67. <tr><td></td></tr>
  68. <tr><td colspan="2"><br><h2>Functions</h2></td></tr>
  69. <tr><td class="memItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="ccn__match_8c.html#fb9d2587d92fdbb92b7b1eee41bd7aab">ccn_digest_ContentObject</a> (const unsigned char *content_object, struct <a class="el" href="structccn__parsed___content_object.html">ccn_parsed_ContentObject</a> *pc)</td></tr>
  70. <tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Compute the digest of the entire ContentObject if necessary, caching the result in pc-&gt;digest, pc-&gt;digest_bytes. <a href="#fb9d2587d92fdbb92b7b1eee41bd7aab"></a><br></td></tr>
  71. <tr><td class="memItemLeft" nowrap align="right" valign="top">static int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="ccn__match_8c.html#e0c8eb0ebf1238cc623dd735b91be527">ccn_pubid_matches</a> (const unsigned char *content_object, struct <a class="el" href="structccn__parsed___content_object.html">ccn_parsed_ContentObject</a> *pc, const unsigned char *interest_msg, const struct <a class="el" href="structccn__parsed__interest.html">ccn_parsed_interest</a> *pi)</td></tr>
  72. <tr><td class="memItemLeft" nowrap align="right" valign="top">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="ccn__match_8c.html#2e161e1c17ef110dfa019bc1d560c82c">ccn_content_matches_interest</a> (const unsigned char *content_object, size_t content_object_size, int implicit_content_digest, struct <a class="el" href="structccn__parsed___content_object.html">ccn_parsed_ContentObject</a> *pc, const unsigned char *interest_msg, size_t interest_msg_size, const struct <a class="el" href="structccn__parsed__interest.html">ccn_parsed_interest</a> *pi)</td></tr>
  73. <tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Test for a match between a ContentObject and an Interest. <a href="#2e161e1c17ef110dfa019bc1d560c82c"></a><br></td></tr>
  74. </table>
  75. <hr><a name="_details"></a><h2>Detailed Description</h2>
  76. Support for the match predicate between interest and content.
  77. <p>
  78. Part of the CCNx C Library.<p>
  79. Copyright (C) 2008, 2009 Palo Alto Research Center, Inc.<p>
  80. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License version 2.1 as published by the Free Software Foundation. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  81. <p>Definition in file <a class="el" href="ccn__match_8c-source.html">ccn_match.c</a>.</p>
  82. <hr><h2>Function Documentation</h2>
  83. <a class="anchor" name="2e161e1c17ef110dfa019bc1d560c82c"></a><!-- doxytag: member="ccn_match.c::ccn_content_matches_interest" ref="2e161e1c17ef110dfa019bc1d560c82c" args="(const unsigned char *content_object, size_t content_object_size, int implicit_content_digest, struct ccn_parsed_ContentObject *pc, const unsigned char *interest_msg, size_t interest_msg_size, const struct ccn_parsed_interest *pi)" -->
  84. <div class="memitem">
  85. <div class="memproto">
  86. <table class="memname">
  87. <tr>
  88. <td class="memname">int ccn_content_matches_interest </td>
  89. <td>(</td>
  90. <td class="paramtype">const unsigned char *&nbsp;</td>
  91. <td class="paramname"> <em>content_object</em>, </td>
  92. </tr>
  93. <tr>
  94. <td class="paramkey"></td>
  95. <td></td>
  96. <td class="paramtype">size_t&nbsp;</td>
  97. <td class="paramname"> <em>content_object_size</em>, </td>
  98. </tr>
  99. <tr>
  100. <td class="paramkey"></td>
  101. <td></td>
  102. <td class="paramtype">int&nbsp;</td>
  103. <td class="paramname"> <em>implicit_content_digest</em>, </td>
  104. </tr>
  105. <tr>
  106. <td class="paramkey"></td>
  107. <td></td>
  108. <td class="paramtype">struct <a class="el" href="structccn__parsed___content_object.html">ccn_parsed_ContentObject</a> *&nbsp;</td>
  109. <td class="paramname"> <em>pc</em>, </td>
  110. </tr>
  111. <tr>
  112. <td class="paramkey"></td>
  113. <td></td>
  114. <td class="paramtype">const unsigned char *&nbsp;</td>
  115. <td class="paramname"> <em>interest_msg</em>, </td>
  116. </tr>
  117. <tr>
  118. <td class="paramkey"></td>
  119. <td></td>
  120. <td class="paramtype">size_t&nbsp;</td>
  121. <td class="paramname"> <em>interest_msg_size</em>, </td>
  122. </tr>
  123. <tr>
  124. <td class="paramkey"></td>
  125. <td></td>
  126. <td class="paramtype">const struct <a class="el" href="structccn__parsed__interest.html">ccn_parsed_interest</a> *&nbsp;</td>
  127. <td class="paramname"> <em>pi</em></td><td>&nbsp;</td>
  128. </tr>
  129. <tr>
  130. <td></td>
  131. <td>)</td>
  132. <td></td><td></td><td></td>
  133. </tr>
  134. </table>
  135. </div>
  136. <div class="memdoc">
  137. <p>
  138. Test for a match between a ContentObject and an Interest.
  139. <p>
  140. <dl compact><dt><b>Parameters:</b></dt><dd>
  141. <table border="0" cellspacing="2" cellpadding="0">
  142. <tr><td valign="top"></td><td valign="top"><em>content_object</em>&nbsp;</td><td>ccnb-encoded ContentObject </td></tr>
  143. <tr><td valign="top"></td><td valign="top"><em>content_object_size</em>&nbsp;</td><td>its size in bytes </td></tr>
  144. <tr><td valign="top"></td><td valign="top"><em>implicit_content_digest</em>&nbsp;</td><td>boolean indicating whether the final name component is implicit (as in the on-wire format) or explicit (as within ccnd's content store). </td></tr>
  145. <tr><td valign="top"></td><td valign="top"><em>pc</em>&nbsp;</td><td>Valid parse information may be provided to speed things up. If NULL it will be reconstructed internally. </td></tr>
  146. <tr><td valign="top"></td><td valign="top"><em>interest_msg</em>&nbsp;</td><td>ccnb-encoded Interest </td></tr>
  147. <tr><td valign="top"></td><td valign="top"><em>interest_msg_size</em>&nbsp;</td><td>its size in bytes </td></tr>
  148. <tr><td valign="top"></td><td valign="top"><em>pi</em>&nbsp;</td><td>see _pc_</td></tr>
  149. </table>
  150. </dl>
  151. <dl class="return" compact><dt><b>Returns:</b></dt><dd>1 if the ccnb-encoded content_object matches the ccnb-encoded interest_msg, otherwise 0. </dd></dl>
  152. <p>Definition at line <a class="el" href="ccn__match_8c-source.html#l00110">110</a> of file <a class="el" href="ccn__match_8c-source.html">ccn_match.c</a>.</p>
  153. <p>Referenced by <a class="el" href="ccn__client_8c-source.html#l01153">ccn_dispatch_message()</a>, <a class="el" href="ccnd__internal__client_8c-source.html#l00127">ccnd_answer_req()</a>, <a class="el" href="ccnd_8c-source.html#l01354">consume_matching_interests()</a>, <a class="el" href="ccnput_8c-source.html#l00078">incoming_interest()</a>, <a class="el" href="dataresponsetest_8c-source.html#l00212">interest_handler()</a>, <a class="el" href="ccnd_8c-source.html#l03524">process_incoming_interest()</a>, and <a class="el" href="ccn__seqwriter_8c-source.html#l00063">seqw_incoming_interest()</a>.</p>
  154. </div>
  155. </div><p>
  156. <a class="anchor" name="fb9d2587d92fdbb92b7b1eee41bd7aab"></a><!-- doxytag: member="ccn_match.c::ccn_digest_ContentObject" ref="fb9d2587d92fdbb92b7b1eee41bd7aab" args="(const unsigned char *content_object, struct ccn_parsed_ContentObject *pc)" -->
  157. <div class="memitem">
  158. <div class="memproto">
  159. <table class="memname">
  160. <tr>
  161. <td class="memname">void ccn_digest_ContentObject </td>
  162. <td>(</td>
  163. <td class="paramtype">const unsigned char *&nbsp;</td>
  164. <td class="paramname"> <em>content_object</em>, </td>
  165. </tr>
  166. <tr>
  167. <td class="paramkey"></td>
  168. <td></td>
  169. <td class="paramtype">struct <a class="el" href="structccn__parsed___content_object.html">ccn_parsed_ContentObject</a> *&nbsp;</td>
  170. <td class="paramname"> <em>pc</em></td><td>&nbsp;</td>
  171. </tr>
  172. <tr>
  173. <td></td>
  174. <td>)</td>
  175. <td></td><td></td><td></td>
  176. </tr>
  177. </table>
  178. </div>
  179. <div class="memdoc">
  180. <p>
  181. Compute the digest of the entire ContentObject if necessary, caching the result in pc-&gt;digest, pc-&gt;digest_bytes.
  182. <p>
  183. <p>Definition at line <a class="el" href="ccn__match_8c-source.html#l00033">33</a> of file <a class="el" href="ccn__match_8c-source.html">ccn_match.c</a>.</p>
  184. <p>Referenced by <a class="el" href="ccn__match_8c-source.html#l00110">ccn_content_matches_interest()</a>, <a class="el" href="ccnls_8c-source.html#l00052">incoming_content()</a>, and <a class="el" href="ccnd_8c-source.html#l03783">process_incoming_content()</a>.</p>
  185. </div>
  186. </div><p>
  187. <a class="anchor" name="e0c8eb0ebf1238cc623dd735b91be527"></a><!-- doxytag: member="ccn_match.c::ccn_pubid_matches" ref="e0c8eb0ebf1238cc623dd735b91be527" args="(const unsigned char *content_object, struct ccn_parsed_ContentObject *pc, const unsigned char *interest_msg, const struct ccn_parsed_interest *pi)" -->
  188. <div class="memitem">
  189. <div class="memproto">
  190. <table class="memname">
  191. <tr>
  192. <td class="memname">static int ccn_pubid_matches </td>
  193. <td>(</td>
  194. <td class="paramtype">const unsigned char *&nbsp;</td>
  195. <td class="paramname"> <em>content_object</em>, </td>
  196. </tr>
  197. <tr>
  198. <td class="paramkey"></td>
  199. <td></td>
  200. <td class="paramtype">struct <a class="el" href="structccn__parsed___content_object.html">ccn_parsed_ContentObject</a> *&nbsp;</td>
  201. <td class="paramname"> <em>pc</em>, </td>
  202. </tr>
  203. <tr>
  204. <td class="paramkey"></td>
  205. <td></td>
  206. <td class="paramtype">const unsigned char *&nbsp;</td>
  207. <td class="paramname"> <em>interest_msg</em>, </td>
  208. </tr>
  209. <tr>
  210. <td class="paramkey"></td>
  211. <td></td>
  212. <td class="paramtype">const struct <a class="el" href="structccn__parsed__interest.html">ccn_parsed_interest</a> *&nbsp;</td>
  213. <td class="paramname"> <em>pi</em></td><td>&nbsp;</td>
  214. </tr>
  215. <tr>
  216. <td></td>
  217. <td>)</td>
  218. <td></td><td></td><td><code> [static]</code></td>
  219. </tr>
  220. </table>
  221. </div>
  222. <div class="memdoc">
  223. <p>
  224. <p>Definition at line <a class="el" href="ccn__match_8c-source.html#l00055">55</a> of file <a class="el" href="ccn__match_8c-source.html">ccn_match.c</a>.</p>
  225. <p>Referenced by <a class="el" href="ccn__match_8c-source.html#l00110">ccn_content_matches_interest()</a>.</p>
  226. </div>
  227. </div><p>
  228. </div>
  229. <hr size="1"><address style="text-align: right;"><small>Generated on Wed Sep 14 12:44:16 2011 for Content-Centric Networking in C by&nbsp;
  230. <a href="http://www.doxygen.org/index.html">
  231. <img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.6 </small></address>
  232. </body>
  233. </html>