diff --git a/components/esp_netif/lwip/esp_netif_lwip_orig.c b/components/esp_netif/lwip/esp_netif_lwip_orig.c index 0465aee7b8..5610df4e00 100644 --- a/components/esp_netif/lwip/esp_netif_lwip_orig.c +++ b/components/esp_netif/lwip/esp_netif_lwip_orig.c @@ -61,6 +61,29 @@ void dns_clear_servers(bool keep_fallback) dns_setserver(numdns, NULL); } } +#if PPP_SUPPORT && PPP_AUTH_SUPPORT +typedef struct { + struct tcpip_api_call_data call; + ppp_pcb *ppp; + u8_t authtype; + const char *user; + const char *passwd; +} set_auth_msg_t; + +static err_t pppapi_do_ppp_set_auth(struct tcpip_api_call_data *m) +{ + set_auth_msg_t *msg = (set_auth_msg_t *)m; + ppp_set_auth(msg->ppp, msg->authtype, msg->user, msg->passwd); + return ERR_OK; +} + +void pppapi_set_auth(ppp_pcb *pcb, u8_t authtype, const char *user, const char *passwd) +{ + set_auth_msg_t msg = { .ppp = pcb, .authtype = authtype, .user = user, .passwd = passwd}; + tcpip_api_call(pppapi_do_ppp_set_auth, &msg.call); +} + +#endif // PPP_SUPPORT && PPP_AUTH_SUPPORT #ifdef CONFIG_LWIP_GARP_TMR_INTERVAL void netif_send_garp(void *arg) diff --git a/components/esp_netif/lwip/esp_netif_lwip_orig.h b/components/esp_netif/lwip/esp_netif_lwip_orig.h index f3dd2d743d..d39e6a17e0 100644 --- a/components/esp_netif/lwip/esp_netif_lwip_orig.h +++ b/components/esp_netif/lwip/esp_netif_lwip_orig.h @@ -11,6 +11,10 @@ #if defined(CONFIG_ESP_NETIF_TCPIP_LWIP_ORIG) || defined(CONFIG_ESP_NETIF_TCPIP_LWIP) +#if PPP_SUPPORT +typedef struct ppp_pcb_s ppp_pcb; +#endif + /** * @brief Sets one extended lwip netif callbacks for all esp-netif */ @@ -28,6 +32,10 @@ static inline void nd6_set_cb(struct netif *netif, void (*cb)(struct netif *neti void dns_clear_servers(bool keep_fallback); +#if PPP_SUPPORT && PPP_AUTH_SUPPORT +void pppapi_set_auth(ppp_pcb *pcb, u8_t authtype, const char *user, const char *passwd); +#endif + #if ESP_GRATUITOUS_ARP void netif_set_garp_flag(struct netif *netif); diff --git a/components/esp_netif/lwip/esp_netif_lwip_ppp.c b/components/esp_netif/lwip/esp_netif_lwip_ppp.c index 19907219ce..858603f69c 100644 --- a/components/esp_netif/lwip/esp_netif_lwip_ppp.c +++ b/components/esp_netif/lwip/esp_netif_lwip_ppp.c @@ -17,6 +17,7 @@ #include "esp_event.h" #include "esp_netif_ppp.h" #include "esp_netif_lwip_internal.h" +#include "esp_netif_lwip_orig.h" #include #include "lwip/ip6_addr.h" diff --git a/tools/ci/check_copyright_ignore.txt b/tools/ci/check_copyright_ignore.txt index 761712431f..a0d014044f 100644 --- a/tools/ci/check_copyright_ignore.txt +++ b/tools/ci/check_copyright_ignore.txt @@ -475,7 +475,6 @@ components/esp_local_ctrl/src/esp_local_ctrl_transport_ble.c components/esp_netif/include/esp_netif_ppp.h components/esp_netif/include/esp_netif_slip.h components/esp_netif/loopback/esp_netif_loopback.c -components/esp_netif/lwip/esp_netif_lwip_ppp.c components/esp_netif/lwip/esp_netif_lwip_slip.c components/esp_netif/lwip/esp_netif_lwip_slip.h components/esp_netif/private_include/esp_netif_private.h