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

📄 c-dns3.html

📁 vxworks相关论文
💻 HTML
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"><html><head><link rel="STYLESHEET" type="text/css" href="wrs.css"><title>    DNS: Domain Name System     </title></head><body bgcolor="FFFFFF"><p class="navbar" align="right"><a href="index.html"><img border="0" alt="[Contents]" src="icons/contents.gif"></a><a href="c-dns.html"><img border="0" alt="[Index]" src="icons/index.gif"></a><a href="c-dns.html"><img border="0" alt="[Top]" src="icons/top.gif"></a><a href="c-dns2.html"><img border="0" alt="[Prev]" src="icons/prev.gif"></a><a href="c-sntp.html"><img border="0" alt="[Next]" src="icons/next.gif"></a></p><font face="Helvetica, sans-serif" class="sans"><h3 class="H2"><i><a name="89927">8.3  &nbsp;&nbsp;The VxWorks Resolver </a></i></h3></font><dl class="margin"><dl class="margin"><dd><p class="Body"><a name="89929"> </a>The VxWorks implementation of the resolver closely follows the 4.4 BSD resolver implementation. However, the VxWorks implementation differs in the way it handles the <b class="symbol_lc">hostent</b> structure.  The 4.4 BSD resolver is a library that links with each process. It uses static structures to exchange data with the process.  This is not possible in VxWorks, which uses a single copy of the library that it shares among all the tasks in the system.  All applications using the resolver library must provide their own buffers.  As a result, under VxWorks, the functions <b class="routine"><i class="routine">resolvGetHostByName</i></b><b>(&nbsp;)</b>and <b class="routine"><i class="routine">resolvGetHostByAddr</i></b><b>(&nbsp;)</b>require two extra parameters (for a detailed description of the interface, see the reference entries for these routines).</p><dd><p class="Body"><a name="89931"> </a>Under VxWorks, the resolver library uses UDP to send requests to the configured name servers.  The resolver also expects the server to handle any recursion necessary to perform the name resolution.  You can configure the resolver at initialization or at run time.<sup><a href="#foot"><b class="FootnoteMarker">1</b></a></sup> The resolver can also query multiple servers if you need to add redundancy to name resolution in your system.  Additionally, you can configure the resolver library's response to a failed name server query. Either the resolver looks in the static host configuration table immediately after the failed query, or the resolver ignores the static table.<sup><a href="#foot"><b class="FootnoteMarker">2</b></a></sup> The default behavior of the resolver is to query only the name server and ignore the static table. </p></dl></dl><font face="Helvetica, sans-serif" class="sans"><h4 class="H3"><i><a name="89938">8.3.1  &nbsp;&nbsp;Resolver Integration </a></i></h4></font><dl class="margin"><dl class="margin"><dd><p class="Body"><a name="89939"> </a>The resolver has been fully integrated into VxWorks. Existing applications can benefit from the resolver without needing to make any code changes. This is because the code internal to <b class="routine"><i class="routine">hostGetByName</i></b><b>(&nbsp;)</b> and <b class="routine"><i class="routine">hostGetByAddr</i></b><b>(&nbsp;)</b> have<b class="library"> </b>been updated to use the resolver.<sup><a href="#foot"><b class="FootnoteMarker">3</b></a></sup> Thus, the only thing you need do to take advantage of the resolver is to include it in your VxWorks image. </p></dl></dl><font face="Helvetica, sans-serif" class="sans"><h4 class="H3"><i><a name="89943">8.3.2  &nbsp;&nbsp;Resolver Configuration </a></i></h4></font><dl class="margin"><dl class="margin"><dd><p class="Body"><a name="89945"> </a>The resolver library is not included by default in the VxWorks image. Thus, to include the resolver in your VxWorks image, you must modify <b class="file">config.h</b> as follows:</p></dl><dl class="margin"><p><ol class="List"><li value="1."><a name="89946"> </a>Reconfigure VxWorks with the DNS resolver on.  The relevant configuration macro is <b class="symbol_UC">INCLUDE_DNS_RESOLVER</b>.</li></ol></p><p><ol class="List"><li value="2."><a name="89948"> </a>Establish the IP address of the Domain Name Server. Change the default value for the constant:</li></ol></p><dl class="margin"><dl class="margin"><dd><pre class="Code3"><b><a name="89949">#define RESOLVER_DOMAIN_SERVER "<i class="textVariable">ip_address</i>" </a></b></pre></dl></dl><dl class="margin"><dd><div class="Indent"><a name="89950"> </a>The IP address of the server needs to be in dotted decimal notation (for example, 90.0.0.3). </div><br></dl><p><ol class="List"><li value="3."><a name="89951"> </a>Make sure that a route to the Domain Name Server exists before you try to access the resolver library. To do this, you can use <b class="routine"><i class="routine">routeAdd</i></b><b>(&nbsp;)</b> to add the route to the routing table. However, if you have included a routing protocol such as RIP or OSPF in your VxWorks image, these protocols add the route for you. </li></ol></p><p><ol class="List"><li value="4."><a name="89952"> </a>Define the domain to which the resolver belongs by changing the default Resolver Domain in the VxWorks configuration (defined by the configuration constant <b class="symbol_UC">RESOLVER_DOMAIN</b>).</li></ol></p><dl class="margin"><dd><div class="Indent"><a name="89954"> </a>You must change this domain name to the domain name to which your   organization belongs.  The resolver uses this domain name when it tries to query the domain server for the name of the host machine for its organization. </div><br></dl></dl><dl class="margin"><dd><p class="Body"><a name="89955"> </a>The resolver library supports a debug option, the DNS Debug Messages parameter: <b class="symbol_UC">DNS_DEBUG</b>. </p><dd><p class="Body"><a name="89956"> </a>Using this parameter causes a log of the resolver queries to be printed to the console. The use of this feature is limited to a single task.  If you have multiple tasks running, the output to the console will be garbled.</p></dl></dl><a name="foot"><hr></a><p class="FootnoteNumberMarker">1:&nbsp;<span class="Footnote"><a name="89934"> </a>For initialization, call <b class="routine"><i class="routine">resolvParamsGet</i></b><b>(&nbsp;)</b> and <b class="routine"><i class="routine">resolvParamsSet</i></b><b>(&nbsp;)</b>. See the reference entries for these routines. </span><p class="FootnoteNumberMarker">2:&nbsp;<span class="Footnote"><a name="89937"> </a>The boot configuration table is maintained by <b class="library">hostLib</b>. </span><p class="FootnoteNumberMarker">3:&nbsp;<span class="Footnote"><a name="89942"> </a>Both<b class="routine"><i class="routine"> hostGetByName</i></b><b>(&nbsp;)</b>and <b class="routine"><i class="routine">hostGetByAddr</i></b><b>(&nbsp;)</b> are <b class="library">hostLib </b>functions. </span><p class="navbar" align="right"><a href="index.html"><img border="0" alt="[Contents]" src="icons/contents.gif"></a><a href="c-dns.html"><img border="0" alt="[Index]" src="icons/index.gif"></a><a href="c-dns.html"><img border="0" alt="[Top]" src="icons/top.gif"></a><a href="c-dns2.html"><img border="0" alt="[Prev]" src="icons/prev.gif"></a><a href="c-sntp.html"><img border="0" alt="[Next]" src="icons/next.gif"></a></p></body></html><!---by WRS Documentation (), Wind River Systems, Inc.    conversion tool:  Quadralay WebWorks Publisher 4.0.11    template:         CSS Template, Jan 1998 - Jefro --->

⌨️ 快捷键说明

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