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

📄 563-565.html

📁 linux-unix130.linux.and.unix.ebooks130 linux and unix ebookslinuxLearning Linux - Collection of 12 E
💻 HTML
字号:
<HTML>

<HEAD>

<TITLE>Special Edition Using Linux, Fourth Edition:Using SLIP and PPP</TITLE>

<META NAME="ROBOTS" CONTENT="NOINDEX, NOFOLLOW">
<SCRIPT>
<!--
function displayWindow(url, width, height) {
        var Win = window.open(url,"displayWindow",'width=' + width +
',height=' + height + ',resizable=1,scrollbars=yes');
}
//-->
</SCRIPT>
</HEAD>

 -->




<!--ISBN=0789717468//-->

<!--TITLE=Special Edition Using Linux, Fourth Edition//-->

<!--AUTHOR=Jack Tackett//-->

<!--AUTHOR=Jr.//-->

<!--AUTHOR=Steve Burnett//-->

<!--PUBLISHER=Macmillan Computer Publishing//-->

<!--IMPRINT=Que//-->

<!--CHAPTER=29//-->

<!--PAGES=563-565//-->

<!--UNASSIGNED1//-->

<!--UNASSIGNED2//-->



<CENTER>

<TABLE BORDER>

<TR>

<TD><A HREF="559-563.html">Previous</A></TD>

<TD><A HREF="../ewtoc.html">Table of Contents</A></TD>

<TD><A HREF="566-568.html">Next</A></TD>

</TR>

</TABLE>

</CENTER>

<P><BR></P>

<P>From the <TT>DIP&gt;</TT> prompt, you can run any <TT>dip</TT> command by typing it and pressing &lt;Return&gt;. The <TT>help</TT> command displays a list of the available commands. Invoking a command with incorrect arguments displays a brief usage statement for that command. Table 29.2 describes the commands available for use at the command-mode prompt or in <TT>dip</TT> scripts.</P>

<TABLE WIDTH="100%"><CAPTION ALIGN=LEFT><B>Table 29.2</B> Commands Available in <TT>dip</TT>

<TR>

<TH COLSPAN="2"><HR>

<TR>

<TH WIDTH="40%" ALIGN="LEFT">Command

<TH WIDTH="60%" ALIGN="LEFT">Description

<TR>

<TH COLSPAN="2"><HR>

<TR>

<TD VALIGN="TOP"><TT>chatkey <I>keyword</I> [<I>code</I>]</TT>

<TD>Adds a keyword and error-level code to the set of error codes returned by the <TT>dial</TT> command. The <TT>chatkey</TT> command can be used to detect when your modem returns <TT>BUSY</TT>, <TT>VOICE</TT>, or other specific messages.

<TR>

<TD VALIGN="TOP"><TT>config [<I>arguments</I>]</TT>

<TD>Allows you to directly manipulate the SLIP interface <TT>dip</TT> provides. This command normally is disabled because it&#146;s a severe security risk. The source code file command.c must be modified slightly to enable this command.

<TR>

<TD VALIGN="TOP"><TT>databits <I>bits</I></TT>

<TD>Sets the number of bits that can be used as data in each byte. This accommodates 6- and 7-bit dial-up connections.

<TR>

<TD VALIGN="TOP"><TT>default</TT>

<TD>Causes <TT>dip</TT> to set a default route in the kernel routing table pointed at the remote host.

<TR>

<TD><TT>dial <I>num</I></TT>

<TD>Dials the specified telephone number.

<TR>

<TD VALIGN="TOP"><TT>echo on|off</TT>

<TD>Turns echo on or off. Echo on makes <TT>dip</TT> display what it&#146;s sending to and receiving from the modem.

<TR>

<TD VALIGN="TOP"><TT>flush</TT>

<TD>Throws away any responses from the modem that haven&#146;t been read yet.

<TR>

<TD VALIGN="TOP"><TT>get $var</TT>

<TD>Sets the variable <TT>$var</TT> to either the constant <TT>ask</TT> or remote constant specified, prompts the user for a value, or takes the next word from the serial line and assigns it to <TT>$var</TT>.

<TR>

<TD><TT>goto <I>label</I></TT>

<TD>Jumps to the specified label in the <TT>dip</TT> script.

<TR>

<TD VALIGN="TOP"><TT>help</TT>

<TD>Displays a listing of available commands in command mode.

<TR>

<TD VALIGN="TOP"><TT>if $var op <I>number</I></TT>

<TD>Performs a conditional branch in a goto label script. <TT>$var</TT> must be one of <TT>$errlvl</TT>, <TT>$locip</TT>, or <TT>$rmtip</TT>. The number must be an integer, and the following operators are available and have their traditional C language meanings: <TT>==</TT>, <TT>!=</TT>, <TT>&lt;</TT>, <TT>&gt;</TT>, <TT>&lt;=</TT>, and <TT>&gt;=</TT>.

<TR>

<TD VALIGN="TOP"><TT>init <I>initstring</I></TT>

<TD>Sets the initialization string sent to the modem by the reset command to <I>initstring</I>.

<TR>

<TD VALIGN="TOP"><TT>mode SLIP|CSLIP</TT>

<TD>Sets the protocol mode for the connection and makes <TT>dip</TT> go into daemon mode. This command normally causes <TT>dip</TT> to go into daemon mode and not return control to the script or the <TT>DIP&gt;</TT> command line.

