Permalink
Cannot retrieve contributors at this time
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
micropython/ports/esp32/ppp_set_auth.c
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
35 lines (27 sloc)
1020 Bytes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* SPDX-FileCopyrightText: 2019-2022 Espressif Systems (Shanghai) CO LTD | |
* | |
* SPDX-License-Identifier: Apache-2.0 | |
*/ | |
// The pppapi_set_auth function was made static in the ESP-IDF, so it's re-added here. | |
// See ESP-IDF commit c67f4c2b4c2bb4b7740f988fc0f8a3e911e56afe | |
#include "ppp_set_auth.h" | |
#if defined(CONFIG_ESP_NETIF_TCPIP_LWIP) && defined(CONFIG_LWIP_PPP_SUPPORT) | |
#include "netif/ppp/pppapi.h" | |
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 |