⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 group__udp__app__api.html

📁 Freescale mcu OpenTCP-1.0.4.doc.html.zip 文档
💻 HTML
📖 第 1 页 / 共 2 页
字号:
<p><dl compact><dt><b>Author: </b></dt><dd> <ul><li> Jari Lahti (<a href="mailto:jari.lahti@violasystems.com">jari.lahti@violasystems.com</a>) </ul></dl><dl compact><dt><b>Date: </b></dt><dd>26.07.2002 </dl><dl compact><dt><b>Parameters: </b></dt><dd><table border=0 cellspacing=2 cellpadding=0><tr><td valign=top><em>sochandle</em>&nbsp;</td><td>handle to socket to be opened </td></tr><tr><td valign=top><em>locport</em>&nbsp;</td><td>local port number </td></tr></table></dl><dl compact><dt><b>Returns: </b></dt><dd> <ul><li> -1 - Error <li> &gt;=0 - Handle to opened socket</ul></dl>This function binds local port to given UDP socket and opens the socket (virtually) in order to enable communication. <dl compact><dt><b>Examples: </b></dt><dd><a class="el" href="udp__demo_8c-example.html#a2">udp_demo.c</a>.</dl><p>Definition at line <a class="el" href="udp_8c-source.html#l00291">291</a> of file <a class="el" href="udp_8c-source.html">udp.c</a>.<p>References <a class="el" href="tcp__ip_8h-source.html#l00525">ucb::locport</a>, <a class="el" href="tcp__ip_8h-source.html#l00516">ucb::state</a>, <a class="el" href="udp_8c-source.html#l00684">udp_getfreeport()</a>, and <a class="el" href="tcp__ip_8h-source.html#l00266">UDP_STATE_OPENED</a>.<p>Referenced by <a class="el" href="bootp_8c-source.html#l00108">bootpc_init()</a>, <a class="el" href="dhcpc_8c-source.html#l00158">dhcpc_init()</a>, <a class="el" href="dns_8c-source.html#l00108">dns_init()</a>, and <a class="el" href="tftps_8c-source.html#l00136">tftps_init()</a>.    </td>  </tr></table><a name="a3" doxytag="tcp_ip.h::udp_close"></a><p><table width="100%" cellpadding="2" cellspacing="0" border="0">  <tr>    <td class="md">      <table cellpadding="0" cellspacing="0" border="0">        <tr>          <td class="md" nowrap valign="top"> INT8 udp_close </td>          <td class="md" valign="top">(&nbsp;</td>          <td class="md" nowrap valign="top">INT8&nbsp;</td>          <td class="mdname1" valign="top" nowrap>&nbsp; <em>sochandle</em>          </td>          <td class="md" valign="top">)&nbsp;</td>          <td class="md" nowrap></td>        </tr>      </table>    </td>  </tr></table><table cellspacing=5 cellpadding=0 border=0>  <tr>    <td>      &nbsp;    </td>    <td><p><dl compact><dt><b>Author: </b></dt><dd> <ul><li> Jari Lahti (<a href="mailto:jari.lahti@violasystems.com">jari.lahti@violasystems.com</a>) </ul></dl><dl compact><dt><b>Date: </b></dt><dd>26.07.2002 </dl><dl compact><dt><b>Parameters: </b></dt><dd><table border=0 cellspacing=2 cellpadding=0><tr><td valign=top><em>sochandle</em>&nbsp;</td><td>handle to socket to be closed </td></tr></table></dl><dl compact><dt><b>Returns: </b></dt><dd> <ul><li> -1 - Error <li> &gt;=0 - handle to closed socket</ul></dl>Closes a given socket in order to disable further communication over it. <p>Definition at line <a class="el" href="udp_8c-source.html#l00340">340</a> of file <a class="el" href="udp_8c-source.html">udp.c</a>.<p>References <a class="el" href="tcp__ip_8h-source.html#l00516">ucb::state</a>, and <a class="el" href="tcp__ip_8h-source.html#l00258">UDP_STATE_CLOSED</a>.    </td>  </tr></table><a name="a4" doxytag="tcp_ip.h::udp_send"></a><p><table width="100%" cellpadding="2" cellspacing="0" border="0">  <tr>    <td class="md">      <table cellpadding="0" cellspacing="0" border="0">        <tr>          <td class="md" nowrap valign="top"> INT16 udp_send </td>          <td class="md" valign="top">(&nbsp;</td>          <td class="md" nowrap valign="top">INT8&nbsp;</td>          <td class="mdname" nowrap>&nbsp; <em>sochandle</em>, </td>        </tr>        <tr>          <td></td>          <td></td>          <td class="md" nowrap>UINT32&nbsp;</td>          <td class="mdname" nowrap>&nbsp; <em>remip</em>, </td>        </tr>        <tr>          <td></td>          <td></td>          <td class="md" nowrap>UINT16&nbsp;</td>          <td class="mdname" nowrap>&nbsp; <em>remport</em>, </td>        </tr>        <tr>          <td></td>          <td></td>          <td class="md" nowrap>UINT8 *&nbsp;</td>          <td class="mdname" nowrap>&nbsp; <em>buf</em>, </td>        </tr>        <tr>          <td></td>          <td></td>          <td class="md" nowrap>UINT16&nbsp;</td>          <td class="mdname" nowrap>&nbsp; <em>blen</em>, </td>        </tr>        <tr>          <td></td>          <td></td>          <td class="md" nowrap>UINT16&nbsp;</td>          <td class="mdname" nowrap>&nbsp; <em>dlen</em></td>        </tr>        <tr>          <td></td>          <td class="md">)&nbsp;</td>          <td class="md" colspan="2"></td>        </tr>      </table>    </td>  </tr></table><table cellspacing=5 cellpadding=0 border=0>  <tr>    <td>      &nbsp;    </td>    <td><p><dl compact><dt><b>Author: </b></dt><dd> <ul><li> Jari Lahti (<a href="mailto:jari.lahti@violasystems.com">jari.lahti@violasystems.com</a>) </ul></dl><dl compact><dt><b>Date: </b></dt><dd>26.07.2002 </dl><dl compact><dt><b>Parameters: </b></dt><dd><table border=0 cellspacing=2 cellpadding=0><tr><td valign=top><em>sochandle</em>&nbsp;</td><td>handle to UDP socket to use </td></tr><tr><td valign=top><em>remip</em>&nbsp;</td><td>remote IP address to which data should be sent </td></tr><tr><td valign=top><em>remport</em>&nbsp;</td><td>remote port number to which data should be sent </td></tr><tr><td valign=top><em>buf</em>&nbsp;</td><td>pointer to data buffer (start of user data) </td></tr><tr><td valign=top><em>blen</em>&nbsp;</td><td>buffer length in bytes (without space reserved at the  beginning of buffer for headers) </td></tr><tr><td valign=top><em>dlen</em>&nbsp;</td><td>length of user data to be sent (in bytes) </td></tr></table></dl><dl compact><dt><b>Returns: </b></dt><dd> <ul><li> -1 - Error (general error, e.g. parameters) <li> -2 - ARP or lower layer not ready, try again later <li> -3 - Socket closed or invalid local port <li> &gt;0 - OK (number represents number of bytes actually sent)</ul></dl><dl compact><dt><b>Warning: </b></dt><dd> <ul><li> <em>buf</em> parameter is a pointer to data to be sent in  user buffer. But note that there <b>MUST</b> be sufficient free buffer space before that data for UDP header (of <a class="el" href="tcp__ip_8h.html#a8">UDP_HLEN</a> size).</ul></dl>Use this function to send data over an already opened UDP socket. <dl compact><dt><b>Examples: </b></dt><dd><a class="el" href="udp__demo_8c-example.html#a4">udp_demo.c</a>.</dl><p>Definition at line <a class="el" href="udp_8c-source.html#l00395">395</a> of file <a class="el" href="udp_8c-source.html">udp.c</a>.<p>References <a class="el" href="ip_8c-source.html#l00539">ip_checksum()</a>, <a class="el" href="ip_8c-source.html#l00582">ip_checksum_buf()</a>, <a class="el" href="ip_8h-source.html#l00073">IP_UDP</a>, <a class="el" href="tcp__ip_8h-source.html#l00525">ucb::locport</a>, <a class="el" href="tcp__ip_8h-source.html#l00539">ucb::opts</a>, <a class="el" href="ip_8c-source.html#l00300">process_ip_out()</a>, <a class="el" href="tcp__ip_8h-source.html#l00516">ucb::state</a>, <a class="el" href="tcp__ip_8h-source.html#l00523">ucb::tos</a>, <a class="el" href="tcp__ip_8h-source.html#l00144">UDP_HLEN</a>, <a class="el" href="tcp__ip_8h-source.html#l00132">UDP_OPT_SEND_CS</a>, and <a class="el" href="tcp__ip_8h-source.html#l00266">UDP_STATE_OPENED</a>.<p>Referenced by <a class="el" href="bootp_8c-source.html#l00183">bootpc_run()</a>, <a class="el" href="dhcpc_8c-source.html#l00389">dhcpc_send_message()</a>, and <a class="el" href="dns_8c-source.html#l00445">get_host_by_name()</a>.    </td>  </tr></table><hr><address style="align: right;"><small>Generated on Sun Aug 3 20:33:01 2003 for OpenTCP by<a href="http://www.doxygen.org/index.html"><img src="doxygen.png" alt="doxygen" align="middle" border=0 width=110 height=53></a>1.2.18 </small></address></body></html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -