1 /* 2 * SPDX-FileCopyrightText: 2019-2022 Espressif Systems (Shanghai) CO LTD 3 * 4 * SPDX-License-Identifier: Apache-2.0 5 */ 6 7 #ifndef _ESP_NETIF_LWIP_PPP_H_ 8 #define _ESP_NETIF_LWIP_PPP_H_ 9 10 /** 11 * @brief Creates new PPP related structure 12 * 13 * @param[in] esp_netif pointer esp-netif instance 14 * @param[in] stack_config TCP/IP stack configuration structure 15 * 16 * @return 17 * - pointer to ppp-netif object on success 18 * - NULL otherwise 19 */ 20 netif_related_data_t * esp_netif_new_ppp(esp_netif_t *esp_netif, const esp_netif_netstack_config_t *esp_netif_stack_config); 21 22 /** 23 * @brief Creates new PPP related structure 24 * 25 * @param[in] esp_netif pointer esp-netif instance 26 * 27 * @return 28 * - ESP_OK on success 29 */ 30 esp_err_t esp_netif_start_ppp(esp_netif_t *esp_netif); 31 32 /** 33 * @brief Data path API to input incoming packets to PPP 34 * 35 * @param[in] ppp pointer to internal ppp context instance 36 * @param[in] buffer pointer to the incoming data 37 * @param[in] len length of the data 38 * @param[in] eb external buffer ptr not used here (to be inline with input function prototypes) 39 * 40 * @return 41 * - ESP_OK on success 42 */ 43 esp_netif_recv_ret_t esp_netif_lwip_ppp_input(void *ppp, void *buffer, size_t len, void *eb); 44 45 /** 46 * @brief Destroys the ppp netif object 47 * 48 * @param[in] netif_related pointer to internal ppp context instance 49 */ 50 void esp_netif_destroy_ppp(netif_related_data_t *netif_related); 51 52 /** 53 * @brief Stops the PPP interface 54 * 55 * @param[in] netif_related pointer to internal ppp context instance 56 * 57 * @return 58 * - ESP_OK on success 59 */ 60 esp_err_t esp_netif_stop_ppp(netif_related_data_t *netif_related); 61 62 /** 63 * @brief Sets default netif for routing priority config 64 * 65 * @note: This function must be called from lwip thread 66 * 67 */ 68 void esp_netif_ppp_set_default_netif(netif_related_data_t *netif_related); 69 70 71 #endif // _ESP_NETIF_LWIP_PPP_H_ 72