Sophie

Sophie

distrib > Mandriva > 2009.0 > i586 > by-pkgid > d9faa203c2b0b6fbb179d93daaea81b7 > files > 138

libdtn-devel-2.6.0-1mdv2009.0.i586.rpm

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<title>DTN Reference Implementation: BundleStatusReport.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&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>
<h1>BundleStatusReport.h</h1><a href="BundleStatusReport_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_STATUS_REPORT_H_</span>
<a name="l00018"></a>00018 <span class="preprocessor"></span><span class="preprocessor">#define _BUNDLE_STATUS_REPORT_H_</span>
<a name="l00019"></a>00019 <span class="preprocessor"></span>
<a name="l00020"></a>00020 <span class="preprocessor">#include "<a class="code" href="bundling_2Bundle_8h.html">Bundle.h</a>"</span>
<a name="l00021"></a>00021 <span class="preprocessor">#include "<a class="code" href="BundleProtocol_8h.html">BundleProtocol.h</a>"</span>
<a name="l00022"></a>00022 <span class="preprocessor">#include "<a class="code" href="BundleTimestamp_8h.html">BundleTimestamp.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="l00029"></a><a class="code" href="classdtn_1_1BundleStatusReport.html">00029</a> <span class="keyword">class </span><a class="code" href="classdtn_1_1BundleStatusReport.html" title="Utility class to create and parse status reports.">BundleStatusReport</a> {
<a name="l00030"></a>00030 <span class="keyword">public</span>:
<a name="l00031"></a><a class="code" href="classdtn_1_1BundleStatusReport.html#b2546897ef428634d8385363b6de1499">00031</a>     <span class="keyword">typedef</span> <span class="keyword">enum</span> {
<a name="l00032"></a><a class="code" href="classdtn_1_1BundleStatusReport.html#b2546897ef428634d8385363b6de149923a02b797429c4a3cf6c5e89f65ee036">00032</a>         <a class="code" href="classdtn_1_1BundleStatusReport.html#b2546897ef428634d8385363b6de149923a02b797429c4a3cf6c5e89f65ee036">STATUS_RECEIVED</a>         = 0x01,
<a name="l00033"></a><a class="code" href="classdtn_1_1BundleStatusReport.html#b2546897ef428634d8385363b6de1499064bcecfb056e6fb69163c02c178e16d">00033</a>         <a class="code" href="classdtn_1_1BundleStatusReport.html#b2546897ef428634d8385363b6de1499064bcecfb056e6fb69163c02c178e16d">STATUS_CUSTODY_ACCEPTED</a> = 0x02,
<a name="l00034"></a><a class="code" href="classdtn_1_1BundleStatusReport.html#b2546897ef428634d8385363b6de14990bf1d45c8cccd8402bde14ee94f6547f">00034</a>         <a class="code" href="classdtn_1_1BundleStatusReport.html#b2546897ef428634d8385363b6de14990bf1d45c8cccd8402bde14ee94f6547f">STATUS_FORWARDED</a>        = 0x04,
<a name="l00035"></a><a class="code" href="classdtn_1_1BundleStatusReport.html#b2546897ef428634d8385363b6de1499c3d5b382fe3e58a9ef8a7ad98203e9f0">00035</a>         <a class="code" href="classdtn_1_1BundleStatusReport.html#b2546897ef428634d8385363b6de1499c3d5b382fe3e58a9ef8a7ad98203e9f0">STATUS_DELIVERED</a>        = 0x08,
<a name="l00036"></a><a class="code" href="classdtn_1_1BundleStatusReport.html#b2546897ef428634d8385363b6de14990b94e9bc2f3ff0bb55a9920a9a5058f2">00036</a>         <a class="code" href="classdtn_1_1BundleStatusReport.html#b2546897ef428634d8385363b6de14990b94e9bc2f3ff0bb55a9920a9a5058f2">STATUS_DELETED</a>          = 0x10,
<a name="l00037"></a><a class="code" href="classdtn_1_1BundleStatusReport.html#b2546897ef428634d8385363b6de1499c3f0fc79cd0c05849272121d95eb3b4a">00037</a>         <a class="code" href="classdtn_1_1BundleStatusReport.html#b2546897ef428634d8385363b6de1499c3f0fc79cd0c05849272121d95eb3b4a">STATUS_ACKED_BY_APP</a>     = 0x20,
<a name="l00038"></a><a class="code" href="classdtn_1_1BundleStatusReport.html#b2546897ef428634d8385363b6de149967395c3e6c6f7b03e5b5eb394d9547f7">00038</a>         <a class="code" href="classdtn_1_1BundleStatusReport.html#b2546897ef428634d8385363b6de149967395c3e6c6f7b03e5b5eb394d9547f7">STATUS_UNUSED</a>           = 0x40,
<a name="l00039"></a><a class="code" href="classdtn_1_1BundleStatusReport.html#b2546897ef428634d8385363b6de14994c392d1a743fed41f93d6c9eca10fac8">00039</a>         <a class="code" href="classdtn_1_1BundleStatusReport.html#b2546897ef428634d8385363b6de14994c392d1a743fed41f93d6c9eca10fac8">STATUS_UNUSED2</a>          = 0x80,
<a name="l00040"></a>00040     } <a class="code" href="classdtn_1_1BundleStatusReport.html#b2546897ef428634d8385363b6de1499">flag_t</a>;
<a name="l00041"></a>00041     
<a name="l00045"></a><a class="code" href="classdtn_1_1BundleStatusReport.html#d34ef9523deb6d1b000be14fc38d338f">00045</a>     <span class="keyword">typedef</span> <a class="code" href="classdtn_1_1BundleProtocol.html#37b000d94172c06970bb8af32889f917" title="Bundle Status Report &amp;quot;Reason Code&amp;quot; flags.">BundleProtocol::status_report_reason_t</a> <a class="code" href="classdtn_1_1BundleProtocol.html#37b000d94172c06970bb8af32889f917" title="Bundle Status Report &amp;quot;Reason Code&amp;quot; flags.">reason_t</a>;
<a name="l00046"></a>00046 
<a name="l00050"></a><a class="code" href="structdtn_1_1BundleStatusReport_1_1data__t.html">00050</a>     <span class="keyword">struct </span><a class="code" href="structdtn_1_1BundleStatusReport_1_1data__t.html" title="Specification of the contents of a Bundle Status Report.">data_t</a> {
<a name="l00051"></a><a class="code" href="structdtn_1_1BundleStatusReport_1_1data__t.html#e333f73e3e8e5f9006d976f9c38cab67">00051</a>         u_int8_t        <a class="code" href="structdtn_1_1BundleStatusReport_1_1data__t.html#e333f73e3e8e5f9006d976f9c38cab67">admin_type_</a>;
<a name="l00052"></a><a class="code" href="structdtn_1_1BundleStatusReport_1_1data__t.html#6c1b239cbfe40a46de7795d6aa6d4ecf">00052</a>         u_int8_t        <a class="code" href="structdtn_1_1BundleStatusReport_1_1data__t.html#6c1b239cbfe40a46de7795d6aa6d4ecf">admin_flags_</a>;
<a name="l00053"></a><a class="code" href="structdtn_1_1BundleStatusReport_1_1data__t.html#3f1f30037f28bb8ad3de467df41d8a8d">00053</a>         u_int8_t        <a class="code" href="structdtn_1_1BundleStatusReport_1_1data__t.html#3f1f30037f28bb8ad3de467df41d8a8d">status_flags_</a>;
<a name="l00054"></a><a class="code" href="structdtn_1_1BundleStatusReport_1_1data__t.html#12fab47b69881fcc1ca2cb75c6941746">00054</a>         u_int8_t        <a class="code" href="structdtn_1_1BundleStatusReport_1_1data__t.html#12fab47b69881fcc1ca2cb75c6941746">reason_code_</a>;
<a name="l00055"></a><a class="code" href="structdtn_1_1BundleStatusReport_1_1data__t.html#dc07b750280a3ffb45b922f6dd64bda2">00055</a>         u_int64_t       <a class="code" href="structdtn_1_1BundleStatusReport_1_1data__t.html#dc07b750280a3ffb45b922f6dd64bda2">orig_frag_offset_</a>;
<a name="l00056"></a><a class="code" href="structdtn_1_1BundleStatusReport_1_1data__t.html#aa5e604aa7f1e5309f33b3eaec40aaa5">00056</a>         u_int64_t       <a class="code" href="structdtn_1_1BundleStatusReport_1_1data__t.html#aa5e604aa7f1e5309f33b3eaec40aaa5">orig_frag_length_</a>;
<a name="l00057"></a><a class="code" href="structdtn_1_1BundleStatusReport_1_1data__t.html#304997abfd815cb4570ba38d5dc5a0f9">00057</a>         <a class="code" href="structdtn_1_1BundleTimestamp.html" title="Simple struct definition for bundle creation timestamps.">BundleTimestamp</a> <a class="code" href="structdtn_1_1BundleStatusReport_1_1data__t.html#304997abfd815cb4570ba38d5dc5a0f9">receipt_tv_</a>;
<a name="l00058"></a><a class="code" href="structdtn_1_1BundleStatusReport_1_1data__t.html#a12c42c06734a0f27e09240cdcf40d5f">00058</a>         <a class="code" href="structdtn_1_1BundleTimestamp.html" title="Simple struct definition for bundle creation timestamps.">BundleTimestamp</a> <a class="code" href="structdtn_1_1BundleStatusReport_1_1data__t.html#a12c42c06734a0f27e09240cdcf40d5f">custody_tv_</a>;
<a name="l00059"></a><a class="code" href="structdtn_1_1BundleStatusReport_1_1data__t.html#8eb774a8ad59cdd6a3a91a87392b30da">00059</a>         <a class="code" href="structdtn_1_1BundleTimestamp.html" title="Simple struct definition for bundle creation timestamps.">BundleTimestamp</a> <a class="code" href="structdtn_1_1BundleStatusReport_1_1data__t.html#8eb774a8ad59cdd6a3a91a87392b30da">forwarding_tv_</a>;
<a name="l00060"></a><a class="code" href="structdtn_1_1BundleStatusReport_1_1data__t.html#972b1e9695dd6d0ed5802170e22ff489">00060</a>         <a class="code" href="structdtn_1_1BundleTimestamp.html" title="Simple struct definition for bundle creation timestamps.">BundleTimestamp</a> <a class="code" href="structdtn_1_1BundleStatusReport_1_1data__t.html#972b1e9695dd6d0ed5802170e22ff489">delivery_tv_</a>;
<a name="l00061"></a><a class="code" href="structdtn_1_1BundleStatusReport_1_1data__t.html#54689605e52b7c87e60f2ff0ab8fb413">00061</a>         <a class="code" href="structdtn_1_1BundleTimestamp.html" title="Simple struct definition for bundle creation timestamps.">BundleTimestamp</a> <a class="code" href="structdtn_1_1BundleStatusReport_1_1data__t.html#54689605e52b7c87e60f2ff0ab8fb413">deletion_tv_</a>;
<a name="l00062"></a><a class="code" href="structdtn_1_1BundleStatusReport_1_1data__t.html#d83b26f19b8246119e870453922ba151">00062</a>         <a class="code" href="structdtn_1_1BundleTimestamp.html" title="Simple struct definition for bundle creation timestamps.">BundleTimestamp</a> <a class="code" href="structdtn_1_1BundleStatusReport_1_1data__t.html#d83b26f19b8246119e870453922ba151">ack_by_app_tv_</a>;
<a name="l00063"></a><a class="code" href="structdtn_1_1BundleStatusReport_1_1data__t.html#24a8b16df7b3050f6ca8fb2479c6d574">00063</a>         <a class="code" href="structdtn_1_1BundleTimestamp.html" title="Simple struct definition for bundle creation timestamps.">BundleTimestamp</a> <a class="code" href="structdtn_1_1BundleStatusReport_1_1data__t.html#24a8b16df7b3050f6ca8fb2479c6d574">orig_creation_tv_</a>;
<a name="l00064"></a><a class="code" href="structdtn_1_1BundleStatusReport_1_1data__t.html#a0e5648f21a9d7ded26521289c2e4aeb">00064</a>         <a class="code" href="classdtn_1_1EndpointID.html">EndpointID</a>      <a class="code" href="structdtn_1_1BundleStatusReport_1_1data__t.html#a0e5648f21a9d7ded26521289c2e4aeb">orig_source_eid_</a>;
<a name="l00065"></a>00065     };
<a name="l00066"></a>00066 
<a name="l00076"></a>00076     <span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code" href="classdtn_1_1BundleStatusReport.html#d3369fc659fbc354c26ddb769917ace8" title="Constructor-like function that fills in the bundle payload buffer with the appropriate...">create_status_report</a>(<a class="code" href="classdtn_1_1Bundle.html" title="The internal representation of a bundle.">Bundle</a>*           bundle,
<a name="l00077"></a>00077                                      <span class="keyword">const</span> <a class="code" href="classdtn_1_1Bundle.html" title="The internal representation of a bundle.">Bundle</a>*     orig_bundle,
<a name="l00078"></a>00078                                      <span class="keyword">const</span> <a class="code" href="classdtn_1_1EndpointID.html">EndpointID</a>&amp; source,
<a name="l00079"></a>00079                                      <a class="code" href="classdtn_1_1BundleStatusReport.html#b2546897ef428634d8385363b6de1499">flag_t</a>            status_flag,
<a name="l00080"></a>00080                                      <a class="code" href="classdtn_1_1BundleProtocol.html#37b000d94172c06970bb8af32889f917" title="Bundle Status Report &amp;quot;Reason Code&amp;quot; flags.">reason_t</a>          reason);
<a name="l00081"></a>00081     
<a name="l00087"></a>00087     <span class="keyword">static</span> <span class="keywordtype">bool</span> <a class="code" href="classdtn_1_1BundleStatusReport.html#a9e6e466cf356e0550bd1f36def1f4dc" title="Parse a byte stream containing a Status Report Payload and store the fields in the...">parse_status_report</a>(<a class="code" href="structdtn_1_1BundleStatusReport_1_1data__t.html" title="Specification of the contents of a Bundle Status Report.">data_t</a>* data,
<a name="l00088"></a>00088                                     <span class="keyword">const</span> u_char* bp, u_int <a class="code" href="num2sdnv_8c.html#fed088663f8704004425cdae2120b9b3">len</a>);
<a name="l00089"></a>00089 
<a name="l00094"></a>00094     <span class="keyword">static</span> <span class="keywordtype">bool</span> <a class="code" href="classdtn_1_1BundleStatusReport.html#a9e6e466cf356e0550bd1f36def1f4dc" title="Parse a byte stream containing a Status Report Payload and store the fields in the...">parse_status_report</a>(<a class="code" href="structdtn_1_1BundleStatusReport_1_1data__t.html" title="Specification of the contents of a Bundle Status Report.">data_t</a>* data,
<a name="l00095"></a>00095                                     <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="l00096"></a>00096 
<a name="l00100"></a>00100     <span class="keyword">static</span> <span class="keyword">const</span> <span class="keywordtype">char</span>* <a class="code" href="classdtn_1_1BundleStatusReport.html#c01eebd70430ee5eaf44240097a765cf" title="Return a string version of the reason code.">reason_to_str</a>(u_int8_t reason);
<a name="l00101"></a>00101 };
<a name="l00102"></a>00102 
<a name="l00103"></a>00103 } <span class="comment">// namespace dtn</span>
<a name="l00104"></a>00104 
<a name="l00105"></a>00105 <span class="preprocessor">#endif </span><span class="comment">/* _BUNDLE_STATUS_REPORT_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&nbsp;
<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>