作家
登录

全析PPP Options选项设置

作者: 来源: 2012-06-13 04:46:24 阅读 我要评论

对于一个网络协议来说,我们不仅仅要了解它的定义和概念,更要清楚它的设置与应用。那么今天我们就主要讲解一下关于PPP Options 的相关内容,来帮助大家了解一下具体的选项配置。

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选项可以在运行的时候设置,设置PPP选项结构体并将这个结构体传给pppInit()函数。这个函数是初始化PPP连接的标准入口点(请参考初始化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.

选项结构体的第一个域是整型数,一个标志位,是几个 OPT_xxx或运算之后的值,所有的OPT_xxx可以在Table 3-3中找到。OPT_xxx的定义在h/netinet/ppp/options.h中。。。。(不知所云)

The following code fragment is>

  • PPP_OPTIONS pppOpt;     /* PPP configuration options */   
  •    
  • void routine ()   
  •     {   
  •     pppOpt.flags = OPT_PASSIVE_MODE | OPT_NO_PAP | OPT_NO_CHAP |   
  •                     OPT_NO_VJ;   
  •     pppOpt.lcp_echo_interval = "30";   
  •     pppOpt.lcp_echo_failure = "10";   
  •    
  •     pppInit (0, "/tyCo/1", "90.0.0.1", "90.0.0.10", 0, &pppOpt, NULL);   
  •     } 
  • Setting PPP Options Using an Options File

    PPP options are most conveniently set using an options file. There is>

  • pppFile = "mars:/tmp/ppp_options"; /* PPP config. options file */   
  •    
  • void routine ()   
  •     {   
  •     pppInit (0, "/tyCo/1", "90.0.0.1", "90.0.0.10", 0, NULL, pppFile);   
  •     }  
  • In this example, mars:/tmp/ppp_options is a file that contains the following: 
  • 在这里例子里,mars:/tmp/ppp_options包含以下内容:
     

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


      推荐阅读

      网络协议分析软件的应用

    网络的结构具有复杂性,和多变性。那么各种各样的网络协议,掌握起来本就困难,更不要说应用过了。那么这里我们可以借助网络协议分析软件来进行管理。经常遇到有些朋友在问,为什么我只能看到我自己的通讯?为什么我没>>>详细阅读


    本文标题:全析PPP Options选项设置

    地址:http://www.17bianji.com/xieyi/4128.html

    关键词: 探索发现

    乐购科技部分新闻及文章转载自互联网,供读者交流和学习,若有涉及作者版权等问题请及时与我们联系,以便更正、删除或按规定办理。感谢所有提供资讯的网站,欢迎各类媒体与乐购科技进行文章共享合作。

    网友点评
    自媒体专栏

    评论

    热度

    精彩导读
    栏目ID=71的表不存在(操作类型=0)