forked from Imagelibrary/uip
246 lines
11 KiB
HTML
246 lines
11 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 hostname resolver 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 Page</a> | <a class="qindex" href="modules.html">Modules</a> | <a class="qindex" href="classes.html">Alphabetical List</a> | <a class="qindex" href="annotated.html">Data Structures</a> | <a class="qindex" href="files.html">File List</a> | <a class="qindex" href="functions.html">Data Fields</a> | <a class="qindex" href="globals.html">Globals</a></div>
|
|
<h1>uIP hostname resolver 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>
|
|
The uIP DNS resolver functions are used to lookup a hostname and map it to a numerical IP address. It maintains a list of resolved hostnames that can be queried with the <a class="el" href="a00099.html#a7">resolv_lookup()</a> function. New hostnames can be resolved using the <a class="el" href="a00099.html#a8">resolv_query()</a> function.<p>
|
|
When a hostname has been resolved (or found to be non-existant), the resolver code calls a callback function called <a class="el" href="a00099.html#a3">resolv_found()</a> that must be implemented by the module that uses the resolver.
|
|
<p>
|
|
<table border=0 cellpadding=0 cellspacing=0>
|
|
<tr><td></td></tr>
|
|
<tr><td colspan=2><br><h2>Files</h2></td></tr>
|
|
<tr><td class="memItemLeft" nowrap align=right valign=top>file </td><td class="memItemRight" valign=bottom><a class="el" href="a00055.html">resolv.c</a></td></tr>
|
|
|
|
<tr><td class="mdescLeft"> </td><td class="mdescRight">DNS host name to IP address resolver. <br><br></td></tr>
|
|
|
|
<p>
|
|
<tr><td class="memItemLeft" nowrap align=right valign=top>file </td><td class="memItemRight" valign=bottom><a class="el" href="a00056.html">resolv.h</a></td></tr>
|
|
|
|
<tr><td class="mdescLeft"> </td><td class="mdescRight">DNS resolver code header file. <br><br></td></tr>
|
|
|
|
<p>
|
|
<tr><td colspan=2><br><h2>Functions</h2></td></tr>
|
|
<tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="a00099.html#a3">resolv_found</a> (char *name, <a class="el" href="a00086.html#a1">u16_t</a> *ipaddr)</td></tr>
|
|
|
|
<tr><td class="mdescLeft"> </td><td class="mdescRight">Callback function which is called when a hostname is found. </em> <a href="#a3"></a><em><br><br></td></tr>
|
|
<tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="a00099.html#a4">resolv_conf</a> (<a class="el" href="a00086.html#a1">u16_t</a> *dnsserver)</td></tr>
|
|
|
|
<tr><td class="mdescLeft"> </td><td class="mdescRight">Configure which DNS server to use for queries. </em> <a href="#a4"></a><em><br><br></td></tr>
|
|
<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a00086.html#a1">u16_t</a> * </td><td class="memItemRight" valign=bottom><a class="el" href="a00099.html#a5">resolv_getserver</a> (void)</td></tr>
|
|
|
|
<tr><td class="mdescLeft"> </td><td class="mdescRight">Obtain the currently configured DNS server. </em> <a href="#a5"></a><em><br><br></td></tr>
|
|
<tr><td class="memItemLeft" nowrap align=right valign=top><a name="a6" doxytag="uipdns::resolv_init"></a>
|
|
void </td><td class="memItemRight" valign=bottom><a class="el" href="a00099.html#a6">resolv_init</a> (void)</td></tr>
|
|
|
|
<tr><td class="mdescLeft"> </td><td class="mdescRight">Initalize the resolver. <br><br></td></tr>
|
|
<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a00086.html#a1">u16_t</a> * </td><td class="memItemRight" valign=bottom><a class="el" href="a00099.html#a7">resolv_lookup</a> (char *name)</td></tr>
|
|
|
|
<tr><td class="mdescLeft"> </td><td class="mdescRight">Look up a hostname in the array of known hostnames. </em> <a href="#a7"></a><em><br><br></td></tr>
|
|
<tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="a00099.html#a8">resolv_query</a> (char *name)</td></tr>
|
|
|
|
<tr><td class="mdescLeft"> </td><td class="mdescRight">Queues a name so that a question for the name will be sent out. </em> <a href="#a8"></a><em><br><br></td></tr>
|
|
</table>
|
|
<hr><h2>Function Documentation</h2>
|
|
<a name="a4" doxytag="resolv.h::resolv_conf"></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 resolv_conf </td>
|
|
<td class="md" valign="top">( </td>
|
|
<td class="md" nowrap valign="top"><a class="el" href="a00086.html#a1">u16_t</a> * </td>
|
|
<td class="mdname1" valign="top" nowrap> <em>dnsserver</em> </td>
|
|
<td class="md" valign="top"> ) </td>
|
|
<td class="md" nowrap></td>
|
|
</tr>
|
|
|
|
</table>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
<table cellspacing=5 cellpadding=0 border=0>
|
|
<tr>
|
|
<td>
|
|
|
|
</td>
|
|
<td>
|
|
|
|
<p>
|
|
Configure which DNS server to use for queries.
|
|
<p>
|
|
<dl compact><dt><b>Parameters:</b></dt><dd>
|
|
<table border="0" cellspacing="2" cellpadding="0">
|
|
<tr><td valign=top><em>dnsserver</em> </td><td>A pointer to a 4-byte representation of the IP address of the DNS server to be configured. </td></tr>
|
|
</table>
|
|
</dl>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
|
|
<p>
|
|
Here is the call graph for this function:<p><center><img src="a00099_a29_cgraph.png" border="0" usemap="#a00099_a29_cgraph_map" alt=""></center>
|
|
<map name="a00099_a29_cgraph_map">
|
|
<area href="a00075.html#a23" shape="rect" coords="149,5,243,26" alt="">
|
|
</map>
|
|
<a name="a3" doxytag="resolv.h::resolv_found"></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 resolv_found </td>
|
|
<td class="md" valign="top">( </td>
|
|
<td class="md" nowrap valign="top">char * </td>
|
|
<td class="mdname" nowrap> <em>name</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td></td>
|
|
<td></td>
|
|
<td class="md" nowrap><a class="el" href="a00086.html#a1">u16_t</a> * </td>
|
|
<td class="mdname" nowrap> <em>ipaddr</em></td>
|
|
</tr>
|
|
<tr>
|
|
<td></td>
|
|
<td class="md">) </td>
|
|
<td class="md" colspan="2"></td>
|
|
</tr>
|
|
|
|
</table>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
<table cellspacing=5 cellpadding=0 border=0>
|
|
<tr>
|
|
<td>
|
|
|
|
</td>
|
|
<td>
|
|
|
|
<p>
|
|
Callback function which is called when a hostname is found.
|
|
<p>
|
|
This function must be implemented by the module that uses the DNS resolver. It is called when a hostname is found, or when a hostname was not found.<p>
|
|
<dl compact><dt><b>Parameters:</b></dt><dd>
|
|
<table border="0" cellspacing="2" cellpadding="0">
|
|
<tr><td valign=top><em>name</em> </td><td>A pointer to the name that was looked up. </td></tr>
|
|
<tr><td valign=top><em>ipaddr</em> </td><td>A pointer to a 4-byte array containing the IP address of the hostname, or NULL if the hostname could not be found. </td></tr>
|
|
</table>
|
|
</dl>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
<a name="a5" doxytag="resolv.h::resolv_getserver"></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"> <a class="el" href="a00086.html#a1">u16_t</a>* resolv_getserver </td>
|
|
<td class="md" valign="top">( </td>
|
|
<td class="md" nowrap valign="top">void </td>
|
|
<td class="mdname1" valign="top" nowrap> </td>
|
|
<td class="md" valign="top"> ) </td>
|
|
<td class="md" nowrap></td>
|
|
</tr>
|
|
|
|
</table>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
<table cellspacing=5 cellpadding=0 border=0>
|
|
<tr>
|
|
<td>
|
|
|
|
</td>
|
|
<td>
|
|
|
|
<p>
|
|
Obtain the currently configured DNS server.
|
|
<p>
|
|
<dl compact><dt><b>Returns:</b></dt><dd>A pointer to a 4-byte representation of the IP address of the currently configured DNS server or NULL if no DNS server has been configured. </dd></dl>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
<a name="a7" doxytag="resolv.h::resolv_lookup"></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"> <a class="el" href="a00086.html#a1">u16_t</a>* resolv_lookup </td>
|
|
<td class="md" valign="top">( </td>
|
|
<td class="md" nowrap valign="top">char * </td>
|
|
<td class="mdname1" valign="top" nowrap> <em>name</em> </td>
|
|
<td class="md" valign="top"> ) </td>
|
|
<td class="md" nowrap></td>
|
|
</tr>
|
|
|
|
</table>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
<table cellspacing=5 cellpadding=0 border=0>
|
|
<tr>
|
|
<td>
|
|
|
|
</td>
|
|
<td>
|
|
|
|
<p>
|
|
Look up a hostname in the array of known hostnames.
|
|
<p>
|
|
<dl compact><dt><b>Note:</b></dt><dd>This function only looks in the internal array of known hostnames, it does not send out a query for the hostname if none was found. The function <a class="el" href="a00099.html#a8">resolv_query()</a> can be used to send a query for a hostname.</dd></dl>
|
|
<dl compact><dt><b>Returns:</b></dt><dd>A pointer to a 4-byte representation of the hostname's IP address, or NULL if the hostname was not found in the array of hostnames. </dd></dl>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
<a name="a8" doxytag="resolv.h::resolv_query"></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 resolv_query </td>
|
|
<td class="md" valign="top">( </td>
|
|
<td class="md" nowrap valign="top">char * </td>
|
|
<td class="mdname1" valign="top" nowrap> <em>name</em> </td>
|
|
<td class="md" valign="top"> ) </td>
|
|
<td class="md" nowrap></td>
|
|
</tr>
|
|
|
|
</table>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
<table cellspacing=5 cellpadding=0 border=0>
|
|
<tr>
|
|
<td>
|
|
|
|
</td>
|
|
<td>
|
|
|
|
<p>
|
|
Queues a name so that a question for the name will be sent out.
|
|
<p>
|
|
<dl compact><dt><b>Parameters:</b></dt><dd>
|
|
<table border="0" cellspacing="2" cellpadding="0">
|
|
<tr><td valign=top><em>name</em> </td><td>The hostname that is to be queried. </td></tr>
|
|
</table>
|
|
</dl>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
<hr size="1"><address style="align: right;"><small>Generated on Tue Oct 7 15:51:51 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>
|