1.2.5.8 PPP Driver Library

The Point-to-Point Protocol (PPP) is implemented as a driver object that provides APIs for:

  • Notifying of an PPP request operation result

  • Sending an PPP echo request containing user supplied data

  • Cancelling a previously sent PPP echo request

  • Registering a PPP Handler

  • Deregisters a previously registered PPP handler

  • Returning a copy of the current PPP statistics

  • Sending an administrative event

  • Getting the PPP local IPv4 address

  • Getting the PPP remote IPv4 address

  • Getting the PPP current state

Abstraction Model

The Point-to-Point Protocol (PPP) provides a standard method for transporting multi-protocol datagrams over point-to-point links. PPP is comprised of three main components:

  1. A method for encapsulating multi-protocol datagrams.

  2. A Link Control Protocol (LCP) for establishing, configuring, and testing the data-link connection.

  3. A family of Network Control Protocols (NCPs) for establishing and configuring different network-layer protocols.

PPP uses HDLC(High-level Data Link Control) which needs an object to transport PPP frames over a serial interface: asynchronous, synchronous, modems, etc. Currently the asynchronous serial line is supported using the UART plib with ring buffer.

The Point-to-Point Protocol is designed for simple links which transport packets between two peers. These links provide full-duplex simultaneous bi-directional operation, and are assumed to deliver packets in order. It is intended that PPP provide a common solution for easy connection of a wide variety of hosts, bridges and routers.

In the process of configuring, maintaining and terminating the point-to-point link, the PPP link goes through several distinct phases which are specified in the following simplified state diagram:

PPP_PhaseDiagram

Library Interface

NameDescription
Macros
_DRV_PPP_H _This is macro _DRV_PPP_H _
Enumerations
PPP_STATEPPP Transition States
PPP_CTRL_PROTOPPP control protocol identifier
PPP_ECHO_RESULTresult of an PPP Echo Request call
PPP_EVENTPPP event occurring during the driver operation
Types
PPP_REQUEST_HANDLEa handle that a client can use after the event handler has been registered
PPP_EVENT_HANDLEPPP event handle
PPP_EVENT_HANDLERPPP event handler prototype
PPP_STAT_HANDLEPPP statistics handle
PPP_STAT_HANDLERPPP statistics handler prototype
Structures
PPP_ECHO_REQUESTContains the data needed for an PPP request operation
PPP_STATISTICSContains the statistics data maintained by the PPP module
Functions
PPP_ECHO_CALLBACKCallback function notifying of an PPP request operation result
PPP_EchoRequestSends an PPP echo request containing user supplied data
PPP_EchoRequestCancelCancels a previously sent PPP echo request
PPP_EventHandlerRegisterRegisters a PPP Handler
PPP_EventHandlerDeregisterDeregisters a previously registered PPP handler
PPP_StatisticsGetReturns a copy of the current PPP statistics
PPP_StatHandlerRegisterRegisters a PPP Handler
PPP_StatHandlerDeregisterDeregisters a previously registered PPP handler
PPP_SendAdminEventSends an administrative event
PPP_GetLocalIpv4AddrGets the PPP local IPv4 address
PPP_GetRemoteIpv4AddrGets the PPP remote IPv4 address
PPP_GetStateGets the PPP current state