自拍偷在线精品自拍偷,亚洲欧美中文日韩v在线观看不卡

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

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

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

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選項(xiàng)可以在運(yùn)行的時(shí)候設(shè)置,設(shè)置PPP選項(xiàng)結(jié)構(gòu)體并將這個(gè)結(jié)構(gòu)體傳給pppInit()函數(shù)。這個(gè)函數(shù)是初始化PPP連接的標(biāo)準(zhǔn)入口點(diǎn)(請(qǐng)參考初始化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.

選項(xiàng)結(jié)構(gòu)體的***個(gè)域是整型數(shù),一個(gè)標(biāo)志位,是幾個(gè) OPT_xxx或運(yùn)算之后的值,所有的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.

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

  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.

使用選項(xiàng)文件設(shè)置PPP選項(xiàng)是最方便的。有一個(gè)限制:選項(xiàng)文件必須在沒(méi)有PPP連接的時(shí)候也能夠訪問(wèn)的到。因此目標(biāo)機(jī)必須有一個(gè)本地磁盤(pán)、RAM或者另外一條網(wǎng)絡(luò)連接。關(guān)于使用文件系統(tǒng)的更多信息,請(qǐ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()來(lái)設(shè)置選項(xiàng)文件。它也可以用來(lái)修改之前通過(guò)config.h或者PPP_OPTION配置好的選項(xiàng)。

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

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.

選項(xiàng)文件的格式是,一個(gè)選項(xiàng)占據(jù)一行; 注釋的部分以#開(kāi)頭。具體的細(xì)節(jié),請(qǐng)參考手冊(cè)中的pppInit()。

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

  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é)任編輯:佟健 來(lái)源: 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-16 12:02:44

vpdn pppoe配

2010-09-29 14:04:25

RHCE DHCP配置

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-28 09:20:28

Linux PPP設(shè)置

2010-09-09 17:21:16

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-03-01 13:19:21

Python線程內(nèi)容

2009-09-24 09:18:18

點(diǎn)贊
收藏

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