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

📄 c-sntp3.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>    SNTP: A Time Protocol     </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-sntp.html"><img border="0" alt="[Index]" src="icons/index.gif"></a><a href="c-sntp.html"><img border="0" alt="[Top]" src="icons/top.gif"></a><a href="c-sntp2.html"><img border="0" alt="[Prev]" src="icons/prev.gif"></a><a href="c-rpc.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="89965">9.3  &nbsp;&nbsp;Using the SNTP Server</a></i></h3></font><dl class="margin"><dl class="margin"><dd><p class="Body"><a name="89966"> </a>To include the SNTP server, reconfigure your VxWorks image.  The relevant configuration macro is <b class="symbol_UC">INCLUDE_SNTPS</b>. VxWorks automatically calls <b class="routine"><i class="routine">sntpsInit</i></b><b>(&nbsp;)</b>during system startup. Depending on the value of the SNTP Server Mode Selection (set by the configuration constant <b class="symbol_UC">SNTPS_MODE</b>), the server executes in one of two modes, <b class="symbol_UC">SNTP_PASSIVE</b> or <b class="symbol_UC">SNTP_ACTIVE</b>. </p><dd><p class="Body"><a name="89971"> </a>If the SNTP Server Mode Selection is set to <b class="symbol_UC">SNTP_PASSIVE</b>, the server waits for requests from clients and sends replies containing an NTP timestamp. If the SNTP Server Mode Selection is set to <b class="symbol_UC">SNTP_ACTIVE</b>, the server periodically transmits NTP timestamp information at fixed intervals. </p><dd><p class="Body"><a name="89974"> </a>When executing in active mode, the SNTP server uses two other configuration settings, the SNTP Server Destination Address (configuration constant <b class="symbol_UC">SNTPS_DSTADDR</b>) and the SNTP Server Update Interval (configuration constant <b class="symbol_UC">SNTPS_INTERVAL</b>) to determine the target IP address and broadcast interval. By default, the server transmits the timestamp information to the local subnet broadcast address every 64 seconds. To change these settings after system startup, call the <b class="routine"><i class="routine">sntpsConfigSet</i></b><b>(&nbsp;)</b>routine. The SNTP server operating in active mode can also respond to client requests as they arrive. </p><dd><p class="Body"><a name="89978"> </a>The SNTP Client/Server Port (configuration constant <b class="symbol_UC">SNTP_PORT</b>) assigns the source and destination UDP port. The default port setting is 123 as specified by the RFC 1769. </p><dd><p class="Body"><a name="89979"> </a>Finally, the SNTP server requires access to a reliable external time source. To do this, you must provide a routine of the form: </p><dl class="margin"><dd><pre class="Code2"><b><a name="89980">STATUS sntpsClockHook (int request, void *pBuffer);</a></b></pre></dl><dd><p class="Body"><a name="89981"> </a>Until this routine is hooked into SNTP, the server cannot provide timestamp information. There are two ways to hook this routine into the SNTP server. The first is to configure VxWorks with the SNTPS Time Hook (configuration constant <b class="symbol_UC">SNTPS_TIME_HOOK</b>) set to the appropriate routine name. You can also call <b class="routine"><i class="routine">sntpsClockSet</i></b><b>(&nbsp;)</b>. See the reference entry fro <b class="routine"><i class="routine">sntpsClockSet</i></b><b>(&nbsp;)</b>for more information.</p></dl></dl><a name="foot"><hr></a><p class="navbar" align="right"><a href="index.html"><img border="0" alt="[Contents]" src="icons/contents.gif"></a><a href="c-sntp.html"><img border="0" alt="[Index]" src="icons/index.gif"></a><a href="c-sntp.html"><img border="0" alt="[Top]" src="icons/top.gif"></a><a href="c-sntp2.html"><img border="0" alt="[Prev]" src="icons/prev.gif"></a><a href="c-rpc.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 + -