usrPPPInit()函数应用(中英对照)

网络 网络管理
下面我们来对usrPPPInit()的内容进行一下介绍。在这里面,我们主要参考了一些资料,进行了翻译。还望对大家有用。

在这里我们主要介绍一下usrPPPInit()的语法应用。这里我们就针对这方面知识进行一下总结。这里我们搜集了一些参考资料进行一下中英文对照。希望对大家有所帮助。下面看看具体内容吧。

Using PPP 使用PPP

After it is configured and initialized, PPP attaches itself into the VxWorks TCP/IP stack at the driver (link) layer. After a PPP link has been established with the remote peer, all normal VxWorks IP networking facilities are available; the PPP connection is transparent to the user.

经过配置和初始化后,PPP就将自己绑定在VxWorks TCP/IP栈的驱动层中了。(VxWorks目标机)和远程主机建立PPP连接之后,所有的VxWorks IP网络功能都是可用的,PPP连接对用户是透明的。

Initializing a PPP Link 初始化一条PPP连接

A PPP link is initialized by calls to either usrPPPInit( ) or pppInit( ). When either of these routines is invoked, the remote peer should be initialized. When a peer is running in passive mode, it must be initialized first (see PPP Options.)

The usrPPPInit( )routine is in config/all/bootConfig.c and src/config/usrNetwork.c. There are four ways it can be called:

If the boot device is set to ppp, usrPPPInit( ) is called as follows:

可以使用usrPPPInit()或pppInit()初始化一条PPP连接。当调用两个之中的任一个函数时,远程主机应该进行初始化。处于被动方的节点,应该先进行初始化(参考PPP 选项)。

usrPPPInit()函数在config/all/bootConfig.c和src/config/usrNetwork.c中,有四种方式调用它:

如果启动设备设置了ppp,usrPPPInit()如下调用:

From( )bootConfig.c when booting from boot ROMs. 从ROM启动时在bootConfig.c里调用。

From usrNetwork.c when booting from VxWorks boot code. 从VxWorks启动代码启动时在usrNetWorks.c里调用。

The PPP interface can also be initialized by calling usrPPPInit( ): 也可以以下面的方式调用usrPPPInit( ):

From the VxWorks shell. 从VxWorks shell里调用。

By user application code. 从用户应用程序代码里调用。

Use either syntax when calling usrPPPInit( ): 可以使用下面两种语法调用usrPPPInit():

usrPPPInit ("bootDevice", unitNum, "localIPAddress", "remoteIPAddress")

usrPPPInit ("bootDevice", unitNum, "localHostName", "remoteHostName")

You can use host names in usrPPPInit( ) provided the hosts have been previously added to the host database. For example, you can call usrPPPInit( ) in the following way:

你可以在usrPPPInit()中使用机器名(之前添加到主机数据库里的),例如,你可以用以下的方式调用:

usrPPPInit ("ppp=/tyCo/1,38400", 1, "147.11.90.1", "147.11.90.199")

The usrPPPInit( ) routine calls pppInit( ), which initializes PPP with the configuration options that were specified at compile-time (see Selecting PPP Options By Configuring VxWorks). The pppInit( ) routine can be called multiple times to initialize multiple channels.2 The connection timeout is specified by PPP_CONNECT_DELAY. The return value of this routine indicates whether the link has been successfully established--if the return value is OK, the network connection should be fully operational.

usrPPPInit()函数调用pppInit(), 它使用编译的时候配置好的选项初始化PPP(Selecting PPP Options By Configuring VxWorks)。pppInit()函数可以多次调用以初始化多个连接,可以用PPP_CONNECT_DELAY来指定连接time out的时间。如果连接建立成功,就返回OK,所有网络的功能就都可以使用了。

The pppInit( ) routine is the standard entry point for initializing a PPP link. All available PPP options can be set using parameters specified for this routine (see Selecting PPP Options Using an Options Structure). Unlike usrPPPInit( ), the return value of pppInit( ) does not indicate the status of the PPP link; it merely reports whether the link could be initialized. To check whether the link is actually established, call pppInfoGet( ) and make sure that the state of IPCP is OPENED. The following code fragment demonstrates use of this mechanism for PPP unit 2:

pppInit()是标准的PPP初始化函数。所有可用的PPP选项都可以通过参数传递给pppInit()(see Selecting PPP Options Using an Options Structure)。不像usrPPPInit(), pppInit()的返回值不指示连接的状态,它仅仅报告连接是否进行了初始化。要检查是否真正建立了连接,调用函数pppInfoGet()(之前先确保IPCP的状态是OPENED)。下面的代码段演示了这个机制:

PPP_INFO     pppInfo;

if ((pppInfoGet (2, &pppInfo) == OK) &&

(pppInfo.ipcp_fsm.state == OPENED))

return (OK);                            /* link established */

else

return (ERROR);                         /* link down */
 

责任编辑:佟健 来源: hi.baidu.com
相关推荐

2010-09-17 14:07:07

SIP中继

2009-08-02 08:50:01

2011-04-22 14:11:38

传真机

2011-06-02 09:47:23

传真机技巧

2011-09-02 17:30:32

英语iKnowAndroid应用

2009-07-22 07:42:00

Scala偏应用函数

2010-11-29 10:53:14

Sybase日期函数

2009-12-02 16:40:48

路由器怎么安装

2013-04-16 10:24:33

函数偏函数编程语言

2011-03-30 11:01:13

C语言随机

2010-06-18 10:33:03

Linux Acces

2024-03-12 10:36:06

函数指针代码

2009-12-11 10:59:48

PHP函数extrac

2010-06-10 17:47:48

Zabbix中文

2010-06-07 12:56:58

Zabbix中文

2009-12-08 09:51:10

PHP intval函

2009-07-17 10:42:06

Swing应用程序处理函数

2010-02-02 10:07:59

C++全局函数

2010-07-26 14:06:43

Perl substr

2014-12-24 10:27:55

HypericHQ开源监控工具
点赞
收藏

51CTO技术栈公众号