<!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: BundleProtocol.h Source File</title> <link href="doxygen.css" rel="stylesheet" type="text/css"> <link href="tabs.css" rel="stylesheet" type="text/css"> </head><body> <!-- Generated by Doxygen 1.5.6 --> <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> <h1>BundleProtocol.h</h1><a href="BundleProtocol_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 2004-2006 Intel Corporation</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_PROTOCOL_H_</span> <a name="l00018"></a>00018 <span class="preprocessor"></span><span class="preprocessor">#define _BUNDLE_PROTOCOL_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="contacts_2Link_8h.html">contacts/Link.h</a>"</span> <a name="l00023"></a>00023 <a name="l00024"></a>00024 <span class="keyword">namespace </span>dtn { <a name="l00025"></a>00025 <a name="l00026"></a>00026 <span class="keyword">class </span>BlockInfo; <a name="l00027"></a>00027 <span class="keyword">class </span>BlockInfoVec; <a name="l00028"></a>00028 <span class="keyword">class </span>BlockProcessor; <a name="l00029"></a>00029 <span class="keyword">class </span>Bundle; <a name="l00030"></a>00030 <span class="keyword">class </span>BundleTimestamp; <a name="l00031"></a>00031 <span class="keyword">class </span>EndpointID; <a name="l00032"></a>00032 <a name="l00040"></a><a class="code" href="classdtn_1_1BundleProtocol.html">00040</a> <span class="keyword">class </span><a class="code" href="classdtn_1_1BundleProtocol.html" title="Centralized class used to convert a Bundle to / from the bundle protocol specification...">BundleProtocol</a> { <a name="l00041"></a>00041 <span class="keyword">public</span>: <a name="l00046"></a>00046 <span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code" href="classdtn_1_1BundleProtocol.html#a08624ba2b213ce97adfc6b5bc5a054a" title="Register a new BlockProcessor handler to handle the given block type code when received...">register_processor</a>(<a class="code" href="classdtn_1_1BlockProcessor.html" title="Base class for the protocol handling of bundle blocks, including the core primary...">BlockProcessor</a>* bp); <a name="l00047"></a>00047 <a name="l00052"></a>00052 <span class="keyword">static</span> <a class="code" href="classdtn_1_1BlockProcessor.html" title="Base class for the protocol handling of bundle blocks, including the core primary...">BlockProcessor</a>* <a class="code" href="classdtn_1_1BundleProtocol.html#9baff2ff7f808753a44b05f90a366c61" title="Find the appropriate BlockProcessor for the given block type code.">find_processor</a>(u_int8_t type); <a name="l00053"></a>00053 <a name="l00057"></a>00057 <span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code" href="classdtn_1_1BundleProtocol.html#6aa13dcc0ae96b1b832970c3f71678be" title="Initialize the default set of block processors.">init_default_processors</a>(); <a name="l00058"></a>00058 <a name="l00063"></a>00063 <span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code" href="classdtn_1_1BundleProtocol.html#77c2dbd79cef726e0234e639e19a34f4" title="Give the processors a chance to chew on the bundle after reloading from disk.">reload_post_process</a>(<a class="code" href="classdtn_1_1Bundle.html" title="The internal representation of a bundle.">Bundle</a>* bundle); <a name="l00064"></a>00064 <a name="l00071"></a>00071 <span class="keyword">static</span> <a class="code" href="classdtn_1_1BlockInfoVec.html" title="Class for a vector of BlockInfo structures.">BlockInfoVec</a>* <a class="code" href="classdtn_1_1BundleProtocol.html#ef1c34c75b476f408546f73b4de1f2f5" title="Generate a BlockInfoVec for the outgoing link and put it into xmit_blocks_.">prepare_blocks</a>(<a class="code" href="classdtn_1_1Bundle.html" title="The internal representation of a bundle.">Bundle</a>* bundle, <span class="keyword">const</span> <a class="code" href="namespacedtn.html#6efb37e503f8062c537b022eb755b94e" title="Typedef for a reference on a link.">LinkRef</a>& link); <a name="l00072"></a>00072 <a name="l00078"></a>00078 <span class="keyword">static</span> <span class="keywordtype">size_t</span> <a class="code" href="classdtn_1_1BundleProtocol.html#77305bae9d1251ebd42e2b602684f59b" title="Generate contents for the given BlockInfoVec on the given Link.">generate_blocks</a>(<a class="code" href="classdtn_1_1Bundle.html" title="The internal representation of a bundle.">Bundle</a>* bundle, <a name="l00079"></a>00079 <a class="code" href="classdtn_1_1BlockInfoVec.html" title="Class for a vector of BlockInfo structures.">BlockInfoVec</a>* blocks, <a name="l00080"></a>00080 <span class="keyword">const</span> <a class="code" href="namespacedtn.html#6efb37e503f8062c537b022eb755b94e" title="Typedef for a reference on a link.">LinkRef</a>& link); <a name="l00081"></a>00081 <a name="l00082"></a>00082 <span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code" href="classdtn_1_1BundleProtocol.html#df59b9b818853e07bfb7464312ca7092">delete_blocks</a>(<a class="code" href="classdtn_1_1Bundle.html" title="The internal representation of a bundle.">Bundle</a>* bundle, <span class="keyword">const</span> <a class="code" href="namespacedtn.html#6efb37e503f8062c537b022eb755b94e" title="Typedef for a reference on a link.">LinkRef</a>& link); <a name="l00083"></a>00083 <a name="l00087"></a>00087 <span class="keyword">static</span> <span class="keywordtype">size_t</span> <a class="code" href="classdtn_1_1BundleProtocol.html#a1dedd9ea4300339bc2a3f7a231ca5dd" title="Return the total length of the formatted bundle block data.">total_length</a>(<span class="keyword">const</span> <a class="code" href="classdtn_1_1BlockInfoVec.html" title="Class for a vector of BlockInfo structures.">BlockInfoVec</a>* blocks); <a name="l00088"></a>00088 <a name="l00093"></a>00093 <span class="keyword">static</span> <span class="keywordtype">size_t</span> <a class="code" href="classdtn_1_1BundleProtocol.html#1b5ecc82d428705f3ba067622faace2c" title="Temporary helper function to find the offset of the first byte of the payload in...">payload_offset</a>(<span class="keyword">const</span> <a class="code" href="classdtn_1_1BlockInfoVec.html" title="Class for a vector of BlockInfo structures.">BlockInfoVec</a>* blocks); <a name="l00094"></a>00094 <a name="l00102"></a>00102 <span class="keyword">static</span> <span class="keywordtype">size_t</span> <a class="code" href="classdtn_1_1BundleProtocol.html#98a0ecbc789e7f84006909b884e70439" title="Copies out a chunk of formatted bundle data at a specified offset from the provided...">produce</a>(<span class="keyword">const</span> <a class="code" href="classdtn_1_1Bundle.html" title="The internal representation of a bundle.">Bundle</a>* bundle, <span class="keyword">const</span> <a class="code" href="classdtn_1_1BlockInfoVec.html" title="Class for a vector of BlockInfo structures.">BlockInfoVec</a>* blocks, <a name="l00103"></a>00103 u_char* data, <span class="keywordtype">size_t</span> offset, <span class="keywordtype">size_t</span> <a class="code" href="num2sdnv_8c.html#fed088663f8704004425cdae2120b9b3">len</a>, <span class="keywordtype">bool</span>* last); <a name="l00104"></a>00104 <a name="l00118"></a>00118 <span class="keyword">static</span> <span class="keywordtype">int</span> <a class="code" href="classdtn_1_1BundleProtocol.html#b1641c2fd8771fbda02c9ee59a1474df" title="Parse the supplied chunk of arriving data and append it to the rcvd_blocks_ list...">consume</a>(<a class="code" href="classdtn_1_1Bundle.html" title="The internal representation of a bundle.">Bundle</a>* bundle, u_char* data, <span class="keywordtype">size_t</span> len, <span class="keywordtype">bool</span>* last); <a name="l00119"></a>00119 <a name="l00123"></a><a class="code" href="classdtn_1_1BundleProtocol.html#37b000d94172c06970bb8af32889f917">00123</a> <span class="keyword">typedef</span> <span class="keyword">enum</span> { <a name="l00124"></a><a class="code" href="classdtn_1_1BundleProtocol.html#37b000d94172c06970bb8af32889f917eac137290a0338e66ed4a0c1cc09c2f2">00124</a> <a class="code" href="classdtn_1_1BundleProtocol.html#37b000d94172c06970bb8af32889f917eac137290a0338e66ed4a0c1cc09c2f2">REASON_NO_ADDTL_INFO</a> = 0x00, <a name="l00125"></a><a class="code" href="classdtn_1_1BundleProtocol.html#37b000d94172c06970bb8af32889f91773f35a814d405ad151db78f95422a394">00125</a> <a class="code" href="classdtn_1_1BundleProtocol.html#37b000d94172c06970bb8af32889f91773f35a814d405ad151db78f95422a394">REASON_LIFETIME_EXPIRED</a> = 0x01, <a name="l00126"></a><a class="code" href="classdtn_1_1BundleProtocol.html#37b000d94172c06970bb8af32889f917e2b2502001dc9ec3108744dc835b6511">00126</a> <a class="code" href="classdtn_1_1BundleProtocol.html#37b000d94172c06970bb8af32889f917e2b2502001dc9ec3108744dc835b6511">REASON_FORWARDED_UNIDIR_LINK</a> = 0x02, <a name="l00127"></a><a class="code" href="classdtn_1_1BundleProtocol.html#37b000d94172c06970bb8af32889f917fcf8e25210f4249990dad68547f7b993">00127</a> <a class="code" href="classdtn_1_1BundleProtocol.html#37b000d94172c06970bb8af32889f917fcf8e25210f4249990dad68547f7b993">REASON_TRANSMISSION_CANCELLED</a> = 0x03, <a name="l00128"></a><a class="code" href="classdtn_1_1BundleProtocol.html#37b000d94172c06970bb8af32889f9176e886c084e3e545573e435ef04760c1a">00128</a> <a class="code" href="classdtn_1_1BundleProtocol.html#37b000d94172c06970bb8af32889f9176e886c084e3e545573e435ef04760c1a">REASON_DEPLETED_STORAGE</a> = 0x04, <a name="l00129"></a><a class="code" href="classdtn_1_1BundleProtocol.html#37b000d94172c06970bb8af32889f917261a9bdbc6f572b8cff433355d191e43">00129</a> <a class="code" href="classdtn_1_1BundleProtocol.html#37b000d94172c06970bb8af32889f917261a9bdbc6f572b8cff433355d191e43">REASON_ENDPOINT_ID_UNINTELLIGIBLE</a> = 0x05, <a name="l00130"></a><a class="code" href="classdtn_1_1BundleProtocol.html#37b000d94172c06970bb8af32889f917e692ecf914f35ccd754a12534793b7d1">00130</a> <a class="code" href="classdtn_1_1BundleProtocol.html#37b000d94172c06970bb8af32889f917e692ecf914f35ccd754a12534793b7d1">REASON_NO_ROUTE_TO_DEST</a> = 0x06, <a name="l00131"></a><a class="code" href="classdtn_1_1BundleProtocol.html#37b000d94172c06970bb8af32889f917635c372cffcc51473ade75ebfa02c1f0">00131</a> <a class="code" href="classdtn_1_1BundleProtocol.html#37b000d94172c06970bb8af32889f917635c372cffcc51473ade75ebfa02c1f0">REASON_NO_TIMELY_CONTACT</a> = 0x07, <a name="l00132"></a><a class="code" href="classdtn_1_1BundleProtocol.html#37b000d94172c06970bb8af32889f917a86c9900fe5641754acdcdb326b79b2c">00132</a> <a class="code" href="classdtn_1_1BundleProtocol.html#37b000d94172c06970bb8af32889f917a86c9900fe5641754acdcdb326b79b2c">REASON_BLOCK_UNINTELLIGIBLE</a> = 0x08, <a name="l00133"></a><a class="code" href="classdtn_1_1BundleProtocol.html#37b000d94172c06970bb8af32889f9177d3cf6e00cf9ebd5eb174355289acaea">00133</a> <a class="code" href="classdtn_1_1BundleProtocol.html#37b000d94172c06970bb8af32889f9177d3cf6e00cf9ebd5eb174355289acaea">REASON_SECURITY_FAILED</a> = 0x09, <a name="l00134"></a>00134 } <a class="code" href="classdtn_1_1BundleProtocol.html#37b000d94172c06970bb8af32889f917" title="Bundle Status Report &quot;Reason Code&quot; flags.">status_report_reason_t</a>; <a name="l00135"></a>00135 <a name="l00143"></a>00143 <span class="keyword">static</span> <span class="keywordtype">bool</span> <a class="code" href="classdtn_1_1BundleProtocol.html#403d237e6ea6655a5e19b6c8f45dae3b" title="Loop through the bundle&#39;s received block list to validate each entry.">validate</a>(<a class="code" href="classdtn_1_1Bundle.html" title="The internal representation of a bundle.">Bundle</a>* bundle, <a name="l00144"></a>00144 <a class="code" href="classdtn_1_1BundleProtocol.html#37b000d94172c06970bb8af32889f917" title="Bundle Status Report &quot;Reason Code&quot; flags.">status_report_reason_t</a>* reception_reason, <a name="l00145"></a>00145 <a class="code" href="classdtn_1_1BundleProtocol.html#37b000d94172c06970bb8af32889f917" title="Bundle Status Report &quot;Reason Code&quot; flags.">status_report_reason_t</a>* deletion_reason); <a name="l00146"></a>00146 <a name="l00151"></a>00151 <span class="keyword">static</span> <span class="keywordtype">int</span> <a class="code" href="classdtn_1_1BundleProtocol.html#c590d33b1e828121f9d096860d4cad9a" title="Store a DTN timestamp into a 64-bit value suitable for transmission over the network...">set_timestamp</a>(u_char* bp, <span class="keywordtype">size_t</span> len, <span class="keyword">const</span> <a class="code" href="structdtn_1_1BundleTimestamp.html" title="Simple struct definition for bundle creation timestamps.">BundleTimestamp</a>& tv); <a name="l00152"></a>00152 <a name="l00158"></a>00158 <span class="keyword">static</span> <span class="keywordtype">int</span> <a class="code" href="classdtn_1_1BundleProtocol.html#09d040740695f886e1e09bd9065767ab" title="Retrieve a DTN timestamp from a 64-bit value that was transmitted over the network...">get_timestamp</a>(<a class="code" href="structdtn_1_1BundleTimestamp.html" title="Simple struct definition for bundle creation timestamps.">BundleTimestamp</a>* tv, <span class="keyword">const</span> u_char* bp, <span class="keywordtype">size_t</span> len); <a name="l00159"></a>00159 <a name="l00163"></a>00163 <span class="keyword">static</span> <span class="keywordtype">size_t</span> <a class="code" href="classdtn_1_1BundleProtocol.html#efd5468219b7a40e33d4d6eaa7fa610e" title="Return the length required to encode the timestamp as two SDNVs.">ts_encoding_len</a>(<span class="keyword">const</span> <a class="code" href="structdtn_1_1BundleTimestamp.html" title="Simple struct definition for bundle creation timestamps.">BundleTimestamp</a>& tv); <a name="l00164"></a>00164 <a name="l00168"></a><a class="code" href="classdtn_1_1BundleProtocol.html#65e637cab3ab85a59f8e326a79a83856">00168</a> <span class="keyword">static</span> <span class="keyword">const</span> <span class="keywordtype">int</span> <a class="code" href="classdtn_1_1BundleProtocol.html#65e637cab3ab85a59f8e326a79a83856" title="The current version of the bundling protocol.">CURRENT_VERSION</a> = 0x06; <a name="l00169"></a>00169 <a name="l00170"></a><a class="code" href="classdtn_1_1BundleProtocol.html#45c131425fd4c84700dcfe7733c11376">00170</a> <span class="keyword">static</span> <span class="keyword">const</span> <span class="keywordtype">unsigned</span> <a class="code" href="classdtn_1_1BundleProtocol.html#45c131425fd4c84700dcfe7733c11376">PREAMBLE_FIXED_LENGTH</a> = 1; <a name="l00171"></a>00171 <a name="l00176"></a><a class="code" href="classdtn_1_1BundleProtocol.html#54a44c247b3c20b4ed11e29494284ca7">00176</a> <span class="keyword">typedef</span> <span class="keyword">enum</span> { <a name="l00177"></a><a class="code" href="classdtn_1_1BundleProtocol.html#54a44c247b3c20b4ed11e29494284ca753097979cfe600d2c1dfb5cf3629b195">00177</a> <a class="code" href="classdtn_1_1BundleProtocol.html#54a44c247b3c20b4ed11e29494284ca753097979cfe600d2c1dfb5cf3629b195" title="INTERNAL ONLY -- NOT IN SPEC.">PRIMARY_BLOCK</a> = 0x000, <a name="l00178"></a><a class="code" href="classdtn_1_1BundleProtocol.html#54a44c247b3c20b4ed11e29494284ca711ba3c0a764c41add8e738d757393d60">00178</a> <a class="code" href="classdtn_1_1BundleProtocol.html#54a44c247b3c20b4ed11e29494284ca711ba3c0a764c41add8e738d757393d60">PAYLOAD_BLOCK</a> = 0x001, <a name="l00179"></a><a class="code" href="classdtn_1_1BundleProtocol.html#54a44c247b3c20b4ed11e29494284ca73f1cdc11347b58f22299129612a2d5e9">00179</a> <a class="code" href="classdtn_1_1BundleProtocol.html#54a44c247b3c20b4ed11e29494284ca73f1cdc11347b58f22299129612a2d5e9">BUNDLE_AUTHENTICATION_BLOCK</a> = 0x002, <a name="l00180"></a><a class="code" href="classdtn_1_1BundleProtocol.html#54a44c247b3c20b4ed11e29494284ca79404d2b594893251777406fa902fee22">00180</a> <a class="code" href="classdtn_1_1BundleProtocol.html#54a44c247b3c20b4ed11e29494284ca79404d2b594893251777406fa902fee22">PAYLOAD_SECURITY_BLOCK</a> = 0x003, <a name="l00181"></a><a class="code" href="classdtn_1_1BundleProtocol.html#54a44c247b3c20b4ed11e29494284ca78d0ab5c2409c7fce7dc3866ffd2ce12e">00181</a> <a class="code" href="classdtn_1_1BundleProtocol.html#54a44c247b3c20b4ed11e29494284ca78d0ab5c2409c7fce7dc3866ffd2ce12e">CONFIDENTIALITY_BLOCK</a> = 0x004, <a name="l00182"></a><a class="code" href="classdtn_1_1BundleProtocol.html#54a44c247b3c20b4ed11e29494284ca756496904248edc05c52fd4822663d46b">00182</a> <a class="code" href="classdtn_1_1BundleProtocol.html#54a44c247b3c20b4ed11e29494284ca756496904248edc05c52fd4822663d46b">PREVIOUS_HOP_BLOCK</a> = 0x005, <a name="l00183"></a><a class="code" href="classdtn_1_1BundleProtocol.html#54a44c247b3c20b4ed11e29494284ca7f69759524468f2b1c3f7f1c2f6619f39">00183</a> <a class="code" href="classdtn_1_1BundleProtocol.html#54a44c247b3c20b4ed11e29494284ca7f69759524468f2b1c3f7f1c2f6619f39" title="NOT IN SPEC YET.">METADATA_BLOCK</a> = 0x008, <a name="l00184"></a><a class="code" href="classdtn_1_1BundleProtocol.html#54a44c247b3c20b4ed11e29494284ca77663bb00a2f3b1e33c5e501bf2c8c9a8">00184</a> <a class="code" href="classdtn_1_1BundleProtocol.html#54a44c247b3c20b4ed11e29494284ca77663bb00a2f3b1e33c5e501bf2c8c9a8" title="NOT IN SPEC YET.">SESSION_BLOCK</a> = 0x009, <a name="l00185"></a><a class="code" href="classdtn_1_1BundleProtocol.html#54a44c247b3c20b4ed11e29494284ca782910c2fe9ca3b672f39e125f46e87b6">00185</a> <a class="code" href="classdtn_1_1BundleProtocol.html#54a44c247b3c20b4ed11e29494284ca782910c2fe9ca3b672f39e125f46e87b6" title="NOT IN SPEC YET.">SEQUENCE_ID_BLOCK</a> = 0x010, <a name="l00186"></a><a class="code" href="classdtn_1_1BundleProtocol.html#54a44c247b3c20b4ed11e29494284ca787466c93eee1166b0fa3642ee1360905">00186</a> <a class="code" href="classdtn_1_1BundleProtocol.html#54a44c247b3c20b4ed11e29494284ca787466c93eee1166b0fa3642ee1360905" title="NOT IN SPEC YET.">OBSOLETES_ID_BLOCK</a> = 0x011, <a name="l00187"></a><a class="code" href="classdtn_1_1BundleProtocol.html#54a44c247b3c20b4ed11e29494284ca7c6d5db373bab62cd6b726724cdfd68b2">00187</a> <a class="code" href="classdtn_1_1BundleProtocol.html#54a44c247b3c20b4ed11e29494284ca7c6d5db373bab62cd6b726724cdfd68b2" title="INTERNAL ONLY -- NOT IN SPEC.">API_EXTENSION_BLOCK</a> = 0x100, <a name="l00188"></a><a class="code" href="classdtn_1_1BundleProtocol.html#54a44c247b3c20b4ed11e29494284ca7a67858f9537b64d0ca49f8921e496a68">00188</a> <a class="code" href="classdtn_1_1BundleProtocol.html#54a44c247b3c20b4ed11e29494284ca7a67858f9537b64d0ca49f8921e496a68" title="INTERNAL ONLY -- NOT IN SPEC.">UNKNOWN_BLOCK</a> = 0x101, <a name="l00189"></a>00189 } <a class="code" href="classdtn_1_1BundleProtocol.html#54a44c247b3c20b4ed11e29494284ca7" title="Valid type codes for bundle blocks.">bundle_block_type_t</a>; <a name="l00190"></a>00190 <a name="l00195"></a><a class="code" href="classdtn_1_1BundleProtocol.html#cd56fabd4393bd86ffc295bafaba540b">00195</a> <span class="keyword">typedef</span> <span class="keyword">enum</span> { <a name="l00196"></a><a class="code" href="classdtn_1_1BundleProtocol.html#cd56fabd4393bd86ffc295bafaba540b615404458f982d50e1fea01b9d383146">00196</a> <a class="code" href="classdtn_1_1BundleProtocol.html#cd56fabd4393bd86ffc295bafaba540b615404458f982d50e1fea01b9d383146">BLOCK_FLAG_REPLICATE</a> = 1 << 0, <a name="l00197"></a><a class="code" href="classdtn_1_1BundleProtocol.html#cd56fabd4393bd86ffc295bafaba540b08e26de152eecfd35ff1081abf480309">00197</a> <a class="code" href="classdtn_1_1BundleProtocol.html#cd56fabd4393bd86ffc295bafaba540b08e26de152eecfd35ff1081abf480309">BLOCK_FLAG_REPORT_ONERROR</a> = 1 << 1, <a name="l00198"></a><a class="code" href="classdtn_1_1BundleProtocol.html#cd56fabd4393bd86ffc295bafaba540b0b657a90e3033d112835cf7df7a4855b">00198</a> <a class="code" href="classdtn_1_1BundleProtocol.html#cd56fabd4393bd86ffc295bafaba540b0b657a90e3033d112835cf7df7a4855b">BLOCK_FLAG_DISCARD_BUNDLE_ONERROR</a> = 1 << 2, <a name="l00199"></a><a class="code" href="classdtn_1_1BundleProtocol.html#cd56fabd4393bd86ffc295bafaba540b60a3533536c98ae651d4533edd238037">00199</a> <a class="code" href="classdtn_1_1BundleProtocol.html#cd56fabd4393bd86ffc295bafaba540b60a3533536c98ae651d4533edd238037">BLOCK_FLAG_LAST_BLOCK</a> = 1 << 3, <a name="l00200"></a><a class="code" href="classdtn_1_1BundleProtocol.html#cd56fabd4393bd86ffc295bafaba540b92bb8f5c147c6963041f7bc20cfe6e29">00200</a> <a class="code" href="classdtn_1_1BundleProtocol.html#cd56fabd4393bd86ffc295bafaba540b92bb8f5c147c6963041f7bc20cfe6e29">BLOCK_FLAG_DISCARD_BLOCK_ONERROR</a> = 1 << 4, <a name="l00201"></a><a class="code" href="classdtn_1_1BundleProtocol.html#cd56fabd4393bd86ffc295bafaba540b780f32e1722378470bd143d2fed9cd29">00201</a> <a class="code" href="classdtn_1_1BundleProtocol.html#cd56fabd4393bd86ffc295bafaba540b780f32e1722378470bd143d2fed9cd29">BLOCK_FLAG_FORWARDED_UNPROCESSED</a> = 1 << 5, <a name="l00202"></a><a class="code" href="classdtn_1_1BundleProtocol.html#cd56fabd4393bd86ffc295bafaba540b6616947d5db3ac647eeb6d6f0411a593">00202</a> <a class="code" href="classdtn_1_1BundleProtocol.html#cd56fabd4393bd86ffc295bafaba540b6616947d5db3ac647eeb6d6f0411a593">BLOCK_FLAG_EID_REFS</a> = 1 << 6 <a name="l00203"></a>00203 } <a class="code" href="classdtn_1_1BundleProtocol.html#cd56fabd4393bd86ffc295bafaba540b" title="Values for block processing flags that appear in all blocks except the primary block...">block_flag_t</a>; <a name="l00204"></a>00204 <a name="l00209"></a><a class="code" href="structdtn_1_1BundleProtocol_1_1BlockPreamble.html">00209</a> <span class="keyword">struct </span><a class="code" href="structdtn_1_1BundleProtocol_1_1BlockPreamble.html" title="The basic block preamble that&#39;s common to all blocks (including the payload block...">BlockPreamble</a> { <a name="l00210"></a><a class="code" href="structdtn_1_1BundleProtocol_1_1BlockPreamble.html#f23c6c3672cae5acde1fbdedb0ac26ff">00210</a> u_int8_t type; <a name="l00211"></a><a class="code" href="structdtn_1_1BundleProtocol_1_1BlockPreamble.html#fcf5e92954184442a1fed4a34fd5b8a8">00211</a> u_int8_t <a class="code" href="structdtn_1_1BundleProtocol_1_1BlockPreamble.html#fcf5e92954184442a1fed4a34fd5b8a8">flags</a>; <a name="l00212"></a><a class="code" href="structdtn_1_1BundleProtocol_1_1BlockPreamble.html#780618d7fb60c4cba70043e006ddfd7a">00212</a> u_char <a class="code" href="structdtn_1_1BundleProtocol_1_1BlockPreamble.html#780618d7fb60c4cba70043e006ddfd7a">length</a>[0]; <span class="comment">// SDNV</span> <a name="l00213"></a>00213 } __attribute__((<a class="code" href="classdtn_1_1BundleProtocol.html#0a8eb09d58cff4c5a228fa4bc9d29a11" title="The basic block preamble that&#39;s common to all blocks (including the payload block...">packed</a>)); <a name="l00214"></a>00214 <a name="l00218"></a><a class="code" href="classdtn_1_1BundleProtocol.html#35e3c05cad3ebc9ec0f4d9b0f88ece20">00218</a> <span class="keyword">typedef</span> <span class="keyword">enum</span> { <a name="l00219"></a><a class="code" href="classdtn_1_1BundleProtocol.html#35e3c05cad3ebc9ec0f4d9b0f88ece20e4dc69cfbb7fd68487cffea427db7f7f">00219</a> <a class="code" href="classdtn_1_1BundleProtocol.html#35e3c05cad3ebc9ec0f4d9b0f88ece20e4dc69cfbb7fd68487cffea427db7f7f">ADMIN_STATUS_REPORT</a> = 0x01, <a name="l00220"></a><a class="code" href="classdtn_1_1BundleProtocol.html#35e3c05cad3ebc9ec0f4d9b0f88ece207e6e1a30d0fed8a953bc65802798f7dd">00220</a> <a class="code" href="classdtn_1_1BundleProtocol.html#35e3c05cad3ebc9ec0f4d9b0f88ece207e6e1a30d0fed8a953bc65802798f7dd">ADMIN_CUSTODY_SIGNAL</a> = 0x02, <a name="l00221"></a><a class="code" href="classdtn_1_1BundleProtocol.html#35e3c05cad3ebc9ec0f4d9b0f88ece20f8fdc109b1a0407b5a3107a3585f6dc3">00221</a> <a class="code" href="classdtn_1_1BundleProtocol.html#35e3c05cad3ebc9ec0f4d9b0f88ece20f8fdc109b1a0407b5a3107a3585f6dc3">ADMIN_ANNOUNCE</a> = 0x05, <span class="comment">// NOT IN BUNDLE SPEC</span> <a name="l00222"></a>00222 } <a class="code" href="classdtn_1_1BundleProtocol.html#35e3c05cad3ebc9ec0f4d9b0f88ece20" title="Administrative Record Type Codes.">admin_record_type_t</a>; <a name="l00223"></a>00223 <a name="l00227"></a><a class="code" href="classdtn_1_1BundleProtocol.html#f827c0a9dff8115434bc273dc53b7df1">00227</a> <span class="keyword">typedef</span> <span class="keyword">enum</span> { <a name="l00228"></a><a class="code" href="classdtn_1_1BundleProtocol.html#f827c0a9dff8115434bc273dc53b7df1951511bc017d452550ea77dd9a15306b">00228</a> <a class="code" href="classdtn_1_1BundleProtocol.html#f827c0a9dff8115434bc273dc53b7df1951511bc017d452550ea77dd9a15306b">ADMIN_IS_FRAGMENT</a> = 0x01, <a name="l00229"></a>00229 } <a class="code" href="classdtn_1_1BundleProtocol.html#f827c0a9dff8115434bc273dc53b7df1" title="Administrative Record Flags.">admin_record_flags_t</a>; <a name="l00230"></a>00230 <a name="l00234"></a><a class="code" href="classdtn_1_1BundleProtocol.html#4e25b9c1d9577e30425bc93a8bc5ddb4">00234</a> <span class="keyword">typedef</span> <span class="keyword">enum</span> { <a name="l00235"></a><a class="code" href="classdtn_1_1BundleProtocol.html#4e25b9c1d9577e30425bc93a8bc5ddb45084c0d1b646f1671fa15d90ab25c5c9">00235</a> <a class="code" href="classdtn_1_1BundleProtocol.html#4e25b9c1d9577e30425bc93a8bc5ddb45084c0d1b646f1671fa15d90ab25c5c9">STATUS_RECEIVED</a> = 1 << 14, <a name="l00236"></a><a class="code" href="classdtn_1_1BundleProtocol.html#4e25b9c1d9577e30425bc93a8bc5ddb4db3d621578bcd84682245b61d2830afe">00236</a> <a class="code" href="classdtn_1_1BundleProtocol.html#4e25b9c1d9577e30425bc93a8bc5ddb4db3d621578bcd84682245b61d2830afe">STATUS_CUSTODY_ACCEPTED</a> = 1 << 15, <a name="l00237"></a><a class="code" href="classdtn_1_1BundleProtocol.html#4e25b9c1d9577e30425bc93a8bc5ddb40daebdf298b9f59bfb5f56c2191003a7">00237</a> <a class="code" href="classdtn_1_1BundleProtocol.html#4e25b9c1d9577e30425bc93a8bc5ddb40daebdf298b9f59bfb5f56c2191003a7">STATUS_FORWARDED</a> = 1 << 16, <a name="l00238"></a><a class="code" href="classdtn_1_1BundleProtocol.html#4e25b9c1d9577e30425bc93a8bc5ddb42f6dc9b01285b3f7db901319b99de065">00238</a> <a class="code" href="classdtn_1_1BundleProtocol.html#4e25b9c1d9577e30425bc93a8bc5ddb42f6dc9b01285b3f7db901319b99de065">STATUS_DELIVERED</a> = 1 << 17, <a name="l00239"></a><a class="code" href="classdtn_1_1BundleProtocol.html#4e25b9c1d9577e30425bc93a8bc5ddb4dddc9465fbf0a1bc602642b99fe03e28">00239</a> <a class="code" href="classdtn_1_1BundleProtocol.html#4e25b9c1d9577e30425bc93a8bc5ddb4dddc9465fbf0a1bc602642b99fe03e28">STATUS_DELETED</a> = 1 << 18, <a name="l00240"></a><a class="code" href="classdtn_1_1BundleProtocol.html#4e25b9c1d9577e30425bc93a8bc5ddb4994ee560ea74e62ba8eee9c6648f4809">00240</a> <a class="code" href="classdtn_1_1BundleProtocol.html#4e25b9c1d9577e30425bc93a8bc5ddb4994ee560ea74e62ba8eee9c6648f4809">STATUS_ACKED_BY_APP</a> = 1 << 19, <a name="l00241"></a><a class="code" href="classdtn_1_1BundleProtocol.html#4e25b9c1d9577e30425bc93a8bc5ddb4e97ac8edac20c401c56fefe09578aa0e">00241</a> <a class="code" href="classdtn_1_1BundleProtocol.html#4e25b9c1d9577e30425bc93a8bc5ddb4e97ac8edac20c401c56fefe09578aa0e">STATUS_UNUSED2</a> = 1 << 20, <a name="l00242"></a>00242 } <a class="code" href="classdtn_1_1BundleProtocol.html#4e25b9c1d9577e30425bc93a8bc5ddb4" title="Bundle Status Report Status Flags.">status_report_flag_t</a>; <a name="l00243"></a>00243 <a name="l00247"></a><a class="code" href="classdtn_1_1BundleProtocol.html#e339b3a1104cd188459059e46543490b">00247</a> <span class="keyword">typedef</span> <span class="keyword">enum</span> { <a name="l00248"></a><a class="code" href="classdtn_1_1BundleProtocol.html#e339b3a1104cd188459059e46543490bf974eaaa8cbe4e66aeaf238a454cecf1">00248</a> <a class="code" href="classdtn_1_1BundleProtocol.html#e339b3a1104cd188459059e46543490bf974eaaa8cbe4e66aeaf238a454cecf1">CUSTODY_NO_ADDTL_INFO</a> = 0x00, <a name="l00249"></a><a class="code" href="classdtn_1_1BundleProtocol.html#e339b3a1104cd188459059e46543490b0a6d60329683ef33d75edbce647fb245">00249</a> <a class="code" href="classdtn_1_1BundleProtocol.html#e339b3a1104cd188459059e46543490b0a6d60329683ef33d75edbce647fb245">CUSTODY_REDUNDANT_RECEPTION</a> = 0x03, <a name="l00250"></a><a class="code" href="classdtn_1_1BundleProtocol.html#e339b3a1104cd188459059e46543490b870861df82a7d42686c4b64887e2e8e7">00250</a> <a class="code" href="classdtn_1_1BundleProtocol.html#e339b3a1104cd188459059e46543490b870861df82a7d42686c4b64887e2e8e7">CUSTODY_DEPLETED_STORAGE</a> = 0x04, <a name="l00251"></a><a class="code" href="classdtn_1_1BundleProtocol.html#e339b3a1104cd188459059e46543490bf04d881f698e458b945dbefb9163a7a4">00251</a> <a class="code" href="classdtn_1_1BundleProtocol.html#e339b3a1104cd188459059e46543490bf04d881f698e458b945dbefb9163a7a4">CUSTODY_ENDPOINT_ID_UNINTELLIGIBLE</a> = 0x05, <a name="l00252"></a><a class="code" href="classdtn_1_1BundleProtocol.html#e339b3a1104cd188459059e46543490bae630a36e16e37e3aec296c18f1a12b2">00252</a> <a class="code" href="classdtn_1_1BundleProtocol.html#e339b3a1104cd188459059e46543490bae630a36e16e37e3aec296c18f1a12b2">CUSTODY_NO_ROUTE_TO_DEST</a> = 0x06, <a name="l00253"></a><a class="code" href="classdtn_1_1BundleProtocol.html#e339b3a1104cd188459059e46543490bbb74fb4f2a0579bd6b56206cfeffaec2">00253</a> <a class="code" href="classdtn_1_1BundleProtocol.html#e339b3a1104cd188459059e46543490bbb74fb4f2a0579bd6b56206cfeffaec2">CUSTODY_NO_TIMELY_CONTACT</a> = 0x07, <a name="l00254"></a><a class="code" href="classdtn_1_1BundleProtocol.html#e339b3a1104cd188459059e46543490bf28ea7f5e87b6196687b5d0f3bf57d4f">00254</a> <a class="code" href="classdtn_1_1BundleProtocol.html#e339b3a1104cd188459059e46543490bf28ea7f5e87b6196687b5d0f3bf57d4f">CUSTODY_BLOCK_UNINTELLIGIBLE</a> = 0x08 <a name="l00255"></a>00255 } <a class="code" href="classdtn_1_1BundleProtocol.html#e339b3a1104cd188459059e46543490b" title="Custody Signal Reason Codes.">custody_signal_reason_t</a>; <a name="l00256"></a>00256 <a name="l00263"></a>00263 <span class="keyword">static</span> <span class="keywordtype">bool</span> <a class="code" href="classdtn_1_1BundleProtocol.html#0100870ed71be16830543b822cfffd2c" title="Assuming the given bundle is an administrative bundle, extract the admin bundle type...">get_admin_type</a>(<span class="keyword">const</span> <a class="code" href="classdtn_1_1Bundle.html" title="The internal representation of a bundle.">Bundle</a>* bundle, <a name="l00264"></a>00264 <a class="code" href="classdtn_1_1BundleProtocol.html#35e3c05cad3ebc9ec0f4d9b0f88ece20" title="Administrative Record Type Codes.">admin_record_type_t</a>* type); <a name="l00265"></a>00265 <a name="l00266"></a>00266 <span class="keyword">private</span>: <a name="l00271"></a><a class="code" href="classdtn_1_1BundleProtocol.html#43a86367ca937ca31641d9c57ca38726">00271</a> <span class="keyword">static</span> <a class="code" href="classdtn_1_1BlockProcessor.html" title="Base class for the protocol handling of bundle blocks, including the core primary...">BlockProcessor</a>* <a class="code" href="classdtn_1_1BundleProtocol.html#43a86367ca937ca31641d9c57ca38726" title="Array of registered BlockProcessor handlers -- fixed size since there can be at most...">processors_</a>[256]; <a name="l00272"></a>00272 <a name="l00273"></a>00273 }; <a name="l00274"></a>00274 <a name="l00275"></a>00275 } <span class="comment">// namespace dtn</span> <a name="l00276"></a>00276 <a name="l00277"></a>00277 <span class="preprocessor">#endif </span><span class="comment">/* _BUNDLE_PROTOCOL_H_ */</span> </pre></div></div> <hr size="1"><address style="text-align: right;"><small>Generated on Mon Jul 21 14:09:38 2008 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.6 </small></address> </body> </html>