<!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: BundleTLVEntry.h 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 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 List</span></a></li> <li><a href="globals.html"><span>File Members</span></a></li> </ul> </div> <h1>BundleTLVEntry.h</h1><a href="BundleTLVEntry_8h.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">#ifndef _BUNDLE_TLV_ENTRY_H_</span> <a name="l00018"></a>00018 <span class="preprocessor"></span><span class="preprocessor">#define _BUNDLE_TLV_ENTRY_H_</span> <a name="l00019"></a>00019 <span class="preprocessor"></span> <a name="l00020"></a>00020 <span class="preprocessor">#include <sys/types.h></span> <a name="l00021"></a>00021 <a name="l00022"></a>00022 <span class="preprocessor">#include "<a class="code" href="PointerList_8h.html">PointerList.h</a>"</span> <a name="l00023"></a>00023 <a name="l00024"></a>00024 <span class="keyword">namespace </span>prophet <a name="l00025"></a>00025 { <a name="l00026"></a>00026 <a name="l00031"></a><a class="code" href="classprophet_1_1BundleTLVEntry.html">00031</a> <span class="keyword">class </span><a class="code" href="classprophet_1_1BundleTLVEntry.html" title="BundleTLVEntry is the in-memory representation of an element listed within the Bundle...">BundleTLVEntry</a> <a name="l00032"></a>00032 { <a name="l00033"></a>00033 <span class="keyword">public</span>: <a name="l00038"></a><a class="code" href="classprophet_1_1BundleTLVEntry.html#ba508cc555c3c88394dc4659c7e0d321">00038</a> <span class="keyword">typedef</span> <span class="keyword">enum</span> <a name="l00039"></a>00039 { <a name="l00040"></a><a class="code" href="classprophet_1_1BundleTLVEntry.html#ba508cc555c3c88394dc4659c7e0d3215a1a084212865f78c542f8c458201a19">00040</a> <a class="code" href="classprophet_1_1BundleTLVEntry.html#ba508cc555c3c88394dc4659c7e0d3215a1a084212865f78c542f8c458201a19" title="no valid type has been specified">UNDEFINED</a> = 0, <a name="l00041"></a><a class="code" href="classprophet_1_1BundleTLVEntry.html#ba508cc555c3c88394dc4659c7e0d321fa6f7dc01f904230e508005e6f942085">00041</a> <a class="code" href="classprophet_1_1BundleTLVEntry.html#ba508cc555c3c88394dc4659c7e0d321fa6f7dc01f904230e508005e6f942085" title="Bundle OFFER.">OFFER</a>, <a name="l00042"></a><a class="code" href="classprophet_1_1BundleTLVEntry.html#ba508cc555c3c88394dc4659c7e0d321e191d0ebeaab2e6ea1e63a773b404c23">00042</a> <a class="code" href="classprophet_1_1BundleTLVEntry.html#ba508cc555c3c88394dc4659c7e0d321e191d0ebeaab2e6ea1e63a773b404c23" title="Bundle RESPONSE.">RESPONSE</a>, <a name="l00043"></a>00043 } <a class="code" href="classprophet_1_1BundleTLVEntry.html#ba508cc555c3c88394dc4659c7e0d321" title="A BundleTLVEntry can represent either an OFFER or a RESPONSE, depending on what is...">bundle_entry_t</a>; <a name="l00044"></a>00044 <a name="l00048"></a><a class="code" href="classprophet_1_1BundleTLVEntry.html#b52386caaeaf3c96b15a29d7927da3ef">00048</a> <span class="keyword">static</span> <span class="keyword">const</span> <span class="keywordtype">char</span>* <a class="code" href="classprophet_1_1BundleTLVEntry.html#b52386caaeaf3c96b15a29d7927da3ef" title="Convenience function.">type_to_str</a>(<a class="code" href="classprophet_1_1BundleTLVEntry.html#ba508cc555c3c88394dc4659c7e0d321" title="A BundleTLVEntry can represent either an OFFER or a RESPONSE, depending on what is...">bundle_entry_t</a> <a class="code" href="classprophet_1_1BundleTLVEntry.html#2d97556fa7fb52f5a8b041b463f59e72" title="Accessors.">type</a>) <a name="l00049"></a>00049 { <a name="l00050"></a>00050 <span class="keywordflow">switch</span>(type) { <a name="l00051"></a>00051 <span class="keywordflow">case</span> <a class="code" href="classprophet_1_1BundleTLVEntry.html#ba508cc555c3c88394dc4659c7e0d321fa6f7dc01f904230e508005e6f942085" title="Bundle OFFER.">OFFER</a>: <span class="keywordflow">return</span> <span class="stringliteral">"OFFER"</span>; <a name="l00052"></a>00052 <span class="keywordflow">case</span> <a class="code" href="classprophet_1_1BundleTLVEntry.html#ba508cc555c3c88394dc4659c7e0d321e191d0ebeaab2e6ea1e63a773b404c23" title="Bundle RESPONSE.">RESPONSE</a>: <span class="keywordflow">return</span> <span class="stringliteral">"RESPONSE"</span>; <a name="l00053"></a>00053 <span class="keywordflow">case</span> <a class="code" href="classprophet_1_1BundleTLVEntry.html#ba508cc555c3c88394dc4659c7e0d3215a1a084212865f78c542f8c458201a19" title="no valid type has been specified">UNDEFINED</a>: <a name="l00054"></a>00054 <span class="keywordflow">default</span>: <span class="keywordflow">break</span>; <a name="l00055"></a>00055 } <a name="l00056"></a>00056 <span class="keywordflow">return</span> <span class="stringliteral">"UNDEFINED"</span>; <a name="l00057"></a>00057 } <a name="l00058"></a>00058 <a name="l00062"></a>00062 <span class="keyword">static</span> <span class="keyword">inline</span> <a class="code" href="classprophet_1_1BundleTLVEntry.html" title="BundleTLVEntry is the in-memory representation of an element listed within the Bundle...">BundleTLVEntry</a>* <a class="code" href="classprophet_1_1BundleTLVEntry.html#089ac2402ce89d32e972398bf200d0e8" title="Factory method for convenience.">create_entry</a>(u_int32_t cts, u_int32_t seq, <a name="l00063"></a>00063 u_int16_t <a class="code" href="classprophet_1_1BundleTLVEntry.html#c470331376431b7ac04bc76578011298" title="Accessors.">sid</a>, <span class="keywordtype">bool</span> <a class="code" href="classprophet_1_1BundleTLVEntry.html#b0ed670f0d842a2f68a527e72c14d266" title="Accessors.">custody</a>, <a name="l00064"></a>00064 <span class="keywordtype">bool</span> <a class="code" href="classprophet_1_1BundleTLVEntry.html#40379b850503c0a3d9c9bc8bd1143abb" title="Accessors.">accept</a>, <span class="keywordtype">bool</span> <a class="code" href="classprophet_1_1BundleTLVEntry.html#6743ec6543c7e9051d68fc2bf3b166a4" title="Accessors.">ack</a>); <a name="l00065"></a>00065 <a name="l00066"></a>00066 <span class="keyword">protected</span>: <a name="l00070"></a><a class="code" href="classprophet_1_1BundleTLVEntry.html#9bb642b53f08bee90fa25fcb60774bfc">00070</a> <a class="code" href="classprophet_1_1BundleTLVEntry.html#9bb642b53f08bee90fa25fcb60774bfc" title="Default constructor, only used by friend classes.">BundleTLVEntry</a>(<a class="code" href="classprophet_1_1BundleTLVEntry.html#ba508cc555c3c88394dc4659c7e0d321" title="A BundleTLVEntry can represent either an OFFER or a RESPONSE, depending on what is...">bundle_entry_t</a> <a class="code" href="classprophet_1_1BundleTLVEntry.html#2d97556fa7fb52f5a8b041b463f59e72" title="Accessors.">type</a> = <a class="code" href="classprophet_1_1BundleTLVEntry.html#ba508cc555c3c88394dc4659c7e0d3215a1a084212865f78c542f8c458201a19" title="no valid type has been specified">UNDEFINED</a>) <a name="l00071"></a>00071 : <a class="code" href="classprophet_1_1BundleTLVEntry.html#da4b202bfb5780221d4949e2b951cd06" title="Creation timestamp.">cts_</a>(0), <a class="code" href="classprophet_1_1BundleTLVEntry.html#fc0dc2b810ee9b64be26f0ef2081b68a" title="sub-second sequence number">seq_</a>(0), <a class="code" href="classprophet_1_1BundleTLVEntry.html#4dacd6257bd789f44faa7b74d10fb0eb" title="string id of bundle destination">sid_</a>(0), <a class="code" href="classprophet_1_1BundleTLVEntry.html#7e050855117cdc73b8de2970259b82fe" title="whether this node accepts custody">custody_</a>(false), <a name="l00072"></a>00072 <a class="code" href="classprophet_1_1BundleTLVEntry.html#4a3b595763fffb973bc372fa03d0ca94" title="whether this Bundle Entry is accepted">accept_</a>(false), <a class="code" href="classprophet_1_1BundleTLVEntry.html#56d63a2a39c6a8a3a2ce1e22e848dc0b" title="represents successful Prophet delivery for bundle">ack_</a>(false), <a class="code" href="classprophet_1_1BundleTLVEntry.html#6b00417a2c42aab78046453a822f25c1" title="indicates whether offer or response TLV">type_</a>(<a class="code" href="classprophet_1_1BundleTLVEntry.html#2d97556fa7fb52f5a8b041b463f59e72" title="Accessors.">type</a>) {} <a name="l00073"></a>00073 <a name="l00077"></a><a class="code" href="classprophet_1_1BundleTLVEntry.html#4e3429cdec08b979393db20b7f9f8826">00077</a> <a class="code" href="classprophet_1_1BundleTLVEntry.html#9bb642b53f08bee90fa25fcb60774bfc" title="Default constructor, only used by friend classes.">BundleTLVEntry</a>(u_int32_t cts, u_int32_t seq, u_int16_t <a class="code" href="classprophet_1_1BundleTLVEntry.html#c470331376431b7ac04bc76578011298" title="Accessors.">sid</a>, <a name="l00078"></a>00078 <span class="keywordtype">bool</span> <a class="code" href="classprophet_1_1BundleTLVEntry.html#b0ed670f0d842a2f68a527e72c14d266" title="Accessors.">custody</a>=<span class="keyword">false</span>, <span class="keywordtype">bool</span> <a class="code" href="classprophet_1_1BundleTLVEntry.html#40379b850503c0a3d9c9bc8bd1143abb" title="Accessors.">accept</a>=<span class="keyword">false</span>, <span class="keywordtype">bool</span> <a class="code" href="classprophet_1_1BundleTLVEntry.html#6743ec6543c7e9051d68fc2bf3b166a4" title="Accessors.">ack</a>=<span class="keyword">false</span>, <a name="l00079"></a>00079 <a class="code" href="classprophet_1_1BundleTLVEntry.html#ba508cc555c3c88394dc4659c7e0d321" title="A BundleTLVEntry can represent either an OFFER or a RESPONSE, depending on what is...">bundle_entry_t</a> <a class="code" href="classprophet_1_1BundleTLVEntry.html#2d97556fa7fb52f5a8b041b463f59e72" title="Accessors.">type</a>=<a class="code" href="classprophet_1_1BundleTLVEntry.html#ba508cc555c3c88394dc4659c7e0d3215a1a084212865f78c542f8c458201a19" title="no valid type has been specified">UNDEFINED</a>) <a name="l00080"></a>00080 : <a class="code" href="classprophet_1_1BundleTLVEntry.html#da4b202bfb5780221d4949e2b951cd06" title="Creation timestamp.">cts_</a>(cts), <a class="code" href="classprophet_1_1BundleTLVEntry.html#fc0dc2b810ee9b64be26f0ef2081b68a" title="sub-second sequence number">seq_</a>(seq), <a class="code" href="classprophet_1_1BundleTLVEntry.html#4dacd6257bd789f44faa7b74d10fb0eb" title="string id of bundle destination">sid_</a>(sid), <a class="code" href="classprophet_1_1BundleTLVEntry.html#7e050855117cdc73b8de2970259b82fe" title="whether this node accepts custody">custody_</a>(<a class="code" href="classprophet_1_1BundleTLVEntry.html#b0ed670f0d842a2f68a527e72c14d266" title="Accessors.">custody</a>), <a name="l00081"></a>00081 <a class="code" href="classprophet_1_1BundleTLVEntry.html#4a3b595763fffb973bc372fa03d0ca94" title="whether this Bundle Entry is accepted">accept_</a>(<a class="code" href="classprophet_1_1BundleTLVEntry.html#40379b850503c0a3d9c9bc8bd1143abb" title="Accessors.">accept</a>), <a class="code" href="classprophet_1_1BundleTLVEntry.html#56d63a2a39c6a8a3a2ce1e22e848dc0b" title="represents successful Prophet delivery for bundle">ack_</a>(<a class="code" href="classprophet_1_1BundleTLVEntry.html#6743ec6543c7e9051d68fc2bf3b166a4" title="Accessors.">ack</a>), <a class="code" href="classprophet_1_1BundleTLVEntry.html#6b00417a2c42aab78046453a822f25c1" title="indicates whether offer or response TLV">type_</a>(<a class="code" href="classprophet_1_1BundleTLVEntry.html#2d97556fa7fb52f5a8b041b463f59e72" title="Accessors.">type</a>) <a name="l00082"></a>00082 { <a name="l00083"></a>00083 <a class="code" href="classprophet_1_1BundleTLVEntry.html#5cb393b60bbd08881defa22344c62405" title="Initialization routine used by constructors and assignment operator.">init_type</a>(<a class="code" href="classprophet_1_1BundleTLVEntry.html#2d97556fa7fb52f5a8b041b463f59e72" title="Accessors.">type</a>); <a name="l00084"></a>00084 } <a name="l00085"></a>00085 <a name="l00086"></a>00086 <span class="keyword">public</span>: <a name="l00090"></a><a class="code" href="classprophet_1_1BundleTLVEntry.html#d10a70adc2d5bcab225fcea9d4492f04">00090</a> <a class="code" href="classprophet_1_1BundleTLVEntry.html#9bb642b53f08bee90fa25fcb60774bfc" title="Default constructor, only used by friend classes.">BundleTLVEntry</a>(<span class="keyword">const</span> <a class="code" href="classprophet_1_1BundleTLVEntry.html" title="BundleTLVEntry is the in-memory representation of an element listed within the Bundle...">BundleTLVEntry</a>& b) <a name="l00091"></a>00091 : <a class="code" href="classprophet_1_1BundleTLVEntry.html#da4b202bfb5780221d4949e2b951cd06" title="Creation timestamp.">cts_</a>(b.<a class="code" href="classprophet_1_1BundleTLVEntry.html#da4b202bfb5780221d4949e2b951cd06" title="Creation timestamp.">cts_</a>), <a class="code" href="classprophet_1_1BundleTLVEntry.html#fc0dc2b810ee9b64be26f0ef2081b68a" title="sub-second sequence number">seq_</a>(b.<a class="code" href="classprophet_1_1BundleTLVEntry.html#fc0dc2b810ee9b64be26f0ef2081b68a" title="sub-second sequence number">seq_</a>), <a class="code" href="classprophet_1_1BundleTLVEntry.html#4dacd6257bd789f44faa7b74d10fb0eb" title="string id of bundle destination">sid_</a>(b.<a class="code" href="classprophet_1_1BundleTLVEntry.html#4dacd6257bd789f44faa7b74d10fb0eb" title="string id of bundle destination">sid_</a>), <a class="code" href="classprophet_1_1BundleTLVEntry.html#7e050855117cdc73b8de2970259b82fe" title="whether this node accepts custody">custody_</a>(b.<a class="code" href="classprophet_1_1BundleTLVEntry.html#7e050855117cdc73b8de2970259b82fe" title="whether this node accepts custody">custody_</a>), <a name="l00092"></a>00092 <a class="code" href="classprophet_1_1BundleTLVEntry.html#4a3b595763fffb973bc372fa03d0ca94" title="whether this Bundle Entry is accepted">accept_</a>(b.<a class="code" href="classprophet_1_1BundleTLVEntry.html#4a3b595763fffb973bc372fa03d0ca94" title="whether this Bundle Entry is accepted">accept_</a>), <a class="code" href="classprophet_1_1BundleTLVEntry.html#56d63a2a39c6a8a3a2ce1e22e848dc0b" title="represents successful Prophet delivery for bundle">ack_</a>(b.<a class="code" href="classprophet_1_1BundleTLVEntry.html#56d63a2a39c6a8a3a2ce1e22e848dc0b" title="represents successful Prophet delivery for bundle">ack_</a>), <a class="code" href="classprophet_1_1BundleTLVEntry.html#6b00417a2c42aab78046453a822f25c1" title="indicates whether offer or response TLV">type_</a>(b.<a class="code" href="classprophet_1_1BundleTLVEntry.html#6b00417a2c42aab78046453a822f25c1" title="indicates whether offer or response TLV">type_</a>) <a name="l00093"></a>00093 { <a name="l00094"></a>00094 <a class="code" href="classprophet_1_1BundleTLVEntry.html#5cb393b60bbd08881defa22344c62405" title="Initialization routine used by constructors and assignment operator.">init_type</a>(b.<a class="code" href="classprophet_1_1BundleTLVEntry.html#6b00417a2c42aab78046453a822f25c1" title="indicates whether offer or response TLV">type_</a>); <a name="l00095"></a>00095 } <a name="l00096"></a>00096 <a name="l00100"></a><a class="code" href="classprophet_1_1BundleTLVEntry.html#cc3dbd595a47c2f084f16e012e7ee843">00100</a> <a class="code" href="classprophet_1_1BundleTLVEntry.html" title="BundleTLVEntry is the in-memory representation of an element listed within the Bundle...">BundleTLVEntry</a>& <a class="code" href="classprophet_1_1BundleTLVEntry.html#cc3dbd595a47c2f084f16e012e7ee843" title="Assignment operator.">operator= </a>(<span class="keyword">const</span> <a class="code" href="classprophet_1_1BundleTLVEntry.html" title="BundleTLVEntry is the in-memory representation of an element listed within the Bundle...">BundleTLVEntry</a>& b) <a name="l00101"></a>00101 { <a name="l00102"></a>00102 <a class="code" href="classprophet_1_1BundleTLVEntry.html#da4b202bfb5780221d4949e2b951cd06" title="Creation timestamp.">cts_</a> = b.<a class="code" href="classprophet_1_1BundleTLVEntry.html#da4b202bfb5780221d4949e2b951cd06" title="Creation timestamp.">cts_</a>; <a name="l00103"></a>00103 <a class="code" href="classprophet_1_1BundleTLVEntry.html#fc0dc2b810ee9b64be26f0ef2081b68a" title="sub-second sequence number">seq_</a> = b.<a class="code" href="classprophet_1_1BundleTLVEntry.html#fc0dc2b810ee9b64be26f0ef2081b68a" title="sub-second sequence number">seq_</a>; <a name="l00104"></a>00104 <a class="code" href="classprophet_1_1BundleTLVEntry.html#4dacd6257bd789f44faa7b74d10fb0eb" title="string id of bundle destination">sid_</a> = b.<a class="code" href="classprophet_1_1BundleTLVEntry.html#4dacd6257bd789f44faa7b74d10fb0eb" title="string id of bundle destination">sid_</a>; <a name="l00105"></a>00105 <a class="code" href="classprophet_1_1BundleTLVEntry.html#7e050855117cdc73b8de2970259b82fe" title="whether this node accepts custody">custody_</a> = b.<a class="code" href="classprophet_1_1BundleTLVEntry.html#7e050855117cdc73b8de2970259b82fe" title="whether this node accepts custody">custody_</a>; <a name="l00106"></a>00106 <a class="code" href="classprophet_1_1BundleTLVEntry.html#4a3b595763fffb973bc372fa03d0ca94" title="whether this Bundle Entry is accepted">accept_</a> = b.<a class="code" href="classprophet_1_1BundleTLVEntry.html#4a3b595763fffb973bc372fa03d0ca94" title="whether this Bundle Entry is accepted">accept_</a>; <a name="l00107"></a>00107 <a class="code" href="classprophet_1_1BundleTLVEntry.html#56d63a2a39c6a8a3a2ce1e22e848dc0b" title="represents successful Prophet delivery for bundle">ack_</a> = b.<a class="code" href="classprophet_1_1BundleTLVEntry.html#56d63a2a39c6a8a3a2ce1e22e848dc0b" title="represents successful Prophet delivery for bundle">ack_</a>; <a name="l00108"></a>00108 <a class="code" href="classprophet_1_1BundleTLVEntry.html#6b00417a2c42aab78046453a822f25c1" title="indicates whether offer or response TLV">type_</a> = b.<a class="code" href="classprophet_1_1BundleTLVEntry.html#6b00417a2c42aab78046453a822f25c1" title="indicates whether offer or response TLV">type_</a>; <a name="l00109"></a>00109 <a class="code" href="classprophet_1_1BundleTLVEntry.html#5cb393b60bbd08881defa22344c62405" title="Initialization routine used by constructors and assignment operator.">init_type</a>(b.<a class="code" href="classprophet_1_1BundleTLVEntry.html#6b00417a2c42aab78046453a822f25c1" title="indicates whether offer or response TLV">type_</a>); <span class="comment">// sanity check</span> <a name="l00110"></a>00110 <span class="keywordflow">return</span> *<span class="keyword">this</span>; <a name="l00111"></a>00111 } <a name="l00112"></a>00112 <a name="l00116"></a><a class="code" href="classprophet_1_1BundleTLVEntry.html#e7f0752044aafec1892ccaa0f76619b6">00116</a> <span class="keyword">virtual</span> <a class="code" href="classprophet_1_1BundleTLVEntry.html#e7f0752044aafec1892ccaa0f76619b6" title="Destructor.">~BundleTLVEntry</a>() {} <a name="l00117"></a>00117 <a name="l00121"></a><a class="code" href="classprophet_1_1BundleTLVEntry.html#6689ca31895480a7a9cbf9727ed53687">00121</a> <span class="keywordtype">bool</span> <a class="code" href="classprophet_1_1BundleTLVEntry.html#6689ca31895480a7a9cbf9727ed53687" title="Comparison operator to facilitate STL sorting.">operator< </a>(<span class="keyword">const</span> <a class="code" href="classprophet_1_1BundleTLVEntry.html" title="BundleTLVEntry is the in-memory representation of an element listed within the Bundle...">BundleTLVEntry</a>& b)<span class="keyword"> const </span> <a name="l00122"></a>00122 <span class="keyword"> </span>{ <a name="l00123"></a>00123 <span class="comment">// if (type_ != b.type_) ... ignore difference</span> <a name="l00124"></a>00124 <span class="keywordflow">if</span> (<a class="code" href="classprophet_1_1BundleTLVEntry.html#4dacd6257bd789f44faa7b74d10fb0eb" title="string id of bundle destination">sid_</a> == b.<a class="code" href="classprophet_1_1BundleTLVEntry.html#4dacd6257bd789f44faa7b74d10fb0eb" title="string id of bundle destination">sid_</a>) <a name="l00125"></a>00125 { <a name="l00126"></a>00126 <span class="keywordflow">if</span> (<a class="code" href="classprophet_1_1BundleTLVEntry.html#da4b202bfb5780221d4949e2b951cd06" title="Creation timestamp.">cts_</a> == b.<a class="code" href="classprophet_1_1BundleTLVEntry.html#da4b202bfb5780221d4949e2b951cd06" title="Creation timestamp.">cts_</a>) <a name="l00127"></a>00127 <span class="keywordflow">return</span> <a class="code" href="classprophet_1_1BundleTLVEntry.html#fc0dc2b810ee9b64be26f0ef2081b68a" title="sub-second sequence number">seq_</a> < b.<a class="code" href="classprophet_1_1BundleTLVEntry.html#fc0dc2b810ee9b64be26f0ef2081b68a" title="sub-second sequence number">seq_</a>; <a name="l00128"></a>00128 <span class="keywordflow">else</span> <a name="l00129"></a>00129 <span class="keywordflow">return</span> (<a class="code" href="classprophet_1_1BundleTLVEntry.html#da4b202bfb5780221d4949e2b951cd06" title="Creation timestamp.">cts_</a> < b.<a class="code" href="classprophet_1_1BundleTLVEntry.html#da4b202bfb5780221d4949e2b951cd06" title="Creation timestamp.">cts_</a>); <a name="l00130"></a>00130 } <a name="l00131"></a>00131 <span class="keywordflow">return</span> (<a class="code" href="classprophet_1_1BundleTLVEntry.html#4dacd6257bd789f44faa7b74d10fb0eb" title="string id of bundle destination">sid_</a> < b.<a class="code" href="classprophet_1_1BundleTLVEntry.html#4dacd6257bd789f44faa7b74d10fb0eb" title="string id of bundle destination">sid_</a>); <a name="l00132"></a>00132 } <a name="l00133"></a>00133 <a name="l00135"></a><a class="code" href="classprophet_1_1BundleTLVEntry.html#1cf4b89ca8699e54a91e04dd4fc7c86e">00135</a> u_int32_t <a class="code" href="classprophet_1_1BundleTLVEntry.html#1cf4b89ca8699e54a91e04dd4fc7c86e" title="Accessors.">creation_ts</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <a class="code" href="classprophet_1_1BundleTLVEntry.html#da4b202bfb5780221d4949e2b951cd06" title="Creation timestamp.">cts_</a>; } <a name="l00136"></a><a class="code" href="classprophet_1_1BundleTLVEntry.html#f53626463b117791141a4c6e1367eecc">00136</a> u_int32_t <a class="code" href="classprophet_1_1BundleTLVEntry.html#f53626463b117791141a4c6e1367eecc" title="Accessors.">seqno</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <a class="code" href="classprophet_1_1BundleTLVEntry.html#fc0dc2b810ee9b64be26f0ef2081b68a" title="sub-second sequence number">seq_</a>; } <a name="l00137"></a><a class="code" href="classprophet_1_1BundleTLVEntry.html#c470331376431b7ac04bc76578011298">00137</a> u_int16_t <a class="code" href="classprophet_1_1BundleTLVEntry.html#c470331376431b7ac04bc76578011298" title="Accessors.">sid</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <a class="code" href="classprophet_1_1BundleTLVEntry.html#4dacd6257bd789f44faa7b74d10fb0eb" title="string id of bundle destination">sid_</a>; } <a name="l00138"></a><a class="code" href="classprophet_1_1BundleTLVEntry.html#b0ed670f0d842a2f68a527e72c14d266">00138</a> <span class="keywordtype">bool</span> <a class="code" href="classprophet_1_1BundleTLVEntry.html#b0ed670f0d842a2f68a527e72c14d266" title="Accessors.">custody</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <a class="code" href="classprophet_1_1BundleTLVEntry.html#7e050855117cdc73b8de2970259b82fe" title="whether this node accepts custody">custody_</a>; } <a name="l00139"></a><a class="code" href="classprophet_1_1BundleTLVEntry.html#40379b850503c0a3d9c9bc8bd1143abb">00139</a> <span class="keywordtype">bool</span> <a class="code" href="classprophet_1_1BundleTLVEntry.html#40379b850503c0a3d9c9bc8bd1143abb" title="Accessors.">accept</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <a class="code" href="classprophet_1_1BundleTLVEntry.html#4a3b595763fffb973bc372fa03d0ca94" title="whether this Bundle Entry is accepted">accept_</a>; } <a name="l00140"></a><a class="code" href="classprophet_1_1BundleTLVEntry.html#6743ec6543c7e9051d68fc2bf3b166a4">00140</a> <span class="keywordtype">bool</span> <a class="code" href="classprophet_1_1BundleTLVEntry.html#6743ec6543c7e9051d68fc2bf3b166a4" title="Accessors.">ack</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <a class="code" href="classprophet_1_1BundleTLVEntry.html#56d63a2a39c6a8a3a2ce1e22e848dc0b" title="represents successful Prophet delivery for bundle">ack_</a>; } <a name="l00141"></a><a class="code" href="classprophet_1_1BundleTLVEntry.html#2d97556fa7fb52f5a8b041b463f59e72">00141</a> <span class="keyword">virtual</span> <a class="code" href="classprophet_1_1BundleTLVEntry.html#ba508cc555c3c88394dc4659c7e0d321" title="A BundleTLVEntry can represent either an OFFER or a RESPONSE, depending on what is...">bundle_entry_t</a> <a class="code" href="classprophet_1_1BundleTLVEntry.html#2d97556fa7fb52f5a8b041b463f59e72" title="Accessors.">type</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <a class="code" href="classprophet_1_1BundleTLVEntry.html#6b00417a2c42aab78046453a822f25c1" title="indicates whether offer or response TLV">type_</a>; } <a name="l00143"></a>00143 <a name="l00148"></a><a class="code" href="classprophet_1_1BundleTLVEntry.html#a183aaa6d8be0194a725569221b7cfc1">00148</a> <span class="keyword">static</span> <a class="code" href="classprophet_1_1BundleTLVEntry.html#ba508cc555c3c88394dc4659c7e0d321" title="A BundleTLVEntry can represent either an OFFER or a RESPONSE, depending on what is...">bundle_entry_t</a> <a class="code" href="classprophet_1_1BundleTLVEntry.html#a183aaa6d8be0194a725569221b7cfc1" title="Utility function to decipher which Bundle_X_Entry type based on the combination of...">decode_flags</a>(<span class="keywordtype">bool</span> <a class="code" href="classprophet_1_1BundleTLVEntry.html#b0ed670f0d842a2f68a527e72c14d266" title="Accessors.">custody</a>, <span class="keywordtype">bool</span> <a class="code" href="classprophet_1_1BundleTLVEntry.html#40379b850503c0a3d9c9bc8bd1143abb" title="Accessors.">accept</a>, <span class="keywordtype">bool</span> <a class="code" href="classprophet_1_1BundleTLVEntry.html#6743ec6543c7e9051d68fc2bf3b166a4" title="Accessors.">ack</a>) <a name="l00149"></a>00149 { <a name="l00150"></a>00150 <span class="comment">// this combination makes no sense</span> <a name="l00151"></a>00151 <span class="keywordflow">if</span> ( accept && ack ) <a name="l00152"></a>00152 <span class="keywordflow">return</span> <a class="code" href="classprophet_1_1BundleTLVEntry.html#ba508cc555c3c88394dc4659c7e0d3215a1a084212865f78c542f8c458201a19" title="no valid type has been specified">UNDEFINED</a>; <a name="l00153"></a>00153 <a name="l00154"></a>00154 <span class="comment">// infer OFFER from !accept and some combos of custody and ack</span> <a name="l00155"></a>00155 <span class="keywordflow">if</span> (! accept) <a name="l00156"></a>00156 { <a name="l00157"></a>00157 <span class="comment">// It doesn't make any sense to offer custody</span> <a name="l00158"></a>00158 <span class="comment">// on ACK</span> <a name="l00159"></a>00159 <span class="keywordflow">if</span> (custody && ack) <a name="l00160"></a>00160 <span class="keywordflow">return</span> <a class="code" href="classprophet_1_1BundleTLVEntry.html#ba508cc555c3c88394dc4659c7e0d3215a1a084212865f78c542f8c458201a19" title="no valid type has been specified">UNDEFINED</a>; <a name="l00161"></a>00161 <a name="l00162"></a>00162 <span class="comment">// The other three combos of custody and ack are legal for OFFER</span> <a name="l00163"></a>00163 <span class="keywordflow">return</span> <a class="code" href="classprophet_1_1BundleTLVEntry.html#ba508cc555c3c88394dc4659c7e0d321fa6f7dc01f904230e508005e6f942085" title="Bundle OFFER.">OFFER</a>; <a name="l00164"></a>00164 } <a name="l00165"></a>00165 <a name="l00166"></a>00166 <span class="comment">// infer RESPONSE from this combo</span> <a name="l00167"></a>00167 <span class="keywordflow">if</span> ( (custody || accept) && (! ack)) <a name="l00168"></a>00168 { <a name="l00169"></a>00169 <span class="comment">// It doesn't make any sense to offer custody </span> <a name="l00170"></a>00170 <span class="comment">// on a bundle unless we accept it</span> <a name="l00171"></a>00171 <span class="keywordflow">if</span> (custody && !accept) <a name="l00172"></a>00172 <span class="keywordflow">return</span> <a class="code" href="classprophet_1_1BundleTLVEntry.html#ba508cc555c3c88394dc4659c7e0d3215a1a084212865f78c542f8c458201a19" title="no valid type has been specified">UNDEFINED</a>; <a name="l00173"></a>00173 <a name="l00174"></a>00174 <span class="keywordflow">return</span> <a class="code" href="classprophet_1_1BundleTLVEntry.html#ba508cc555c3c88394dc4659c7e0d321e191d0ebeaab2e6ea1e63a773b404c23" title="Bundle RESPONSE.">RESPONSE</a>; <a name="l00175"></a>00175 } <a name="l00176"></a>00176 <a name="l00177"></a>00177 <span class="comment">// failed to decode</span> <a name="l00178"></a>00178 <span class="keywordflow">return</span> <a class="code" href="classprophet_1_1BundleTLVEntry.html#ba508cc555c3c88394dc4659c7e0d3215a1a084212865f78c542f8c458201a19" title="no valid type has been specified">UNDEFINED</a>; <a name="l00179"></a>00179 } <a name="l00180"></a>00180 <a name="l00181"></a>00181 <span class="keyword">protected</span>: <a name="l00185"></a><a class="code" href="classprophet_1_1BundleTLVEntry.html#5cb393b60bbd08881defa22344c62405">00185</a> <span class="keywordtype">void</span> <a class="code" href="classprophet_1_1BundleTLVEntry.html#5cb393b60bbd08881defa22344c62405" title="Initialization routine used by constructors and assignment operator.">init_type</a>(<a class="code" href="classprophet_1_1BundleTLVEntry.html#ba508cc555c3c88394dc4659c7e0d321" title="A BundleTLVEntry can represent either an OFFER or a RESPONSE, depending on what is...">bundle_entry_t</a> <a class="code" href="classprophet_1_1BundleTLVEntry.html#2d97556fa7fb52f5a8b041b463f59e72" title="Accessors.">type</a>) <a name="l00186"></a>00186 { <a name="l00187"></a>00187 <a class="code" href="classprophet_1_1BundleTLVEntry.html#ba508cc555c3c88394dc4659c7e0d321" title="A BundleTLVEntry can represent either an OFFER or a RESPONSE, depending on what is...">bundle_entry_t</a> df = <a class="code" href="classprophet_1_1BundleTLVEntry.html#a183aaa6d8be0194a725569221b7cfc1" title="Utility function to decipher which Bundle_X_Entry type based on the combination of...">decode_flags</a>(<a class="code" href="classprophet_1_1BundleTLVEntry.html#7e050855117cdc73b8de2970259b82fe" title="whether this node accepts custody">custody_</a>,<a class="code" href="classprophet_1_1BundleTLVEntry.html#4a3b595763fffb973bc372fa03d0ca94" title="whether this Bundle Entry is accepted">accept_</a>,<a class="code" href="classprophet_1_1BundleTLVEntry.html#56d63a2a39c6a8a3a2ce1e22e848dc0b" title="represents successful Prophet delivery for bundle">ack_</a>); <a name="l00188"></a>00188 <a name="l00189"></a>00189 <span class="comment">// Three values to compare: The initial value</span> <a name="l00190"></a>00190 <span class="comment">// of "type_", the incoming parameter "type",</span> <a name="l00191"></a>00191 <span class="comment">// and the inferred value "df". </span> <a name="l00192"></a>00192 <a name="l00193"></a>00193 <span class="comment">// One value to set: class member "type_"</span> <a name="l00194"></a>00194 <a name="l00195"></a>00195 <span class="comment">// If type_ == UNDEFINED, then df and type must match</span> <a name="l00196"></a>00196 <span class="comment">// and type_ is set to their shared value.</span> <a name="l00197"></a>00197 <span class="comment">// If type_ == UNDEFINED, and df and type do not match,</span> <a name="l00198"></a>00198 <span class="comment">// type_ does not change</span> <a name="l00199"></a>00199 <span class="comment">// If type_ != UNDEFINED, then df and type must match type_</span> <a name="l00200"></a>00200 <span class="comment">// else type_ gets set to UNDEFINED</span> <a name="l00201"></a>00201 <a name="l00202"></a>00202 <span class="keywordflow">if</span> (<a class="code" href="classprophet_1_1BundleTLVEntry.html#6b00417a2c42aab78046453a822f25c1" title="indicates whether offer or response TLV">type_</a> == <a class="code" href="classprophet_1_1BundleTLVEntry.html#ba508cc555c3c88394dc4659c7e0d3215a1a084212865f78c542f8c458201a19" title="no valid type has been specified">UNDEFINED</a>) <a name="l00203"></a>00203 { <a name="l00204"></a>00204 <span class="keywordflow">if</span> (df == type) <a class="code" href="classprophet_1_1BundleTLVEntry.html#6b00417a2c42aab78046453a822f25c1" title="indicates whether offer or response TLV">type_</a> = type; <a name="l00205"></a>00205 <span class="comment">// else type_ = UNDEFINED</span> <a name="l00206"></a>00206 <span class="keywordflow">return</span>; <a name="l00207"></a>00207 } <a name="l00208"></a>00208 <span class="comment">// else if (type_ != UNDEFINED)</span> <a name="l00209"></a>00209 <span class="keywordflow">if</span> ((df == type && df == <a class="code" href="classprophet_1_1BundleTLVEntry.html#6b00417a2c42aab78046453a822f25c1" title="indicates whether offer or response TLV">type_</a>)) <a name="l00210"></a>00210 <span class="keywordflow">return</span>; <a name="l00211"></a>00211 <a name="l00212"></a>00212 <span class="comment">// logical fault</span> <a name="l00213"></a>00213 <a class="code" href="classprophet_1_1BundleTLVEntry.html#6b00417a2c42aab78046453a822f25c1" title="indicates whether offer or response TLV">type_</a> = <a class="code" href="classprophet_1_1BundleTLVEntry.html#ba508cc555c3c88394dc4659c7e0d3215a1a084212865f78c542f8c458201a19" title="no valid type has been specified">UNDEFINED</a>; <a name="l00214"></a>00214 } <a name="l00215"></a>00215 <a name="l00216"></a><a class="code" href="classprophet_1_1BundleTLVEntry.html#da4b202bfb5780221d4949e2b951cd06">00216</a> u_int32_t <a class="code" href="classprophet_1_1BundleTLVEntry.html#da4b202bfb5780221d4949e2b951cd06" title="Creation timestamp.">cts_</a>; <a name="l00217"></a><a class="code" href="classprophet_1_1BundleTLVEntry.html#fc0dc2b810ee9b64be26f0ef2081b68a">00217</a> u_int32_t <a class="code" href="classprophet_1_1BundleTLVEntry.html#fc0dc2b810ee9b64be26f0ef2081b68a" title="sub-second sequence number">seq_</a>; <a name="l00218"></a><a class="code" href="classprophet_1_1BundleTLVEntry.html#4dacd6257bd789f44faa7b74d10fb0eb">00218</a> u_int16_t <a class="code" href="classprophet_1_1BundleTLVEntry.html#4dacd6257bd789f44faa7b74d10fb0eb" title="string id of bundle destination">sid_</a>; <a name="l00219"></a><a class="code" href="classprophet_1_1BundleTLVEntry.html#7e050855117cdc73b8de2970259b82fe">00219</a> <span class="keywordtype">bool</span> <a class="code" href="classprophet_1_1BundleTLVEntry.html#7e050855117cdc73b8de2970259b82fe" title="whether this node accepts custody">custody_</a>; <a name="l00220"></a><a class="code" href="classprophet_1_1BundleTLVEntry.html#4a3b595763fffb973bc372fa03d0ca94">00220</a> <span class="keywordtype">bool</span> <a class="code" href="classprophet_1_1BundleTLVEntry.html#4a3b595763fffb973bc372fa03d0ca94" title="whether this Bundle Entry is accepted">accept_</a>; <a name="l00221"></a><a class="code" href="classprophet_1_1BundleTLVEntry.html#56d63a2a39c6a8a3a2ce1e22e848dc0b">00221</a> <span class="keywordtype">bool</span> <a class="code" href="classprophet_1_1BundleTLVEntry.html#56d63a2a39c6a8a3a2ce1e22e848dc0b" title="represents successful Prophet delivery for bundle">ack_</a>; <a name="l00222"></a><a class="code" href="classprophet_1_1BundleTLVEntry.html#6b00417a2c42aab78046453a822f25c1">00222</a> <a class="code" href="classprophet_1_1BundleTLVEntry.html#ba508cc555c3c88394dc4659c7e0d321" title="A BundleTLVEntry can represent either an OFFER or a RESPONSE, depending on what is...">bundle_entry_t</a> <a class="code" href="classprophet_1_1BundleTLVEntry.html#6b00417a2c42aab78046453a822f25c1" title="indicates whether offer or response TLV">type_</a>; <a name="l00223"></a>00223 <a name="l00224"></a>00224 }; <span class="comment">// class BundleTLVEntry</span> <a name="l00225"></a>00225 <a name="l00230"></a><a class="code" href="classprophet_1_1BundleOfferEntry.html">00230</a> <span class="keyword">class </span><a class="code" href="classprophet_1_1BundleOfferEntry.html" title="BundleOfferEntry represents one Bundle, a single entry in a Bundle TLV sent by a...">BundleOfferEntry</a> : <span class="keyword">public</span> <a class="code" href="classprophet_1_1BundleTLVEntry.html" title="BundleTLVEntry is the in-memory representation of an element listed within the Bundle...">BundleTLVEntry</a> <a name="l00231"></a>00231 { <a name="l00232"></a>00232 <span class="keyword">public</span>: <a name="l00236"></a><a class="code" href="classprophet_1_1BundleOfferEntry.html#5ee456bbc82a3a153283d8e8b950fffb">00236</a> <a class="code" href="classprophet_1_1BundleOfferEntry.html#f3856bb78499876ff4a20292eb794fe5" title="Default constructor, only used by friend classes.">BundleOfferEntry</a>(u_int32_t cts, u_int32_t seq, u_int16_t <a class="code" href="classprophet_1_1BundleTLVEntry.html#c470331376431b7ac04bc76578011298" title="Accessors.">sid</a>, <a name="l00237"></a>00237 <span class="keywordtype">bool</span> <a class="code" href="classprophet_1_1BundleTLVEntry.html#b0ed670f0d842a2f68a527e72c14d266" title="Accessors.">custody</a>, <span class="keywordtype">bool</span> <a class="code" href="classprophet_1_1BundleTLVEntry.html#6743ec6543c7e9051d68fc2bf3b166a4" title="Accessors.">ack</a>) <a name="l00238"></a>00238 : <a class="code" href="classprophet_1_1BundleTLVEntry.html" title="BundleTLVEntry is the in-memory representation of an element listed within the Bundle...">BundleTLVEntry</a>(cts,seq,sid,custody,false,ack,<a class="code" href="classprophet_1_1BundleTLVEntry.html" title="BundleTLVEntry is the in-memory representation of an element listed within the Bundle...">BundleTLVEntry</a>::<a class="code" href="classprophet_1_1BundleTLVEntry.html#ba508cc555c3c88394dc4659c7e0d321fa6f7dc01f904230e508005e6f942085" title="Bundle OFFER.">OFFER</a>) <a name="l00239"></a>00239 {} <a name="l00240"></a>00240 <a name="l00244"></a><a class="code" href="classprophet_1_1BundleOfferEntry.html#0408e06c13ccf7fd1199e6f5b81db257">00244</a> <a class="code" href="classprophet_1_1BundleOfferEntry.html#f3856bb78499876ff4a20292eb794fe5" title="Default constructor, only used by friend classes.">BundleOfferEntry</a>(<span class="keyword">const</span> <a class="code" href="classprophet_1_1BundleOfferEntry.html" title="BundleOfferEntry represents one Bundle, a single entry in a Bundle TLV sent by a...">BundleOfferEntry</a>& b) <a name="l00245"></a>00245 : <a class="code" href="classprophet_1_1BundleTLVEntry.html" title="BundleTLVEntry is the in-memory representation of an element listed within the Bundle...">BundleTLVEntry</a>(b) {} <a name="l00246"></a>00246 <a name="l00250"></a><a class="code" href="classprophet_1_1BundleOfferEntry.html#ed7be63da4b522090ea08d3f772f3b8a">00250</a> <span class="keyword">virtual</span> <a class="code" href="classprophet_1_1BundleOfferEntry.html#ed7be63da4b522090ea08d3f772f3b8a" title="Destructor.">~BundleOfferEntry</a>() {} <a name="l00251"></a>00251 <a name="l00252"></a>00252 <span class="keyword">protected</span>: <a name="l00253"></a><a class="code" href="classprophet_1_1BundleOfferEntry.html#aac70954fda36b5d965ce983cda3ea06">00253</a> <span class="keyword">friend</span> <span class="keyword">class </span><a class="code" href="classprophet_1_1PointerList.html" title="Auto deletes pointers in list destructor This object assumes ownership for member...">PointerList</a><<a class="code" href="classprophet_1_1BundleOfferEntry.html" title="BundleOfferEntry represents one Bundle, a single entry in a Bundle TLV sent by a...">BundleOfferEntry</a>>; <a name="l00254"></a>00254 <a name="l00258"></a><a class="code" href="classprophet_1_1BundleOfferEntry.html#f3856bb78499876ff4a20292eb794fe5">00258</a> <a class="code" href="classprophet_1_1BundleOfferEntry.html#f3856bb78499876ff4a20292eb794fe5" title="Default constructor, only used by friend classes.">BundleOfferEntry</a>() <a name="l00259"></a>00259 { <a name="l00260"></a>00260 <a class="code" href="classprophet_1_1BundleTLVEntry.html#6b00417a2c42aab78046453a822f25c1" title="indicates whether offer or response TLV">BundleTLVEntry::type_</a> = <a class="code" href="classprophet_1_1BundleTLVEntry.html#ba508cc555c3c88394dc4659c7e0d3215a1a084212865f78c542f8c458201a19" title="no valid type has been specified">BundleTLVEntry::UNDEFINED</a>; <a name="l00261"></a>00261 } <a name="l00262"></a>00262 }; <span class="comment">// class BundleOfferEntry</span> <a name="l00263"></a>00263 <a name="l00268"></a><a class="code" href="classprophet_1_1BundleResponseEntry.html">00268</a> <span class="keyword">class </span><a class="code" href="classprophet_1_1BundleResponseEntry.html" title="BundleResponseEntry represents one Bundle, a single entry in a Bundle TLV sent by...">BundleResponseEntry</a> : <span class="keyword">public</span> <a class="code" href="classprophet_1_1BundleTLVEntry.html" title="BundleTLVEntry is the in-memory representation of an element listed within the Bundle...">BundleTLVEntry</a> <a name="l00269"></a>00269 { <a name="l00270"></a>00270 <span class="keyword">public</span>: <a name="l00274"></a><a class="code" href="classprophet_1_1BundleResponseEntry.html#2a309b498c76dc69d54c85fd7e55d0fe">00274</a> <a class="code" href="classprophet_1_1BundleResponseEntry.html#c03dae6bdc3fcebc8c682d326298fbd3" title="Default constructor, only used by friend classes.">BundleResponseEntry</a>(u_int32_t cts, u_int32_t seq, u_int16_t <a class="code" href="classprophet_1_1BundleTLVEntry.html#c470331376431b7ac04bc76578011298" title="Accessors.">sid</a>, <a name="l00275"></a>00275 <span class="keywordtype">bool</span> <a class="code" href="classprophet_1_1BundleTLVEntry.html#b0ed670f0d842a2f68a527e72c14d266" title="Accessors.">custody</a>, <span class="keywordtype">bool</span> <a class="code" href="classprophet_1_1BundleTLVEntry.html#40379b850503c0a3d9c9bc8bd1143abb" title="Accessors.">accept</a>) <a name="l00276"></a>00276 : <a class="code" href="classprophet_1_1BundleTLVEntry.html" title="BundleTLVEntry is the in-memory representation of an element listed within the Bundle...">BundleTLVEntry</a>(cts,seq,sid,custody,accept,false,<a class="code" href="classprophet_1_1BundleTLVEntry.html" title="BundleTLVEntry is the in-memory representation of an element listed within the Bundle...">BundleTLVEntry</a>::<a class="code" href="classprophet_1_1BundleTLVEntry.html#ba508cc555c3c88394dc4659c7e0d321e191d0ebeaab2e6ea1e63a773b404c23" title="Bundle RESPONSE.">RESPONSE</a>) <a name="l00277"></a>00277 {} <a name="l00278"></a>00278 <a name="l00282"></a><a class="code" href="classprophet_1_1BundleResponseEntry.html#33ffc8d0a615b91b6b9bb7b78487ae6a">00282</a> <a class="code" href="classprophet_1_1BundleResponseEntry.html#c03dae6bdc3fcebc8c682d326298fbd3" title="Default constructor, only used by friend classes.">BundleResponseEntry</a>(<span class="keyword">const</span> <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) <a name="l00283"></a>00283 : <a class="code" href="classprophet_1_1BundleTLVEntry.html" title="BundleTLVEntry is the in-memory representation of an element listed within the Bundle...">BundleTLVEntry</a>(b) {} <a name="l00284"></a>00284 <a name="l00288"></a><a class="code" href="classprophet_1_1BundleResponseEntry.html#5a9e37326043133119df8bec81060a19">00288</a> <span class="keyword">virtual</span> <a class="code" href="classprophet_1_1BundleResponseEntry.html#5a9e37326043133119df8bec81060a19" title="Destructor.">~BundleResponseEntry</a>() {} <a name="l00289"></a>00289 <a name="l00290"></a>00290 <span class="keyword">protected</span>: <a name="l00291"></a><a class="code" href="classprophet_1_1BundleResponseEntry.html#792edf5e0212fa8d8a9789534952535c">00291</a> <span class="keyword">friend</span> <span class="keyword">class </span><a class="code" href="classprophet_1_1PointerList.html" title="Auto deletes pointers in list destructor This object assumes ownership for member...">PointerList</a><<a class="code" href="classprophet_1_1BundleResponseEntry.html" title="BundleResponseEntry represents one Bundle, a single entry in a Bundle TLV sent by...">BundleResponseEntry</a>>; <a name="l00292"></a>00292 <a name="l00296"></a><a class="code" href="classprophet_1_1BundleResponseEntry.html#c03dae6bdc3fcebc8c682d326298fbd3">00296</a> <a class="code" href="classprophet_1_1BundleResponseEntry.html#c03dae6bdc3fcebc8c682d326298fbd3" title="Default constructor, only used by friend classes.">BundleResponseEntry</a>() <a name="l00297"></a>00297 { <a name="l00298"></a>00298 <a class="code" href="classprophet_1_1BundleTLVEntry.html#6b00417a2c42aab78046453a822f25c1" title="indicates whether offer or response TLV">BundleTLVEntry::type_</a> = <a class="code" href="classprophet_1_1BundleTLVEntry.html#ba508cc555c3c88394dc4659c7e0d3215a1a084212865f78c542f8c458201a19" title="no valid type has been specified">BundleTLVEntry::UNDEFINED</a>; <a name="l00299"></a>00299 } <a name="l00300"></a>00300 }; <span class="comment">// class BundleResponseEntry</span> <a name="l00301"></a>00301 <a name="l00302"></a>00302 BundleTLVEntry* <a name="l00303"></a><a class="code" href="classprophet_1_1BundleTLVEntry.html#089ac2402ce89d32e972398bf200d0e8">00303</a> <a class="code" href="classprophet_1_1BundleTLVEntry.html#089ac2402ce89d32e972398bf200d0e8" title="Factory method for convenience.">BundleTLVEntry::create_entry</a>(u_int32_t cts, u_int32_t seq, u_int16_t sid, <a name="l00304"></a>00304 <span class="keywordtype">bool</span> <a class="code" href="dtncat_8c.html#160881851a33309c0106503ac4d14d96">custody</a>, <span class="keywordtype">bool</span> accept, <span class="keywordtype">bool</span> ack) <a name="l00305"></a>00305 { <a name="l00306"></a>00306 <span class="keywordflow">switch</span> (<a class="code" href="classprophet_1_1BundleTLVEntry.html#a183aaa6d8be0194a725569221b7cfc1" title="Utility function to decipher which Bundle_X_Entry type based on the combination of...">decode_flags</a>(custody,accept,ack)) <a name="l00307"></a>00307 { <a name="l00308"></a>00308 <span class="keywordflow">case</span> <a class="code" href="classprophet_1_1BundleTLVEntry.html#ba508cc555c3c88394dc4659c7e0d321fa6f7dc01f904230e508005e6f942085" title="Bundle OFFER.">OFFER</a>: <a name="l00309"></a>00309 <span class="keywordflow">return</span> <span class="keyword">new</span> <a class="code" href="classprophet_1_1BundleOfferEntry.html" title="BundleOfferEntry represents one Bundle, a single entry in a Bundle TLV sent by a...">BundleOfferEntry</a>(cts,seq,sid,custody,ack); <a name="l00310"></a>00310 <span class="keywordflow">case</span> <a class="code" href="classprophet_1_1BundleTLVEntry.html#ba508cc555c3c88394dc4659c7e0d321e191d0ebeaab2e6ea1e63a773b404c23" title="Bundle RESPONSE.">RESPONSE</a>: <a name="l00311"></a>00311 <span class="keywordflow">return</span> <span class="keyword">new</span> <a class="code" href="classprophet_1_1BundleResponseEntry.html" title="BundleResponseEntry represents one Bundle, a single entry in a Bundle TLV sent by...">BundleResponseEntry</a>(cts,seq,sid,custody,accept); <a name="l00312"></a>00312 <span class="keywordflow">case</span> <a class="code" href="classprophet_1_1BundleTLVEntry.html#ba508cc555c3c88394dc4659c7e0d3215a1a084212865f78c542f8c458201a19" title="no valid type has been specified">UNDEFINED</a>: <a name="l00313"></a>00313 <span class="keywordflow">default</span>: <a name="l00314"></a>00314 <span class="keywordflow">return</span> NULL; <a name="l00315"></a>00315 } <a name="l00316"></a>00316 <span class="keywordflow">return</span> NULL; <span class="comment">// not reached</span> <a name="l00317"></a>00317 } <a name="l00318"></a>00318 <a name="l00319"></a>00319 }; <span class="comment">// namespace</span> <a name="l00320"></a>00320 <a name="l00321"></a>00321 <span class="preprocessor">#endif // _BUNDLE_TLV_ENTRY_H_</span> </pre></div></div> <hr size="1"><address style="text-align: right;"><small>Generated on Fri Jan 30 09:26:53 2009 for DTN Reference Implementation by <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>