Files
uip/doc/html/a00080.html
2013-03-27 21:30:25 +01:00

828 lines
34 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
<title>uIP 0.9: uIP application functions</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Generated by Doxygen 1.3.3 -->
<div class="qindex"><a class="qindex" href="main.html">Main&nbsp;Page</a> | <a class="qindex" href="modules.html">Modules</a> | <a class="qindex" href="classes.html">Alphabetical&nbsp;List</a> | <a class="qindex" href="annotated.html">Data&nbsp;Structures</a> | <a class="qindex" href="files.html">File&nbsp;List</a> | <a class="qindex" href="functions.html">Data&nbsp;Fields</a> | <a class="qindex" href="globals.html">Globals</a></div>
<h1>uIP application functions<br>
<small>
[<a class="el" href="a00075.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>
<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>#define&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00080.html#a5">uip_send</a>(data, len)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Send data on the current connection. </em> <a href="#a5"></a><em><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>#define&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00080.html#a6">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. </em> <a href="#a6"></a><em><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>#define&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00080.html#a7">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. </em> <a href="#a7"></a><em><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>#define&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00080.html#a8">uip_close</a>()</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Close the current connection. </em> <a href="#a8"></a><em><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>#define&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00080.html#a9">uip_abort</a>()</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Abort the current connection. </em> <a href="#a9"></a><em><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>#define&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00080.html#a10">uip_stop</a>()</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Tell the sending host to stop sending data. </em> <a href="#a10"></a><em><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top><a name="a11" doxytag="uipappfunc::uip_stopped"></a>
#define&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00080.html#a11">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="a00080.html#a10">uip_stop()</a>. <br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>#define&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00080.html#a12">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="a00080.html#a10">uip_stop()</a>. </em> <a href="#a12"></a><em><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>#define&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00080.html#a13">uip_newdata</a>()</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Is new incoming data available? </em> <a href="#a13"></a><em><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>#define&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00080.html#a14">uip_acked</a>()</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Has previously sent data been acknowledged? </em> <a href="#a14"></a><em><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>#define&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00080.html#a15">uip_connected</a>()</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Has the connection just been connected? </em> <a href="#a15"></a><em><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>#define&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00080.html#a16">uip_closed</a>()</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Has the connection been closed by the other end? </em> <a href="#a16"></a><em><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>#define&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00080.html#a17">uip_aborted</a>()</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Has the connection been aborted by the other end? </em> <a href="#a17"></a><em><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>#define&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00080.html#a18">uip_timedout</a>()</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Has the connection timed out? </em> <a href="#a18"></a><em><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>#define&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00080.html#a19">uip_rexmit</a>()</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Do we need to retransmit previously data? </em> <a href="#a19"></a><em><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>#define&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00080.html#a20">uip_poll</a>()</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Is the connection being polled by uIP? </em> <a href="#a20"></a><em><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top><a name="a21" doxytag="uipappfunc::uip_initialmss"></a>
#define&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00080.html#a21">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><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>#define&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00080.html#a22">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. </em> <a href="#a22"></a><em><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>#define&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00080.html#a23">uip_udp_remove</a>(conn)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Removed a UDP connection. </em> <a href="#a23"></a><em><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>#define&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00080.html#a24">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. </em> <a href="#a24"></a><em><br><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="a00080.html#a0">uip_listen</a> (<a class="el" href="a00086.html#a1">u16_t</a> port)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Start listening to the specified port. </em> <a href="#a0"></a><em><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>void&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00080.html#a1">uip_unlisten</a> (<a class="el" href="a00086.html#a1">u16_t</a> port)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Stop listening to the specified port. </em> <a href="#a1"></a><em><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a00037.html">uip_conn</a> *&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00080.html#a2">uip_connect</a> (<a class="el" href="a00086.html#a1">u16_t</a> *ripaddr, <a class="el" href="a00086.html#a1">u16_t</a> port)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Connect to a remote host using TCP. </em> <a href="#a2"></a><em><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a00046.html">uip_udp_conn</a> *&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00080.html#a3">uip_udp_new</a> (<a class="el" href="a00086.html#a1">u16_t</a> *ripaddr, <a class="el" href="a00086.html#a1">u16_t</a> rport)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Set up a new UDP connection. </em> <a href="#a3"></a><em><br><br></td></tr>
</table>
<hr><h2>Define Documentation</h2>
<a name="a9" doxytag="uip.h::uip_abort"></a><p>
<table class="mdTable" width="100%" 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>
</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="a00080.html#a8">uip_close()</a> function. </td>
</tr>
</table>
<a name="a17" doxytag="uip.h::uip_aborted"></a><p>
<table class="mdTable" width="100%" 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>
</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. </td>
</tr>
</table>
<a name="a14" doxytag="uip.h::uip_acked"></a><p>
<table class="mdTable" width="100%" 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>
</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. </td>
</tr>
</table>
<a name="a8" doxytag="uip.h::uip_close"></a><p>
<table class="mdTable" width="100%" 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>
</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. </td>
</tr>
</table>
<a name="a16" doxytag="uip.h::uip_closed"></a><p>
<table class="mdTable" width="100%" 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>
</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. </td>
</tr>
</table>
<a name="a15" doxytag="uip.h::uip_connected"></a><p>
<table class="mdTable" width="100%" 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>
</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="a00080.html#a2">uip_connect()</a>) or passively opened (with <a class="el" href="a00080.html#a0">uip_listen()</a>). </td>
</tr>
</table>
<a name="a6" doxytag="uip.h::uip_datalen"></a><p>
<table class="mdTable" width="100%" 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>
</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. </td>
</tr>
</table>
<a name="a22" doxytag="uip.h::uip_mss"></a><p>
<table class="mdTable" width="100%" 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>
</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="a00080.html#a21">uip_initialmss()</a>). </td>
</tr>
</table>
<a name="a13" doxytag="uip.h::uip_newdata"></a><p>
<table class="mdTable" width="100%" 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>
</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. </td>
</tr>
</table>
<a name="a20" doxytag="uip.h::uip_poll"></a><p>
<table class="mdTable" width="100%" 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>
</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. </td>
</tr>
</table>
<a name="a12" doxytag="uip.h::uip_restart"></a><p>
<table class="mdTable" width="100%" 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>
</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="a00080.html#a10">uip_stop()</a>.
<p>
This function will open the receiver's window again so that we start receiving data for the current connection. </td>
</tr>
</table>
<a name="a19" doxytag="uip.h::uip_rexmit"></a><p>
<table class="mdTable" width="100%" 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>
</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="a00080.html#a5">uip_send()</a> function. </td>
</tr>
</table>
<a name="a5" doxytag="uip.h::uip_send"></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> #define uip_send</td>
<td class="md" valign="top">(&nbsp;</td>
<td class="md" nowrap valign="top">data, <tr>
<td></td>
<td></td>
<td class="md" nowrap>len&nbsp;</td>
<td class="mdname1" valign="top" nowrap> </td>
<td class="md" valign="top">&nbsp;)&nbsp;</td>
<td class="md" nowrap>
</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="a00080.html#a22">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="a00080.html#a19">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><em>data</em>&nbsp;</td><td>A pointer to the data which is to be sent.</td></tr>
<tr><td valign=top><em>len</em>&nbsp;</td><td>The maximum amount of data bytes to be sent. </td></tr>
</table>
</dl>
</td>
</tr>
</table>
<a name="a10" doxytag="uip.h::uip_stop"></a><p>
<table class="mdTable" width="100%" 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>
</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. </td>
</tr>
</table>
<a name="a18" doxytag="uip.h::uip_timedout"></a><p>
<table class="mdTable" width="100%" 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>
</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. </td>
</tr>
</table>
<a name="a23" doxytag="uip.h::uip_udp_remove"></a><p>
<table class="mdTable" width="100%" 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>
</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><em>conn</em>&nbsp;</td><td>A pointer to the <a class="el" href="a00046.html">uip_udp_conn</a> structure for the connection. </td></tr>
</table>
</dl>
</td>
</tr>
</table>
<a name="a24" doxytag="uip.h::uip_udp_send"></a><p>
<table class="mdTable" width="100%" 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>
</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><em>len</em>&nbsp;</td><td>The length of the data in the uip_buf buffer. </td></tr>
</table>
</dl>
</td>
</tr>
</table>
<a name="a7" doxytag="uip.h::uip_urgdatalen"></a><p>
<table class="mdTable" width="100%" 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>
</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>
</td>
</tr>
</table>
<hr><h2>Function Documentation</h2>
<a name="a2" doxytag="uip.h::uip_connect"></a><p>
<table class="mdTable" width="100%" 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="a00037.html">uip_conn</a>* uip_connect </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="md" nowrap valign="top"><a class="el" href="a00086.html#a1">u16_t</a> *&nbsp;</td>
<td class="mdname" nowrap> <em>ripaddr</em>, </td>
</tr>
<tr>
<td></td>
<td></td>
<td class="md" nowrap><a class="el" href="a00086.html#a1">u16_t</a>&nbsp;</td>
<td class="mdname" nowrap> <em>port</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>
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="a00080.html#a2">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="a00074.html">uipopt.h</a>.<p>
Since this function requires the port number to be in network byte order, a convertion using <a class="el" href="a00081.html#a2">HTONS()</a> or <a class="el" href="a00081.html#a0">htons()</a> is necessary.</dd></dl>
<div class="fragment"><pre> <a class="code" href="a00086.html#a1">u16_t</a> ipaddr[2];
<a class="code" href="a00081.html#a1">uip_ipaddr</a>(ipaddr, 192,168,1,2);
<a class="code" href="a00080.html#a2">uip_connect</a>(ipaddr, <a class="code" href="a00081.html#a2">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><em>ripaddr</em>&nbsp;</td><td>A pointer to a 4-byte array representing the IP address of the remote hot.</td></tr>
<tr><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>
</td>
</tr>
</table>
<a name="a0" doxytag="uip.h::uip_listen"></a><p>
<table class="mdTable" width="100%" 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="a00086.html#a1">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="a00081.html#a2">HTONS()</a> or <a class="el" href="a00081.html#a0">htons()</a> is necessary.</dd></dl>
<div class="fragment"><pre> <a class="code" href="a00080.html#a25">uip_listen</a>(<a class="code" href="a00081.html#a2">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><em>port</em>&nbsp;</td><td>A 16-bit port number in network byte order. </td></tr>
</table>
</dl>
</td>
</tr>
</table>
<a name="a3" doxytag="uip.h::uip_udp_new"></a><p>
<table class="mdTable" width="100%" 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="a00046.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="a00086.html#a1">u16_t</a> *&nbsp;</td>
<td class="mdname" nowrap> <em>ripaddr</em>, </td>
</tr>
<tr>
<td></td>
<td></td>
<td class="md" nowrap><a class="el" href="a00086.html#a1">u16_t</a>&nbsp;</td>
<td class="mdname" nowrap> <em>rport</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>
Set up a new UDP connection.
<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign=top><em>ripaddr</em>&nbsp;</td><td>A pointer to a 4-byte structure representing the IP address of the remote host.</td></tr>
<tr><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="a00046.html">uip_udp_conn</a> structure for the new connection or NULL if no connection could be allocated. </dd></dl>
</td>
</tr>
</table>
<a name="a1" doxytag="uip.h::uip_unlisten"></a><p>
<table class="mdTable" width="100%" 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="a00086.html#a1">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="a00081.html#a2">HTONS()</a> or <a class="el" href="a00081.html#a0">htons()</a> is necessary.</dd></dl>
<div class="fragment"><pre> <a class="code" href="a00080.html#a24">uip_unlisten</a>(<a class="code" href="a00081.html#a2">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><em>port</em>&nbsp;</td><td>A 16-bit port number in network byte order. </td></tr>
</table>
</dl>
</td>
</tr>
</table>
<hr size="1"><address style="align: right;"><small>Generated on Tue Oct 7 15:51:43 2003 for uIP 0.9 by
<a href="http://www.doxygen.org/index.html">
<img src="doxygen.png" alt="doxygen" align="middle" border=0 >
</a>1.3.3 </small></address>
</body>
</html>