Sophie

Sophie

distrib > Mandriva > 2010.0 > i586 > media > contrib-release > by-pkgid > 29c369053a983cc5d8c880dc6e0a2237 > files > 550

libdtn-devel-2.6.0-2mdv2009.1.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>DTN Reference Implementation: ResponseTLV.cc Source File</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.8 -->
<div class="navigation" id="top">
  <div class="tabs">
    <ul>
      <li><a href="main.html"><span>Main&nbsp;Page</span></a></li>
      <li><a href="namespaces.html"><span>Namespaces</span></a></li>
      <li><a href="annotated.html"><span>Classes</span></a></li>
      <li class="current"><a href="files.html"><span>Files</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>File&nbsp;Members</span></a></li>
    </ul>
  </div>
<h1>ResponseTLV.cc</h1><a href="ResponseTLV_8cc.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/*</span>
<a name="l00002"></a>00002 <span class="comment"> *    Copyright 2007 Baylor University</span>
<a name="l00003"></a>00003 <span class="comment"> *</span>
<a name="l00004"></a>00004 <span class="comment"> *    Licensed under the Apache License, Version 2.0 (the "License");</span>
<a name="l00005"></a>00005 <span class="comment"> *    you may not use this file except in compliance with the License.</span>
<a name="l00006"></a>00006 <span class="comment"> *    You may obtain a copy of the License at</span>
<a name="l00007"></a>00007 <span class="comment"> *</span>
<a name="l00008"></a>00008 <span class="comment"> *        http://www.apache.org/licenses/LICENSE-2.0</span>
<a name="l00009"></a>00009 <span class="comment"> *</span>
<a name="l00010"></a>00010 <span class="comment"> *    Unless required by applicable law or agreed to in writing, software</span>
<a name="l00011"></a>00011 <span class="comment"> *    distributed under the License is distributed on an "AS IS" BASIS,</span>
<a name="l00012"></a>00012 <span class="comment"> *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.</span>
<a name="l00013"></a>00013 <span class="comment"> *    See the License for the specific language governing permissions and</span>
<a name="l00014"></a>00014 <span class="comment"> *    limitations under the License.</span>
<a name="l00015"></a>00015 <span class="comment"> */</span>
<a name="l00016"></a>00016 
<a name="l00017"></a>00017 <span class="preprocessor">#include &lt;arpa/inet.h&gt;</span> <span class="comment">// for hton[ls] and ntoh[ls]</span>
<a name="l00018"></a>00018 <span class="preprocessor">#include "<a class="code" href="ResponseTLV_8h.html">ResponseTLV.h</a>"</span>
<a name="l00019"></a>00019 
<a name="l00020"></a>00020 <span class="keyword">namespace </span>prophet
<a name="l00021"></a>00021 {
<a name="l00022"></a>00022 
<a name="l00023"></a><a class="code" href="classprophet_1_1ResponseTLV.html#07f1b18a22e4a75776c6f098ef2dc9ea">00023</a> <a class="code" href="classprophet_1_1ResponseTLV.html#07f1b18a22e4a75776c6f098ef2dc9ea" title="Constructor.">ResponseTLV::ResponseTLV</a>()
<a name="l00024"></a>00024     : <a class="code" href="classprophet_1_1BundleTLV.html">BundleTLV</a>(<a class="code" href="classprophet_1_1BaseTLV.html" title="The Prophet I-D (March 2006) dictates five bytecodes for router state exchange messages...">BaseTLV</a>::RESPONSE_TLV) {}
<a name="l00025"></a>00025 
<a name="l00026"></a><a class="code" href="classprophet_1_1ResponseTLV.html#8bc1b2c10a5f30f8aaf3b3f50bd560b2">00026</a> <a class="code" href="classprophet_1_1ResponseTLV.html#07f1b18a22e4a75776c6f098ef2dc9ea" title="Constructor.">ResponseTLV::ResponseTLV</a>(<span class="keyword">const</span> <a class="code" href="classprophet_1_1BundleResponseList.html" title="In-memory representation of list of bundle response entries from a Bundle TLV sent...">BundleResponseList</a>&amp; bl)
<a name="l00027"></a>00027     : <a class="code" href="classprophet_1_1BundleTLV.html">BundleTLV</a>(<a class="code" href="classprophet_1_1BaseTLV.html" title="The Prophet I-D (March 2006) dictates five bytecodes for router state exchange messages...">BaseTLV</a>::RESPONSE_TLV,0,bl.guess_size(BundleEntrySize)),
<a name="l00028"></a>00028       list_(bl) {}
<a name="l00029"></a>00029 
<a name="l00030"></a>00030 <span class="keywordtype">size_t</span>
<a name="l00031"></a><a class="code" href="classprophet_1_1ResponseTLV.html#547a6db2abc38e7a5b7465b83f524966">00031</a> <a class="code" href="classprophet_1_1ResponseTLV.html#547a6db2abc38e7a5b7465b83f524966" title="Virtual from BaseTLV.">ResponseTLV::serialize</a>(u_char* bp, <span class="keywordtype">size_t</span> <a class="code" href="num2sdnv_8c.html#fed088663f8704004425cdae2120b9b3">len</a>)<span class="keyword"> const</span>
<a name="l00032"></a>00032 <span class="keyword"></span>{
<a name="l00033"></a>00033     <span class="comment">// weed out the oddball</span>
<a name="l00034"></a>00034     <span class="keywordflow">if</span> (bp == NULL) <span class="keywordflow">return</span> 0;
<a name="l00035"></a>00035     <span class="keywordflow">if</span> (<a class="code" href="classprophet_1_1BaseTLV.html#88263c57b5c2760ece631ce8943c6249" title="typecode for this TLV">typecode_</a> != <a class="code" href="classprophet_1_1BaseTLV.html#37c3690d6040c870b40fa0436b67b09d41b6935bfc9badb7cc041dada67836e5">BaseTLV::RESPONSE_TLV</a>) <span class="keywordflow">return</span> 0;
<a name="l00036"></a>00036 
<a name="l00037"></a>00037     <span class="comment">// check that lengths match up</span>
<a name="l00038"></a>00038     <span class="keywordflow">if</span> (<a class="code" href="classprophet_1_1BundleTLV.html#9f8735ed361f09d5bb05fc0975c6b191">BundleTLVHeaderSize</a> +
<a name="l00039"></a>00039             <a class="code" href="classprophet_1_1ResponseTLV.html#2095ca1150778670babbbce1c56f9724" title="Priority sorted list of Bundles to request from peer.">list_</a>.<a class="code" href="classprophet_1_1BundleEntryList.html#881e48ea062bab1b88fd041f8f773f4a" title="Estimate serialized buffer length.">guess_size</a>(<a class="code" href="classprophet_1_1BundleTLV.html#a7921e77cc4c5585d79932a24b8a7927">BundleEntrySize</a>) &gt; len)
<a name="l00040"></a>00040         <span class="keywordflow">return</span> 0;
<a name="l00041"></a>00041 
<a name="l00042"></a>00042     <span class="comment">// account for bytes written</span>
<a name="l00043"></a>00043     <a class="code" href="classprophet_1_1BaseTLV.html#4c0a7b24b795bafb52c16b24a6188823" title="serialized length of TLV, mutable so it can be assigned by serialize() const">length_</a> = 0;
<a name="l00044"></a>00044 
<a name="l00045"></a>00045     <span class="comment">// start writing out to buffer</span>
<a name="l00046"></a>00046     <a class="code" href="structprophet_1_1BundleTLV_1_1BundleTLVHeader.html" title="Bundle Offer/Response Header  p.">BundleTLVHeader</a>* hdr = (<a class="code" href="structprophet_1_1BundleTLV_1_1BundleTLVHeader.html" title="Bundle Offer/Response Header  p.">BundleTLVHeader</a>*) bp;
<a name="l00047"></a>00047     memset(hdr, 0, <a class="code" href="classprophet_1_1BundleTLV.html#9f8735ed361f09d5bb05fc0975c6b191">BundleTLVHeaderSize</a>);
<a name="l00048"></a>00048     hdr-&gt;<a class="code" href="structprophet_1_1BundleTLV_1_1BundleTLVHeader.html#83ceb3125a38cddbc859463ebd12cbe1" title="defined as 0xA2">type</a> = <a class="code" href="classprophet_1_1BaseTLV.html#37c3690d6040c870b40fa0436b67b09d41b6935bfc9badb7cc041dada67836e5">BaseTLV::RESPONSE_TLV</a>;
<a name="l00049"></a>00049     hdr-&gt;<a class="code" href="structprophet_1_1BundleTLV_1_1BundleTLVHeader.html#700b11136c08d66b3a4132fc7e22e6e6" title="TBD.">flags</a> = 0;
<a name="l00050"></a>00050     hdr-&gt;<a class="code" href="structprophet_1_1BundleTLV_1_1BundleTLVHeader.html#3caebac83135faee423f6a09ade8c776" title="Number of bundle offer entries.">offer_count</a> = htons(<a class="code" href="classprophet_1_1ResponseTLV.html#2095ca1150778670babbbce1c56f9724" title="Priority sorted list of Bundles to request from peer.">list_</a>.<a class="code" href="classprophet_1_1BundleEntryList.html#7f9d7c0e391d203027f2ce3ba3eca232" title="Return number of Bundle offers in list.">size</a>());
<a name="l00051"></a>00051 
<a name="l00052"></a>00052     <a class="code" href="classprophet_1_1BaseTLV.html#4c0a7b24b795bafb52c16b24a6188823" title="serialized length of TLV, mutable so it can be assigned by serialize() const">length_</a> += <a class="code" href="classprophet_1_1BundleTLV.html#9f8735ed361f09d5bb05fc0975c6b191">BundleTLVHeaderSize</a>;
<a name="l00053"></a>00053     bp      += <a class="code" href="classprophet_1_1BundleTLV.html#9f8735ed361f09d5bb05fc0975c6b191">BundleTLVHeaderSize</a>;
<a name="l00054"></a>00054     len     -= <a class="code" href="classprophet_1_1BundleTLV.html#9f8735ed361f09d5bb05fc0975c6b191">BundleTLVHeaderSize</a>;
<a name="l00055"></a>00055 
<a name="l00056"></a>00056     <span class="comment">// write out each Bundle offer</span>
<a name="l00057"></a>00057     <span class="keywordflow">for</span> (<a class="code" href="classprophet_1_1BundleEntryList.html#3332c2306c20626dd5e0b9767ac2c378">BundleResponseList::const_iterator</a> i = <a class="code" href="classprophet_1_1ResponseTLV.html#2095ca1150778670babbbce1c56f9724" title="Priority sorted list of Bundles to request from peer.">list_</a>.<a class="code" href="classprophet_1_1BundleEntryList.html#475b43261ea35c8ff5ef1c9104b3fe78" title="These iterators are not thread safe.">begin</a>();
<a name="l00058"></a>00058          i != <a class="code" href="classprophet_1_1ResponseTLV.html#2095ca1150778670babbbce1c56f9724" title="Priority sorted list of Bundles to request from peer.">list_</a>.<a class="code" href="classprophet_1_1BundleEntryList.html#bc89e63957c0c2242d9d7b1396f273f0" title="These iterators are not thread safe.">end</a>();
<a name="l00059"></a>00059          i++)
<a name="l00060"></a>00060     {
<a name="l00061"></a>00061         <a class="code" href="classprophet_1_1BundleResponseEntry.html" title="BundleResponseEntry represents one Bundle, a single entry in a Bundle TLV sent by...">BundleResponseEntry</a>* b = *i;
<a name="l00062"></a>00062         <span class="keywordtype">size_t</span> bytes_written =
<a name="l00063"></a>00063             <a class="code" href="classprophet_1_1BundleTLV.html#eeadbbb84b780c5d390a9f1e6318c850" title="Serialize BundleOfferTLVEntry out to no more than len bytes of buffer; return bytes...">BundleTLV::write_bundle_entry</a>(b-&gt;<a class="code" href="classprophet_1_1BundleTLVEntry.html#1cf4b89ca8699e54a91e04dd4fc7c86e" title="Accessors.">creation_ts</a>(),
<a name="l00064"></a>00064                                     b-&gt;<a class="code" href="classprophet_1_1BundleTLVEntry.html#f53626463b117791141a4c6e1367eecc" title="Accessors.">seqno</a>(), b-&gt;<a class="code" href="classprophet_1_1BundleTLVEntry.html#c470331376431b7ac04bc76578011298" title="Accessors.">sid</a>(), b-&gt;<a class="code" href="classprophet_1_1BundleTLVEntry.html#b0ed670f0d842a2f68a527e72c14d266" title="Accessors.">custody</a>(),
<a name="l00065"></a>00065                                     b-&gt;<a class="code" href="classprophet_1_1BundleTLVEntry.html#40379b850503c0a3d9c9bc8bd1143abb" title="Accessors.">accept</a>(), b-&gt;<a class="code" href="classprophet_1_1BundleTLVEntry.html#6743ec6543c7e9051d68fc2bf3b166a4" title="Accessors.">ack</a>(), b-&gt;<a class="code" href="classprophet_1_1BundleTLVEntry.html#2d97556fa7fb52f5a8b041b463f59e72" title="Accessors.">type</a>(),
<a name="l00066"></a>00066                                     bp, len);
<a name="l00067"></a>00067 
<a name="l00068"></a>00068         <span class="keywordflow">if</span> (<a class="code" href="classprophet_1_1BundleTLV.html#a7921e77cc4c5585d79932a24b8a7927">BundleEntrySize</a> &gt; bytes_written) <span class="keywordflow">break</span>;
<a name="l00069"></a>00069 
<a name="l00070"></a>00070         length_ += bytes_written;
<a name="l00071"></a>00071         len     -= bytes_written;
<a name="l00072"></a>00072         bp      += bytes_written;
<a name="l00073"></a>00073     }
<a name="l00074"></a>00074 
<a name="l00075"></a>00075     hdr-&gt;<a class="code" href="structprophet_1_1BundleTLV_1_1BundleTLVHeader.html#eeff4bf7749c53b5210337567549c659" title="Length of the TLV in octets, including the TLV header and any nested TLVs.">length</a> = htons(length_);
<a name="l00076"></a>00076     <span class="keywordflow">return</span> length_;
<a name="l00077"></a>00077 }
<a name="l00078"></a>00078 
<a name="l00079"></a>00079 <span class="keywordtype">bool</span>
<a name="l00080"></a><a class="code" href="classprophet_1_1ResponseTLV.html#4ebb2b665c2708911b6a83df20717164">00080</a> <a class="code" href="classprophet_1_1ResponseTLV.html#4ebb2b665c2708911b6a83df20717164" title="Virtual from BaseTLV.">ResponseTLV::deserialize</a>(<span class="keyword">const</span> u_char* bp, <span class="keywordtype">size_t</span> <a class="code" href="num2sdnv_8c.html#fed088663f8704004425cdae2120b9b3">len</a>)
<a name="l00081"></a>00081 {
<a name="l00082"></a>00082     <span class="comment">// weed out the oddball</span>
<a name="l00083"></a>00083     <span class="keywordflow">if</span> (bp == NULL) <span class="keywordflow">return</span> <span class="keyword">false</span>;
<a name="l00084"></a>00084     <span class="keywordflow">if</span> (<a class="code" href="classprophet_1_1BaseTLV.html#88263c57b5c2760ece631ce8943c6249" title="typecode for this TLV">typecode_</a> != <a class="code" href="classprophet_1_1BaseTLV.html#37c3690d6040c870b40fa0436b67b09d41b6935bfc9badb7cc041dada67836e5">RESPONSE_TLV</a>) <span class="keywordflow">return</span> <span class="keyword">false</span>;
<a name="l00085"></a>00085     <span class="keywordflow">if</span> (! <a class="code" href="classprophet_1_1ResponseTLV.html#2095ca1150778670babbbce1c56f9724" title="Priority sorted list of Bundles to request from peer.">list_</a>.<a class="code" href="classprophet_1_1BundleEntryList.html#2ac8813783a19d6a1ec23915ce958032" title="Return whether list is empty.">empty</a>()) <span class="keywordflow">return</span> <span class="keyword">false</span>;
<a name="l00086"></a>00086 
<a name="l00087"></a>00087     <span class="comment">// check that lengths match up</span>
<a name="l00088"></a>00088     <span class="keywordflow">if</span> (<a class="code" href="classprophet_1_1BundleTLV.html#9f8735ed361f09d5bb05fc0975c6b191">BundleTLVHeaderSize</a> &gt; len) <span class="keywordflow">return</span> <span class="keyword">false</span>;
<a name="l00089"></a>00089 
<a name="l00090"></a>00090     <span class="comment">// zero out accounting</span>
<a name="l00091"></a>00091     <span class="keywordtype">size_t</span> amt_read = 0;
<a name="l00092"></a>00092     <a class="code" href="classprophet_1_1BaseTLV.html#4c0a7b24b795bafb52c16b24a6188823" title="serialized length of TLV, mutable so it can be assigned by serialize() const">length_</a> = 0;
<a name="l00093"></a>00093 
<a name="l00094"></a>00094     <span class="comment">// parse the header</span>
<a name="l00095"></a>00095     <a class="code" href="structprophet_1_1BundleTLV_1_1BundleTLVHeader.html" title="Bundle Offer/Response Header  p.">BundleTLVHeader</a>* b = (<a class="code" href="structprophet_1_1BundleTLV_1_1BundleTLVHeader.html" title="Bundle Offer/Response Header  p.">BundleTLVHeader</a>*) bp;
<a name="l00096"></a>00096     <span class="keywordflow">if</span> (b-&gt;<a class="code" href="structprophet_1_1BundleTLV_1_1BundleTLVHeader.html#83ceb3125a38cddbc859463ebd12cbe1" title="defined as 0xA2">type</a> != <a class="code" href="classprophet_1_1BaseTLV.html#88263c57b5c2760ece631ce8943c6249" title="typecode for this TLV">typecode_</a>) <span class="keywordflow">return</span> <span class="keyword">false</span>;
<a name="l00097"></a>00097     <a class="code" href="classprophet_1_1BaseTLV.html#4c0a7b24b795bafb52c16b24a6188823" title="serialized length of TLV, mutable so it can be assigned by serialize() const">length_</a> = ntohs(b-&gt;<a class="code" href="structprophet_1_1BundleTLV_1_1BundleTLVHeader.html#eeff4bf7749c53b5210337567549c659" title="Length of the TLV in octets, including the TLV header and any nested TLVs.">length</a>);
<a name="l00098"></a>00098     <span class="keywordflow">if</span> (<a class="code" href="classprophet_1_1BaseTLV.html#4c0a7b24b795bafb52c16b24a6188823" title="serialized length of TLV, mutable so it can be assigned by serialize() const">length_</a> &gt; len) <span class="keywordflow">return</span> <span class="keyword">false</span>;
<a name="l00099"></a>00099     <a class="code" href="classprophet_1_1BaseTLV.html#31f1ebbf538b5b28c42e49e1eef6a34e" title="TLV-specific flags.">flags_</a> = b-&gt;<a class="code" href="structprophet_1_1BundleTLV_1_1BundleTLVHeader.html#700b11136c08d66b3a4132fc7e22e6e6" title="TBD.">flags</a>;
<a name="l00100"></a>00100     <span class="keywordtype">size_t</span> offer_count = ntohs(b-&gt;<a class="code" href="structprophet_1_1BundleTLV_1_1BundleTLVHeader.html#3caebac83135faee423f6a09ade8c776" title="Number of bundle offer entries.">offer_count</a>);
<a name="l00101"></a>00101 
<a name="l00102"></a>00102     <span class="comment">// now move past the header</span>
<a name="l00103"></a>00103     bp       += <a class="code" href="classprophet_1_1BundleTLV.html#9f8735ed361f09d5bb05fc0975c6b191">BundleTLVHeaderSize</a>;
<a name="l00104"></a>00104     len      -= <a class="code" href="classprophet_1_1BundleTLV.html#9f8735ed361f09d5bb05fc0975c6b191">BundleTLVHeaderSize</a>;
<a name="l00105"></a>00105     amt_read += <a class="code" href="classprophet_1_1BundleTLV.html#9f8735ed361f09d5bb05fc0975c6b191">BundleTLVHeaderSize</a>;
<a name="l00106"></a>00106 
<a name="l00107"></a>00107     <span class="keywordflow">while</span> (len &gt;= <a class="code" href="classprophet_1_1BundleTLV.html#9f8735ed361f09d5bb05fc0975c6b191">BundleTLVHeaderSize</a> &amp;&amp;
<a name="l00108"></a>00108            amt_read + <a class="code" href="classprophet_1_1BundleTLV.html#9f8735ed361f09d5bb05fc0975c6b191">BundleTLVHeaderSize</a> &lt;= <a class="code" href="classprophet_1_1BaseTLV.html#4c0a7b24b795bafb52c16b24a6188823" title="serialized length of TLV, mutable so it can be assigned by serialize() const">length_</a> &amp;&amp;
<a name="l00109"></a>00109            offer_count-- &gt; 0)
<a name="l00110"></a>00110     {
<a name="l00111"></a>00111         u_int32_t cts = 0;
<a name="l00112"></a>00112         u_int32_t seq = 0;
<a name="l00113"></a>00113         u_int16_t sid = 0;
<a name="l00114"></a>00114         <span class="keywordtype">bool</span> <a class="code" href="dtncat_8c.html#160881851a33309c0106503ac4d14d96">custody</a> = <span class="keyword">false</span>,
<a name="l00115"></a>00115              accept = <span class="keyword">false</span>,
<a name="l00116"></a>00116              ack = <span class="keyword">false</span>;
<a name="l00117"></a>00117         <a class="code" href="classprophet_1_1BundleTLVEntry.html#ba508cc555c3c88394dc4659c7e0d321" title="A BundleTLVEntry can represent either an OFFER or a RESPONSE, depending on what is...">BundleTLVEntry::bundle_entry_t</a> type = <a class="code" href="classprophet_1_1BundleTLVEntry.html#ba508cc555c3c88394dc4659c7e0d3215a1a084212865f78c542f8c458201a19" title="no valid type has been specified">BundleTLVEntry::UNDEFINED</a>;
<a name="l00118"></a>00118 
<a name="l00119"></a>00119         <span class="keywordtype">size_t</span> bytes_read =
<a name="l00120"></a>00120             <a class="code" href="classprophet_1_1BundleTLV.html#4fe36522dccc0c81046b72e54d02d05c" title="Deserialize struct BundleOfferTLVEntry from transport into memory, reading no more...">BundleTLV::read_bundle_entry</a>(&amp;cts,&amp;seq,&amp;sid,&amp;custody,
<a name="l00121"></a>00121                                          &amp;accept,&amp;ack,&amp;type,bp,len);
<a name="l00122"></a>00122 
<a name="l00123"></a>00123         <span class="keywordflow">if</span> (<a class="code" href="classprophet_1_1BundleTLV.html#a7921e77cc4c5585d79932a24b8a7927">BundleEntrySize</a> &gt; bytes_read)
<a name="l00124"></a>00124             <span class="keywordflow">return</span> <span class="keyword">false</span>;
<a name="l00125"></a>00125 
<a name="l00126"></a>00126         <span class="keywordflow">if</span> (type != <a class="code" href="classprophet_1_1BundleTLVEntry.html#ba508cc555c3c88394dc4659c7e0d321e191d0ebeaab2e6ea1e63a773b404c23" title="Bundle RESPONSE.">BundleTLVEntry::RESPONSE</a>)
<a name="l00127"></a>00127             <span class="keywordflow">return</span> <span class="keyword">false</span>;
<a name="l00128"></a>00128 
<a name="l00129"></a>00129         <span class="keywordflow">if</span> (! <a class="code" href="classprophet_1_1ResponseTLV.html#2095ca1150778670babbbce1c56f9724" title="Priority sorted list of Bundles to request from peer.">list_</a>.<a class="code" href="classprophet_1_1BundleResponseList.html#bfb26b75e5a8c01aca8f4a20f9ccd390" title="Convenience wrapper around base class&amp;#39;s add_entry.">add_response</a>(cts,seq,sid,custody,accept))
<a name="l00130"></a>00130             <span class="keywordflow">return</span> <span class="keyword">false</span>;
<a name="l00131"></a>00131 
<a name="l00132"></a>00132         <span class="comment">// account for what's been read</span>
<a name="l00133"></a>00133         amt_read += bytes_read;
<a name="l00134"></a>00134         len      -= bytes_read;
<a name="l00135"></a>00135         bp       += bytes_read;
<a name="l00136"></a>00136     }
<a name="l00137"></a>00137 
<a name="l00138"></a>00138     <span class="keywordflow">return</span> (amt_read == <a class="code" href="classprophet_1_1BaseTLV.html#4c0a7b24b795bafb52c16b24a6188823" title="serialized length of TLV, mutable so it can be assigned by serialize() const">length_</a>);
<a name="l00139"></a>00139 }
<a name="l00140"></a>00140 
<a name="l00141"></a>00141 }; <span class="comment">// namespace prophet</span>
</pre></div></div>
<hr size="1"><address style="text-align: right;"><small>Generated on Fri Jan 30 09:26:57 2009 for DTN Reference Implementation by&nbsp;
<a href="http://www.doxygen.org/index.html">
<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.8 </small></address>
</body>
</html>