rtt-f030/components/net/uip/doc/html/a00147.html

1047 lines
54 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
<title>uIP 1.0: uIP application functions</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.4.6 -->
<div class="tabs">
<ul>
<li><a href="main.html"><span>Main&nbsp;Page</span></a></li>
<li><a href="modules.html"><span>Modules</span></a></li>
<li><a href="classes.html"><span>Data&nbsp;Structures</span></a></li>
<li><a href="files.html"><span>Files</span></a></li>
<li><a href="examples.html"><span>Examples</span></a></li>
</ul></div>
<h1>uIP application functions<br>
<small>
[<a class="el" href="a00150.html">The uIP TCP/IP stack</a>]</small>
</h1><hr><a name="_details"></a><h2>Detailed Description</h2>
Functions used by an application running of top of uIP.
<p>
<p>
<table border="0" cellpadding="0" cellspacing="0">
<tr><td></td></tr>
<tr><td colspan="2"><br><h2>Defines</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="gef14e83c046e19ab9fe9d1bbcca276c2"></a><!-- doxytag: member="uipappfunc::uip_outstanding" ref="gef14e83c046e19ab9fe9d1bbcca276c2" args="(conn)" -->
#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00147.html#gef14e83c046e19ab9fe9d1bbcca276c2">uip_outstanding</a>(conn)&nbsp;&nbsp;&nbsp;((conn)-&gt;len)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00147.html#g1a1bc437c09ddef238abab41d77c3177">uip_datalen</a>()</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">The length of any incoming data that is currently avaliable (if avaliable) in the uip_appdata buffer. <a href="#g1a1bc437c09ddef238abab41d77c3177"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00147.html#g8411c95a4d89367ad2d9d6bde1a3d537">uip_urgdatalen</a>()</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">The length of any out-of-band data (urgent data) that has arrived on the connection. <a href="#g8411c95a4d89367ad2d9d6bde1a3d537"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00147.html#g61db1dcb7c760e4dd5d60bf4e5576dca">uip_close</a>()</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Close the current connection. <a href="#g61db1dcb7c760e4dd5d60bf4e5576dca"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00147.html#g88d2ccf7cd821f89d9a8df7e3948b56c">uip_abort</a>()</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Abort the current connection. <a href="#g88d2ccf7cd821f89d9a8df7e3948b56c"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00147.html#g0a8bb9d6d0f1f56852ccfccbbad6c5d8">uip_stop</a>()</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Tell the sending host to stop sending data. <a href="#g0a8bb9d6d0f1f56852ccfccbbad6c5d8"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="g64a238a5c02640a7a4aef004163aeb47"></a><!-- doxytag: member="uipappfunc::uip_stopped" ref="g64a238a5c02640a7a4aef004163aeb47" args="(conn)" -->
#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00147.html#g64a238a5c02640a7a4aef004163aeb47">uip_stopped</a>(conn)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Find out if the current connection has been previously stopped with <a class="el" href="a00147.html#g0a8bb9d6d0f1f56852ccfccbbad6c5d8">uip_stop()</a>. <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00147.html#g81ac47cee1c18f6aa479044069db7ca3">uip_restart</a>()</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Restart the current connection, if is has previously been stopped with <a class="el" href="a00147.html#g0a8bb9d6d0f1f56852ccfccbbad6c5d8">uip_stop()</a>. <a href="#g81ac47cee1c18f6aa479044069db7ca3"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00147.html#ga9de254b8aa308eb4aab17efdde622d2">uip_udpconnection</a>()</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Is the current connection a UDP connection? <a href="#ga9de254b8aa308eb4aab17efdde622d2"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00147.html#g26a14b8dae3f861830af9e7cf1e03725">uip_newdata</a>()</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Is new incoming data available? <a href="#g26a14b8dae3f861830af9e7cf1e03725"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00147.html#gde6634974418e3240c212b9b16864368">uip_acked</a>()</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Has previously sent data been acknowledged? <a href="#gde6634974418e3240c212b9b16864368"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00147.html#gdb971fb1525d0c5002f52125b05f3218">uip_connected</a>()</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Has the connection just been connected? <a href="#gdb971fb1525d0c5002f52125b05f3218"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00147.html#gef6c4140c632b6a406779342cf3b6eb6">uip_closed</a>()</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Has the connection been closed by the other end? <a href="#gef6c4140c632b6a406779342cf3b6eb6"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00147.html#gfbd5fc486dfdf6bf6fc9db52b1f418c4">uip_aborted</a>()</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Has the connection been aborted by the other end? <a href="#gfbd5fc486dfdf6bf6fc9db52b1f418c4"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00147.html#g7b2ac4b18bd2ac3912fe67b3b17158c3">uip_timedout</a>()</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Has the connection timed out? <a href="#g7b2ac4b18bd2ac3912fe67b3b17158c3"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00147.html#ga8933ad15a2e2947dae4a5cff50e6007">uip_rexmit</a>()</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Do we need to retransmit previously data? <a href="#ga8933ad15a2e2947dae4a5cff50e6007"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00147.html#g58bb90796c1cdad3aac2ecf44d87b20e">uip_poll</a>()</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Is the connection being polled by uIP? <a href="#g58bb90796c1cdad3aac2ecf44d87b20e"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga87feebc7cffd4d8300e776cf64e4fec"></a><!-- doxytag: member="uipappfunc::uip_initialmss" ref="ga87feebc7cffd4d8300e776cf64e4fec" args="()" -->
#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00147.html#ga87feebc7cffd4d8300e776cf64e4fec">uip_initialmss</a>()</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Get the initial maxium segment size (MSS) of the current connection. <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00147.html#gb5fecbc62edd128012cea0f47b57ab9f">uip_mss</a>()</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Get the current maxium segment size that can be sent on the current connection. <a href="#gb5fecbc62edd128012cea0f47b57ab9f"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00147.html#gf2dbaceb10c67783a115075b5b6d66df">uip_udp_remove</a>(conn)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Removed a UDP connection. <a href="#gf2dbaceb10c67783a115075b5b6d66df"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00147.html#ga20812098a4663c8a9fc4ce8e95391b6">uip_udp_bind</a>(conn, port)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Bind a UDP connection to a local port. <a href="#ga20812098a4663c8a9fc4ce8e95391b6"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00147.html#ge5ab69d40013e6cf86ef1763c95d920e">uip_udp_send</a>(len)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Send a UDP datagram of length len on the current connection. <a href="#ge5ab69d40013e6cf86ef1763c95d920e"></a><br></td></tr>
<tr><td colspan="2"><br><h2>Functions</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00147.html#gdd1ab3704ecd4900eec61a6897d32dc8">uip_listen</a> (<a class="el" href="a00153.html#g77570ac4fcab86864fa1916e55676da2">u16_t</a> port)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Start listening to the specified port. <a href="#gdd1ab3704ecd4900eec61a6897d32dc8"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00147.html#gaa585784b0914cac1d37f07f85457008">uip_unlisten</a> (<a class="el" href="a00153.html#g77570ac4fcab86864fa1916e55676da2">u16_t</a> port)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Stop listening to the specified port. <a href="#gaa585784b0914cac1d37f07f85457008"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="a00088.html">uip_conn</a> *&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00147.html#g8096b0c4b543dc408f4dd031ddae7240">uip_connect</a> (<a class="el" href="a00150.html#g1ef35301f43a5bbb9f89f07b5a36b9a0">uip_ipaddr_t</a> *ripaddr, <a class="el" href="a00153.html#g77570ac4fcab86864fa1916e55676da2">u16_t</a> port)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Connect to a remote host using TCP. <a href="#g8096b0c4b543dc408f4dd031ddae7240"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00147.html#g04b053a623aac7cd4195157d470661b3">uip_send</a> (const void *data, int len)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Send data on the current connection. <a href="#g04b053a623aac7cd4195157d470661b3"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="a00095.html">uip_udp_conn</a> *&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00147.html#g79c4110211247df3fb30b8cf1c4c02af">uip_udp_new</a> (<a class="el" href="a00150.html#g1ef35301f43a5bbb9f89f07b5a36b9a0">uip_ipaddr_t</a> *ripaddr, <a class="el" href="a00153.html#g77570ac4fcab86864fa1916e55676da2">u16_t</a> rport)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Set up a new UDP connection. <a href="#g79c4110211247df3fb30b8cf1c4c02af"></a><br></td></tr>
</table>
<hr><h2>Define Documentation</h2>
<a class="anchor" name="g88d2ccf7cd821f89d9a8df7e3948b56c"></a><!-- doxytag: member="uip.h::uip_abort" ref="g88d2ccf7cd821f89d9a8df7e3948b56c" args="()" --><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top">#define uip_abort </td>
<td class="md" valign="top">(&nbsp;</td>
&nbsp;</td>
<td class="mdname1" valign="top" nowrap> </td>
<td class="md" valign="top">&nbsp;)&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>
Abort the current connection.
<p>
This function will abort (reset) the current connection, and is usually used when an error has occured that prevents using the <a class="el" href="a00147.html#g61db1dcb7c760e4dd5d60bf4e5576dca">uip_close()</a> function. <dl compact><dt><b>Examples: </b></dt><dd>
<a class="el" href="a00040.html#a285">webclient.c</a>.</dl>
<p>
Definition at line <a class="el" href="a00202.html#l00581">581</a> of file <a class="el" href="a00202.html">uip.h</a>.
<p>
Referenced by <a class="el" href="a00184.html#l00298">httpd_appcall()</a>, and <a class="el" href="a00180.html#l00378">webclient_appcall()</a>. </td>
</tr>
</table>
<a class="anchor" name="gfbd5fc486dfdf6bf6fc9db52b1f418c4"></a><!-- doxytag: member="uip.h::uip_aborted" ref="gfbd5fc486dfdf6bf6fc9db52b1f418c4" args="()" --><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top">#define uip_aborted </td>
<td class="md" valign="top">(&nbsp;</td>
&nbsp;</td>
<td class="mdname1" valign="top" nowrap> </td>
<td class="md" valign="top">&nbsp;)&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>
Has the connection been aborted by the other end?
<p>
Non-zero if the current connection has been aborted (reset) by the remote host. <dl compact><dt><b>Examples: </b></dt><dd>
<a class="el" href="a00038.html#a185">smtp.c</a>, <a class="el" href="a00044.html#a236">telnetd.c</a>, and <a class="el" href="a00040.html#a297">webclient.c</a>.</dl>
<p>
Definition at line <a class="el" href="a00202.html#l00680">680</a> of file <a class="el" href="a00202.html">uip.h</a>.
<p>
Referenced by <a class="el" href="a00184.html#l00298">httpd_appcall()</a>, <a class="el" href="a00174.html#l00190">smtp_appcall()</a>, and <a class="el" href="a00180.html#l00378">webclient_appcall()</a>. </td>
</tr>
</table>
<a class="anchor" name="gde6634974418e3240c212b9b16864368"></a><!-- doxytag: member="uip.h::uip_acked" ref="gde6634974418e3240c212b9b16864368" args="()" --><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top">#define uip_acked </td>
<td class="md" valign="top">(&nbsp;</td>
&nbsp;</td>
<td class="mdname1" valign="top" nowrap> </td>
<td class="md" valign="top">&nbsp;)&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>
Has previously sent data been acknowledged?
<p>
Will reduce to non-zero if the previously sent data has been acknowledged by the remote host. This means that the application can send new data. <dl compact><dt><b>Examples: </b></dt><dd>
<a class="el" href="a00044.html#a238">telnetd.c</a>, and <a class="el" href="a00040.html#a300">webclient.c</a>.</dl>
<p>
Definition at line <a class="el" href="a00202.html#l00648">648</a> of file <a class="el" href="a00202.html">uip.h</a>.
<p>
Referenced by <a class="el" href="a00180.html#l00378">webclient_appcall()</a>. </td>
</tr>
</table>
<a class="anchor" name="g61db1dcb7c760e4dd5d60bf4e5576dca"></a><!-- doxytag: member="uip.h::uip_close" ref="g61db1dcb7c760e4dd5d60bf4e5576dca" args="()" --><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top">#define uip_close </td>
<td class="md" valign="top">(&nbsp;</td>
&nbsp;</td>
<td class="mdname1" valign="top" nowrap> </td>
<td class="md" valign="top">&nbsp;)&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>
Close the current connection.
<p>
This function will close the current connection in a nice way. <dl compact><dt><b>Examples: </b></dt><dd>
<a class="el" href="a00044.html#a234">telnetd.c</a>.</dl>
<p>
Definition at line <a class="el" href="a00202.html#l00570">570</a> of file <a class="el" href="a00202.html">uip.h</a>. </td>
</tr>
</table>
<a class="anchor" name="gef6c4140c632b6a406779342cf3b6eb6"></a><!-- doxytag: member="uip.h::uip_closed" ref="gef6c4140c632b6a406779342cf3b6eb6" args="()" --><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top">#define uip_closed </td>
<td class="md" valign="top">(&nbsp;</td>
&nbsp;</td>
<td class="mdname1" valign="top" nowrap> </td>
<td class="md" valign="top">&nbsp;)&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>
Has the connection been closed by the other end?
<p>
Is non-zero if the connection has been closed by the remote host. The application may then do the necessary clean-ups. <dl compact><dt><b>Examples: </b></dt><dd>
<a class="el" href="a00038.html#a184">smtp.c</a>, <a class="el" href="a00044.html#a235">telnetd.c</a>, and <a class="el" href="a00040.html#a305">webclient.c</a>.</dl>
<p>
Definition at line <a class="el" href="a00202.html#l00670">670</a> of file <a class="el" href="a00202.html">uip.h</a>.
<p>
Referenced by <a class="el" href="a00184.html#l00298">httpd_appcall()</a>, <a class="el" href="a00174.html#l00190">smtp_appcall()</a>, and <a class="el" href="a00180.html#l00378">webclient_appcall()</a>. </td>
</tr>
</table>
<a class="anchor" name="gdb971fb1525d0c5002f52125b05f3218"></a><!-- doxytag: member="uip.h::uip_connected" ref="gdb971fb1525d0c5002f52125b05f3218" args="()" --><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top">#define uip_connected </td>
<td class="md" valign="top">(&nbsp;</td>
&nbsp;</td>
<td class="mdname1" valign="top" nowrap> </td>
<td class="md" valign="top">&nbsp;)&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>
Has the connection just been connected?
<p>
Reduces to non-zero if the current connection has been connected to a remote host. This will happen both if the connection has been actively opened (with <a class="el" href="a00147.html#g8096b0c4b543dc408f4dd031ddae7240">uip_connect()</a>) or passively opened (with <a class="el" href="a00147.html#gdd1ab3704ecd4900eec61a6897d32dc8">uip_listen()</a>). <dl compact><dt><b>Examples: </b></dt><dd>
<a class="el" href="a00036.html#a107">hello-world.c</a>, <a class="el" href="a00044.html#a232">telnetd.c</a>, and <a class="el" href="a00040.html#a293">webclient.c</a>.</dl>
<p>
Definition at line <a class="el" href="a00202.html#l00660">660</a> of file <a class="el" href="a00202.html">uip.h</a>.
<p>
Referenced by <a class="el" href="a00170.html#l00055">hello_world_appcall()</a>, <a class="el" href="a00184.html#l00298">httpd_appcall()</a>, and <a class="el" href="a00180.html#l00378">webclient_appcall()</a>. </td>
</tr>
</table>
<a class="anchor" name="g1a1bc437c09ddef238abab41d77c3177"></a><!-- doxytag: member="uip.h::uip_datalen" ref="g1a1bc437c09ddef238abab41d77c3177" args="()" --><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top">#define uip_datalen </td>
<td class="md" valign="top">(&nbsp;</td>
&nbsp;</td>
<td class="mdname1" valign="top" nowrap> </td>
<td class="md" valign="top">&nbsp;)&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>
The length of any incoming data that is currently avaliable (if avaliable) in the uip_appdata buffer.
<p>
The test function uip_data() must first be used to check if there is any data available at all. <dl compact><dt><b>Examples: </b></dt><dd>
<a class="el" href="a00048.html#a15">dhcpc.c</a>, <a class="el" href="a00044.html#a231">telnetd.c</a>, and <a class="el" href="a00040.html#a290">webclient.c</a>.</dl>
<p>
Definition at line <a class="el" href="a00202.html#l00550">550</a> of file <a class="el" href="a00202.html">uip.h</a>. </td>
</tr>
</table>
<a class="anchor" name="gb5fecbc62edd128012cea0f47b57ab9f"></a><!-- doxytag: member="uip.h::uip_mss" ref="gb5fecbc62edd128012cea0f47b57ab9f" args="()" --><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top">#define uip_mss </td>
<td class="md" valign="top">(&nbsp;</td>
&nbsp;</td>
<td class="mdname1" valign="top" nowrap> </td>
<td class="md" valign="top">&nbsp;)&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>
Get the current maxium segment size that can be sent on the current connection.
<p>
The current maxiumum segment size that can be sent on the connection is computed from the receiver's window and the MSS of the connection (which also is available by calling <a class="el" href="a00147.html#ga87feebc7cffd4d8300e776cf64e4fec">uip_initialmss()</a>). <dl compact><dt><b>Examples: </b></dt><dd>
<a class="el" href="a00044.html#a225">telnetd.c</a>, and <a class="el" href="a00040.html#a277">webclient.c</a>.</dl>
<p>
Definition at line <a class="el" href="a00202.html#l00737">737</a> of file <a class="el" href="a00202.html">uip.h</a>. </td>
</tr>
</table>
<a class="anchor" name="g26a14b8dae3f861830af9e7cf1e03725"></a><!-- doxytag: member="uip.h::uip_newdata" ref="g26a14b8dae3f861830af9e7cf1e03725" args="()" --><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top">#define uip_newdata </td>
<td class="md" valign="top">(&nbsp;</td>
&nbsp;</td>
<td class="mdname1" valign="top" nowrap> </td>
<td class="md" valign="top">&nbsp;)&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>
Is new incoming data available?
<p>
Will reduce to non-zero if there is new data for the application present at the uip_appdata pointer. The size of the data is avaliable through the uip_len variable. <dl compact><dt><b>Examples: </b></dt><dd>
<a class="el" href="a00048.html#a25">dhcpc.c</a>, <a class="el" href="a00046.html#a145">resolv.c</a>, <a class="el" href="a00044.html#a239">telnetd.c</a>, and <a class="el" href="a00040.html#a301">webclient.c</a>.</dl>
<p>
Definition at line <a class="el" href="a00202.html#l00637">637</a> of file <a class="el" href="a00202.html">uip.h</a>.
<p>
Referenced by <a class="el" href="a00192.html#l00253">psock_newdata()</a>, <a class="el" href="a00172.html#l00331">resolv_appcall()</a>, and <a class="el" href="a00180.html#l00378">webclient_appcall()</a>. </td>
</tr>
</table>
<a class="anchor" name="g58bb90796c1cdad3aac2ecf44d87b20e"></a><!-- doxytag: member="uip.h::uip_poll" ref="g58bb90796c1cdad3aac2ecf44d87b20e" args="()" --><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top">#define uip_poll </td>
<td class="md" valign="top">(&nbsp;</td>
&nbsp;</td>
<td class="mdname1" valign="top" nowrap> </td>
<td class="md" valign="top">&nbsp;)&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>
Is the connection being polled by uIP?
<p>
Is non-zero if the reason the application is invoked is that the current connection has been idle for a while and should be polled.<p>
The polling event can be used for sending data without having to wait for the remote host to send data. <dl compact><dt><b>Examples: </b></dt><dd>
<a class="el" href="a00046.html#a144">resolv.c</a>, <a class="el" href="a00044.html#a241">telnetd.c</a>, and <a class="el" href="a00040.html#a303">webclient.c</a>.</dl>
<p>
Definition at line <a class="el" href="a00202.html#l00716">716</a> of file <a class="el" href="a00202.html">uip.h</a>.
<p>
Referenced by <a class="el" href="a00184.html#l00298">httpd_appcall()</a>, <a class="el" href="a00172.html#l00331">resolv_appcall()</a>, and <a class="el" href="a00180.html#l00378">webclient_appcall()</a>. </td>
</tr>
</table>
<a class="anchor" name="g81ac47cee1c18f6aa479044069db7ca3"></a><!-- doxytag: member="uip.h::uip_restart" ref="g81ac47cee1c18f6aa479044069db7ca3" args="()" --><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top">#define uip_restart </td>
<td class="md" valign="top">(&nbsp;</td>
&nbsp;</td>
<td class="mdname1" valign="top" nowrap> </td>
<td class="md" valign="top">&nbsp;)&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>
Restart the current connection, if is has previously been stopped with <a class="el" href="a00147.html#g0a8bb9d6d0f1f56852ccfccbbad6c5d8">uip_stop()</a>.
<p>
This function will open the receiver's window again so that we start receiving data for the current connection.
<p>
Definition at line <a class="el" href="a00202.html#l00610">610</a> of file <a class="el" href="a00202.html">uip.h</a>. </td>
</tr>
</table>
<a class="anchor" name="ga8933ad15a2e2947dae4a5cff50e6007"></a><!-- doxytag: member="uip.h::uip_rexmit" ref="ga8933ad15a2e2947dae4a5cff50e6007" args="()" --><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top">#define uip_rexmit </td>
<td class="md" valign="top">(&nbsp;</td>
&nbsp;</td>
<td class="mdname1" valign="top" nowrap> </td>
<td class="md" valign="top">&nbsp;)&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>
Do we need to retransmit previously data?
<p>
Reduces to non-zero if the previously sent data has been lost in the network, and the application should retransmit it. The application should send the exact same data as it did the last time, using the <a class="el" href="a00147.html#g04b053a623aac7cd4195157d470661b3">uip_send()</a> function. <dl compact><dt><b>Examples: </b></dt><dd>
<a class="el" href="a00044.html#a240">telnetd.c</a>, and <a class="el" href="a00040.html#a302">webclient.c</a>.</dl>
<p>
Definition at line <a class="el" href="a00202.html#l00702">702</a> of file <a class="el" href="a00202.html">uip.h</a>.
<p>
Referenced by <a class="el" href="a00180.html#l00378">webclient_appcall()</a>. </td>
</tr>
</table>
<a class="anchor" name="g0a8bb9d6d0f1f56852ccfccbbad6c5d8"></a><!-- doxytag: member="uip.h::uip_stop" ref="g0a8bb9d6d0f1f56852ccfccbbad6c5d8" args="()" --><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top">#define uip_stop </td>
<td class="md" valign="top">(&nbsp;</td>
&nbsp;</td>
<td class="mdname1" valign="top" nowrap> </td>
<td class="md" valign="top">&nbsp;)&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>
Tell the sending host to stop sending data.
<p>
This function will close our receiver's window so that we stop receiving data for the current connection.
<p>
Definition at line <a class="el" href="a00202.html#l00591">591</a> of file <a class="el" href="a00202.html">uip.h</a>. </td>
</tr>
</table>
<a class="anchor" name="g7b2ac4b18bd2ac3912fe67b3b17158c3"></a><!-- doxytag: member="uip.h::uip_timedout" ref="g7b2ac4b18bd2ac3912fe67b3b17158c3" args="()" --><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top">#define uip_timedout </td>
<td class="md" valign="top">(&nbsp;</td>
&nbsp;</td>
<td class="mdname1" valign="top" nowrap> </td>
<td class="md" valign="top">&nbsp;)&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>
Has the connection timed out?
<p>
Non-zero if the current connection has been aborted due to too many retransmissions. <dl compact><dt><b>Examples: </b></dt><dd>
<a class="el" href="a00038.html#a186">smtp.c</a>, <a class="el" href="a00044.html#a237">telnetd.c</a>, and <a class="el" href="a00040.html#a298">webclient.c</a>.</dl>
<p>
Definition at line <a class="el" href="a00202.html#l00690">690</a> of file <a class="el" href="a00202.html">uip.h</a>.
<p>
Referenced by <a class="el" href="a00184.html#l00298">httpd_appcall()</a>, <a class="el" href="a00174.html#l00190">smtp_appcall()</a>, and <a class="el" href="a00180.html#l00378">webclient_appcall()</a>. </td>
</tr>
</table>
<a class="anchor" name="ga20812098a4663c8a9fc4ce8e95391b6"></a><!-- doxytag: member="uip.h::uip_udp_bind" ref="ga20812098a4663c8a9fc4ce8e95391b6" args="(conn, port)" --><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top">#define uip_udp_bind </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="md" nowrap valign="top">conn, <tr>
<td class="md" nowrap align="right"></td>
<td class="md"></td>
<td class="md" nowrap>port&nbsp;</td>
<td class="mdname1" valign="top" nowrap> </td>
<td class="md" valign="top">&nbsp;)&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>
Bind a UDP connection to a local port.
<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>conn</em>&nbsp;</td><td>A pointer to the <a class="el" href="a00095.html">uip_udp_conn</a> structure for the connection.</td></tr>
<tr><td valign="top"></td><td valign="top"><em>port</em>&nbsp;</td><td>The local port number, in network byte order. </td></tr>
</table>
</dl>
<dl compact><dt><b>Examples: </b></dt><dd>
<a class="el" href="a00048.html#a40">dhcpc.c</a>.</dl>
<p>
Definition at line <a class="el" href="a00202.html#l00787">787</a> of file <a class="el" href="a00202.html">uip.h</a>. </td>
</tr>
</table>
<a class="anchor" name="gf2dbaceb10c67783a115075b5b6d66df"></a><!-- doxytag: member="uip.h::uip_udp_remove" ref="gf2dbaceb10c67783a115075b5b6d66df" args="(conn)" --><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top">#define uip_udp_remove </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="md" nowrap valign="top">conn&nbsp;</td>
<td class="mdname1" valign="top" nowrap> </td>
<td class="md" valign="top">&nbsp;)&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>
Removed a UDP connection.
<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>conn</em>&nbsp;</td><td>A pointer to the <a class="el" href="a00095.html">uip_udp_conn</a> structure for the connection. </td></tr>
</table>
</dl>
<dl compact><dt><b>Examples: </b></dt><dd>
<a class="el" href="a00046.html#a152">resolv.c</a>.</dl>
<p>
Definition at line <a class="el" href="a00202.html#l00775">775</a> of file <a class="el" href="a00202.html">uip.h</a>.
<p>
Referenced by <a class="el" href="a00172.html#l00438">resolv_conf()</a>. </td>
</tr>
</table>
<a class="anchor" name="ge5ab69d40013e6cf86ef1763c95d920e"></a><!-- doxytag: member="uip.h::uip_udp_send" ref="ge5ab69d40013e6cf86ef1763c95d920e" args="(len)" --><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top">#define uip_udp_send </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="md" nowrap valign="top">len&nbsp;</td>
<td class="mdname1" valign="top" nowrap> </td>
<td class="md" valign="top">&nbsp;)&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>
Send a UDP datagram of length len on the current connection.
<p>
This function can only be called in response to a UDP event (poll or newdata). The data must be present in the uip_buf buffer, at the place pointed to by the uip_appdata pointer.<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>len</em>&nbsp;</td><td>The length of the data in the uip_buf buffer. </td></tr>
</table>
</dl>
<dl compact><dt><b>Examples: </b></dt><dd>
<a class="el" href="a00046.html#a140">resolv.c</a>.</dl>
<p>
Definition at line <a class="el" href="a00202.html#l00800">800</a> of file <a class="el" href="a00202.html">uip.h</a>. </td>
</tr>
</table>
<a class="anchor" name="ga9de254b8aa308eb4aab17efdde622d2"></a><!-- doxytag: member="uip.h::uip_udpconnection" ref="ga9de254b8aa308eb4aab17efdde622d2" args="()" --><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top">#define uip_udpconnection </td>
<td class="md" valign="top">(&nbsp;</td>
&nbsp;</td>
<td class="mdname1" valign="top" nowrap> </td>
<td class="md" valign="top">&nbsp;)&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>
Is the current connection a UDP connection?
<p>
This function checks whether the current connection is a UDP connection.
<p>
Definition at line <a class="el" href="a00202.html#l00626">626</a> of file <a class="el" href="a00202.html">uip.h</a>. </td>
</tr>
</table>
<a class="anchor" name="g8411c95a4d89367ad2d9d6bde1a3d537"></a><!-- doxytag: member="uip.h::uip_urgdatalen" ref="g8411c95a4d89367ad2d9d6bde1a3d537" args="()" --><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top">#define uip_urgdatalen </td>
<td class="md" valign="top">(&nbsp;</td>
&nbsp;</td>
<td class="mdname1" valign="top" nowrap> </td>
<td class="md" valign="top">&nbsp;)&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>
The length of any out-of-band data (urgent data) that has arrived on the connection.
<p>
<dl compact><dt><b>Note:</b></dt><dd>The configuration parameter UIP_URGDATA must be set for this function to be enabled. </dd></dl>
<p>
Definition at line <a class="el" href="a00202.html#l00561">561</a> of file <a class="el" href="a00202.html">uip.h</a>. </td>
</tr>
</table>
<hr><h2>Function Documentation</h2>
<a class="anchor" name="g8096b0c4b543dc408f4dd031ddae7240"></a><!-- doxytag: member="uip.h::uip_connect" ref="g8096b0c4b543dc408f4dd031ddae7240" args="(uip_ipaddr_t *ripaddr, u16_t port)" --><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top">struct <a class="el" href="a00088.html">uip_conn</a>* uip_connect </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="md" nowrap valign="top"><a class="el" href="a00150.html#g1ef35301f43a5bbb9f89f07b5a36b9a0">uip_ipaddr_t</a> *&nbsp;</td>
<td class="mdname" nowrap> <em>ripaddr</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td class="md"></td>
<td class="md" nowrap><a class="el" href="a00153.html#g77570ac4fcab86864fa1916e55676da2">u16_t</a>&nbsp;</td>
<td class="mdname" nowrap> <em>port</em></td>
</tr>
<tr>
<td class="md"></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>
Connect to a remote host using TCP.
<p>
This function is used to start a new connection to the specified port on the specied host. It allocates a new connection identifier, sets the connection to the SYN_SENT state and sets the retransmission timer to 0. This will cause a TCP SYN segment to be sent out the next time this connection is periodically processed, which usually is done within 0.5 seconds after the call to <a class="el" href="a00147.html#g8096b0c4b543dc408f4dd031ddae7240">uip_connect()</a>.<p>
<dl compact><dt><b>Note:</b></dt><dd>This function is avaliable only if support for active open has been configured by defining UIP_ACTIVE_OPEN to 1 in <a class="el" href="a00140.html">uipopt.h</a>.<p>
Since this function requires the port number to be in network byte order, a conversion using <a class="el" href="a00148.html#g69a7a4951ff21b302267532c21ee78fc">HTONS()</a> or <a class="el" href="a00148.html#ga22b04cac8cf283ca12f028578bebc06">htons()</a> is necessary.</dd></dl>
<div class="fragment"><pre class="fragment"> <a class="code" href="a00150.html#g1ef35301f43a5bbb9f89f07b5a36b9a0">uip_ipaddr_t</a> ipaddr;
<a class="code" href="a00148.html#g87f0b54ade0d159fba495089128a4932">uip_ipaddr</a>(&amp;ipaddr, 192,168,1,2);
<a class="code" href="a00147.html#g8096b0c4b543dc408f4dd031ddae7240">uip_connect</a>(&amp;ipaddr, <a class="code" href="a00148.html#g69a7a4951ff21b302267532c21ee78fc">HTONS</a>(80));
</pre></div><p>
<dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>ripaddr</em>&nbsp;</td><td>The IP address of the remote hot.</td></tr>
<tr><td valign="top"></td><td valign="top"><em>port</em>&nbsp;</td><td>A 16-bit port number in network byte order.</td></tr>
</table>
</dl>
<dl compact><dt><b>Returns:</b></dt><dd>A pointer to the uIP connection identifier for the new connection, or NULL if no connection could be allocated. </dd></dl>
<dl compact><dt><b>Examples: </b></dt><dd>
<a class="el" href="a00038.html#a190">smtp.c</a>, and <a class="el" href="a00040.html#a273">webclient.c</a>.</dl>
<p>
Definition at line <a class="el" href="a00201.html#l00407">407</a> of file <a class="el" href="a00201.html">uip.c</a>.
<p>
References <a class="el" href="a00201.html#l01882">htons()</a>, <a class="el" href="a00202.html#l01156">uip_conn::lport</a>, <a class="el" href="a00202.html#l01174">uip_conn::tcpstateflags</a>, <a class="el" href="a00202.html#l01372">UIP_CLOSED</a>, <a class="el" href="a00201.html#l00163">uip_conn</a>, <a class="el" href="a00206.html#l00245">UIP_CONNS</a>, and <a class="el" href="a00201.html#l00166">uip_conns</a>.
<p>
Referenced by <a class="el" href="a00174.html#l00233">smtp_send()</a>, and <a class="el" href="a00180.html#l00140">webclient_get()</a>. </td>
</tr>
</table>
<a class="anchor" name="gdd1ab3704ecd4900eec61a6897d32dc8"></a><!-- doxytag: member="uip.h::uip_listen" ref="gdd1ab3704ecd4900eec61a6897d32dc8" args="(u16_t port)" --><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top">void uip_listen </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="md" nowrap valign="top"><a class="el" href="a00153.html#g77570ac4fcab86864fa1916e55676da2">u16_t</a>&nbsp;</td>
<td class="mdname1" valign="top" nowrap> <em>port</em> </td>
<td class="md" valign="top">&nbsp;)&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>
Start listening to the specified port.
<p>
<dl compact><dt><b>Note:</b></dt><dd>Since this function expects the port number in network byte order, a conversion using <a class="el" href="a00148.html#g69a7a4951ff21b302267532c21ee78fc">HTONS()</a> or <a class="el" href="a00148.html#ga22b04cac8cf283ca12f028578bebc06">htons()</a> is necessary.</dd></dl>
<div class="fragment"><pre class="fragment"> <a class="code" href="a00147.html#gdd1ab3704ecd4900eec61a6897d32dc8">uip_listen</a>(<a class="code" href="a00148.html#g69a7a4951ff21b302267532c21ee78fc">HTONS</a>(80));
</pre></div><p>
<dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>port</em>&nbsp;</td><td>A 16-bit port number in network byte order. </td></tr>
</table>
</dl>
<dl compact><dt><b>Examples: </b></dt><dd>
<a class="el" href="a00036.html#a102">hello-world.c</a>, and <a class="el" href="a00044.html#a218">telnetd.c</a>.</dl>
<p>
Definition at line <a class="el" href="a00201.html#l00529">529</a> of file <a class="el" href="a00201.html">uip.c</a>.
<p>
References <a class="el" href="a00206.html#l00259">UIP_LISTENPORTS</a>.
<p>
Referenced by <a class="el" href="a00170.html#l00041">hello_world_init()</a>, and <a class="el" href="a00184.html#l00333">httpd_init()</a>. </td>
</tr>
</table>
<a class="anchor" name="g04b053a623aac7cd4195157d470661b3"></a><!-- doxytag: member="uip.h::uip_send" ref="g04b053a623aac7cd4195157d470661b3" args="(const void *data, int len)" --><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top">void uip_send </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="md" nowrap valign="top">const void *&nbsp;</td>
<td class="mdname" nowrap> <em>data</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td class="md"></td>
<td class="md" nowrap>int&nbsp;</td>
<td class="mdname" nowrap> <em>len</em></td>
</tr>
<tr>
<td class="md"></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>
Send data on the current connection.
<p>
This function is used to send out a single segment of TCP data. Only applications that have been invoked by uIP for event processing can send data.<p>
The amount of data that actually is sent out after a call to this funcion is determined by the maximum amount of data TCP allows. uIP will automatically crop the data so that only the appropriate amount of data is sent. The function <a class="el" href="a00147.html#gb5fecbc62edd128012cea0f47b57ab9f">uip_mss()</a> can be used to query uIP for the amount of data that actually will be sent.<p>
<dl compact><dt><b>Note:</b></dt><dd>This function does not guarantee that the sent data will arrive at the destination. If the data is lost in the network, the application will be invoked with the <a class="el" href="a00147.html#ga8933ad15a2e2947dae4a5cff50e6007">uip_rexmit()</a> event being set. The application will then have to resend the data using this function.</dd></dl>
<dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>data</em>&nbsp;</td><td>A pointer to the data which is to be sent.</td></tr>
<tr><td valign="top"></td><td valign="top"><em>len</em>&nbsp;</td><td>The maximum amount of data bytes to be sent. </td></tr>
</table>
</dl>
<dl compact><dt><b>Examples: </b></dt><dd>
<a class="el" href="a00048.html#a10">dhcpc.c</a>, <a class="el" href="a00044.html#a226">telnetd.c</a>, and <a class="el" href="a00040.html#a278">webclient.c</a>.</dl>
<p>
Definition at line <a class="el" href="a00201.html#l01888">1888</a> of file <a class="el" href="a00201.html">uip.c</a>.
<p>
References <a class="el" href="a00201.html#l00145">uip_sappdata</a>, and <a class="el" href="a00201.html#l00155">uip_slen</a>. </td>
</tr>
</table>
<a class="anchor" name="g79c4110211247df3fb30b8cf1c4c02af"></a><!-- doxytag: member="uip.h::uip_udp_new" ref="g79c4110211247df3fb30b8cf1c4c02af" args="(uip_ipaddr_t *ripaddr, u16_t rport)" --><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top">struct <a class="el" href="a00095.html">uip_udp_conn</a>* uip_udp_new </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="md" nowrap valign="top"><a class="el" href="a00150.html#g1ef35301f43a5bbb9f89f07b5a36b9a0">uip_ipaddr_t</a> *&nbsp;</td>
<td class="mdname" nowrap> <em>ripaddr</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td class="md"></td>
<td class="md" nowrap><a class="el" href="a00153.html#g77570ac4fcab86864fa1916e55676da2">u16_t</a>&nbsp;</td>
<td class="mdname" nowrap> <em>rport</em></td>
</tr>
<tr>
<td class="md"></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>
Set up a new UDP connection.
<p>
This function sets up a new UDP connection. The function will automatically allocate an unused local port for the new connection. However, another port can be chosen by using the <a class="el" href="a00147.html#ga20812098a4663c8a9fc4ce8e95391b6">uip_udp_bind()</a> call, after the <a class="el" href="a00147.html#g79c4110211247df3fb30b8cf1c4c02af">uip_udp_new()</a> function has been called.<p>
Example: <div class="fragment"><pre class="fragment"> <a class="code" href="a00150.html#g1ef35301f43a5bbb9f89f07b5a36b9a0">uip_ipaddr_t</a> addr;
<span class="keyword">struct </span><a class="code" href="a00095.html">uip_udp_conn</a> *c;
<a class="code" href="a00148.html#g87f0b54ade0d159fba495089128a4932">uip_ipaddr</a>(&amp;addr, 192,168,2,1);
c = <a class="code" href="a00147.html#g79c4110211247df3fb30b8cf1c4c02af">uip_udp_new</a>(&amp;addr, <a class="code" href="a00148.html#g69a7a4951ff21b302267532c21ee78fc">HTONS</a>(12345));
<span class="keywordflow">if</span>(c != <a class="code" href="a00160.html#g070d2ce7b6bb7e5c05602aa8c308d0c4">NULL</a>) {
<a class="code" href="a00147.html#ga20812098a4663c8a9fc4ce8e95391b6">uip_udp_bind</a>(c, <a class="code" href="a00148.html#g69a7a4951ff21b302267532c21ee78fc">HTONS</a>(12344));
}
</pre></div> <dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>ripaddr</em>&nbsp;</td><td>The IP address of the remote host.</td></tr>
<tr><td valign="top"></td><td valign="top"><em>rport</em>&nbsp;</td><td>The remote port number in network byte order.</td></tr>
</table>
</dl>
<dl compact><dt><b>Returns:</b></dt><dd>The <a class="el" href="a00095.html">uip_udp_conn</a> structure for the new connection or NULL if no connection could be allocated. </dd></dl>
<dl compact><dt><b>Examples: </b></dt><dd>
<a class="el" href="a00048.html#a38">dhcpc.c</a>, and <a class="el" href="a00046.html#a153">resolv.c</a>.</dl>
<p>
Definition at line <a class="el" href="a00201.html#l00473">473</a> of file <a class="el" href="a00201.html">uip.c</a>.
<p>
References <a class="el" href="a00201.html#l01882">htons()</a>, <a class="el" href="a00202.html#l01212">uip_udp_conn::lport</a>, <a class="el" href="a00201.html#l00173">uip_udp_conn</a>, <a class="el" href="a00206.html#l00206">UIP_UDP_CONNS</a>, and <a class="el" href="a00201.html#l00174">uip_udp_conns</a>.
<p>
Referenced by <a class="el" href="a00172.html#l00438">resolv_conf()</a>. </td>
</tr>
</table>
<a class="anchor" name="gaa585784b0914cac1d37f07f85457008"></a><!-- doxytag: member="uip.h::uip_unlisten" ref="gaa585784b0914cac1d37f07f85457008" args="(u16_t port)" --><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top">void uip_unlisten </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="md" nowrap valign="top"><a class="el" href="a00153.html#g77570ac4fcab86864fa1916e55676da2">u16_t</a>&nbsp;</td>
<td class="mdname1" valign="top" nowrap> <em>port</em> </td>
<td class="md" valign="top">&nbsp;)&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>
Stop listening to the specified port.
<p>
<dl compact><dt><b>Note:</b></dt><dd>Since this function expects the port number in network byte order, a conversion using <a class="el" href="a00148.html#g69a7a4951ff21b302267532c21ee78fc">HTONS()</a> or <a class="el" href="a00148.html#ga22b04cac8cf283ca12f028578bebc06">htons()</a> is necessary.</dd></dl>
<div class="fragment"><pre class="fragment"> <a class="code" href="a00147.html#gaa585784b0914cac1d37f07f85457008">uip_unlisten</a>(<a class="code" href="a00148.html#g69a7a4951ff21b302267532c21ee78fc">HTONS</a>(80));
</pre></div><p>
<dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>port</em>&nbsp;</td><td>A 16-bit port number in network byte order. </td></tr>
</table>
</dl>
<p>
Definition at line <a class="el" href="a00201.html#l00518">518</a> of file <a class="el" href="a00201.html">uip.c</a>.
<p>
References <a class="el" href="a00206.html#l00259">UIP_LISTENPORTS</a>. </td>
</tr>
</table>
<hr size="1"><address style="align: right;"><small>Generated on Mon Jun 12 10:23:02 2006 for uIP 1.0 by&nbsp;
<a href="http://www.doxygen.org/index.html">
<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.6 </small></address>
</body>
</html>