smart-green-house/rtt-uart-nb/rt-thread/components/net/uip/doc/html/a00103.html

85 lines
7.6 KiB
HTML
Raw Permalink Normal View History

2023-10-28 18:00:47 +08:00
<!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: apps/resolv/resolv.h File Reference</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 id="current"><a href="files.html"><span>Files</span></a></li>
<li><a href="examples.html"><span>Examples</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>Globals</span></a></li>
</ul></div>
<h1>apps/resolv/resolv.h File Reference</h1><hr><a name="_details"></a><h2>Detailed Description</h2>
DNS resolver code header file.
<p>
<dl compact><dt><b>Author:</b></dt><dd>Adam Dunkels &lt;<a href="mailto:adam@dunkels.com">adam@dunkels.com</a>&gt; </dd></dl>
<p>
Definition in file <a class="el" href="a00173.html">resolv.h</a>.
<p>
<code>#include &quot;<a class="el" href="a00206.html">uipopt.h</a>&quot;</code><br>
<p>
<a href="a00173.html">Go to the source code of this file.</a><table border="0" cellpadding="0" cellspacing="0">
<tr><td></td></tr>
<tr><td colspan="2"><br><h2>Appication specific configurations</h2></td></tr>
<tr><td colspan="2">An uIP application is implemented using a single application function that is called by uIP whenever a TCP/IP event occurs. The name of this function must be registered with uIP at compile time using the UIP_APPCALL definition.<p>
uIP applications can store the application state within the <a class="el" href="a00088.html">uip_conn</a> structure by specifying the type of the application structure by typedef:ing the type uip_tcp_appstate_t and uip_udp_appstate_t.<p>
The file containing the definitions must be included in the <a class="el" href="a00140.html">uipopt.h</a> file.<p>
The following example illustrates how this can look. <div class="fragment"><pre class="fragment"><span class="keywordtype">void</span> <a class="code" href="a00164.html#g648ddfb2dde2cc55034e4e0ea41cb6d1">httpd_appcall</a>(<span class="keywordtype">void</span>);
<span class="preprocessor">#define UIP_APPCALL httpd_appcall</span>
<span class="preprocessor"></span>
<span class="keyword">struct </span><a class="code" href="a00080.html">httpd_state</a> {
<a class="code" href="a00153.html#g4caecabca98b43919dd11be1c0d4cd8e">u8_t</a> <a class="code" href="a00080.html#94fcc9f5c47f419040d849ce58beae35">state</a>;
<a class="code" href="a00153.html#g77570ac4fcab86864fa1916e55676da2">u16_t</a> <a class="code" href="a00080.html#6df929b448ea98bc44d41f5e96237bda">count</a>;
<span class="keywordtype">char</span> *dataptr;
<span class="keywordtype">char</span> *script;
};
<span class="keyword">typedef</span> <span class="keyword">struct </span><a class="code" href="a00080.html">httpd_state</a> <a class="code" href="a00153.html#g69646a81a922033c5281445a71f8ffed">uip_tcp_appstate_t</a>
</pre></div> <br><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">typedef int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00153.html#ga92afb113e122f860392bfbd385f842e">uip_udp_appstate_t</a></td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">The type of the application state that is to be stored in the <a class="el" href="a00088.html">uip_conn</a> structure. <a href="a00153.html#ga92afb113e122f860392bfbd385f842e"></a><br></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="g3d768e989e308144190ae1a5ddfa9726"></a><!-- doxytag: member="resolv.h::UIP_UDP_APPCALL" ref="g3d768e989e308144190ae1a5ddfa9726" args="" -->
#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00160.html#g3d768e989e308144190ae1a5ddfa9726">UIP_UDP_APPCALL</a>&nbsp;&nbsp;&nbsp;resolv_appcall</td></tr>
<tr><td colspan="2"><br><h2>Functions</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="g7c5359305008e9183b18d6ab75f568bf"></a><!-- doxytag: member="resolv.h::resolv_appcall" ref="g7c5359305008e9183b18d6ab75f568bf" args="(void)" -->
void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00160.html#g7c5359305008e9183b18d6ab75f568bf">resolv_appcall</a> (void)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00160.html#g6d9751d534453425c7a5a215d1d4414c">resolv_found</a> (char *name, <a class="el" href="a00153.html#g77570ac4fcab86864fa1916e55676da2">u16_t</a> *ipaddr)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Callback function which is called when a hostname is found. <a href="a00160.html#g6d9751d534453425c7a5a215d1d4414c"></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="a00160.html#gdf916e0c752f5cda70d0bddb2be422ba">resolv_conf</a> (<a class="el" href="a00153.html#g77570ac4fcab86864fa1916e55676da2">u16_t</a> *dnsserver)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Configure which DNS server to use for queries. <a href="a00160.html#gdf916e0c752f5cda70d0bddb2be422ba"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="a00153.html#g77570ac4fcab86864fa1916e55676da2">u16_t</a> *&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00160.html#g3191066cf8f76bd00b6843b77c37068f">resolv_getserver</a> (void)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Obtain the currently configured DNS server. <a href="a00160.html#g3191066cf8f76bd00b6843b77c37068f"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="gb50f78bbf36d912d69f6c1685d0b40e3"></a><!-- doxytag: member="resolv.h::resolv_init" ref="gb50f78bbf36d912d69f6c1685d0b40e3" args="(void)" -->
void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00160.html#gb50f78bbf36d912d69f6c1685d0b40e3">resolv_init</a> (void)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Initalize the resolver. <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="a00153.html#g77570ac4fcab86864fa1916e55676da2">u16_t</a> *&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00160.html#g66d19181ad5fe8b8f7c84d1f1d46a2ec">resolv_lookup</a> (char *name)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Look up a hostname in the array of known hostnames. <a href="a00160.html#g66d19181ad5fe8b8f7c84d1f1d46a2ec"></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="a00160.html#ge4dcbbe6c641d2e3b8537b479df5fc99">resolv_query</a> (char *name)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Queues a name so that a question for the name will be sent out. <a href="a00160.html#ge4dcbbe6c641d2e3b8537b479df5fc99"></a><br></td></tr>
</table>
<hr size="1"><address style="align: right;"><small>Generated on Mon Jun 12 10:23:01 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>