1 // Copyright 2021 Espressif Systems (Shanghai) CO 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 #ifndef _OPENTHREAD_LWIP_IF_H_ 16 #define _OPENTHREAD_LWIP_IF_H_ 17 18 #include "lwip/netif.h" 19 #include "lwip/err.h" 20 #include "lwip/ip6.h" 21 22 #ifdef __cplusplus 23 extern "C" { 24 #endif 25 26 /** 27 * @brief This function initializes the OpenThread lwIP network interface. 28 * 29 * @param[in] netif The lwIP interface to initialize 30 * 31 * @return 32 * - ERR_OK 33 * 34 */ 35 err_t openthread_netif_init(struct netif *netif); 36 37 /** 38 * @brief This function sends the buffer to the lwIP network interface 39 * 40 * @param[in] netif The lwIP interface to send to. 41 * @param[in] buffer The packet to send. 42 * @param[in] len The length of the buffer. 43 * @param[in] eb Unused. 44 * 45 */ 46 void openthread_netif_input(void *netif, void *buffer, size_t len, void *eb); 47 48 #ifdef __cplusplus 49 } 50 #endif 51 52 #endif /* _OPENTHREAD_LWIP_IF_H_ */ 53