Main Page | Modules | Alphabetical List | Data Structures | Directories | File List | Data Fields | Globals | Related Pages | Examples

PPP
[PPP]

Collaboration diagram for PPP:


Detailed Description

PPP Driver.


Data Structures

struct  _PPPDCB
 PPP interface structure. More...
struct  _PPPDCB
 PPP interface structure. More...

Defines

#define PPP_PFC   0x01
#define PPP_ACFC   0x02
#define LCP_DEFOPT_ASYNCMAP   0x000A0000UL
#define LCP_OPEN   1
#define LCP_CLOSE   2
#define LCP_LOWERUP   3
#define LCP_LOWERDOWN   4

Typedefs

typedef _PPPDCB PPPDCB
 PPP interface type.

Functions

void NutPppInput (NUTDEVICE *dev, NETBUF *nb)
 Handle incoming PPP frames.
int NutPppOutput (NUTDEVICE *dev, u_short type, u_char *ha, NETBUF *nb)
 Send PPP frame.
void NutPppSm (void *arg)
 PPP state machine timeout thread.
int NutPppInitStateMachine (NUTDEVICE *dev)
 Initialize the PPP state machine.
void LcpOpen (NUTDEVICE *dev)
 Trigger LCP open event.
void LcpClose (NUTDEVICE *dev)
 Trigger LCP close event.
void LcpLowerUp (NUTDEVICE *dev)
 Trigger LCP lower up event.
void LcpLowerDown (NUTDEVICE *dev)
 Trigger LCP lower down event.
void IpcpOpen (NUTDEVICE *dev)
 Trigger IPCP open event.
void IpcpClose (NUTDEVICE *dev)
 Trigger IPCP close event.
void IpcpLowerUp (NUTDEVICE *dev)
void IpcpLowerDown (NUTDEVICE *dev)

Variables

NUTDEVICE devPpp
 Device information structure.
u_long new_magic = 0x12345678
IFNET ifn_ppp
 Network interface information structure.
NUTDEVICE devPpp
 Device information structure.


Function Documentation

void NutPppInput NUTDEVICE dev,
NETBUF nb
 

Handle incoming PPP frames.

Splits the PPP frame into the data link and the network part. Then the frame is routed to the proper handler, based on the type field in the header.

Note:
This routine is called by the device driver on incoming PPP frames. Applications typically do not call this function.
Parameters:
dev Identifies the device that received the frame.
nb Pointer to a network buffer structure containing the PPP frame.

int NutPppOutput NUTDEVICE dev,
u_short  type,
u_char ha,
NETBUF nb
 

Send PPP frame.

Send a PPP frame of a given type using the specified device.

Parameters:
dev Identifies the network device to use.
type Type of this frame.
ha Hardware address of the destination, ignored with PPP.
nb Network buffer structure containing the packet to be sent. The structure must have been allocated by a previous call NutNetBufAlloc() and will be freed if this function returns with an error.
Returns:
0 on success, -1 in case of any errors.

NutPppSm void *  arg  ) 
 

PPP state machine timeout thread.

Handles timeouts for LCP and IPCP.

int NutPppInitStateMachine NUTDEVICE dev  ) 
 

Initialize the PPP state machine.

Start the PPP timer thread, if not already running.

Parameters:
dev Pointer to the NUTDEVICE structure of the PPP device.
Returns:
0 on success, -1 otherwise.

void LcpOpen NUTDEVICE dev  ) 
 

Trigger LCP open event.

Enable the link to come up. Typically triggered by the upper layer, when it is enabled.

Parameters:
dev Pointer to the NUTDEVICE structure of the PPP device.

void LcpClose NUTDEVICE dev  ) 
 

Trigger LCP close event.

Disable the link.

Parameters:
dev Pointer to the NUTDEVICE structure of the PPP device.

void LcpLowerUp NUTDEVICE dev  ) 
 

Trigger LCP lower up event.

Parameters:
dev Pointer to the NUTDEVICE structure of the PPP device.

void LcpLowerDown NUTDEVICE dev  ) 
 

Trigger LCP lower down event.

Parameters:
dev Pointer to the NUTDEVICE structure of the PPP device.

void IpcpOpen NUTDEVICE dev  ) 
 

Trigger IPCP open event.

Link is allowed to come up.

Parameters:
dev Pointer to the NUTDEVICE structure of the PPP device.

void IpcpClose NUTDEVICE dev  ) 
 

Trigger IPCP close event.

Disable the link.

Cancel timeouts and either initiate close or possibly go directly to the PPPS_CLOSED state.

Parameters:
dev Pointer to the NUTDEVICE structure of the PPP device.


Variable Documentation

NUTDEVICE devPpp
 

Device information structure.

This is a virtual device driver has no underlying hardware and must not be registered. It will be initialized when the application calls NutNetIfConfig().

IFNET ifn_ppp
 

Initial value:

 {
    IFT_PPP,                    
    {0, 0, 0, 0, 0, 0}
    ,                           
    0,                          
    0,                          
    0,                          
    PPP_MRU,                    
    0,                          
    0,                          
    NutPppInput,                
    0,                          
    NutPppOutput                
}
Network interface information structure.

NUTDEVICE devPpp
 

Initial value:

 {
    0,                          
    {'p', 'p', 'p', 0, 0, 0, 0, 0, 0}
    ,                           
    IFTYP_NET,                  
    0,                          
    0,                          
    &ifn_ppp,                   
    &dcb_ppp,                   
    NutPppInit,                 
    NutPppIOCtl,                
    NutPppRead,                 
    NutPppWrite,                

    NutPppWrite_P,              

    NutPppOpen,                 
    NutPppClose,                
    0                           
}
Device information structure.

This is a virtual device driver has no underlying hardware and must not be registered. It will be initialized when the application calls NutNetIfConfig().


© 2000-2006 by egnite Software GmbH - visit http://www.ethernut.de/