lwip/linux: Add lwip support for networking component under linux

linux/lwip: Wrap some IO posix functions
* to workaourd the FreeRTOS EINTR issue (when building without lwip)
* to correctly choose the sub-system based on fd (when building with
lwip) -- passing control to either linux/system or to lwip
This commit also addapts tapio-if to provide DHCP client by default and
configurable settings for static IP
This commit is contained in:
David Cermak
2023-04-03 20:31:51 +02:00
committed by David Čermák
parent 0bfffa0160
commit b2af4d9689
31 changed files with 277 additions and 88 deletions

View File

@@ -4,9 +4,13 @@
* SPDX-License-Identifier: Apache-2.0
*/
#pragma once
#ifdef LWIP_HDR_ESP_LWIPOPTS_H
// ignore when included from lwipopts.h since lwip provides all necessary definitions
#else
// otherwise include system fcntl
#include_next <sys/fcntl.h>
#include "sdkconfig.h"
#ifdef LWIP_HDR_LINUX_SYS_SOCKETS_H
// only if we prefer linux system sockets, include from system paths
#include_next <fcntl.h>
#elif CONFIG_IDF_TARGET_LINUX
// need to declare, as on linux we bypass IDF vfs and wrap posix io functions
extern int fcntl(int s, int cmd, ...);
#endif
// ignore otherwise (typically included from lwipopts.h) since lwip provides all necessary definitions