📄 c-dll4.html
字号:
<tr valign="middle"><td colspan="20"></td></tr></table></p callout><dl class="margin"><dd><p class="Body"><a name="84542"> </a>You can include the optional DES cryptographic package for use with the Password Authentication Protocol (PAP). The relevant configuration macro is <b class="symbol_UC">INCLUDE_PPP_CRYPT</b>. It is not included in the standard Tornado Release; contact your WRS Sales Representative to inquire about the availability of this optional package. The DES package allows user passwords to be stored in encrypted form on the VxWorks target. If the package is installed, then it is useful only when the VxWorks target is acting as a PAP server, that is, when VxWorks is authenticating the PPP peer. Its absence does not preclude the use of PAP. For detailed information about using the DES package with PAP, see <a href="c-dll4.html#85309"><i class="title">Using PAP</i></a>).</p><dd><p class="Body"><a name="84548"> </a>This PPP implementation includes many optional features (approximately 50 in all) that can be configured in to enable the PPP capabilities listed in <a href="c-dll4.html#84394"><i class="title">3.4.2 PPP Features</i></a>. There are three methods of configuration:</p></dl><dl class="margin"><p class="listspace"><ul class="Bullet" type="disc"><li><a name="84552"> </a>At compile-time, by reconfiguring VxWorks as described in the <i class="title">Tornado User's Guide: Projects</i>. Use this method with <b class="routine"><i class="routine">usrPPPInit</i></b><b>( )</b>. (See <a href="c-dll4.html#84708"><i class="title">Initializing a PPP Link</i></a>.)</li></ul></p><p class="listspace"><ul class="Bullet" type="disc"><li><a name="84556"> </a>At run-time, by filling in a PPP options structure. Use this method with <b class="routine"><i class="routine">pppInit</i></b><b>( )</b>. (See <a href="c-dll4.html#84708"><i class="title">Initializing a PPP Link</i></a>.)</li></ul></p><p class="listspace"><ul class="Bullet" type="disc"><li><a name="84560"> </a>At run-time, by setting options in a PPP options file. This method is used with either <b class="routine"><i class="routine">usrPPPInit</i></b><b>( )</b> or <b class="routine"><i class="routine">pppInit</i></b><b>( )</b>, and can be used to change the selection of PPP options previously configured by one of the other two configuration methods, provided that the PPP options file can be read without using the PPP link (for example, an options file located on a target's local disk).</li></ul></p></dl><dl class="margin"><dd><p class="Body"><a name="84561"> </a>Each of these methods is described in a section that follows. For brief descriptions of the various PPP options, see <a href="c-dll4.html#96246">Table 3-3</a>.</p></dl></dl><font face="Helvetica, sans-serif" class="sans"><h4 class="H4"><i><a name="84566">Selecting PPP Options By Configuring VxWorks<b class="file"> </b></a></i></h4></font><dl class="margin"><dl class="margin"><dd><p class="Body"><a name="84568"> </a>The various configuration options offered by this PPP implementation can be initialized at compile-time by defining a number of configuration options.</p></dl></dl><dl class="margin"><dd><p class="table" callout><table border="0" cellpadding="0" cellspacing="0"><tr valign="top"><td valign="top" width="40"><br><img border="0" alt="*" src="icons/note.gif"></td><td><hr><div class="CalloutCell"><a name="94407"><b class="symbol_UC"><font face="Helvetica, sans-serif" size="-1" class="sans">NOTE: </font></b></a>See the <i class="title">Tornado User's Guide: Projects</i> for information on how to set some configuration options through a graphical user interface, without directly editing <b class="file">config.h</b>.</div></td></tr><tr valign="top"><td></td><td><hr></td></tr><tr valign="middle"><td colspan="20"></td></tr></table></p callout><dl class="margin"><dd><p class="Body"><a name="84570"> </a>First, make sure the <b class="symbol_UC">PPP_OPTIONS_STRUCT</b><b class="symbol_lc"> </b>constant is defined in <b class="file">config.h</b> (it is defined by default). Unless <b class="symbol_UC">PPP_OPTIONS_STRUCT</b> is defined, configuration options in <b class="file">config.h</b> cannot be enabled.</p><dd><p class="Body"><a name="84572"> </a>Then, specify the default serial interface that will be used by <b class="routine"><i class="routine">usrPPPInit</i></b><b>( )</b> by defining the <b class="symbol_lc">PPP_TTY</b> constant. Configuration options can be selected using configuration constants only when <b class="routine"><i class="routine">usrPPPInit</i></b><b>( )</b> is invoked to initialize PPP. Specify the number of seconds <b class="routine"><i class="routine">usrPPPInit</i></b><b>( )</b> will wait for a PPP link to be established between a target and peer by defining the <b class="symbol_UC">PPP_CONNECT_DELAY</b><b class="symbol_lc"> </b>constant. <a href="c-dll4.html#84581">Table 3-1</a> lists the principal configuration constants used with PPP.<b><p class="table"><h4 class="EntityTitle"><a name="84581"><font face="Helvetica, sans-serif" size="-1" class="sans">Table 3-1: PPP Configuration Constants</font></a></h4><table border="0" cellpadding="0" cellspacing="0"><tr><td colspan="20"><hr class="tablerule"></td></tr><tr valign="middle"><th rowspan="1" colspan="1"><div class="CellHeading"><b><a name="84585"> </a><font face="Helvetica, sans-serif" size="-1" class="sans">Constant</font></b></div></th><td width="10"> </td><th rowspan="1" colspan="1"><div class="CellHeading"><b><a name="84587"> </a><font face="Helvetica, sans-serif" size="-1" class="sans">Purpose</font></b></div></th><td width="10"> </td></tr><tr><td colspan="20"><hr class="tablerule2"></td></tr><tr valign="top"><td colspan=1 rowspan=1><div class="CellBody"><a name="84589"> </a><b class="symbol_UC">INCLUDE_PPP</b> </div></td><td width="10"> </td><td colspan=1 rowspan=1><div class="CellBody"><a name="84595"> </a>Include PPP. <sup><b class="FootnoteMarker">1</b></sup></div></td><td width="10"> </td></tr><tr valign="top"><td colspan=1 rowspan=1><div class="CellBody"><a name="84597"> </a><b class="symbol_UC">INCLUDE_PPP_CRYPT</b> </div></td><td width="10"> </td><td colspan=1 rowspan=1><div class="CellBody"><a name="84599"> </a>Include DES cryptographic package.</div></td><td width="10"> </td></tr><tr valign="top"><td colspan=1 rowspan=1><div class="CellBody"><a name="84601"> </a><b class="symbol_UC">PPP_OPTIONS_STRUCT</b> </div></td><td width="10"> </td><td colspan=1 rowspan=1><div class="CellBody"><a name="84603"> </a>Enable configuration options set in <b>config.h</b>.</div></td><td width="10"> </td></tr><tr valign="top"><td colspan=1 rowspan=1><div class="CellBody"><a name="84605"> </a><b class="symbol_UC">PPP_TTY</b> </div></td><td width="10"> </td><td colspan=1 rowspan=1><div class="CellBody"><a name="84607"> </a>Define default serial interface.</div></td><td width="10"> </td></tr><tr valign="top"><td colspan=1 rowspan=1><div class="CellBody"><a name="84609"> </a><b class="symbol_UC">PPP_CONNECT_DELAY</b> </div></td><td width="10"> </td><td colspan=1 rowspan=1><div class="CellBody"><a name="84611"> </a>Define time-out delay for link establishment.</div></td><td width="10"> </td></tr><tr><td colspan="20"><hr class="tablerule"></td></tr><tr valign="middle"><td colspan="20"><p class="FootnoteNumberMarker">1: <span class="TableFootnote"><a name="84593"> </a>If you want to use VxSim for Solaris with PPP as the backend, you must configure VxWorks with BSD 4.3 compatability off. The relevant configuration macro is <b class="symbol_UC">BSD43_COMPATIBLE</b>. Otherwise, you get an exception in the WDB task when the target server tries to connect to the WDB agent.</span></p></td></tr></table></p></b></p><dd><p class="Body"><a name="84615"> </a><a href="c-dll4.html#93862">Table 3-2</a> shows the two basic formats used for configuration options in <b class="file">config.h</b>. The full list of options available with PPP appears in column 1 of <a href="c-dll4.html#96246">Table 3-3</a>. By default, all of these options are disabled. To enable any <b class="symbol_UC">PPP_OPT</b><b class="symbol_lc">_</b><i class="textVariable">option</i> setting, define its value to be 1 (these option constants are boolean values). To set any <b class="symbol_UC">PPP_STR</b><b class="symbol_lc">_</b><i class="textVariable">optionstring</i> entry, define it by representing the desired value as a string. For example, to set <b class="symbol_UC">PPP_STR_MTU</b> to 1000, enter:</p><dl class="margin"><dd><pre class="Code2"><b><a name="84639">#define PPP_STR_MTU "1000"<p class="table"></pre><h4 class="EntityTitle"><a name="93862"><font face="Helvetica, sans-serif" size="-1" class="sans">Table 3-2: PPP Configuration Options in <b class="file">config.h</b></font></a></h4><table border="0" cellpadding="0" cellspacing="0"><tr><td colspan="20"><hr class="tablerule"></td></tr><tr valign="middle"><th rowspan="1" colspan="1"><div class="CellHeading"><b><a name="93866"> </a><font face="Helvetica, sans-serif" size="-1" class="sans">Configuration Option</font></b></div></th><td width="10"> </td><th rowspan="1" colspan="1"><div class="CellHeading"><b><a name="93868"> </a><font face="Helvetica, sans-serif" size="-1" class="sans">Option Included</font></b></div></th><td width="10"> </td></tr><tr><td colspan="20"><hr class="tablerule2"></td></tr><tr valign="top"><td colspan=1 rowspan=1><div class="CellBody"><a name="93871"> </a><b class="symbol_lc">PPP_OPT_</b><i class="textVariable">option</i></div></td><td width="10"> </td><td colspan=1 rowspan=1><div class="CellBody"><a name="93873"> </a>Specify a PPP configuration option.</div></td><td width="10"> </td></tr><tr valign="top"><td colspan=1 rowspan=1><div class="CellBody"><a name="93876"> </a><b class="symbol_lc">PPP_STR_</b><i class="textVariable">optionstring</i></div></td><td width="10"> </td><td colspan=1 rowspan=1><div class="CellBody"><a name="93878"> </a>Specify a PPP configuration option string.</div></td><td width="10"> </td></tr><tr><td colspan="20"><hr class="tablerule"></td></tr><tr valign="middle"><td colspan="20"></td></tr></table></p></a></b></pre></dl><dd><p class="Body"><a name="84640"> </a>Setting <b class="symbol_UC">PPP_OPTIONS_STRUCT</b>, <b class="symbol_UC">PPP_TTY</b>, and <b class="symbol_UC">PPP_CONNECT_DELAY</b><b class="symbol_lc"> </b>in <b class="file">config.h</b>, as well as any configuration options, constitutes a modification to the configuration file. These changes do not actually take effect until after you have recompiled VxWorks and initialized PPP. To initialize PPP, call <b class="routine"><i class="routine">usrPPPInit</i></b><b>( )</b>. You can make this call manually from a target shell (see <a href="c-dll4.html#84708"><i class="title">Initializing a PPP Link</i></a>) or can include it in the boot code (see <a href="c-booting.html#84222"><i class="title">Booting over the Network</i></a>).</p></dl></dl><font face="Helvetica, sans-serif" class="sans"><h4 class="H4"><i><a name="84650">Selecting PPP Options Using an Options Structure</a></i></h4></font><dl class="margin"><dl class="margin"><dd><p class="Body"><a name="84652"> </a>PPP options may be set at run-time by filling in a PPP options structure and passing the structure location to the <b class="routine"><i class="routine">pppInit</i></b><b>( )</b> routine. This routine is the standard entry point for initializing a PPP link (see <a href="c-dll4.html#84708"><i class="title">Initializing a PPP Link</i></a>).</p><dd><p class="Body"><a name="84658"> </a>The PPP options structure is <b class="symbol_lc">typedef</b>ed to <b class="symbol_UC">PPP_OPTIONS</b>, and its definition is located in <b class="file">h/netinet/ppp/options.h</b>, which is included through <b class="file">h/pppLib.h</b>.</p><dd><p class="Body"><a name="84659"> </a>The first field of the structure is an integer, <b class="symbol_lc">flags</b>, which is a bit field that holds the <b class="symbol_UC">OR</b>ed value of the <b class="symbol_UC">OPT</b><b class="symbol_lc">_</b><i class="textVariable">option</i> macros displayed in column 2 of <a href="c-dll4.html#96246">Table 3-3</a>. Definitions for <b class="symbol_UC">OPT</b><b class="symbol_lc">_</b><i class="textVariable">option</i> are located in <b class="file">h/netinet/ppp/options.h</b>. The remaining structure fields in column 2 are character pointers to the various PPP options specified by a string. </p><dd><p class="Body"><a name="84664"> </a>The following code fragment is one way to set configuration options using the PPP options structure. It initializes a PPP interface that uses the target's second serial port (<b>/tyCo/1</b>). The local IP address is 90.0.0.1; the IP address of the remote peer is 90.0.0.10. The baud rate is the default rate for the <i class="acronym_lc">tty</i> device. The VJ compression and authentication options have been disabled, and LCP (Link Control Protocol) echo requests have been enabled.</p><dl class="margin">
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -