1 // Copyright 2019 Espressif Systems (Shanghai) PTE LTD 2 // 3 // Licensed under the Apache License, Version 2.0 (the "License"); 4 // you may not use this file except in compliance with the License. 5 // You may obtain a copy of the License at 6 7 // http://www.apache.org/licenses/LICENSE-2.0 8 // 9 // Unless required by applicable law or agreed to in writing, software 10 // distributed under the License is distributed on an "AS IS" BASIS, 11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 // See the License for the specific language governing permissions and 13 // limitations under the License. 14 15 #include "esp_netif.h" 16 #include "esp_netif_lwip_internal.h" 17 #include "esp_netif_lwip_ppp.h" 18 19 #ifdef CONFIG_ESP_NETIF_TCPIP_LWIP 20 21 #include "netif/wlanif.h" 22 #include "netif/ethernetif.h" 23 24 // 25 // Purpose of this object is to define default network stack configuration 26 // of basic types of interfaces using lwip network stack 27 // 28 29 static const struct esp_netif_netstack_config s_eth_netif_config = { 30 .lwip = { 31 .init_fn = ethernetif_init, 32 .input_fn = ethernetif_input 33 } 34 }; 35 static const struct esp_netif_netstack_config s_wifi_netif_config_ap = { 36 .lwip = { 37 .init_fn = wlanif_init_ap, 38 .input_fn = wlanif_input 39 } 40 41 }; 42 static const struct esp_netif_netstack_config s_wifi_netif_config_sta = { 43 .lwip = { 44 .init_fn = wlanif_init_sta, 45 .input_fn = wlanif_input 46 } 47 }; 48 49 static const struct esp_netif_netstack_config s_netif_config_ppp = { 50 .lwip_ppp = { 51 .input_fn = esp_netif_lwip_ppp_input, 52 .ppp_events = { 53 .ppp_error_event_enabled = true, 54 .ppp_phase_event_enabled = false 55 } 56 } 57 }; 58 59 60 const esp_netif_netstack_config_t *_g_esp_netif_netstack_default_eth = &s_eth_netif_config; 61 const esp_netif_netstack_config_t *_g_esp_netif_netstack_default_wifi_sta = &s_wifi_netif_config_sta; 62 const esp_netif_netstack_config_t *_g_esp_netif_netstack_default_wifi_ap = &s_wifi_netif_config_ap; 63 const esp_netif_netstack_config_t *_g_esp_netif_netstack_default_ppp = &s_netif_config_ppp; 64 65 #endif /*CONFIG_ESP_NETIF_TCPIP_LWIP*/ 66