Zephyr API Documentation  3.6.0
A Scalable Open Source RTOS
3.6.0
All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
ppp.h File Reference

Go to the source code of this file.

Data Structures

struct  ppp_api
 PPP L2 API. More...
 
struct  ppp_fsm
 Generic PPP Finite State Machine. More...
 
struct  ppp_my_option_data
 
struct  lcp_options
 
struct  ipcp_options
 
struct  ipv6cp_options
 
struct  ppp_context
 PPP L2 context specific to certain network interface. More...
 

Macros

#define PPP_MRU   CONFIG_NET_PPP_MTU_MRU
 PPP maximum receive unit (MRU)
 
#define PPP_MTU   PPP_MRU
 PPP maximum transfer unit (MTU)
 
#define PPP_MAX_TERMINATE_REASON_LEN   32
 Max length of terminate description string.
 
#define PPP_INTERFACE_IDENTIFIER_LEN   8
 Length of network interface identifier.
 
#define PPP_MY_OPTION_ACKED   BIT(0)
 
#define PPP_MY_OPTION_REJECTED   BIT(1)
 
#define IPCP_NUM_MY_OPTIONS   3
 
#define IPV6CP_NUM_MY_OPTIONS   1
 

Typedefs

typedef void(* net_ppp_lcp_echo_reply_cb_t) (void *user_data, size_t user_data_len)
 A callback function that can be called if a Echo-Reply needs to be received.
 

Enumerations

enum  ppp_protocol_type {
  PPP_IP = 0x0021 , PPP_IPV6 = 0x0057 , PPP_IPCP = 0x8021 , PPP_ECP = 0x8053 ,
  PPP_IPV6CP = 0x8057 , PPP_CCP = 0x80FD , PPP_LCP = 0xc021 , PPP_PAP = 0xc023 ,
  PPP_CHAP = 0xc223 , PPP_EAP = 0xc227
}
 PPP protocol types. More...
 
enum  ppp_phase {
  PPP_DEAD , PPP_ESTABLISH , PPP_AUTH , PPP_NETWORK ,
  PPP_RUNNING , PPP_TERMINATE
}
 PPP phases. More...
 
enum  ppp_state {
  PPP_INITIAL , PPP_STARTING , PPP_CLOSED , PPP_STOPPED ,
  PPP_CLOSING , PPP_STOPPING , PPP_REQUEST_SENT , PPP_ACK_RECEIVED ,
  PPP_ACK_SENT , PPP_OPENED
}
 PPP states, RFC 1661 ch. More...
 
enum  ppp_packet_type {
  PPP_CONFIGURE_REQ = 1 , PPP_CONFIGURE_ACK = 2 , PPP_CONFIGURE_NACK = 3 , PPP_CONFIGURE_REJ = 4 ,
  PPP_TERMINATE_REQ = 5 , PPP_TERMINATE_ACK = 6 , PPP_CODE_REJ = 7 , PPP_PROTOCOL_REJ = 8 ,
  PPP_ECHO_REQ = 9 , PPP_ECHO_REPLY = 10 , PPP_DISCARD_REQ = 11
}
 PPP protocol operations from RFC 1661. More...
 
enum  lcp_option_type {
  LCP_OPTION_RESERVED = 0 , LCP_OPTION_MRU = 1 , LCP_OPTION_ASYNC_CTRL_CHAR_MAP = 2 , LCP_OPTION_AUTH_PROTO = 3 ,
  LCP_OPTION_QUALITY_PROTO = 4 , LCP_OPTION_MAGIC_NUMBER = 5 , LCP_OPTION_PROTO_COMPRESS = 7 , LCP_OPTION_ADDR_CTRL_COMPRESS = 8
}
 LCP option types from RFC 1661 ch. More...
 
enum  ipcp_option_type {
  IPCP_OPTION_RESERVED = 0 , IPCP_OPTION_IP_ADDRESSES = 1 , IPCP_OPTION_IP_COMP_PROTO = 2 , IPCP_OPTION_IP_ADDRESS = 3 ,
  IPCP_OPTION_DNS1 = 129 , IPCP_OPTION_NBNS1 = 130 , IPCP_OPTION_DNS2 = 131 , IPCP_OPTION_NBNS2 = 132
}
 IPCP option types from RFC 1332. More...
 
enum  ipv6cp_option_type { IPV6CP_OPTION_RESERVED = 0 , IPV6CP_OPTION_INTERFACE_IDENTIFIER = 1 }
 IPV6CP option types from RFC 5072. More...
 
enum  ppp_flags { PPP_CARRIER_UP }
 

Functions

void net_ppp_init (struct net_if *iface)
 Initialize PPP L2 stack for a given interface.
 
static void ppp_mgmt_raise_carrier_on_event (struct net_if *iface)
 Raise CARRIER_ON event when PPP is connected.
 
static void ppp_mgmt_raise_carrier_off_event (struct net_if *iface)
 Raise CARRIER_OFF event when PPP is disconnected.
 
static void ppp_mgmt_raise_phase_running_event (struct net_if *iface)
 Raise PHASE_RUNNING event when PPP reaching RUNNING phase.
 
static void ppp_mgmt_raise_phase_dead_event (struct net_if *iface)
 Raise PHASE_DEAD event when PPP reaching DEAD phase.
 
static int net_ppp_ping (int idx, int32_t timeout)
 Send PPP Echo-Request to peer.
 
static struct ppp_contextnet_ppp_context_get (int idx)
 Get PPP context information.