📄 ppplib.html
字号:
<html><head><!-- /vobs/wpwr/docs/vxworks/ref/pppLib.html - generated by refgen from pppLib.c --> <title> pppLib </title></head><body bgcolor="#FFFFFF"> <hr><a name="top"></a><p align=right><a href="libIndex.html"><i>VxWorks Reference Manual : Libraries</i></a></p></blockquote><h1>pppLib</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong>pppLib</strong> - Point-to-Point Protocol library </p></blockquote><h4>ROUTINES</h4><blockquote><p><p><b><i><a href="./pppLib.html#pppInit">pppInit</a></i>( )</b> - initialize a PPP network interface<br><b><i><a href="./pppLib.html#pppDelete">pppDelete</a></i>( )</b> - delete a PPP network interface<br><p></blockquote><h4>DESCRIPTION</h4><blockquote><p>This library implements the VxWorks Point-to-Point Protocol (PPP)facility. PPP allows VxWorks to communicate with other machines by sendingencapsulated multi-protocol datagrams over a point-to-point serial link.VxWorks may have up to 16 PPP interfaces active at any one time. Eachindividual interface (or "unit") operates independent of the state ofother PPP units.<p></blockquote><h4>USER-CALLABLE ROUTINES</h4><blockquote><p>PPP network interfaces are initialized using the <b><i><a href="./pppLib.html#pppInit">pppInit</a></i>( )</b> routine. This routine's parameters specify the unit number, the name of the serial interface (<i>tty</i>) device, Internet (IP) addresses for both ends of the link,the interface baud rate, an optional pointer to a configuration options structure, and an optional pointer to a configuration options file. The <b><i><a href="./pppLib.html#pppDelete">pppDelete</a></i>( )</b> routine deletes a specified PPP interface.<p></blockquote><h4>DATA ENCAPSULATION</h4><blockquote><p>PPP uses HDLC-like framing, in which five header and three trailer octets areused to encapsulate each datagram. In environments where bandwidth is ata premium, the total encapsulation may be shortened to four octets withthe available address/control and protocol field compression options.<p></blockquote><h4>LINK CONTROL PROTOCOL</h4><blockquote><p>PPP incorporates a link-layer protocol called Link Control Protocol (LCP),which is responsible for the link set up, configuration, and termination.LCP provides for automatic negotiation of several link options, includingdatagram encapsulation format, user authentication, and link monitoring(LCP echo request/reply).<p></blockquote><h4>NETWORK CONTROL PROTOCOLS</h4><blockquote><p>PPP's Network Control Protocols (NCP) allow PPP to support different network protocols. VxWorks supports only one NCP, the InternetProtocol Control Protocol (IPCP), which allows the establishment andconfiguration of IP over PPP links. IPCP supports the negotiation of IPaddresses and TCP/IP header compression (commonly called "VJ" compression).<p></blockquote><h4>AUTHENTICATION</h4><blockquote><p>The VxWorks PPP implementation supports two separate user authenticationprotocols: the Password Authentication Protocol (PAP) and theChallenge-Handshake Authentication Protocol (CHAP). While PAP onlyauthenticates at the time of link establishment, CHAP may be configured toperiodically require authentication throughout the life of the link.Both protocols are independent of one another, and either may be configuredin through the PPP options structure or options file.<p></blockquote><h4>IMPLEMENTATION</h4><blockquote><p>Each VxWorks PPP interface is handled by two tasks: the daemon task(tPPP<i>unit</i>) and the write task (tPPP<i>unit</i>Wrt).<p>The daemon task controls the various PPP control protocols (LCP, IPCP, CHAP,and PAP). Each PPP interface has its own daemon task that handles linkset up, negotiation of link options, link-layer user athentication, andlink termination. The daemon task is not used for the actual sending andreceiving of IP datagrams.<p>The write task controls the transmit end of a PPP driver interface.Each PPP interface has its own write task that handles the actual sendingof a packet by writing data to the <i>tty</i> device. Whenever a packet is readyto be sent out, the PPP driver activates this task by giving a semaphore.The write task then completes the packet framing and writesthe packet data to the <i>tty</i> device.<p>The receive end of the PPP interface is implemented as a "hook" intothe <i>tty</i> device driver. The <i>tty</i> driver's receive interrupt service routine(ISR) calls the PPP driver's ISR every time a character is received on theserial channel. When the correct PPP framing character sequence is received,the PPP ISR schedules the tNetTask task to call the PPP input routine.The PPP input routine reads a whole PPP packet out of the <i>tty</i> ringbuffer and processes it according to PPP framing rules.The packet is then queued either to the IP input queue or to the PPP daemontask input queue.<p></blockquote><h4>INCLUDE FILES</h4><blockquote><p><b>pppLib.h</b><p></blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./pppLib.html#top">pppLib</a></b>, <b><a href="./ifLib.html#top">ifLib</a></b>, <b><a href="./tyLib.html#top">tyLib</a></b>, <b><a href="./pppSecretLib.html#top">pppSecretLib</a></b>, <b><a href="./pppShow.html#top">pppShow</a></b>, <i>VxWorks Programmer's Guide: Network</i><br> , <i>RFC-1332: The PPP Internet Protocol Control Protocol (IPCP) </i>, <i>RFC-1334: PPP Authentication Protocols </i>, <i>RFC-1548: The Point-to-Point Protocol (PPP) </i>, <i>RFC-1549: PPP in HDLC Framing </i><p></blockquote><h4>ACKNOWLEDGEMENT</h4><blockquote><p>This program is based on original work done by Paul Mackerras ofAustralian National University, Brad Parker, Greg Christy, Drew D. Perkins,Rick Adams, and Chris Torek.<p><hr><a name="pppInit"></a><p align=right><a href="rtnIndex.html"><i>Libraries : Routines</i></a></p></blockquote><h1><i>pppInit</i>( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong><i>pppInit</i>( )</strong> - initialize a PPP network interface</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>int pppInit ( int unit, /* PPP interface unit number to initialize */ char * devname, /* name of the <i>tty</i> device to be used */ char * local_addr, /* local IP address of the PPP interface */ char * remote_addr, /* remote peer IP address of the PPP link */ int baud, /* baud rate of <i>tty</i>; NULL = default */ PPP_OPTIONS * pOptions, /* PPP options structure pointer */ char * fOptions /* PPP options file name */ )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine initializes a Point-to-Point Protocol (PPP) network interface.The parameters to this routine specify the unit number (<i>unit</i>) of thePPP interface, the name of the serial interface (<i>tty</i>) device (<i>devname</i>),the IP addresses of the local and remote ends of the link, the interfacebaud rate, an optional configuration options structure pointer, and anoptional configuration options file name.<p></blockquote><h4>IP ADDRESSES</h4><blockquote><p><p>The <i>local_addr</i> and <i>remote_addr</i> parameters specify the IP addressesof the local and remote ends of the PPP link, respectively.If <i>local_addr</i> is NULL, the local IP address will be negotiated withthe remote peer. If the remote peer does not assign a local IP address,it will default to the address associated with the local target's machinename. If <i>remote_addr</i> is NULL, the remote peer's IP address will obtainedfrom the remote peer. A routing table entry to the remote peer will beautomatically added once the PPP link is established.<p></blockquote><h4>CONFIGURATION OPTIONS STRUCTURE</h4><blockquote><p><p>The optional parameter <i>pOptions</i> specifies configuration options forthe PPP link. If NULL, this parameter is ignored, otherwise itis assumed to be a pointer to a <b>PPP_OPTIONS</b> options structure (definedin <b>h/netinet/ppp/options.h</b>).<p>The "flags" member of the <b>PPP_OPTIONS</b> structure is a bit-mask, where thefollowing bit-flags may be specified:<dl><dt><b>OPT_NO_ALL</b><dd>Do not request/allow any options.<p><dt><b>OPT_PASSIVE_MODE</b><dd>Set passive mode.<p><dt><b>OPT_SILENT_MODE</b><dd>Set silent mode.<p><dt><b>OPT_DEFAULTROUTE</b><dd>Add default route.<p><dt><b>OPT_PROXYARP</b><dd>Add proxy ARP entry.<p><dt><b>OPT_IPCP_ACCEPT_LOCAL</b><dd>Accept peer's idea of the local IP address.<p><dt><b>OPT_IPCP_ACCEPT_REMOTE</b><dd>Accept peer's idea of the remote IP address.<p><dt><b>OPT_NO_IP</b><dd>Disable IP address negotiation.<p><dt><b>OPT_NO_ACC</b><dd>Disable address/control compression.<p><dt><b>OPT_NO_PC</b><dd>Disable protocol field compression.<p><dt><b>OPT_NO_VJ</b><dd>Disable VJ (Van Jacobson) compression.<p><dt><b>OPT_NO_VJCCOMP</b><dd>Disable VJ (Van Jacobson) connnection ID compression.<p><dt><b>OPT_NO_ASYNCMAP</b><dd>Disable async map negotiation.<p><dt><b>OPT_NO_MN</b><dd>Disable magic number negotiation.<p><dt><b>OPT_NO_MRU</b><dd>Disable MRU (Maximum Receive Unit) negotiation.<p><dt><b>OPT_NO_PAP</b><dd>Do not allow PAP authentication with peer.<p><dt><b>OPT_NO_CHAP</b><dd>Do not allow CHAP authentication with peer.<p><dt><b>OPT_REQUIRE_PAP</b><dd>Require PAP authentication with peer.<p><dt><b>OPT_REQUIRE_CHAP</b><dd>Require CHAP authentication with peer.<p><dt><b>OPT_LOGIN</b><dd>Use the login password database for PAP authentication of peer.<p><dt><b>OPT_DEBUG</b><dd>Enable PPP daemon debug mode.<p><dt><b>OPT_DRIVER_DEBUG</b><dd> Enable PPP driver debug mode. </dl><p>The remaining members of the <b>PPP_OPTIONS</b> structure specify PPP configurationsoptions that require string values. These options are:<dl><dt>char *asyncmap<dd>Set the desired async map to the specified string.<p><dt>char *escape_chars<dd>Set the chars to escape on transmission to the specified string.<p><dt>char *vj_max_slots<dd>Set maximum number of VJ compression header slots to the specified string.<p><dt>char *netmask<dd>Set netmask value for negotiation to the specified string.<p><dt>char *mru<dd>Set MRU value for negotiation to the specified string.<p><dt>char *mtu<dd>Set MTU (Maximum Transmission Unit) value for negotiation to thespecified string.<p><dt>char *lcp_echo_failure<dd>Set the maximum number of consecutive LCP echo failures to the specifiedstring.<p><dt>char *lcp_echo_interval<dd>Set the interval in seconds between LCP echo requests to the specified string.<p><dt>char *lcp_restart<dd>Set the timeout in seconds for the LCP negotiation to the specified string.<p><dt>char *lcp_max_terminate<dd>Set the maximum number of transmissions for LCP termination requeststo the specified string.<p><dt>char *lcp_max_configure<dd>Set the maximum number of transmissions for LCP configurationrequests to the specified string.<p><dt>char *lcp_max_failure<dd>Set the maximum number of LCP configuration NAKs to the specified string.<p><dt>char *ipcp_restart<dd>Set the timeout in seconds for IPCP negotiation to the specified string.<p><dt>char *ipcp_max_terminate<dd>Set the maximum number of transmissions for IPCP termination requeststo the specified string.<p><dt>char *ipcp_max_configure<dd>Set the maximum number of transmissions for IPCP configuration requeststo the specified string.<p><dt>char *ipcp_max_failure<dd>Set the maximum number of IPCP configuration NAKs to the specified string.<p><dt>char *local_auth_name<dd>Set the local name for authentication to the specified string.<p><dt>char *remote_auth_name<dd>Set the remote name for authentication to the specified string.<p><dt>char *pap_file<dd>Get PAP secrets from the specified file. This option is necessaryif either peer requires PAP authentication.<p><dt>char *pap_user_name<dd>Set the user name for PAP authentication with the peer to thespecified string.<p><dt>char *pap_passwd<dd>Set the password for PAP authentication with the peer to the specified string.<p><dt>char *pap_restart<dd>Set the timeout in seconds for PAP negotiation to the specified string.<p><dt>char *pap_max_authreq<dd>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -