Sophie

Sophie

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

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

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<title>DTN Reference Implementation: dtn_api.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&nbsp;Page</span></a></li>
      <li><a href="namespaces.html"><span>Namespaces</span></a></li>
      <li><a href="annotated.html"><span>Classes</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
    </ul>
  </div>
  <div class="tabs">
    <ul>
      <li><a href="files.html"><span>File&nbsp;List</span></a></li>
      <li><a href="globals.html"><span>File&nbsp;Members</span></a></li>
    </ul>
  </div>
<h1>dtn_api.h</h1><a href="dtn__api_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 DTN_API_H</span>
<a name="l00018"></a>00018 <span class="preprocessor"></span><span class="preprocessor">#define DTN_API_H</span>
<a name="l00019"></a>00019 <span class="preprocessor"></span>
<a name="l00020"></a>00020 <span class="preprocessor">#include "<a class="code" href="dtn__errno_8h.html">dtn_errno.h</a>"</span>
<a name="l00021"></a>00021 <span class="preprocessor">#include "<a class="code" href="dtn__types_8h.html">dtn_types.h</a>"</span>
<a name="l00022"></a>00022 
<a name="l00026"></a><a class="code" href="dtn__api_8h.html#566289d829b69370d7635c21364bfe18">00026</a> <span class="keyword">typedef</span> <span class="keywordtype">int</span>* <a class="code" href="dtn__api_8h.html#566289d829b69370d7635c21364bfe18" title="The basic handle for communication with the dtn router.">dtn_handle_t</a>;
<a name="l00027"></a>00027 
<a name="l00028"></a>00028 <span class="preprocessor">#ifdef  __cplusplus</span>
<a name="l00029"></a>00029 <span class="preprocessor"></span><span class="keyword">extern</span> <span class="stringliteral">"C"</span> {
<a name="l00030"></a>00030 <span class="preprocessor">#endif</span>
<a name="l00031"></a>00031 <span class="preprocessor"></span>
<a name="l00032"></a>00032 <span class="comment">/*************************************************************</span>
<a name="l00033"></a>00033 <span class="comment"> *</span>
<a name="l00034"></a>00034 <span class="comment"> *                     API Functions</span>
<a name="l00035"></a>00035 <span class="comment"> *</span>
<a name="l00036"></a>00036 <span class="comment"> *************************************************************/</span>
<a name="l00037"></a>00037 
<a name="l00045"></a>00045 <span class="keyword">extern</span> <span class="keywordtype">int</span> <a class="code" href="dtn__api_8c.html#3afc66b2e2c75fae07a45467df9f74e9" title="Open a new connection to the router.">dtn_open</a>(<a class="code" href="dtn__api_8h.html#566289d829b69370d7635c21364bfe18" title="The basic handle for communication with the dtn router.">dtn_handle_t</a>* <a class="code" href="dtncat_8c.html#01daea96255bb21a8979b3b45f5bbb70">handle</a>);
<a name="l00046"></a>00046 
<a name="l00050"></a>00050 <span class="keyword">extern</span> <span class="keywordtype">int</span> <a class="code" href="dtn__api_8c.html#887c16260463d6057bf5b03a1ff0e224" title="Close an open dtn handle.">dtn_close</a>(<a class="code" href="dtn__api_8h.html#566289d829b69370d7635c21364bfe18" title="The basic handle for communication with the dtn router.">dtn_handle_t</a> handle);
<a name="l00051"></a>00051 
<a name="l00055"></a>00055 <span class="keyword">extern</span> <span class="keywordtype">int</span> <a class="code" href="dtn__api_8c.html#6183d81d5f742d13e1fdee26423d94b4" title="Get the error associated with the given handle.">dtn_errno</a>(<a class="code" href="dtn__api_8h.html#566289d829b69370d7635c21364bfe18" title="The basic handle for communication with the dtn router.">dtn_handle_t</a> handle);
<a name="l00056"></a>00056 
<a name="l00060"></a>00060 <span class="keyword">extern</span> <span class="keywordtype">void</span> <a class="code" href="dtn__api_8c.html#e87d5715259043c2490d71b80dd78f81" title="Set the error associated with the given handle.">dtn_set_errno</a>(<a class="code" href="dtn__api_8h.html#566289d829b69370d7635c21364bfe18" title="The basic handle for communication with the dtn router.">dtn_handle_t</a> handle, <span class="keywordtype">int</span> err);
<a name="l00061"></a>00061 
<a name="l00066"></a>00066 <span class="keyword">extern</span> <span class="keywordtype">int</span> <a class="code" href="dtn__api_8c.html#0947b9119c69984edf25df43ead8858b" title="Build an appropriate local endpoint id by appending the specified service tag to...">dtn_build_local_eid</a>(<a class="code" href="dtn__api_8h.html#566289d829b69370d7635c21364bfe18" title="The basic handle for communication with the dtn router.">dtn_handle_t</a> handle,
<a name="l00067"></a>00067                                <a class="code" href="structdtn__endpoint__id__t.html" title="Specification of a dtn endpoint id, i.e.">dtn_endpoint_id_t</a>* local_eid,
<a name="l00068"></a>00068                                <span class="keyword">const</span> <span class="keywordtype">char</span>* service_tag);
<a name="l00069"></a>00069 
<a name="l00077"></a>00077 <span class="keyword">extern</span> <span class="keywordtype">int</span> <a class="code" href="dtn__api_8c.html#7384bf592d4aff0892ff948aafa98b0c" title="Create a dtn registration.">dtn_register</a>(<a class="code" href="dtn__api_8h.html#566289d829b69370d7635c21364bfe18" title="The basic handle for communication with the dtn router.">dtn_handle_t</a> handle,
<a name="l00078"></a>00078                         <a class="code" href="structdtn__reg__info__t.html" title="Registration state.">dtn_reg_info_t</a>* reginfo,
<a name="l00079"></a>00079                         <a class="code" href="dtn__types_8h.html#d9378ff6ab7ee699568e037a8105f9b6" title="A registration cookie.">dtn_reg_id_t</a>* newregid);
<a name="l00080"></a>00080 
<a name="l00091"></a>00091 <span class="keyword">extern</span> <span class="keywordtype">int</span> <a class="code" href="dtn__api_8c.html#8c0647069233d858f0cefb57859a0b0e" title="Remove a dtn registration.">dtn_unregister</a>(<a class="code" href="dtn__api_8h.html#566289d829b69370d7635c21364bfe18" title="The basic handle for communication with the dtn router.">dtn_handle_t</a> handle,
<a name="l00092"></a>00092                           <a class="code" href="dtn__types_8h.html#d9378ff6ab7ee699568e037a8105f9b6" title="A registration cookie.">dtn_reg_id_t</a> <a class="code" href="dtncat_8c.html#8eb0c3e35c1feb7baf9802f03bf42e41">regid</a>);
<a name="l00093"></a>00093 
<a name="l00099"></a>00099 <span class="keyword">extern</span> <span class="keywordtype">int</span> <a class="code" href="dtn__api_8c.html#add060907ae0beceeebb75ac61a8f552" title="Check for an existing registration on the given endpoint id, returning DTN_SUCCSS...">dtn_find_registration</a>(<a class="code" href="dtn__api_8h.html#566289d829b69370d7635c21364bfe18" title="The basic handle for communication with the dtn router.">dtn_handle_t</a> handle,
<a name="l00100"></a>00100                                  <a class="code" href="structdtn__endpoint__id__t.html" title="Specification of a dtn endpoint id, i.e.">dtn_endpoint_id_t</a>* eid,
<a name="l00101"></a>00101                                  <a class="code" href="dtn__types_8h.html#d9378ff6ab7ee699568e037a8105f9b6" title="A registration cookie.">dtn_reg_id_t</a>* newregid);
<a name="l00102"></a>00102 
<a name="l00106"></a>00106 <span class="keyword">extern</span> <span class="keywordtype">int</span> <a class="code" href="dtn__api_8c.html#d65700cde584399bad4abe2536b2bc24" title="Modify an existing registration.">dtn_change_registration</a>(<a class="code" href="dtn__api_8h.html#566289d829b69370d7635c21364bfe18" title="The basic handle for communication with the dtn router.">dtn_handle_t</a> handle,
<a name="l00107"></a>00107                                    <a class="code" href="dtn__types_8h.html#d9378ff6ab7ee699568e037a8105f9b6" title="A registration cookie.">dtn_reg_id_t</a> regid,
<a name="l00108"></a>00108                                    <a class="code" href="structdtn__reg__info__t.html" title="Registration state.">dtn_reg_info_t</a> *reginfo);
<a name="l00109"></a>00109 
<a name="l00114"></a>00114 <span class="keyword">extern</span> <span class="keywordtype">int</span> <a class="code" href="dtn__api_8c.html#ab949d76f4c34a202aea5bac853b310b" title="Associate a registration with the current ipc channel.">dtn_bind</a>(<a class="code" href="dtn__api_8h.html#566289d829b69370d7635c21364bfe18" title="The basic handle for communication with the dtn router.">dtn_handle_t</a> handle, <a class="code" href="dtn__types_8h.html#d9378ff6ab7ee699568e037a8105f9b6" title="A registration cookie.">dtn_reg_id_t</a> regid);
<a name="l00115"></a>00115 
<a name="l00122"></a>00122 <span class="keyword">extern</span> <span class="keywordtype">int</span> <a class="code" href="dtn__api_8c.html#25e6dc7a917a193cd9dd2d28caee7f31" title="Explicitly remove an association from the current ipc handle.">dtn_unbind</a>(<a class="code" href="dtn__api_8h.html#566289d829b69370d7635c21364bfe18" title="The basic handle for communication with the dtn router.">dtn_handle_t</a> handle, <a class="code" href="dtn__types_8h.html#d9378ff6ab7ee699568e037a8105f9b6" title="A registration cookie.">dtn_reg_id_t</a> regid);
<a name="l00123"></a>00123 
<a name="l00127"></a>00127 <span class="keyword">extern</span> <span class="keywordtype">int</span> <a class="code" href="dtn__api_8c.html#9bcce797cfff268e49c0f5b2e5f21788" title="Send a bundle either from memory or from a file.">dtn_send</a>(<a class="code" href="dtn__api_8h.html#566289d829b69370d7635c21364bfe18" title="The basic handle for communication with the dtn router.">dtn_handle_t</a> handle,
<a name="l00128"></a>00128                     <a class="code" href="dtn__types_8h.html#d9378ff6ab7ee699568e037a8105f9b6" title="A registration cookie.">dtn_reg_id_t</a> regid,
<a name="l00129"></a>00129                     <a class="code" href="structdtn__bundle__spec__t.html" title="Bundle metadata.">dtn_bundle_spec_t</a>* spec,
<a name="l00130"></a>00130                     <a class="code" href="structdtn__bundle__payload__t.html">dtn_bundle_payload_t</a>* payload,
<a name="l00131"></a>00131                     <a class="code" href="structdtn__bundle__id__t.html" title="Type definition for a unique bundle identifier.">dtn_bundle_id_t</a>* <span class="keywordtype">id</span>);
<a name="l00132"></a>00132 
<a name="l00136"></a>00136 <span class="keyword">extern</span> <span class="keywordtype">int</span> <a class="code" href="dtn__api_8c.html#aebe24341617dde06219462c0aac77a0" title="Cancel a bundle transmission.">dtn_cancel</a>(<a class="code" href="dtn__api_8h.html#566289d829b69370d7635c21364bfe18" title="The basic handle for communication with the dtn router.">dtn_handle_t</a> handle,
<a name="l00137"></a>00137                       <a class="code" href="structdtn__bundle__id__t.html" title="Type definition for a unique bundle identifier.">dtn_bundle_id_t</a>* <span class="keywordtype">id</span>);
<a name="l00138"></a>00138 
<a name="l00150"></a>00150 <span class="keyword">extern</span> <span class="keywordtype">int</span> <a class="code" href="dtn__api_8c.html#7005346bb34aabb5b6332690871fe3f4" title="Blocking receive for a bundle, filling in the spec and payload structures with the...">dtn_recv</a>(<a class="code" href="dtn__api_8h.html#566289d829b69370d7635c21364bfe18" title="The basic handle for communication with the dtn router.">dtn_handle_t</a> handle,
<a name="l00151"></a>00151                     <a class="code" href="structdtn__bundle__spec__t.html" title="Bundle metadata.">dtn_bundle_spec_t</a>* spec,
<a name="l00152"></a>00152                     <a class="code" href="dtn__types_8h.html#3dcfddc1b850a71a18d8a0868f67e762" title="The payload of a bundle can be sent or received either in a file, in which case the...">dtn_bundle_payload_location_t</a> location,
<a name="l00153"></a>00153                     <a class="code" href="structdtn__bundle__payload__t.html">dtn_bundle_payload_t</a>* payload,
<a name="l00154"></a>00154                     <a class="code" href="dtn__types_8h.html#8865a20f2e713bb38e35736e32e1653c" title="DTN timeouts are specified in seconds.">dtn_timeval_t</a> timeout);
<a name="l00155"></a>00155 
<a name="l00163"></a>00163 <span class="keyword">extern</span> <span class="keywordtype">int</span> <a class="code" href="dtn__api_8c.html#5f6c1134fae89446725b57516748a737" title="Blocking query for new subscribers on a session.">dtn_session_update</a>(<a class="code" href="dtn__api_8h.html#566289d829b69370d7635c21364bfe18" title="The basic handle for communication with the dtn router.">dtn_handle_t</a> handle,
<a name="l00164"></a>00164                               <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span>* status,
<a name="l00165"></a>00165                               <a class="code" href="structdtn__endpoint__id__t.html" title="Specification of a dtn endpoint id, i.e.">dtn_endpoint_id_t</a>* session,
<a name="l00166"></a>00166                               <a class="code" href="dtn__types_8h.html#8865a20f2e713bb38e35736e32e1653c" title="DTN timeouts are specified in seconds.">dtn_timeval_t</a> timeout);
<a name="l00167"></a>00167 
<a name="l00172"></a>00172 <span class="keyword">extern</span> <span class="keywordtype">int</span> <a class="code" href="dtn__api_8c.html#4d6380561a5b032ca5f84031926c5d40" title="Return a file descriptor for the given handle suitable for calling poll() or select()...">dtn_poll_fd</a>(<a class="code" href="dtn__api_8h.html#566289d829b69370d7635c21364bfe18" title="The basic handle for communication with the dtn router.">dtn_handle_t</a> handle);
<a name="l00173"></a>00173 
<a name="l00189"></a>00189 <span class="keyword">extern</span> <span class="keywordtype">int</span> <a class="code" href="dtn__api_8c.html#24563d1e420ea738e7d456a58e3ec152" title="Begin a polling period for incoming bundles.">dtn_begin_poll</a>(<a class="code" href="dtn__api_8h.html#566289d829b69370d7635c21364bfe18" title="The basic handle for communication with the dtn router.">dtn_handle_t</a> handle, <a class="code" href="dtn__types_8h.html#8865a20f2e713bb38e35736e32e1653c" title="DTN timeouts are specified in seconds.">dtn_timeval_t</a> timeout);
<a name="l00190"></a>00190 
<a name="l00194"></a>00194 <span class="keyword">extern</span> <span class="keywordtype">int</span> <a class="code" href="dtn__api_8c.html#ad48e265c83879125870207dc2fe3c55" title="Cancel a polling interval.">dtn_cancel_poll</a>(<a class="code" href="dtn__api_8h.html#566289d829b69370d7635c21364bfe18" title="The basic handle for communication with the dtn router.">dtn_handle_t</a> handle);
<a name="l00195"></a>00195 
<a name="l00196"></a>00196 <span class="comment">/*************************************************************</span>
<a name="l00197"></a>00197 <span class="comment"> *</span>
<a name="l00198"></a>00198 <span class="comment"> *                     Utility Functions</span>
<a name="l00199"></a>00199 <span class="comment"> *</span>
<a name="l00200"></a>00200 <span class="comment"> *************************************************************/</span>
<a name="l00201"></a>00201 
<a name="l00205"></a>00205 <span class="keyword">extern</span> <span class="keywordtype">void</span> <a class="code" href="dtn__api_8c.html#b2935a9a7f4ade630f7d2ad1fec5c615" title="Copy the contents of one eid into another.">dtn_copy_eid</a>(<a class="code" href="structdtn__endpoint__id__t.html" title="Specification of a dtn endpoint id, i.e.">dtn_endpoint_id_t</a>* dst, <a class="code" href="structdtn__endpoint__id__t.html" title="Specification of a dtn endpoint id, i.e.">dtn_endpoint_id_t</a>* <a class="code" href="dtnmoteproxy_8c.html#e1ade0f5a1b32f6c8be72f31a99e2a18">src</a>);
<a name="l00206"></a>00206 
<a name="l00211"></a>00211 <span class="keyword">extern</span> <span class="keywordtype">int</span> <a class="code" href="dtn__api_8c.html#055c8bb8eaa570aacbe6a164ff123c84" title="Parse a string into an endpoint id structure, validating that it is in fact a valid...">dtn_parse_eid_string</a>(<a class="code" href="structdtn__endpoint__id__t.html" title="Specification of a dtn endpoint id, i.e.">dtn_endpoint_id_t</a>* eid, <span class="keyword">const</span> <span class="keywordtype">char</span>* str);
<a name="l00212"></a>00212 
<a name="l00220"></a>00220 <span class="keyword">extern</span> <span class="keywordtype">int</span> <a class="code" href="dtn__api_8c.html#21b6d705673aae970524972aca3db99f" title="Sets the value of the given payload structure to either a memory buffer or a file...">dtn_set_payload</a>(<a class="code" href="structdtn__bundle__payload__t.html">dtn_bundle_payload_t</a>* payload,
<a name="l00221"></a>00221                            <a class="code" href="dtn__types_8h.html#3dcfddc1b850a71a18d8a0868f67e762" title="The payload of a bundle can be sent or received either in a file, in which case the...">dtn_bundle_payload_location_t</a> location,
<a name="l00222"></a>00222                            <span class="keywordtype">char</span>* <a class="code" href="num2sdnv_8c.html#455b3605dc605fe8e055b9c1470535cf">val</a>, <span class="keywordtype">int</span> <a class="code" href="num2sdnv_8c.html#fed088663f8704004425cdae2120b9b3">len</a>);
<a name="l00223"></a>00223 
<a name="l00228"></a>00228 <span class="keywordtype">void</span> <a class="code" href="dtn__api_8c.html#50a363bf1bf2803892afc1438ab62cff" title="Frees dynamic storage allocated by the xdr for a bundle payload in dtn_recv.">dtn_free_payload</a>(<a class="code" href="structdtn__bundle__payload__t.html">dtn_bundle_payload_t</a>* payload);
<a name="l00229"></a>00229 
<a name="l00233"></a>00233 <span class="keyword">const</span> <span class="keywordtype">char</span>* <a class="code" href="dtn__api_8c.html#8bb5dd6e64e8cfaaa4b80e1373785cc2" title="Return a string version of a status report reason code.">dtn_status_report_reason_to_str</a>(<a class="code" href="dtn__types_8h.html#87e1a70c1e1b7872a0337ed40dc4f134" title="Bundle Status Report &amp;quot;Reason Code&amp;quot; flags.">dtn_status_report_reason_t</a> err);
<a name="l00234"></a>00234 
<a name="l00235"></a>00235 <span class="preprocessor">#ifdef  __cplusplus</span>
<a name="l00236"></a>00236 <span class="preprocessor"></span>}
<a name="l00237"></a>00237 <span class="preprocessor">#endif</span>
<a name="l00238"></a>00238 <span class="preprocessor"></span>
<a name="l00239"></a>00239 <span class="preprocessor">#endif </span><span class="comment">/* DTN_API_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&nbsp;
<a href="http://www.doxygen.org/index.html">
<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.8 </small></address>
</body>
</html>