2022-02-14 07:46:21 -05:00
|
|
|
/*
|
2023-09-22 13:10:36 -04:00
|
|
|
* SPDX-FileCopyrightText: 2019-2023 Espressif Systems (Shanghai) CO LTD
|
2022-02-14 07:46:21 -05:00
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
|
|
*/
|
2019-11-11 10:38:43 -05:00
|
|
|
|
|
|
|
#ifndef _ESP_NETIF_LWIP_PPP_H_
|
|
|
|
#define _ESP_NETIF_LWIP_PPP_H_
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief Creates new PPP related structure
|
2023-09-22 13:10:36 -04:00
|
|
|
* This needs to be called withing lwIP context
|
2019-11-11 10:38:43 -05:00
|
|
|
*
|
|
|
|
* @param[in] esp_netif pointer esp-netif instance
|
|
|
|
* @param[in] stack_config TCP/IP stack configuration structure
|
|
|
|
*
|
|
|
|
* @return
|
|
|
|
* - pointer to ppp-netif object on success
|
|
|
|
* - NULL otherwise
|
|
|
|
*/
|
2020-06-12 10:43:34 -04:00
|
|
|
netif_related_data_t * esp_netif_new_ppp(esp_netif_t *esp_netif, const esp_netif_netstack_config_t *esp_netif_stack_config);
|
2019-11-11 10:38:43 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief Creates new PPP related structure
|
2023-09-22 13:10:36 -04:00
|
|
|
* This needs to be called withing lwIP context
|
2019-11-11 10:38:43 -05:00
|
|
|
*
|
2020-11-25 10:37:36 -05:00
|
|
|
* @param[in] esp_netif pointer esp-netif instance
|
2019-11-11 10:38:43 -05:00
|
|
|
*
|
|
|
|
* @return
|
|
|
|
* - ESP_OK on success
|
|
|
|
*/
|
2020-11-25 10:37:36 -05:00
|
|
|
esp_err_t esp_netif_start_ppp(esp_netif_t *esp_netif);
|
2019-11-11 10:38:43 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief Data path API to input incoming packets to PPP
|
|
|
|
*
|
|
|
|
* @param[in] ppp pointer to internal ppp context instance
|
|
|
|
* @param[in] buffer pointer to the incoming data
|
|
|
|
* @param[in] len length of the data
|
|
|
|
* @param[in] eb external buffer ptr not used here (to be inline with input function prototypes)
|
|
|
|
*
|
|
|
|
* @return
|
|
|
|
* - ESP_OK on success
|
|
|
|
*/
|
2023-03-27 06:54:25 -04:00
|
|
|
esp_netif_recv_ret_t esp_netif_lwip_ppp_input(void *ppp, void *buffer, size_t len, void *eb);
|
2019-11-11 10:38:43 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief Destroys the ppp netif object
|
2023-09-22 13:10:36 -04:00
|
|
|
* This needs to be called withing lwIP context
|
2019-11-11 10:38:43 -05:00
|
|
|
*
|
2020-06-12 10:43:34 -04:00
|
|
|
* @param[in] netif_related pointer to internal ppp context instance
|
2019-11-11 10:38:43 -05:00
|
|
|
*/
|
2020-06-12 10:43:34 -04:00
|
|
|
void esp_netif_destroy_ppp(netif_related_data_t *netif_related);
|
2019-11-11 10:38:43 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief Stops the PPP interface
|
2023-09-22 13:10:36 -04:00
|
|
|
* This needs to be called withing lwIP context
|
2019-11-11 10:38:43 -05:00
|
|
|
*
|
2020-06-12 10:43:34 -04:00
|
|
|
* @param[in] netif_related pointer to internal ppp context instance
|
2019-11-11 10:38:43 -05:00
|
|
|
*
|
|
|
|
* @return
|
|
|
|
* - ESP_OK on success
|
|
|
|
*/
|
2020-06-12 10:43:34 -04:00
|
|
|
esp_err_t esp_netif_stop_ppp(netif_related_data_t *netif_related);
|
2019-11-11 10:38:43 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief Sets default netif for routing priority config
|
2023-09-22 13:10:36 -04:00
|
|
|
* This needs to be called withing lwIP context
|
2019-11-11 10:38:43 -05:00
|
|
|
*
|
2020-02-11 04:27:46 -05:00
|
|
|
* @note: This function must be called from lwip thread
|
|
|
|
*
|
2019-11-11 10:38:43 -05:00
|
|
|
*/
|
2020-06-12 10:43:34 -04:00
|
|
|
void esp_netif_ppp_set_default_netif(netif_related_data_t *netif_related);
|
2019-11-11 10:38:43 -05:00
|
|
|
|
2023-09-22 13:10:36 -04:00
|
|
|
/**
|
|
|
|
* @brief Set PPP auth internal version (TCPIP context must be locked)
|
|
|
|
* This needs to be called withing lwIP context
|
|
|
|
*
|
|
|
|
* For params/return value description, please @refitem esp_netif_ppp_set_auth()
|
|
|
|
*/
|
|
|
|
esp_err_t esp_netif_ppp_set_auth_internal(esp_netif_t *netif, esp_netif_auth_type_t authtype, const char *user, const char *passwd);
|
2020-09-11 18:37:28 -04:00
|
|
|
|
|
|
|
#endif // _ESP_NETIF_LWIP_PPP_H_
|