1
6
7
8
9
10
11
12
13
14
15
16
17
18
21
36
37
42
43
44
47
48
49
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
85
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
/* ... */
#ifndef _ESP_NETIF_PPP_H_
#define _ESP_NETIF_PPP_H_
#ifdef __cplusplus
extern "C" {
#endif
ESP_EVENT_DECLARE_BASE(NETIF_PPP_STATUS);
/* ... */
typedef struct esp_netif_ppp_config {
bool ppp_phase_event_enabled;
bool ppp_error_event_enabled;
#ifdef CONFIG_LWIP_ENABLE_LCP_ECHO
bool ppp_lcp_echo_disabled;
/* ... */
/* ... */#endif
#ifdef CONFIG_LWIP_PPP_SERVER_SUPPORT
esp_ip4_addr_t ppp_our_ip4_addr;
esp_ip4_addr_t ppp_their_ip4_addr; /* ... */
#endif
}{ ... } esp_netif_ppp_config_t;
/* ... */
#define NETIF_PP_PHASE_OFFSET (0x100)
/* ... */
#define NETIF_PPP_INTERNAL_ERR_OFFSET (0x200)
/* ... */
typedef enum {
NETIF_PPP_ERRORNONE = 0,
NETIF_PPP_ERRORPARAM = 1,
NETIF_PPP_ERROROPEN = 2,
NETIF_PPP_ERRORDEVICE = 3,
NETIF_PPP_ERRORALLOC = 4,
NETIF_PPP_ERRORUSER = 5,
NETIF_PPP_ERRORCONNECT = 6,
NETIF_PPP_ERRORAUTHFAIL = 7,
NETIF_PPP_ERRORPROTOCOL = 8,
NETIF_PPP_ERRORPEERDEAD = 9,
NETIF_PPP_ERRORIDLETIMEOUT = 10,
NETIF_PPP_ERRORCONNECTTIME = 11,
NETIF_PPP_ERRORLOOPBACK = 12,
NETIF_PPP_PHASE_DEAD = NETIF_PP_PHASE_OFFSET + 0,
NETIF_PPP_PHASE_MASTER = NETIF_PP_PHASE_OFFSET + 1,
NETIF_PPP_PHASE_HOLDOFF = NETIF_PP_PHASE_OFFSET + 2,
NETIF_PPP_PHASE_INITIALIZE = NETIF_PP_PHASE_OFFSET + 3,
NETIF_PPP_PHASE_SERIALCONN = NETIF_PP_PHASE_OFFSET + 4,
NETIF_PPP_PHASE_DORMANT = NETIF_PP_PHASE_OFFSET + 5,
NETIF_PPP_PHASE_ESTABLISH = NETIF_PP_PHASE_OFFSET + 6,
NETIF_PPP_PHASE_AUTHENTICATE = NETIF_PP_PHASE_OFFSET + 7,
NETIF_PPP_PHASE_CALLBACK = NETIF_PP_PHASE_OFFSET + 8,
NETIF_PPP_PHASE_NETWORK = NETIF_PP_PHASE_OFFSET + 9,
NETIF_PPP_PHASE_RUNNING = NETIF_PP_PHASE_OFFSET + 10,
NETIF_PPP_PHASE_TERMINATE = NETIF_PP_PHASE_OFFSET + 11,
NETIF_PPP_PHASE_DISCONNECT = NETIF_PP_PHASE_OFFSET + 12,
NETIF_PPP_CONNECT_FAILED = NETIF_PPP_INTERNAL_ERR_OFFSET + 0,
}{ ... } esp_netif_ppp_status_event_t;
/* ... */
typedef enum {
NETIF_PPP_AUTHTYPE_NONE = 0x00,
NETIF_PPP_AUTHTYPE_PAP = 0x01,
NETIF_PPP_AUTHTYPE_CHAP = 0x02,
NETIF_PPP_AUTHTYPE_MSCHAP = 0x04,
NETIF_PPP_AUTHTYPE_MSCHAP_V2 = 0x08,
NETIF_PPP_AUTHTYPE_EAP = 0x10,
}{ ... } esp_netif_auth_type_t;
/* ... */
esp_err_t esp_netif_ppp_set_auth(esp_netif_t *netif, esp_netif_auth_type_t authtype, const char *user, const char *passwd);
/* ... */
esp_err_t esp_netif_ppp_set_params(esp_netif_t *netif, const esp_netif_ppp_config_t *config);
/* ... */
esp_err_t esp_netif_ppp_get_params(esp_netif_t *netif, esp_netif_ppp_config_t *config);
#ifdef __cplusplus
}{...}
#endif
/* ... */
#endif