偷偷摘套内射激情视频,久久精品99国产国产精,中文字幕无线乱码人妻,中文在线中文a,性爽19p

全析PPP Options選項設(shè)置

網(wǎng)絡(luò) 網(wǎng)絡(luò)管理
下面我們來對PPP Options的具體設(shè)置內(nèi)容進行一下分析和講解。那么通過我們的翻譯和介紹,希望大家能夠?qū)Υ擞兴私狻?/div>

對于一個網(wǎng)絡(luò)協(xié)議來說,我們不僅僅要了解它的定義和概念,更要清楚它的設(shè)置與應(yīng)用。那么今天我們就主要講解一下關(guān)于PPP Options 的相關(guān)內(nèi)容,來幫助大家了解一下具體的選項配置。

Selecting PPP Options Using an Options Structure

PPP options may be set at run-time by filling in a PPP options structure and passing the structure location to the ppp Init( ) routine. This routine is the standard entry point for initializing a PPP link (see Initializing a PPP Link).

The PPP options structure is typedefed to PPP_OPTIONS, and its definition is located in h/netinet/ppp/options.h, which is included through h/pppLib.h.

PPP選項可以在運行的時候設(shè)置,設(shè)置PPP選項結(jié)構(gòu)體并將這個結(jié)構(gòu)體傳給pppInit()函數(shù)。這個函數(shù)是初始化PPP連接的標(biāo)準(zhǔn)入口點(請參考初始化PPP連接)。

The first field of the structure is an integer, flags, which is a bit field that holds the ORed value of the OPT_option macros displayed in column 2 of Table 3-3. Definitions for OPT_option are located in h/netinet/ppp/options.h. The remaining structure fields in column 2 are character pointers to the various PPP options specified by a string.

選項結(jié)構(gòu)體的***個域是整型數(shù),一個標(biāo)志位,是幾個 OPT_xxx或運算之后的值,所有的OPT_xxx可以在Table 3-3中找到。OPT_xxx的定義在h/netinet/ppp/options.h中。。。。(不知所云)

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 (/tyCo/1). 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 tty device. The VJ compression and authentication options have been disabled, and LCP (Link Control Protocol) echo requests have been enabled.

下面的代碼段說明了使用PPP選項結(jié)構(gòu)體配置連接的一種方式。用目標(biāo)機的第二個串口(/tyCo/1)初始化一個PPP連接,本地IP是90.90.0.1,遠(yuǎn)程機器的IP是90.90.0.10,波特率是tty設(shè)備缺省的速率。VJ壓縮和認(rèn)證選項是禁用的,鏈路控制協(xié)議的echo請求是啟用的。

  1. PPP_OPTIONS pppOpt;     /* PPP configuration options */   
  2.    
  3. void routine ()   
  4.     {   
  5.     pppOpt.flags = OPT_PASSIVE_MODE | OPT_NO_PAP | OPT_NO_CHAP |   
  6.                     OPT_NO_VJ;   
  7.     pppOpt.lcp_echo_interval = "30";   
  8.     pppOpt.lcp_echo_failure = "10";   
  9.    
  10.     pppInit (0, "/tyCo/1", "90.0.0.1", "90.0.0.10", 0, &pppOpt, NULL);   
  11.     } 

Setting PPP Options Using an Options File

PPP options are most conveniently set using an options file. There is one restriction: the options file must be readable by the target without there being an active PPP link. Therefore the target must either have a local disk or RAM disk or an additional network connection. For more information about using file systems, see VxWorks Programmer's Guide: Local File Systems.

使用選項文件設(shè)置PPP選項是最方便的。有一個限制:選項文件必須在沒有PPP連接的時候也能夠訪問的到。因此目標(biāo)機必須有一個本地磁盤、RAM或者另外一條網(wǎng)絡(luò)連接。關(guān)于使用文件系統(tǒng)的更多信息,請參考VxWorks程序員指南:本地文件系統(tǒng)。

This configuration method can be used with either usrPPPInit( ) or pppInit( ). It also can be used to modify the selection of PPP options previously configured using configuration constants in config.h or the option structure PPP_OPTION.

When using usrPPPInit( ) to initialize PPP, define the configuration constant PPP_OPTIONS_FILE to be the absolute path name of the options file (NULL by default). When using pppInit( ), pass in a character string that specifies the absolute path name of the options file.

可以使用usrPPPInit()或pppInit()來設(shè)置選項文件。它也可以用來修改之前通過config.h或者PPP_OPTION配置好的選項。

當(dāng)你使用usrPPPInit()初始化一條連接的時候,要定義PPP_OPTIONS_FILE為選項文件的絕對路徑(缺省的是NULL)。使用pppInit()初始化的時候,要傳入一個參數(shù)指定選項文件的絕對路徑。

The options file format is one option per line; comment lines begin with #. For a description of option syntax, see the manual entry for pppInit( ).

The following code fragment generates the same results as the code example in Selecting PPP Options Using an Options Structure. The difference is that the configuration options are obtained from a file rather than a structure.

選項文件的格式是,一個選項占據(jù)一行; 注釋的部分以#開頭。具體的細(xì)節(jié),請參考手冊中的pppInit()。

下面的代碼段的作用和Selecting PPP Options Using an Options Structure中的例子的效果是一樣的。不同的地方是,這里從一個文件獲取配置選項。

  1. pppFile = "mars:/tmp/ppp_options"; /* PPP config. options file */   
  2.    
  3. void routine ()   
  4.     {   
  5.     pppInit (0, "/tyCo/1", "90.0.0.1", "90.0.0.10", 0, NULL, pppFile);   
  6.     }  
  7. In this example, mars:/tmp/ppp_options is a file that contains the following: 

在這里例子里,mars:/tmp/ppp_options包含以下內(nèi)容:
 

  1. passive   
  2. no_pap   
  3. no_chap   
  4. no_vj   
  5. lcp_echo_interval 30   
  6. lcp_echo_failure 10 

 

責(zé)任編輯:佟健 來源: hi.baidu.com
相關(guān)推薦

2010-07-21 16:08:57

telnet命令

2010-09-06 10:47:00

PPP配置

2010-09-09 17:27:43

PPP Multili

2010-09-09 17:31:15

ppp authent

2010-09-29 14:04:25

RHCE DHCP配置

2010-09-16 12:02:44

vpdn pppoe配

2010-09-03 10:23:49

PPP Multili

2010-09-06 13:41:43

PPPPPTP

2010-09-06 14:07:07

PPP Multili

2010-09-03 09:43:37

Linux內(nèi)核PPP

2010-09-06 11:07:07

pppdppp

2010-09-09 17:21:16

2010-09-28 09:20:28

Linux PPP設(shè)置

2009-09-24 12:50:23

Hibernate F

2010-02-22 11:02:55

Python功能

2009-11-10 12:43:45

2011-02-22 15:16:58

2011-02-22 15:07:03

VSFTPD

2010-02-04 13:43:20

Android操作系統(tǒng)

2010-03-01 13:19:21

Python線程內(nèi)容
點贊
收藏

51CTO技術(shù)棧公眾號