<!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: Params.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>Params.h</h1><a href="Params_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 _PROPHET_PARAMS_H_</span> <a name="l00018"></a>00018 <span class="preprocessor"></span><span class="preprocessor">#define _PROPHET_PARAMS_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 <span class="preprocessor">#include "<a class="code" href="servlib_2prophet_2Node_8h.html">Node.h</a>"</span> <a name="l00022"></a>00022 <span class="preprocessor">#include "<a class="code" href="FwdStrategy_8h.html">FwdStrategy.h</a>"</span> <a name="l00023"></a>00023 <span class="preprocessor">#include "<a class="code" href="QueuePolicy_8h.html">QueuePolicy.h</a>"</span> <a name="l00024"></a>00024 <a name="l00025"></a>00025 <span class="keyword">namespace </span>prophet <a name="l00026"></a>00026 { <a name="l00027"></a>00027 <a name="l00032"></a><a class="code" href="classprophet_1_1ProphetParams.html">00032</a> <span class="keyword">class </span><a class="code" href="classprophet_1_1ProphetParams.html" title="Tunable parameter struct for setting global default values for various Prophet algorithms...">ProphetParams</a> : <span class="keyword">public</span> <a class="code" href="structprophet_1_1NodeParams.html" title="Tunable parameter struct for setting global default values for Prophet node algorithms...">NodeParams</a> <a name="l00033"></a>00033 { <a name="l00034"></a>00034 <span class="keyword">public</span>: <a name="l00038"></a><a class="code" href="classprophet_1_1ProphetParams.html#6e4c7b5a5d78f8b5634f499811996498">00038</a> <span class="keyword">static</span> <span class="keyword">const</span> u_int8_t <a class="code" href="classprophet_1_1ProphetParams.html#6e4c7b5a5d78f8b5634f499811996498" title="Time between HELLO beacons (in 100ms units).">HELLO_INTERVAL</a> = 20; <a name="l00039"></a>00039 <a name="l00043"></a><a class="code" href="classprophet_1_1ProphetParams.html#720d21253b43171a2456e2704dc89881">00043</a> <span class="keyword">static</span> <span class="keyword">const</span> u_int <a class="code" href="classprophet_1_1ProphetParams.html#720d21253b43171a2456e2704dc89881" title="Max units of HELLO_INTERVAL before peer is considered unreachable.">HELLO_DEAD</a> = 20; <a name="l00044"></a>00044 <a name="l00048"></a><a class="code" href="classprophet_1_1ProphetParams.html#f82e3954574e3c8d47c86ff61022b29e">00048</a> <span class="keyword">static</span> <span class="keyword">const</span> u_int <a class="code" href="classprophet_1_1ProphetParams.html#f82e3954574e3c8d47c86ff61022b29e" title="Max times to forward a bundle for GTMX.">DEFAULT_NUM_F_MAX</a> = 5; <a name="l00049"></a>00049 <a name="l00053"></a><a class="code" href="classprophet_1_1ProphetParams.html#908cc77b0dec31dffe50c4a5fb936b98">00053</a> <span class="keyword">static</span> <span class="keyword">const</span> u_int <a class="code" href="classprophet_1_1ProphetParams.html#908cc77b0dec31dffe50c4a5fb936b98" title="Min times to forward a bundle for LEPR.">DEFAULT_NUM_F_MIN</a> = 3; <a name="l00054"></a>00054 <a name="l00058"></a><a class="code" href="classprophet_1_1ProphetParams.html#2a36a8663428c3980716f2213c14866f">00058</a> <span class="keyword">static</span> <span class="keyword">const</span> u_int <a class="code" href="classprophet_1_1ProphetParams.html#2a36a8663428c3980716f2213c14866f" title="Seconds between aging of nodes and Prophet ACKs.">AGE_PERIOD</a> = 180; <a name="l00059"></a>00059 <a name="l00063"></a><a class="code" href="classprophet_1_1ProphetParams.html#a03c1f2abfb829093d93fdc489ed56cd">00063</a> <span class="keyword">static</span> <span class="keyword">const</span> u_int8_t <a class="code" href="classprophet_1_1ProphetParams.html#a03c1f2abfb829093d93fdc489ed56cd" title="Current version of the protocol.">PROPHET_VERSION</a> = 0x01; <a name="l00064"></a>00064 <a name="l00068"></a><a class="code" href="classprophet_1_1ProphetParams.html#ae3176fe21c362b1fe3f0eaa3fed021b">00068</a> <span class="keyword">static</span> <span class="keyword">const</span> u_int <a class="code" href="classprophet_1_1ProphetParams.html#ae3176fe21c362b1fe3f0eaa3fed021b" title="Maximum number of routes to retain (not specified by I-D).">MAX_TABLE_SIZE</a> = 1024; <a name="l00069"></a>00069 <a name="l00073"></a><a class="code" href="classprophet_1_1ProphetParams.html#f85a9c71b43b0dea2e1e7a3f7b58b6d7">00073</a> <a class="code" href="classprophet_1_1ProphetParams.html#f85a9c71b43b0dea2e1e7a3f7b58b6d7" title="Constructor.">ProphetParams</a>() <a name="l00074"></a>00074 : <a class="code" href="structprophet_1_1NodeParams.html" title="Tunable parameter struct for setting global default values for Prophet node algorithms...">NodeParams</a>(), <a name="l00075"></a>00075 <a class="code" href="classprophet_1_1ProphetParams.html#673fa444b729127a7b55082009adcdea" title="bundle forwarding strategy">fs_</a>(<a class="code" href="structprophet_1_1FwdStrategy.html">FwdStrategy</a>::GRTR), <a name="l00076"></a>00076 <a class="code" href="classprophet_1_1ProphetParams.html#baee73aa7287cc40ce5c4371c258d0ed" title="bundle queuing policy">qp_</a>(<a class="code" href="structprophet_1_1QueuePolicy.html">QueuePolicy</a>::FIFO), <a name="l00077"></a>00077 <a class="code" href="classprophet_1_1ProphetParams.html#8e006d8ded69418e398b6072045e1d4f" title="delay between HELLO beacons (100ms units)">hello_interval_</a>(<a class="code" href="classprophet_1_1ProphetParams.html#6e4c7b5a5d78f8b5634f499811996498" title="Time between HELLO beacons (in 100ms units).">HELLO_INTERVAL</a>), <a name="l00078"></a>00078 <a class="code" href="classprophet_1_1ProphetParams.html#a5d95b8fa1a69a0a388ffd8eef7341c2" title="hello_interval&#39;s before giving up on peer">hello_dead_</a>(<a class="code" href="classprophet_1_1ProphetParams.html#720d21253b43171a2456e2704dc89881" title="Max units of HELLO_INTERVAL before peer is considered unreachable.">HELLO_DEAD</a>), <a name="l00079"></a>00079 <a class="code" href="classprophet_1_1ProphetParams.html#2bb242a3808cae5674591862dc63e819" title="max times to forward bundle using GTMX">max_forward_</a>(<a class="code" href="classprophet_1_1ProphetParams.html#f82e3954574e3c8d47c86ff61022b29e" title="Max times to forward a bundle for GTMX.">DEFAULT_NUM_F_MAX</a>), <a name="l00080"></a>00080 <a class="code" href="classprophet_1_1ProphetParams.html#9a302dc3c667538f0e8fb443784daf7c" title="min times to forward bundle before LEPR drops">min_forward_</a>(<a class="code" href="classprophet_1_1ProphetParams.html#908cc77b0dec31dffe50c4a5fb936b98" title="Min times to forward a bundle for LEPR.">DEFAULT_NUM_F_MIN</a>), <a name="l00081"></a>00081 <a class="code" href="classprophet_1_1ProphetParams.html#d578dc8630c93dd1b6d30206ba869851" title="seconds between applying age algorithm">age_period_</a>(<a class="code" href="classprophet_1_1ProphetParams.html#2a36a8663428c3980716f2213c14866f" title="Seconds between aging of nodes and Prophet ACKs.">AGE_PERIOD</a>), <a name="l00082"></a>00082 <a class="code" href="classprophet_1_1ProphetParams.html#c4c67c6dd4e453f159ddd5a6afca8fb4" title="max number of routes to retain">max_table_size_</a>(<a class="code" href="classprophet_1_1ProphetParams.html#ae3176fe21c362b1fe3f0eaa3fed021b" title="Maximum number of routes to retain (not specified by I-D).">MAX_TABLE_SIZE</a>), <a name="l00083"></a>00083 <a class="code" href="classprophet_1_1ProphetParams.html#328896a3deacdf22a8720de8fd051239" title="minimum predictability before dropping route">epsilon_</a>(0.0039), <span class="comment">// min value using 1/255</span> <a name="l00084"></a>00084 <a class="code" href="classprophet_1_1ProphetParams.html#e2989205b08dc2713427e5288d200992" title="whether this node accepts bundles to relay to peers">relay_node_</a>(true), <a name="l00085"></a>00085 <a class="code" href="classprophet_1_1ProphetParams.html#c1997e3bc89d1b0b3c600de0a3f24869" title="not implemented; whether node bridges to Internet">internet_gw_</a>(false) <span class="comment">// not implemented</span> <a name="l00086"></a>00086 {} <a name="l00087"></a>00087 <a name="l00089"></a><a class="code" href="classprophet_1_1ProphetParams.html#e9ab4c2472a21a32f73d181d28ca54b6">00089</a> <a class="code" href="structprophet_1_1FwdStrategy.html#50567dba6d835926a1532568f6a46ff9" title="Forwarding strategies p.">FwdStrategy::fwd_strategy_t</a> <a class="code" href="classprophet_1_1ProphetParams.html#e9ab4c2472a21a32f73d181d28ca54b6" title="Accessors.">fs</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <a class="code" href="classprophet_1_1ProphetParams.html#673fa444b729127a7b55082009adcdea" title="bundle forwarding strategy">fs_</a>; } <a name="l00090"></a><a class="code" href="classprophet_1_1ProphetParams.html#bec48531a456495acbf3b7ffa28ac556">00090</a> <a class="code" href="structprophet_1_1QueuePolicy.html#41e2705af81c561ed69d802afa47ed68" title="Queuing policies p.">QueuePolicy::q_policy_t</a> <a class="code" href="classprophet_1_1ProphetParams.html#bec48531a456495acbf3b7ffa28ac556" title="Accessors.">qp</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <a class="code" href="classprophet_1_1ProphetParams.html#baee73aa7287cc40ce5c4371c258d0ed" title="bundle queuing policy">qp_</a>; } <a name="l00091"></a><a class="code" href="classprophet_1_1ProphetParams.html#04ea96f02e94052cc8f048a467c55074">00091</a> u_int8_t <a class="code" href="classprophet_1_1ProphetParams.html#04ea96f02e94052cc8f048a467c55074" title="Accessors.">hello_interval</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <a class="code" href="classprophet_1_1ProphetParams.html#8e006d8ded69418e398b6072045e1d4f" title="delay between HELLO beacons (100ms units)">hello_interval_</a>; } <a name="l00092"></a><a class="code" href="classprophet_1_1ProphetParams.html#7050d905cedc23b5f258e65ffe860359">00092</a> u_int <a class="code" href="classprophet_1_1ProphetParams.html#7050d905cedc23b5f258e65ffe860359" title="Accessors.">hello_dead</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <a class="code" href="classprophet_1_1ProphetParams.html#a5d95b8fa1a69a0a388ffd8eef7341c2" title="hello_interval&#39;s before giving up on peer">hello_dead_</a>; } <a name="l00093"></a><a class="code" href="classprophet_1_1ProphetParams.html#0a1480df9d48aed49f493c6c35c32f77">00093</a> u_int <a class="code" href="classprophet_1_1ProphetParams.html#0a1480df9d48aed49f493c6c35c32f77" title="Accessors.">max_forward</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <a class="code" href="classprophet_1_1ProphetParams.html#2bb242a3808cae5674591862dc63e819" title="max times to forward bundle using GTMX">max_forward_</a>; } <a name="l00094"></a><a class="code" href="classprophet_1_1ProphetParams.html#6265cbe3208a059e04786c87b5ff11c7">00094</a> u_int <a class="code" href="classprophet_1_1ProphetParams.html#6265cbe3208a059e04786c87b5ff11c7" title="Accessors.">min_forward</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <a class="code" href="classprophet_1_1ProphetParams.html#9a302dc3c667538f0e8fb443784daf7c" title="min times to forward bundle before LEPR drops">min_forward_</a>; } <a name="l00095"></a><a class="code" href="classprophet_1_1ProphetParams.html#6c35942f9819d4a227489e0d94321c13">00095</a> u_int <a class="code" href="classprophet_1_1ProphetParams.html#6c35942f9819d4a227489e0d94321c13" title="Accessors.">age_period</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <a class="code" href="classprophet_1_1ProphetParams.html#d578dc8630c93dd1b6d30206ba869851" title="seconds between applying age algorithm">age_period_</a>; } <a name="l00096"></a><a class="code" href="classprophet_1_1ProphetParams.html#cf23b3c63661086bef05205a4fdec21f">00096</a> <span class="keywordtype">double</span> <a class="code" href="classprophet_1_1ProphetParams.html#cf23b3c63661086bef05205a4fdec21f" title="Accessors.">epsilon</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <a class="code" href="classprophet_1_1ProphetParams.html#328896a3deacdf22a8720de8fd051239" title="minimum predictability before dropping route">epsilon_</a>; } <a name="l00097"></a><a class="code" href="classprophet_1_1ProphetParams.html#ed551cc6108185cdbda6e79a56b8f4f9">00097</a> <span class="keywordtype">bool</span> <a class="code" href="classprophet_1_1ProphetParams.html#ed551cc6108185cdbda6e79a56b8f4f9" title="Accessors.">relay_node</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <a class="code" href="classprophet_1_1ProphetParams.html#e2989205b08dc2713427e5288d200992" title="whether this node accepts bundles to relay to peers">relay_node_</a>; } <a name="l00098"></a><a class="code" href="classprophet_1_1ProphetParams.html#a77b57df2c35055a7759373bad0ffcf3">00098</a> <span class="keywordtype">bool</span> <a class="code" href="classprophet_1_1ProphetParams.html#a77b57df2c35055a7759373bad0ffcf3" title="Accessors.">internet_gw</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <a class="code" href="classprophet_1_1ProphetParams.html#c1997e3bc89d1b0b3c600de0a3f24869" title="not implemented; whether node bridges to Internet">internet_gw_</a>; } <a name="l00100"></a>00100 <a name="l00101"></a><a class="code" href="classprophet_1_1ProphetParams.html#673fa444b729127a7b55082009adcdea">00101</a> <a class="code" href="structprophet_1_1FwdStrategy.html#50567dba6d835926a1532568f6a46ff9" title="Forwarding strategies p.">FwdStrategy::fwd_strategy_t</a> <a class="code" href="classprophet_1_1ProphetParams.html#673fa444b729127a7b55082009adcdea" title="bundle forwarding strategy">fs_</a>; <a name="l00102"></a><a class="code" href="classprophet_1_1ProphetParams.html#baee73aa7287cc40ce5c4371c258d0ed">00102</a> <a class="code" href="structprophet_1_1QueuePolicy.html#41e2705af81c561ed69d802afa47ed68" title="Queuing policies p.">QueuePolicy::q_policy_t</a> <a class="code" href="classprophet_1_1ProphetParams.html#baee73aa7287cc40ce5c4371c258d0ed" title="bundle queuing policy">qp_</a>; <a name="l00103"></a>00103 <a name="l00104"></a><a class="code" href="classprophet_1_1ProphetParams.html#8e006d8ded69418e398b6072045e1d4f">00104</a> u_int8_t <a class="code" href="classprophet_1_1ProphetParams.html#8e006d8ded69418e398b6072045e1d4f" title="delay between HELLO beacons (100ms units)">hello_interval_</a>; <a name="l00105"></a><a class="code" href="classprophet_1_1ProphetParams.html#a5d95b8fa1a69a0a388ffd8eef7341c2">00105</a> u_int <a class="code" href="classprophet_1_1ProphetParams.html#a5d95b8fa1a69a0a388ffd8eef7341c2" title="hello_interval&#39;s before giving up on peer">hello_dead_</a>; <a name="l00106"></a>00106 <a name="l00107"></a><a class="code" href="classprophet_1_1ProphetParams.html#2bb242a3808cae5674591862dc63e819">00107</a> u_int <a class="code" href="classprophet_1_1ProphetParams.html#2bb242a3808cae5674591862dc63e819" title="max times to forward bundle using GTMX">max_forward_</a>; <a name="l00108"></a><a class="code" href="classprophet_1_1ProphetParams.html#9a302dc3c667538f0e8fb443784daf7c">00108</a> u_int <a class="code" href="classprophet_1_1ProphetParams.html#9a302dc3c667538f0e8fb443784daf7c" title="min times to forward bundle before LEPR drops">min_forward_</a>; <a name="l00109"></a>00109 <a name="l00110"></a><a class="code" href="classprophet_1_1ProphetParams.html#d578dc8630c93dd1b6d30206ba869851">00110</a> u_int <a class="code" href="classprophet_1_1ProphetParams.html#d578dc8630c93dd1b6d30206ba869851" title="seconds between applying age algorithm">age_period_</a>; <a name="l00111"></a>00111 <a name="l00112"></a><a class="code" href="classprophet_1_1ProphetParams.html#c4c67c6dd4e453f159ddd5a6afca8fb4">00112</a> u_int <a class="code" href="classprophet_1_1ProphetParams.html#c4c67c6dd4e453f159ddd5a6afca8fb4" title="max number of routes to retain">max_table_size_</a>; <a name="l00113"></a>00113 <a name="l00114"></a><a class="code" href="classprophet_1_1ProphetParams.html#328896a3deacdf22a8720de8fd051239">00114</a> <span class="keywordtype">double</span> <a class="code" href="classprophet_1_1ProphetParams.html#328896a3deacdf22a8720de8fd051239" title="minimum predictability before dropping route">epsilon_</a>; <a name="l00115"></a>00115 <a name="l00116"></a><a class="code" href="classprophet_1_1ProphetParams.html#e2989205b08dc2713427e5288d200992">00116</a> <span class="keywordtype">bool</span> <a class="code" href="classprophet_1_1ProphetParams.html#e2989205b08dc2713427e5288d200992" title="whether this node accepts bundles to relay to peers">relay_node_</a>; <a name="l00117"></a><a class="code" href="classprophet_1_1ProphetParams.html#c1997e3bc89d1b0b3c600de0a3f24869">00117</a> <span class="keywordtype">bool</span> <a class="code" href="classprophet_1_1ProphetParams.html#c1997e3bc89d1b0b3c600de0a3f24869" title="not implemented; whether node bridges to Internet">internet_gw_</a>; <a name="l00118"></a>00118 }; <a name="l00119"></a>00119 <a name="l00120"></a>00120 }; <span class="comment">// namespace prophet</span> <a name="l00121"></a>00121 <a name="l00122"></a>00122 <span class="preprocessor">#endif // _PROPHET_PARAMS_H_</span> </pre></div></div> <hr size="1"><address style="text-align: right;"><small>Generated on Fri Jan 30 09:26:57 2009 for DTN Reference Implementation by <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>