<TR>

<TD VALIGN="TOP"><TT>modem HAYES</TT>

<TD>Sets the modem type. Only the <TT>HAYES</TT> modem type is now supported. (<TT>HAYES</TT> must be capitalized.)

<TR>

<TD VALIGN="TOP"><TT>netmask <I>mask</I></TT>

<TD>Sets the netmask for the routes <TT>dip</TT> installs to <I>mask</I>.

<TR>

<TD><TT>parity E|O|N</TT>

<TD>Sets the parity of the serial line: even, odd, or none.

<TR>

<TD VALIGN="TOP"><TT>password</TT>

<TD>Prompts the user for a password and retrieves it in a secure manner. This command doesn&#146;t echo the password as you type it.

<TR>

<TD VALIGN="TOP"><TT>print</TT>

<TD>Echoes text to the console <TT>dip</TT> started on. Variables included in the text are replaced with their values.

<TR>

<TD><TT>port <I>dev</I></TT>

<TD>Sets the device <TT>dip</TT> uses.

<TR>

<TD><TT>quit</TT>

<TD>Exits the <TT>dip</TT> program.

<TR>

<TD><TT>reset</TT>

<TD>Sends the init string to the serial line.

<TR>

<TD VALIGN="TOP"><TT>send <I>text</I></TT>

<TD>Sends the specified text to the serial line. The traditional C-style backslash sequences are properly handled.

<TR>

<TD VALIGN="TOP"><TT>sleep <I>num</I></TT>

<TD>Delays processing for the specified number of seconds.

<TR>

<TD><TT>speed <I>num</I></TT>

<TD>Sets the serial line speed.

<TR>

<TD><TT>stopbits <I>bits</I></TT>

<TD>Sets the number of stop bits used by the serial port.

<TR>

<TD VALIGN="TOP"><TT>timeout <I>num</I></TT>

<TD>Sets the default timeout to the integer value <I>num</I>. This is measured in seconds.

<TR>

<TD VALIGN="TOP"><TT>term</TT>

<TD>Makes <TT>dip</TT> go into terminal emulation mode. This allows you to interface directly with the serial link. Pressing &lt;Ctrl&#43;]&gt; returns you to the <TT>DIP&gt;</TT> prompt.

<TR>

<TD VALIGN="TOP"><TT>wait <I>word num</I></TT>

<TD>Makes <TT>dip</TT> wait for the specified word to arrive on the serial line with a timeout of <I>num</I> seconds.

<TR>

<TD COLSPAN="2"><HR>

</TABLE>

<P><TT>dip</TT> also provides a number of variables for your use. Some, such as the local and remote IP addresses, can be set by you; others are read-only and are used for diagnostic and informational purposes. Each variable begins with a dollar sign and must be typed in lowercase letters. Table 29.3 lists these variables and their uses.</P>

<TABLE WIDTH="100%"><CAPTION ALIGN=LEFT><B>Table 29.3</B> Variables Provided by <TT>dip</TT>

<TR>

<TH COLSPAN="2"><HR>

<TR>

<TH WIDTH="20%" ALIGN="LEFT">Variable

<TH WIDTH="80%" ALIGN="LEFT">Description

<TR>

<TH COLSPAN="2"><HR>

<TR>

<TD><TT>$local</TT>

<TD>The host name of the local machine.

<TR>

<TD><TT>$locip</TT>

<TD>The IP address assigned to the local machine.

<TR>

<TD><TT>$remote</TT>

<TD>The host name of the remote machine.

<TR>

<TD><TT>$rmtip</TT>

<TD>The IP address of the remote machine.

<TR>

<TD><TT>$mtu</TT>

<TD>The MTU value for the connection.

<TR>

<TD><TT>$modem</TT>

<TD>The modem type being used (read-only).

<TR>

<TD><TT>$port</TT>

<TD>The name of the serial device <TT>dip</TT> is using (read-only).

<TR>

<TD><TT>$speed</TT>

<TD>The speed setting of the serial device (read-only).

<TR>

<TD VALIGN="TOP"><TT>$errlvl</TT>

<TD>The result code of the last command (read-only) executed. Zero indicates success; any other value is an error.

<TR>

<TD COLSPAN="2"><HR>

</TABLE>

<BLOCKQUOTE>

<P><FONT SIZE="-1"><HR><B>TIP:&nbsp;&nbsp;</B>Setting the <TT>$local</TT> or <TT>$remote</TT> variable to a host name causes <TT>dip</TT> to resolve the host name to its IP address and store that in the respective IP address variable. This saves a step in the scripts you write.<HR></FONT>

</BLOCKQUOTE>

<BLOCKQUOTE>

<P><FONT SIZE="-1"><HR><B>NOTE:&nbsp;&nbsp;</B>You can&#146;t set the read-only variables directly by using the <TT>get</TT> command.<HR></FONT>

</BLOCKQUOTE>

<P><BR></P>

<CENTER>

<TABLE BORDER>

<TR>

<TD><A HREF="559-563.html">Previous</A></TD>

<TD><A HREF="../ewtoc.html">Table of Contents</A></TD>

<TD><A HREF="566-568.html">Next</A></TD>

</TR>

</TABLE>

</CENTER>





</td>
</tr>
</table>

<!-- begin footer information -->





</body></html>

⌨️ 快捷键说明

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