Introduce the lwIP network stack
Subsystems (7)
v2 cover Introduce the lwIP network stack
This is a rework of a patch series by Maxim Uvarov: "net/lwip: add lwip library for the network stack" [1]. The goal is to introduce the lwIP TCP/IP stack [2] [3] as an alternative to the current implementation in net/, selectable with Kconfig, and ultimately keep only lwIP if possible. Some reasons for doing so are:
- Make the support of HTTPS in the wget command easier. Javier T. (CC'd) has some additional lwIP and Mbed TLS patches to do so. With that it becomes possible to fetch and launch a distro installer such as Debian etc. directly from the U-Boot shell.
- Possibly benefit from additional features implemented in lwIP
- Less code to maintain in U-Boot
The first patch introduces a new Kconfig symbol: NET_LWIP, which selects the lwIP implementation instead of the current one (NET). Contrary to the approach chosen by Maxim in [1], NET_LWIP and NET cannot be enabled simultaneously. The rationale is we want to start from a clean state and not pull potentially duplicated functionality from both stacks. Note however that a few files are still built in net/, they are the ones related to ethernet device management and the ethernet bootflow.
The second patch imports the lwIP code as a Git subtree under lib/lwip/lwip. Some glue code is added under lib/lwip/u-boot.
The third patch introduces the Makefile to build lwIP when CONFIG_NET_LWIP=y.
The subsequent patches implement various network-oriented commands and
features: dhcp, dns, ping, tftpboot, wget.
NET_LWIP is not enabled by default because it lacks functionality compared to NET and many CI tests would fail to run or even build.
Some tests (dm dsa/eth) are disabled when NET_LWIP is selected because they make strong assumptions on how the network stack is implemented and how the packet flow occurs. For example, an ARP exchange is expected when an ICMP packet goes out, but with lwIP no exchange will occur if the host IP is already in the the ARP cache.
Due to the above and in order to provide some level of testing, a new QEMU configuration is introduced (qemu_arm64_lwip_defconfig) which is the same as qemu_arm64_lwip_defconfig but with NET_LWIP and CMD_*_LWIP enabled. Tests are added to test/py/tests/test_net.py for that configuration.
Changes in v2:
** Address comments from Ilias A.
- "net-lwip: add wget command"
Implement the wget_with_dns() function to do most of the wget work and call it from do_wget(). This allows to simplify patch "net-lwip: add support for EFI_HTTP_BOOT".
- "net-lwip: import net command from cmd/net.c"
Move a few functions from cmd/net.c to a new file cmd/net-common.c rather than duplicating then in cmd/net-lwip.c.
- "net-lwip: add support for EFI_HTTP_BOOT"
Since wget_with_dns() is now implemented in "net-lwip: add wget command", just enable the wget command when the lwIP stack is enabled and EFI_HTTP_BOOT is requested.
** Address comments from Tom R.
- "net-lwip: add DHCP support and dhcp commmand", "net-lwip: add TFTP support and tftpboot command", "net-lwip: add ping command",
"net-lwip: add dns command",
"net-lwip: add wget command"
Do not introduce new CMD_XXX_LWIP symbols and use existing CMD_XXX instead.
- "configs: add qemu_arm64_lwip_defconfig"
Use #include <configs/qemu_arm64_defconfig>.
- "net-lwip: import lwIP library under lib/lwip"
Patch removed and replaced by the introduction of a Git subtree:
"Squashed 'lib/lwip/lwip/' content from commit 0a0452b2c3".
Note that I have not yet addressed your comments on "test: dm: dsa,
eth: disable tests when CONFIG_NET_LWIP=y"). I need some more time for that and I think running CI on this v2 will help better understand what is needed for v3.
** Miscellaneous improvements
- "net: introduce alternative implementation as net-lwip/":
* Make DFU_OVER_TFTP not DFU_TFTP incompatible with NET_LWIP. It seems quite natural to supplement "depends on NET" with "&& !NET_LWIP".
* Make PROT_*_LWIP not visible by removing the Kconfig prompt.
[1] https://lore.kernel.org/all/[email protected]/
[2] https://www.nongnu.org/lwip/
[3] https://en.wikipedia.org/wiki/LwIP
Jerome Forissier (14):
net: introduce alternative implementation as net-lwip/ Squashed 'lib/lwip/lwip/' content from commit 0a0452b2c39
net-lwip: build lwIP
net-lwip: add DHCP support and dhcp commmand
net-lwip: add TFTP support and tftpboot command
net-lwip: add ping command
net-lwip: add dns command
net-lwip: add wget command
test: dm: dsa, eth: disable tests when CONFIG_NET_LWIP=y
cmd: bdinfo: enable -e when CONFIG_CMD_NET_LWIP=y
configs: add qemu_arm64_lwip_defconfig
test/py: net: add _lwip variants of dhcp, ping and tftpboot tests
MAINTAINERS: net-lwip: add myself as a maintainer
CI: add qemu_arm64_lwip to the test matrix
Signature · 1 line
2.40.1
PATCH v2 3/14 net-lwip: build lwIP
Build the lwIP library when NET_LWIP is enabled. The following files are adaptation layers written specially for U-Boot:
lib/lwip/u-boot/arch/cc.h
lib/lwip/u-boot/arch/sys_arch.h (empty)
lib/lwip/u-boot/limits.h (empty)
lib/lwip/u-boot/lwipopts.h
They were initially contributed by Maxim in a previous RFC patch series.
--- lib/Makefile | 2 + lib/lwip/Makefile | 57 +++++++++ lib/lwip/u-boot/arch/cc.h | 43 +++++++ lib/lwip/u-boot/arch/sys_arch.h | 0 lib/lwip/u-boot/limits.h | 0 lib/lwip/u-boot/lwipopts.h | 197 ++++++++++++++++++++++++++++++++ net-lwip/Kconfig | 3 +- 7 files changed, 301 insertions(+), 1 deletion(-) create mode 100644 lib/lwip/Makefile create mode 100644 lib/lwip/u-boot/arch/cc.h create mode 100644 lib/lwip/u-boot/arch/sys_arch.h create mode 100644 lib/lwip/u-boot/limits.h create mode 100644 lib/lwip/u-boot/lwipopts.h
lib/Makefile +2 -0
@@ -94,6 +94,8 @@ obj-$(CONFIG_LIBAVB) += libavb/ obj-$(CONFIG_$(SPL_TPL_)OF_LIBFDT) += libfdt/ obj-$(CONFIG_$(SPL_TPL_)OF_REAL) += fdtdec_common.o fdtdec.o +obj-$(CONFIG_NET_LWIP) += lwip/ + ifdef CONFIG_SPL_BUILD obj-$(CONFIG_SPL_YMODEM_SUPPORT) += crc16-ccitt.o obj-$(CONFIG_$(SPL_TPL_)HASH) += crc16-ccitt.o
lib/lwip/Makefile new file +57 -0
57 lines not on this page · raw message
lib/lwip/u-boot/arch/cc.h new file +43 -0
43 lines not on this page · raw message
lib/lwip/u-boot/arch/sys_arch.h new file +0 -0
lib/lwip/u-boot/limits.h new file +0 -0
lib/lwip/u-boot/lwipopts.h new file +197 -0
197 lines not on this page · raw message
net-lwip/Kconfig +2 -1
@@ -12,4 +12,5 @@ menuconfig NET_LWIP depend on CONFIG_NET (such as cmd/net.c enabled via CONFIG_CMD_NET). Therefore the two symbols CONFIG_NET and CONFIG_NET_LWIP are mutually exclusive. - NOTE: This is currently a placeholder. + NOTE: This currently only builds the lwIP library but does not add + any functionality to U-Boot.
Signature · 1 line
2.40.1
PATCH v2 5/14 net-lwip: add TFTP support and tftpboot command
In reply to Jerome ForissierImplement do_tftpb().
--- cmd/Kconfig | 3 +- cmd/net-lwip.c | 8 ++ net-lwip/dhcp.c | 11 ++- net-lwip/tftp.c | 206 +++++++++++++++++++++++++++++++++++++++++++++++- 4 files changed, 223 insertions(+), 5 deletions(-)
cmd/Kconfig +1 -2
@@ -2101,10 +2101,9 @@ config CMD_DHCP config CMD_TFTPBOOT bool "tftp" select PROT_UDP_LWIP - default n + default y help tftpboot - load file via network using TFTP protocol - Currently a placeholder (not implemented) endif
cmd/net-lwip.c +8 -0
@@ -11,3 +11,11 @@ U_BOOT_CMD("[loadAddress] [[hostIPaddr:]bootfilename]" );#endif + +#if defined(CONFIG_CMD_TFTPBOOT ) +U_BOOT_CMD ( + tftpboot,3 ,0 , do_tftpb, +"boot image via network using TFTP protocol\n" , +"[loadAddress] [[hostIPaddr:]bootfilename]" +); +#endif
net-lwip/dhcp.c +10 -1
@@ -94,11 +94,20 @@ int do_dhcp(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])int dhcp_run (ulong addr,const char *fname,bool autoload) {char *dhcp_argv[] = {"dhcp" ,NULL , }; +#ifdef CONFIG_CMD_TFTPBOOT +char *tftp_argv[] = {"tftpboot" , boot_file_name,NULL , }; +#endif struct cmd_tbl cmdtp = {};/* dummy */ if (autoload) { -/* Will be supported when TFTP is added */ +#ifdef CONFIG_CMD_TFTPBOOT +/* Assume DHCP was already performed */ +if (boot_file_name[0 ]) +return do_tftpb (&cmdtp,0 ,2 , tftp_argv); +return 0 ; +#else return -EOPNOTSUPP ; +#endif }return do_dhcp (&cmdtp,0 ,1 , dhcp_argv);
net-lwip/tftp.c +204 -2
214 lines not on this page · raw message
Signature · 1 line
2.40.1
PATCH v2 6/14 net-lwip: add ping command
In reply to Jerome ForissierAdd support for the the ping command with NET_LWIP. The implementation is derived from lwIP's contrib/apps/ping/ping.c.
--- boot/Kconfig | 2 +- cmd/Kconfig | 6 ++ cmd/net-lwip.c | 8 +++ include/net-lwip.h | 3 + net-lwip/Makefile | 1 + net-lwip/ping.c | 171 +++++++++++++++++++++++++++++++++++++++++++++ 6 files changed, 190 insertions(+), 1 deletion(-) create mode 100644 net-lwip/ping.c
boot/Kconfig +1 -1
@@ -379,7 +379,7 @@ config BOOT_DEFAULTS_CMDS select CMD_FS_GENERIC select CMD_PART if PARTITIONS select CMD_DHCP if CMD_NET || CMD_NET_LWIP - select CMD_PING if CMD_NET + select CMD_PING if CMD_NET || CMD_NET_LWIP select CMD_PXE if CMD_NET select CMD_BOOTI if ARM64 select CMD_BOOTZ if ARM && !ARM64
cmd/Kconfig +6 -0
@@ -2098,6 +2098,12 @@ config CMD_DHCP help Boot image via network using DHCP/TFTP protocol +config CMD_PING + bool "ping" + select PROT_RAW_LWIP + help + Send ICMP ECHO_REQUEST to network host + config CMD_TFTPBOOT bool "tftp" select PROT_UDP_LWIP
cmd/net-lwip.c +8 -0
@@ -12,6 +12,14 @@ U_BOOT_CMD( );#endif +#if defined(CONFIG_CMD_PING ) +U_BOOT_CMD ( + ping,2 ,1 , do_ping, +"send ICMP ECHO_REQUEST to network host" , +"pingAddress" +); +#endif +#if defined(CONFIG_CMD_TFTPBOOT ) U_BOOT_CMD( tftpboot, 3, 0, do_tftpb,
include/net-lwip.h +3 -0
@@ -5,6 +5,7 @@#include <asm/cache.h> #include <linux/types.h> +#include <lwip/ip_addr.h> #include <lwip/netif.h> #include <time.h>
@@ -50,6 +51,7 @@ int eth_env_get_enetaddr_by_index(const char *base_name, int index,int eth_init (void );/* Initialize the device */ int eth_send (void *packet,int length);/* Send a packet */ int eth_rx (void ); +const char *eth_get_name (void );int eth_get_dev_index (void );int eth_init_state_only (void );/* Set active state */ void eth_set_current (void );/* set nterface to ethcur var */
@@ -80,6 +82,7 @@ int net_lwip_init(void);struct netif *net_lwip_get_netif (void );int do_dhcp (struct cmd_tbl *cmdtp,int flag,int argc,char *const argv[]); +int do_ping (struct cmd_tbl *cmdtp,int flag,int argc,char *const argv[]);int do_tftpb (struct cmd_tbl *cmdtp,int flag,int argc,char *const argv[]);#endif /* __NET_LWIP_H__ */
net-lwip/Makefile +1 -0
@@ -7,6 +7,7 @@ obj-$(CONFIG_$(SPL_)DM_ETH) += ../net/eth_common.o obj-$(CONFIG_$(SPL_)DM_ETH) += ../net/eth-uclass.o obj-$(CONFIG_$(SPL_)DM_ETH) += net-lwip.o obj-$(CONFIG_CMD_DHCP) += dhcp.o +obj-$(CONFIG_CMD_PING) += ping.o obj-$(CONFIG_CMD_TFTPBOOT) += tftp.o # Disable this warning as it is triggered by:
net-lwip/ping.c new file +171 -0
171 lines not on this page · raw message
Signature · 1 line
2.40.1
PATCH v2 7/14 net-lwip: add dns command
In reply to Jerome ForissierAdd CONFIG_CMD_DNS_LWIP depending on CONFIG_NET_LWIP to provide the dns command using lwIP.
--- cmd/Kconfig | 6 +++ cmd/net-lwip.c | 8 ++++ include/net-lwip.h | 1 + net-lwip/Makefile | 1 + net-lwip/dns.c | 107 +++++++++++++++++++++++++++++++++++++++++++++ 5 files changed, 123 insertions(+) create mode 100644 net-lwip/dns.c
cmd/Kconfig +6 -0
@@ -2098,6 +2098,12 @@ config CMD_DHCP help Boot image via network using DHCP/TFTP protocol +config CMD_DNS + bool "dns" + select PROT_DNS_LWIP + help + Lookup the IP of a hostname + config CMD_PING bool "ping" select PROT_RAW_LWIP
cmd/net-lwip.c +8 -0
@@ -27,3 +27,11 @@ U_BOOT_CMD("[loadAddress] [[hostIPaddr:]bootfilename]" );#endif + +#if defined(CONFIG_CMD_DNS ) +U_BOOT_CMD ( + dns,3 ,1 , do_dns, +"lookup the IP of a hostname" , +"hostname [envvar]" +); +#endif
include/net-lwip.h +1 -0
@@ -82,6 +82,7 @@ int net_lwip_init(void);struct netif *net_lwip_get_netif (void );int do_dhcp (struct cmd_tbl *cmdtp,int flag,int argc,char *const argv[]); +int do_dns (struct cmd_tbl *cmdtp,int flag,int argc,char *const argv[]);int do_ping (struct cmd_tbl *cmdtp,int flag,int argc,char *const argv[]);int do_tftpb (struct cmd_tbl *cmdtp,int flag,int argc,char *const argv[]);
net-lwip/Makefile +1 -0
@@ -7,6 +7,7 @@ obj-$(CONFIG_$(SPL_)DM_ETH) += ../net/eth_common.o obj-$(CONFIG_$(SPL_)DM_ETH) += ../net/eth-uclass.o obj-$(CONFIG_$(SPL_)DM_ETH) += net-lwip.o obj-$(CONFIG_CMD_DHCP) += dhcp.o +obj-$(CONFIG_CMD_DNS) += dns.o obj-$(CONFIG_CMD_PING) += ping.o obj-$(CONFIG_CMD_TFTPBOOT) += tftp.o
net-lwip/dns.c new file +107 -0
107 lines not on this page · raw message
Signature · 1 line
2.40.1
PATCH v2 9/14 test: dm: dsa, eth: disable tests when CONFIG_NET_LWIP=y
In reply to Jerome ForissierSome sandbox tests make strong assumptions on how the network stack is implemented. For example, the ping tests assume that ARP resolution occurs upon sending out the ICMP packet. This is not always the case with the lwIP stack which can cache ARP information. Therefore, disable these tests when CONFIG_NET_LWIP is enabled.
--- test/dm/dsa.c | 2 ++ test/dm/eth.c | 4 ++++ 2 files changed, 6 insertions(+)
test/dm/dsa.c +2 -0
@@ -59,6 +59,7 @@ static int dm_test_dsa_probe(struct unit_test_state *uts)DM_TEST (dm_test_dsa_probe,UT_TESTF_SCAN_FDT ); +#if !defined(CONFIG_NET_LWIP )/* This test sends ping requests with the local address through each DSA port * via the sandbox DSA master Eth. */
@@ -80,3 +81,4 @@ static int dm_test_dsa(struct unit_test_state *uts) }DM_TEST (dm_test_dsa,UT_TESTF_SCAN_FDT ); +#endif /* !defined(CONFIG_NET_LWIP) */
test/dm/eth.c +4 -0
@@ -170,6 +170,7 @@ static int dm_test_ip6_make_lladdr(struct unit_test_state *uts)DM_TEST (dm_test_ip6_make_lladdr,UT_TESTF_SCAN_FDT );#endif +#if !defined(CONFIG_NET_LWIP )static int dm_test_eth (struct unit_test_state *uts) { net_ping_ip =string_to_ip ("1.1.2.2" );
@@ -298,6 +299,7 @@ static int dm_test_eth_act(struct unit_test_state *uts) return 0; }DM_TEST (dm_test_eth_act,UT_TESTF_SCAN_FDT ); +#endif /* !CONFIG_NET_LWIP */ /* Ensure that all addresses are loaded properly */ static int dm_test_ethaddr (struct unit_test_state *uts)
@@ -332,6 +334,7 @@ static int dm_test_ethaddr(struct unit_test_state *uts) }DM_TEST (dm_test_ethaddr,UT_TESTF_SCAN_FDT ); +#if !defined(CONFIG_NET_LWIP )/* The asserts include a return on fail; cleanup in the caller */ static int _dm_test_eth_rotate1 (struct unit_test_state *uts) {
@@ -616,6 +619,7 @@ static int dm_test_eth_async_ping_reply(struct unit_test_state *uts) }DM_TEST (dm_test_eth_async_ping_reply,UT_TESTF_SCAN_FDT ); +#endif /* !CONFIG_NET_LWIP */ #if IS_ENABLED (CONFIG_IPV6_ROUTER_DISCOVERY )
Signature · 1 line
2.40.1
PATCH v2 8/14 net-lwip: add wget command
In reply to Jerome ForissierAdd support for the wget command with NET_LWIP.
About the small change in cmd/efidebug.c: when the wget command based on the lwIP stack is used the wget command has a built-in URL validation function since it needs to parse it anyways (in parse_url()). Therefore wget_validate_uri() doesn't exist. So, guard the call in efidebug.c with CONFIG_CMD_WGET.
Based on code initially developed by Maxim U.
--- cmd/Kconfig | 7 ++ cmd/Makefile | 5 +- cmd/efidebug.c | 8 +- cmd/net-common.c | 112 ++++++++++++++++++++++++++++ cmd/net-lwip.c | 12 +++ cmd/net.c | 115 ----------------------------- include/net-lwip.h | 51 +++++++++++++ net-lwip/Makefile | 1 + net-lwip/wget.c | 180 +++++++++++++++++++++++++++++++++++++++++++++ 9 files changed, 372 insertions(+), 119 deletions(-) create mode 100644 cmd/net-common.c create mode 100644 net-lwip/wget.c
cmd/Kconfig +7 -0
@@ -2117,6 +2117,13 @@ config CMD_TFTPBOOT help tftpboot - load file via network using TFTP protocol +config CMD_WGET + bool "wget" + select PROT_TCP_LWIP + help + wget is a simple command to download kernel, or other files, + from a http server over TCP. + endif endif
cmd/Makefile +4 -1
@@ -129,8 +129,11 @@ obj-$(CONFIG_CMD_MUX) += mux.o obj-$(CONFIG_CMD_NAND) += nand.o obj-$(CONFIG_CMD_NET) += net.o obj-$(CONFIG_CMD_NET_LWIP) += net-lwip.o +obj-$(filter y,$(CONFIG_CMD_NET) $(CONFIG_CMD_NET_LWIP)) += net-common.o ifdef CONFIG_CMD_NET_LWIP -CFLAGS_net-lwip.o := -I$(srctree)/lib/lwip/lwip/src/include -I$(srctree)/lib/lwip/u-boot +lwip-includes := -I$(srctree)/lib/lwip/lwip/src/include -I$(srctree)/lib/lwip/u-boot +CFLAGS_net-lwip.o := $(lwip-includes) +CFLAGS_net-common.o := $(lwip-includes) endif obj-$(CONFIG_ENV_SUPPORT) += nvedit.o obj-$(CONFIG_CMD_NVEDIT_EFI) += nvedit_efi.o
cmd/efidebug.c +5 -3
@@ -741,9 +741,11 @@ static int efi_boot_add_uri(int argc, char *const argv[], u16 *var_name16,if (!label)return CMD_RET_FAILURE ; -if (!wget_validate_uri (argv[3 ])) { -printf ("ERROR: invalid URI\n" ); -return CMD_RET_FAILURE ; +if (IS_ENABLED (CONFIG_CMD_WGET )) { +if (!wget_validate_uri (argv[3 ])) { +printf ("ERROR: invalid URI\n" ); +return CMD_RET_FAILURE ; + } }efi_create_indexed_name (var_name16, var_name16_size,"Boot" , id);
cmd/net-common.c new file +112 -0
112 lines not on this page · raw message
cmd/net-lwip.c +12 -0
@@ -2,6 +2,10 @@/* Copyright (C) 2024 Linaro Ltd. */ #include <command.h> +#include <dm/device.h> +#include <dm/uclass.h> +#include <linux/compat.h> +#include <linux/ethtool.h> #include <net-lwip.h> #if defined(CONFIG_CMD_DHCP )
@@ -35,3 +39,11 @@ U_BOOT_CMD("hostname [envvar]" );#endif + +#if defined(CONFIG_CMD_WGET ) +U_BOOT_CMD ( + wget,3 ,1 , do_wget, +"boot image via network using HTTP protocol" , +"[loadAddress] URL" +); +#endif
cmd/net.c +0 -115
118 lines not on this page · raw message
include/net-lwip.h +51 -0
62 lines not on this page · raw message
net-lwip/Makefile +1 -0
@@ -10,6 +10,7 @@ obj-$(CONFIG_CMD_DHCP) += dhcp.o obj-$(CONFIG_CMD_DNS) += dns.o obj-$(CONFIG_CMD_PING) += ping.o obj-$(CONFIG_CMD_TFTPBOOT) += tftp.o +obj-$(CONFIG_CMD_WGET) += wget.o # Disable this warning as it is triggered by: # sprintf(buf, index ? "foo%d" : "foo", index)
net-lwip/wget.c new file +180 -0
180 lines not on this page · raw message
Signature · 1 line
2.40.1
PATCH v2 10/14 cmd: bdinfo: enable -e when CONFIG_CMD_NET_LWIP=y
In reply to Jerome ForissierSupport "bdinfo -e" when lwIP is selected.
--- cmd/bdinfo.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
cmd/bdinfo.c +3 -2
@@ -152,7 +152,7 @@ static int bdinfo_print_all(struct bd_info *bd)bdinfo_print_num_l ("relocaddr" , gd->relocaddr);bdinfo_print_num_l ("reloc off" , gd->reloc_off);printf ("%-12s= %u-bit\n" ,"Build" , (uint )sizeof (void *) *8 ); -if (IS_ENABLED (CONFIG_CMD_NET )) +if (IS_ENABLED (CONFIG_CMD_NET ) ||IS_ENABLED (CONFIG_CMD_NET_LWIP ))print_eth ();bdinfo_print_num_l ("fdt_blob" , (ulong )map_to_sysmem (gd->fdt_blob));bdinfo_print_num_l ("new_fdt" , (ulong )map_to_sysmem (gd->new_fdt));
@@ -198,7 +198,8 @@ int do_bdinfo(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])case 'a' :return bdinfo_print_all (bd);case 'e' : -if (!IS_ENABLED (CONFIG_CMD_NET )) +if (!IS_ENABLED (CONFIG_CMD_NET ) && + !IS_ENABLED (CONFIG_CMD_NET_LWIP ))return CMD_RET_USAGE ;print_eth ();return CMD_RET_SUCCESS ;
Signature · 1 line
2.40.1
PATCH v2 11/14 configs: add qemu_arm64_lwip_defconfig
In reply to Jerome ForissierAdd qemu_arm64_lwip_defconfig based on qemu_arm64_defconfig but with NET_LWIP instead of NET. The new file was obtained by doing:
1. make qemu_arm64_defconfig
2. make menuconfig
Select NET_LWIP
3. make savedefconfig
4. diff -u defconfig configs/qemu_arm64_defconfig
5. Create configs/qemu_arm64_lwip_defconfig, use #include <> to inherit from configs/qemu_arm64_defconfig, append 'CONFIG_NET_LWIP=y' and '# CONFIG_DFU_TFTP is not set' to reflect the diff.
--- configs/qemu_arm64_lwip_defconfig | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 configs/qemu_arm64_lwip_defconfig
configs/qemu_arm64_lwip_defconfig new file +3 -0
@@ -0,0 +1,3 @@ +#include <configs/qemu_arm64_defconfig> +CONFIG_NET_LWIP=y +# CONFIG_DFU_TFTP is not set
Signature · 1 line
2.40.1
PATCH v2 12/14 test/py: net: add _lwip variants of dhcp, ping and tftpboot tests
In reply to Jerome ForissierWHen NET_LWIP is enabled, the dhcp/ping/tftpboot commands are enabled via CMD_DHCP_LWIP, CMD_PING_LWIP and CMD_TFTPBOOT_LWIP, respectively; therefore the config annotations in the Python test scripts need to be cmd_dhcp_lwip, cmd_ping_lwip and cmd_tftpboot_lwip.
The console output of the tftpboot command with lwIP is slightly different from the non-lwIP implementation. This is taken care of in test_net_tftpboot().
--- test/py/tests/test_net.py | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-)
test/py/tests/test_net.py +17 -4
@@ -127,6 +127,10 @@ def test_net_dhcp(u_boot_console): global net_set_up net_set_up = True [email protected]('cmd_dhcp_lwip') +def test_net_dhcp_lwip(u_boot_console): + test_net_dhcp(u_boot_console) + @pytest.mark.buildconfigspec('cmd_dhcp') @pytest.mark.buildconfigspec('cmd_mii') def test_net_dhcp_abort(u_boot_console):
@@ -230,6 +234,10 @@ def test_net_ping(u_boot_console): output = u_boot_console.run_command('ping $serverip') assert 'is alive' in output [email protected]('cmd_ping_lwip') +def test_net_ping_lwip(u_boot_console): + test_net_ping(u_boot_console) + @pytest.mark.buildconfigspec('IPV6_ROUTER_DISCOVERY') def test_net_network_discovery(u_boot_console): """Test the network discovery feature of IPv6.
@@ -255,7 +263,7 @@ def test_net_network_discovery(u_boot_console): assert '0000:0000:0000:0000:0000:0000:0000:0000' not in output @pytest.mark.buildconfigspec('cmd_net') -def test_net_tftpboot(u_boot_console): +def test_net_tftpboot(u_boot_console, lwip = False): """Test the tftpboot command. A file is downloaded from the TFTP server, its size and optionally its
@@ -279,10 +287,11 @@ def test_net_tftpboot(u_boot_console): output = u_boot_console.run_command('tftpboot %s' % (fn)) else: output = u_boot_console.run_command('tftpboot %x %s' % (addr, fn)) - expected_text = 'Bytes transferred = ' sz = f.get('size', None) - if sz: - expected_text += '%d' % sz + if lwip: + expected_text = f'{sz} bytes transferred' + else: + expected_text = f'Bytes transferred = {sz}' assert expected_text in output expected_crc = f.get('crc32', None)
@@ -295,6 +304,10 @@ def test_net_tftpboot(u_boot_console): output = u_boot_console.run_command('crc32 $fileaddr $filesize') assert expected_crc in output [email protected]("cmd_net_lwip") +def test_net_tftpboot_lwip(u_boot_console): + test_net_tftpboot(u_boot_console, True) + @pytest.mark.buildconfigspec('cmd_nfs') def test_net_nfs(u_boot_console): """Test the nfs command.
Signature · 1 line
2.40.1
PATCH v2 13/14 MAINTAINERS: net-lwip: add myself as a maintainer
In reply to Jerome ForissierAdd myself as a maintainer for the lwIP network stack integration code and network commands. The library code itself (i.e., most files under lib/lwip/ except README, Makefile and integration files in u-boot) is unmodified from upstream and therefore does not need a maintainer.
--- MAINTAINERS | 11 +++++++++++ 1 file changed, 11 insertions(+)
MAINTAINERS +11 -0
@@ -1315,6 +1315,17 @@ F: drivers/net/ F: include/net.h F: net/ +NETWORK (LWIP) +M: Jerome Forissier <[email protected]> +S: Maintained +F: cmd/net-lwip.c +F: configs/qemu_arm64_lwip_defconfig +F: include/net-lwip.h +F: lib/lwip/Makefile +F: lib/lwip/README +F: lib/lwip/u-boot/ +F: net-lwip/ + NIOS M: Thomas Chou <[email protected]> S: Maintained
Signature · 1 line
2.40.1
PATCH v2 14/14 CI: add qemu_arm64_lwip to the test matrix
In reply to Jerome ForissierBuild and run qemu_arm64_lwip_defconfig in CI. This tests the lightweight IP (lwIP) implementation of the dhcp, tftpboot and ping commands.
--- .azure-pipelines.yml | 7 +++++++ 1 file changed, 7 insertions(+)
.azure-pipelines.yml +7 -0
@@ -199,6 +199,10 @@ stages: cd \${WORK_DIR} git config --global --add safe.directory \${WORK_DIR} git clone --depth=1 https://source.denx.de/u-boot/u-boot-test-hooks /tmp/uboot-test-hooks + # qemu_arm64_lwip_defconfig is the same as qemu_arm64 but with NET_LWIP enabled. + # The test config and the boardenv file from qemu_arm64 can be re-used so create symlinks + ln -s conf.qemu_arm64_na /tmp/uboot-test-hooks/bin/travis-ci/conf.qemu_arm64_lwip_na + ln -s u_boot_boardenv_qemu_arm64_na.py /tmp/uboot-test-hooks/py/travis-ci/u_boot_boardenv_qemu_arm64_lwip_na.py ln -s travis-ci /tmp/uboot-test-hooks/bin/\`hostname\` ln -s travis-ci /tmp/uboot-test-hooks/py/\`hostname\` grub-mkimage --prefix=\"\" -o ~/grub_x86.efi -O i386-efi normal echo lsefimmap lsefi lsefisystab efinet tftp minicmd
@@ -371,6 +375,9 @@ stages: qemu_arm64: TEST_PY_BD: "qemu_arm64" TEST_PY_TEST_SPEC: "not sleep" + qemu_arm64_lwip: + TEST_PY_BD: "qemu_arm64_lwip" + TEST_PY_TEST_SPEC: "test_net_dhcp_lwip or test_net_ping_lwip or test_net_tftpboot_lwip" qemu_m68k: TEST_PY_BD: "M5208EVBE" TEST_PY_ID: "--id qemu"
Signature · 1 line
2.40.1
PATCH v2 1/14 net: introduce alternative implementation as net-lwip/
In reply to Jerome ForissierPrepare the introduction of the lwIP (lightweight IP) TCP/IP stack by adding a new net-lwip/ directory and the NET_LWIP symbol. At this point, enabling NET_LWIP simply disables NET. Subsequent commits will introduce the lwIP code, re-work the NETDEVICE integration and port some of the NET commands and features to lwIP.
SPL_NET cannot be enabled when NET_LWIP=y. SPL_NET pulls some symbols that are part of NET (such as arp_init(), arp_timeout_check(), arp_receive(), net_arp_wait_packet_ip()). lwIP support in SPL may be added later.
Similarly, DFU_TFTP is not compatible with NET_LWIP because it depends on net_loop(), tftp_timeout_ms, tftp_timeout_count_max. Let's add a dependency on !NET_LWIP for now.
--- Kconfig | 2 ++ Makefile | 2 +- common/Kconfig | 2 +- common/spl/Kconfig | 1 + drivers/dfu/Kconfig | 2 +- drivers/fastboot/Kconfig | 4 ++-- drivers/net/phy/Kconfig | 2 +- drivers/usb/gadget/Kconfig | 2 +- net-lwip/Kconfig | 15 +++++++++++++++ net/Kconfig | 1 + 10 files changed, 26 insertions(+), 7 deletions(-) create mode 100644 net-lwip/Kconfig
Kconfig +2 -0
@@ -747,6 +747,8 @@ source "env/Kconfig" source "net/Kconfig" +source "net-lwip/Kconfig" + source "drivers/Kconfig" source "fs/Kconfig"
Makefile +1 -1
@@ -859,7 +859,7 @@ libs-$(CONFIG_OF_EMBED) += dts/ libs-y += env/ libs-y += lib/ libs-y += fs/ -libs-y += net/ +libs-$(CONFIG_NET) += net/ libs-y += disk/ libs-y += drivers/ libs-$(CONFIG_SYS_FSL_DDR) += drivers/ddr/fsl/
common/Kconfig +1 -1
@@ -424,7 +424,7 @@ config LOGF_FUNC_PAD config LOG_SYSLOG bool "Log output to syslog server" - depends on NET + depends on NET || NET_LWIP help Enables a log driver which broadcasts log records via UDP port 514 to syslog servers.
common/spl/Kconfig +1 -0
@@ -1055,6 +1055,7 @@ config SPL_DM_SPI_FLASH config SPL_NET bool "Support networking" + depends on !NET_LWIP help Enable support for network devices (such as Ethernet) in SPL. This permits SPL to load U-Boot over a network link rather than
drivers/dfu/Kconfig +1 -1
@@ -11,7 +11,7 @@ config DFU_OVER_USB config DFU_OVER_TFTP bool - depends on NET + depends on NET && !NET_LWIP if DFU config DFU_WRITE_ALT
drivers/fastboot/Kconfig +2 -2
@@ -27,7 +27,7 @@ config USB_FUNCTION_FASTBOOT This enables the USB part of the fastboot gadget. config UDP_FUNCTION_FASTBOOT - depends on NET + depends on NET || NET_LWIP select FASTBOOT bool "Enable fastboot protocol over UDP" help
@@ -41,7 +41,7 @@ config UDP_FUNCTION_FASTBOOT_PORT The fastboot protocol requires a UDP port number. config TCP_FUNCTION_FASTBOOT - depends on NET + depends on NET || NET_LWIP select FASTBOOT bool "Enable fastboot protocol over TCP" help
drivers/net/phy/Kconfig +1 -1
@@ -11,7 +11,7 @@ config MV88E6352_SWITCH menuconfig PHYLIB bool "Ethernet PHY (physical media interface) support" - depends on NET + depends on NET || NET_LWIP help Enable Ethernet PHY (physical media interface) support.
drivers/usb/gadget/Kconfig +1 -1
@@ -224,7 +224,7 @@ endif # USB_GADGET_DOWNLOAD config USB_ETHER bool "USB Ethernet Gadget" - depends on NET + depends on NET || NET_LWIP default y if ARCH_SUNXI && USB_MUSB_GADGET help Creates an Ethernet network device through a USB peripheral
net-lwip/Kconfig new file +15 -0
@@ -0,0 +1,15 @@ +# +# Network configuration (with lwIP stack) +# + +menuconfig NET_LWIP + bool "Networking support (lwIP stack) -- EXPERIMENTAL" + help + Include networking support based on the lwIP (lightweight IP) + TCP/IP stack (https://nongnu.org/lwip). This is a replacement for + the default U-Boot network stack and applications located in net/ + and enabled via CONFIG_NET as well as other pieces of code that + depend on CONFIG_NET (such as cmd/net.c enabled via CONFIG_CMD_NET). + Therefore the two symbols CONFIG_NET and CONFIG_NET_LWIP are mutually + exclusive. + NOTE: This is currently a placeholder.
net/Kconfig +1 -0
@@ -6,6 +6,7 @@ menuconfig NET bool "Networking support" default y imply NETDEVICES + depends on !NET_LWIP if NET
Signature · 1 line
2.40.1
PATCH v2 2/14 Squashed 'lib/lwip/lwip/' content from commit 0a0452b2c39
In reply to Jerome Forissiergit-subtree-dir: lib/lwip/lwip
git-subtree-split: 0a0452b2c39bdd91e252aef045c115f88f6ca773
--- .gitattributes | 10 + .github/workflows/ci-linux.yml | 43 + .gitignore | 60 + .vscode/c_cpp_properties.json | 28 + .vscode/launch.json | 62 + .vscode/settings.json | 10 + .vscode/tasks.json | 54 + BUILDING | 119 + CHANGELOG | 4635 +++++++++++++++ CMakeLists.txt | 35 + COPYING | 25 + FEATURES | 11 + FILES | 6 + README | 109 + UPGRADING | 288 + codespell_changed_files.sh | 26 + codespell_check.sh | 57 + contrib/Coverity/coverity.c | 106 + contrib/Filelists.cmake | 61 + contrib/Filelists.mk | 57 + contrib/addons/dhcp_extra_opts/README | 5 + .../addons/dhcp_extra_opts/dhcp_extra_opts.c | 91 + .../addons/dhcp_extra_opts/dhcp_extra_opts.h | 61 + contrib/addons/ipv6_static_routing/README | 43 + .../ipv6_static_routing/ip6_route_table.c | 248 + .../ipv6_static_routing/ip6_route_table.h | 94 + .../addons/netconn/external_resolve/dnssd.c | 164 + .../addons/netconn/external_resolve/dnssd.h | 50 + contrib/addons/tcp_isn/tcp_isn.c | 182 + contrib/addons/tcp_isn/tcp_isn.h | 48 + contrib/addons/tcp_md5/README | 27 + contrib/addons/tcp_md5/tcp_md5.c | 534 ++ contrib/addons/tcp_md5/tcp_md5.h | 84 + .../CCodeGeneration/CCodeGeneration.csproj | 67 + .../LwipMibCompiler/CCodeGeneration/CFile.cs | 54 + .../CCodeGeneration/CGenerator.cs | 119 + .../LwipMibCompiler/CCodeGeneration/Code.cs | 56 + .../CCodeGeneration/CodeContainerBase.cs | 139 + .../CCodeGeneration/CodeElement.cs | 41 + .../CCodeGeneration/Comment.cs | 75 + .../CCodeGeneration/EmptyLine.cs | 64 + .../CCodeGeneration/Function.cs | 129 + .../CCodeGeneration/FunctionDeclaration.cs | 114 + .../CCodeGeneration/IfThenElse.cs | 137 + .../LwipMibCompiler/CCodeGeneration/PP_If.cs | 67 + .../CCodeGeneration/PP_Ifdef.cs | 76 + .../CCodeGeneration/PP_Include.cs | 71 + .../CCodeGeneration/PP_Macro.cs | 59 + .../CCodeGeneration/PlainText.cs | 49 + .../Properties/AssemblyInfo.cs | 36 + .../LwipMibCompiler/CCodeGeneration/Switch.cs | 146 + .../CCodeGeneration/VariableDeclaration.cs | 82 + .../CCodeGeneration/VariablePrototype.cs | 73 + .../CCodeGeneration/VariableType.cs | 130 + .../apps/LwipMibCompiler/LwipMibCompiler.sln | 47 + .../LwipMibCompiler/LwipMibCompiler.csproj | 73 + .../LwipMibCompiler/Program.cs | 480 ++ .../Properties/AssemblyInfo.cs | 36 + .../LwipMibCompiler/app.config | 3 + .../LwipSnmpCodeGeneration/IRestriction.cs | 120 + .../LwipSnmpCodeGeneration/LwipSnmp.cs | 199 + .../LwipSnmpCodeGeneration.csproj | 72 + .../LwipSnmpCodeGeneration/MibCFile.cs | 196 + .../LwipSnmpCodeGeneration/MibHeaderFile.cs | 129 + .../Properties/AssemblyInfo.cs | 36 + .../LwipSnmpCodeGeneration/SnmpMib.cs | 97 + .../LwipSnmpCodeGeneration/SnmpNode.cs | 119 + .../SnmpScalarAggregationNode.cs | 293 + .../SnmpScalarArrayNode.cs | 105 + .../LwipSnmpCodeGeneration/SnmpScalarNode.cs | 395 ++ .../SnmpScalarNodeBits.cs | 121 + .../SnmpScalarNodeCounter64.cs | 72 + .../SnmpScalarNodeInt.cs | 86 + .../SnmpScalarNodeObjectIdentifier.cs | 90 + .../SnmpScalarNodeOctetString.cs | 118 + .../SnmpScalarNodeTruthValue.cs | 66 + .../SnmpScalarNodeUint.cs | 91 + .../LwipSnmpCodeGeneration/SnmpTableNode.cs | 332 ++ .../LwipSnmpCodeGeneration/SnmpTreeNode.cs | 242 + .../MibViewer/FormMain.Designer.cs | 166 + .../LwipMibCompiler/MibViewer/FormMain.cs | 217 + .../LwipMibCompiler/MibViewer/FormMain.resx | 298 + .../MibViewer/MibViewer.csproj | 94 + .../apps/LwipMibCompiler/MibViewer/Program.cs | 51 + .../MibViewer/Properties/AssemblyInfo.cs | 36 + .../Properties/Resources.Designer.cs | 63 + .../MibViewer/Properties/Resources.resx | 117 + .../MibViewer/Properties/Settings.Designer.cs | 26 + .../MibViewer/Properties/Settings.settings | 7 + .../apps/LwipMibCompiler/MibViewer/app.config | 3 + .../Mibs/IANA-ADDRESS-FAMILY-NUMBERS-MIB | 131 + .../LwipMibCompiler/Mibs/IANA-CHARSET-MIB | 345 ++ .../Mibs/IANA/IANA-ITU-ALARM-TC-MIB | 333 ++ .../Mibs/IANA/IANA-LANGUAGE-MIB | 127 + .../LwipMibCompiler/Mibs/IANA/IANA-MALLOC-MIB | 67 + .../LwipMibCompiler/Mibs/IANA/IANA-MAU-MIB | 770 +++ .../Mibs/IANA/IANA-PRINTER-MIB | 1319 +++++ .../Mibs/IANA/IANA-RTPROTO-MIB | 92 + .../Mibs/IANA/IANATn3270eTC-MIB | 306 + .../LwipMibCompiler/Mibs/IANA/IANAifType-MIB | 572 ++ contrib/apps/LwipMibCompiler/Mibs/IF-MIB | 1899 ++++++ .../LwipMibCompiler/Mibs/INET-ADDRESS-MIB | 421 ++ contrib/apps/LwipMibCompiler/Mibs/IP-MIB | 5254 +++++++++++++++++ contrib/apps/LwipMibCompiler/Mibs/RFC-1212 | 75 + contrib/apps/LwipMibCompiler/Mibs/RFC-1215 | 34 + contrib/apps/LwipMibCompiler/Mibs/RFC1065-SMI | 132 + contrib/apps/LwipMibCompiler/Mibs/RFC1155-SMI | 129 + contrib/apps/LwipMibCompiler/Mibs/RFC1158-MIB | 1493 +++++ contrib/apps/LwipMibCompiler/Mibs/RFC1213-MIB | 2621 ++++++++ contrib/apps/LwipMibCompiler/Mibs/SNMPv2-CONF | 318 + contrib/apps/LwipMibCompiler/Mibs/SNMPv2-MIB | 903 +++ contrib/apps/LwipMibCompiler/Mibs/SNMPv2-SMI | 352 ++ contrib/apps/LwipMibCompiler/Mibs/SNMPv2-TC | 786 +++ contrib/apps/LwipMibCompiler/Mibs/SNMPv2-TM | 194 + contrib/apps/LwipMibCompiler/Mibs/TCP-MIB | 829 +++ contrib/apps/LwipMibCompiler/Mibs/UDP-MIB | 579 ++ .../SharpSnmpLib/Mib/DisplayHint.cs | 84 + .../Elements/Entities/AgentCapabilities.cs | 29 + .../Mib/Elements/Entities/EntityBase.cs | 46 + .../Mib/Elements/Entities/IEntity.cs | 62 + .../Mib/Elements/Entities/ModuleCompliance.cs | 23 + .../Mib/Elements/Entities/ModuleIdentity.cs | 10 + .../Elements/Entities/NotificationGroup.cs | 22 + .../Mib/Elements/Entities/NotificationType.cs | 11 + .../Mib/Elements/Entities/ObjectGroup.cs | 22 + .../Mib/Elements/Entities/ObjectIdentity.cs | 21 + .../Mib/Elements/Entities/ObjectType.cs | 336 ++ .../Elements/Entities/OidValueAssignment.cs | 30 + .../SharpSnmpLib/Mib/Elements/Exports.cs | 56 + .../SharpSnmpLib/Mib/Elements/IDeclaration.cs | 18 + .../SharpSnmpLib/Mib/Elements/IElement.cs | 35 + .../Mib/Elements/ITypeReferrer.cs | 10 + .../SharpSnmpLib/Mib/Elements/Imports.cs | 81 + .../SharpSnmpLib/Mib/Elements/ImportsFrom.cs | 60 + .../SharpSnmpLib/Mib/Elements/TrapType.cs | 48 + .../Mib/Elements/Types/BaseType.cs | 54 + .../Mib/Elements/Types/BitsType.cs | 26 + .../SharpSnmpLib/Mib/Elements/Types/Choice.cs | 35 + .../Mib/Elements/Types/ITypeAssignment.cs | 6 + .../Mib/Elements/Types/IntegerType.cs | 117 + .../Mib/Elements/Types/IpAddressType.cs | 21 + .../SharpSnmpLib/Mib/Elements/Types/Macro.cs | 34 + .../Elements/Types/ObjectIdentifierType.cs | 11 + .../Mib/Elements/Types/OctetStringType.cs | 31 + .../Mib/Elements/Types/OpaqueType.cs | 11 + .../Mib/Elements/Types/Sequence.cs | 46 + .../Mib/Elements/Types/SequenceOf.cs | 23 + .../Mib/Elements/Types/TextualConvention.cs | 238 + .../Mib/Elements/Types/TypeAssignment.cs | 147 + .../Mib/Elements/Types/UnsignedType.cs | 103 + .../SharpSnmpLib/Mib/IModule.cs | 81 + .../SharpSnmpLib/Mib/ISymbolEnumerator.cs | 9 + .../LwipMibCompiler/SharpSnmpLib/Mib/Lexer.cs | 581 ++ .../SharpSnmpLib/Mib/MaxAccess.cs | 17 + .../SharpSnmpLib/Mib/MibDocument.cs | 57 + .../SharpSnmpLib/Mib/MibException.cs | 113 + .../SharpSnmpLib/Mib/MibModule.cs | 294 + .../SharpSnmpLib/Mib/MibResolver.cs | 97 + .../SharpSnmpLib/Mib/MibTree.cs | 130 + .../SharpSnmpLib/Mib/MibTreeNode.cs | 112 + .../SharpSnmpLib/Mib/MibTypesResolver.cs | 216 + .../SharpSnmpLib/Mib/ObjectIdentifier.cs | 54 + .../SharpSnmpLib/Mib/Status.cs | 17 + .../SharpSnmpLib/Mib/Symbol.cs | 357 ++ .../SharpSnmpLib/Mib/SymbolList.cs | 146 + .../SharpSnmpLib/Mib/ValueMap.cs | 103 + .../SharpSnmpLib/Mib/ValueRange.cs | 76 + .../SharpSnmpLib/Properties/AssemblyInfo.cs | 61 + .../Properties/Resources.Designer.cs | 63 + .../SharpSnmpLib/Properties/Resources.resx | 120 + .../SharpSnmpLib/SharpSnmpLib.Mib.csproj | 140 + .../LwipMibCompiler/SharpSnmpLib/license.txt | 458 ++ .../LwipMibCompiler/SharpSnmpLib/readme.txt | 1 + .../SharpSnmpLib/sharpsnmplib.snk | Bin 0 -> 596 bytes .../example/compile_udp_mib.cmd | 1 + .../example/compile_udp_mib.sh | 1 + contrib/apps/chargen/README | 52 + contrib/apps/chargen/chargen.c | 274 + contrib/apps/chargen/chargen.h | 12 + contrib/apps/httpserver/README | 12 + contrib/apps/httpserver/httpserver-netconn.c | 103 + contrib/apps/httpserver/httpserver-netconn.h | 6 + contrib/apps/netio/netio.c | 55 + contrib/apps/netio/netio.h | 6 + contrib/apps/ping/ping.c | 396 ++ contrib/apps/ping/ping.h | 19 + contrib/apps/rtp/rtp.c | 308 + contrib/apps/rtp/rtp.h | 8 + contrib/apps/rtp/rtpdata.h | 2040 +++++++ contrib/apps/shell/shell.c | 1277 ++++ contrib/apps/shell/shell.h | 37 + .../apps/socket_examples/socket_examples.c | 680 +++ .../apps/socket_examples/socket_examples.h | 6 + contrib/apps/tcpecho/tcpecho.c | 101 + contrib/apps/tcpecho/tcpecho.h | 38 + contrib/apps/tcpecho_raw/tcpecho_raw.c | 301 + contrib/apps/tcpecho_raw/tcpecho_raw.h | 35 + contrib/apps/udpecho/udpecho.c | 88 + contrib/apps/udpecho/udpecho.h | 37 + contrib/apps/udpecho_raw/udpecho_raw.c | 88 + contrib/apps/udpecho_raw/udpecho_raw.h | 39 + contrib/examples/ethernetif/ethernetif.c | 337 ++ contrib/examples/example_app/default_netif.h | 47 + contrib/examples/example_app/lwipcfg.h.ci | 73 + .../examples/example_app/lwipcfg.h.example | 77 + contrib/examples/example_app/lwipopts.h | 326 + contrib/examples/example_app/lwippools.h | 20 + contrib/examples/example_app/ppp_settings.h | 6 + contrib/examples/example_app/test.c | 773 +++ .../example_app/test_configs/opt_default.h | 295 + .../example_app/test_configs/opt_dualstack.h | 295 + .../example_app/test_configs/opt_ipv4only.h | 295 + .../example_app/test_configs/opt_ipv6only.h | 295 + .../test_configs/opt_no_tcp_dualstack.h | 4 + .../test_configs/opt_no_tcp_ipv4only.h | 4 + .../test_configs/opt_no_tcp_ipv6only.h | 4 + .../test_configs/opt_no_udp_dualstack.h | 4 + .../test_configs/opt_no_udp_ipv4only.h | 4 + .../test_configs/opt_no_udp_ipv6only.h | 4 + .../example_app/test_configs/opt_none.h | 2 + .../example_app/test_configs/opt_nosys_dual.h | 295 + .../example_app/test_configs/opt_nosys_ipv4.h | 295 + .../example_app/test_configs/opt_nosys_ipv6.h | 295 + .../examples/httpd/cgi_example/cgi_example.c | 107 + .../examples/httpd/cgi_example/cgi_example.h | 38 + contrib/examples/httpd/examples_fs/404.html | 21 + .../examples/httpd/examples_fs/img/sics.gif | Bin 0 -> 724 bytes contrib/examples/httpd/examples_fs/index.html | 47 + contrib/examples/httpd/examples_fs/login.html | 28 + .../examples/httpd/examples_fs/loginfail.html | 25 + .../examples/httpd/examples_fs/session.html | 25 + contrib/examples/httpd/examples_fs/ssi.shtml | 315 + contrib/examples/httpd/examples_fsdata.c | 1543 +++++ .../examples/httpd/fs_example/fs_example.c | 324 + .../examples/httpd/fs_example/fs_example.h | 38 + .../httpd/genfiles_example/genfiles_example.c | 186 + .../httpd/genfiles_example/genfiles_example.h | 38 + .../httpd/https_example/https_example.c | 144 + .../httpd/https_example/https_example.h | 38 + .../httpd/post_example/post_example.c | 167 + .../examples/httpd/ssi_example/ssi_example.c | 264 + .../examples/httpd/ssi_example/ssi_example.h | 38 + contrib/examples/lwiperf/lwiperf_example.c | 50 + contrib/examples/lwiperf/lwiperf_example.h | 43 + contrib/examples/mdns/mdns_example.c | 63 + contrib/examples/mdns/mdns_example.h | 43 + contrib/examples/mqtt/mqtt_example.c | 128 + contrib/examples/mqtt/mqtt_example.h | 43 + contrib/examples/ppp/pppos_example.c | 221 + contrib/examples/ppp/pppos_example.h | 43 + contrib/examples/snmp/snmp_example.c | 80 + contrib/examples/snmp/snmp_example.h | 43 + .../snmp/snmp_private_mib/lwip_prvmib.c | 401 ++ .../snmp/snmp_private_mib/private_mib.h | 26 + contrib/examples/snmp/snmp_v3/snmpv3_dummy.c | 395 ++ contrib/examples/snmp/snmp_v3/snmpv3_dummy.h | 53 + contrib/examples/sntp/sntp_example.c | 66 + contrib/examples/sntp/sntp_example.h | 45 + contrib/examples/tftp/tftp_example.c | 155 + contrib/examples/tftp/tftp_example.h | 29 + contrib/ports/CMakeCommon.cmake | 128 + contrib/ports/Common.allports.mk | 91 + .../ports/freertos/include/arch/sys_arch.h | 95 + contrib/ports/freertos/sys_arch.c | 607 ++ contrib/ports/unix/Common.mk | 51 + contrib/ports/unix/Filelists.cmake | 44 + contrib/ports/unix/README | 25 + contrib/ports/unix/check/CMakeLists.txt | 61 + contrib/ports/unix/check/Makefile | 94 + contrib/ports/unix/check/README | 8 + contrib/ports/unix/check/config.h | 2 + contrib/ports/unix/example_app/CMakeLists.txt | 27 + contrib/ports/unix/example_app/Makefile | 60 + .../ports/unix/example_app/default_netif.c | 68 + contrib/ports/unix/example_app/iteropts.sh | 34 + contrib/ports/unix/lib/CMakeLists.txt | 33 + contrib/ports/unix/lib/README | 28 + contrib/ports/unix/lib/lwipopts.h | 436 ++ contrib/ports/unix/port/include/arch/cc.h | 89 + contrib/ports/unix/port/include/arch/perf.h | 63 + .../ports/unix/port/include/arch/sys_arch.h | 90 + contrib/ports/unix/port/include/netif/fifo.h | 54 + contrib/ports/unix/port/include/netif/list.h | 26 + .../ports/unix/port/include/netif/pcapif.h | 39 + contrib/ports/unix/port/include/netif/sio.h | 60 + contrib/ports/unix/port/include/netif/tapif.h | 43 + contrib/ports/unix/port/include/netif/vdeif.h | 43 + contrib/ports/unix/port/netif/fifo.c | 139 + contrib/ports/unix/port/netif/list.c | 152 + contrib/ports/unix/port/netif/pcapif.c | 207 + contrib/ports/unix/port/netif/sio.c | 485 ++ contrib/ports/unix/port/netif/tapif.c | 432 ++ contrib/ports/unix/port/netif/vdeif.c | 344 ++ contrib/ports/unix/port/perf.c | 65 + contrib/ports/unix/port/sys_arch.c | 840 +++ contrib/ports/unix/posixlib/CMakeLists.txt | 94 + contrib/ports/unix/posixlib/Uninstall.cmake | 22 + .../ports/unix/posixlib/include/posix/inet.h | 76 + .../unix/posixlib/include/posix/sockets.h | 150 + contrib/ports/unix/posixlib/lwipopts.h | 180 + contrib/ports/unix/setup-tapif | 22 + contrib/ports/win32/Common.mk | 51 + contrib/ports/win32/Filelists.cmake | 46 + contrib/ports/win32/check/check_stdint.h | 1 + contrib/ports/win32/check/config.h | 29 + contrib/ports/win32/check/stdbool.h | 9 + contrib/ports/win32/check/sys/time.h | 12 + contrib/ports/win32/check/time.c | 66 + contrib/ports/win32/check/unistd.h | 7 + .../ports/win32/example_app/CMakeLists.txt | 27 + contrib/ports/win32/example_app/Makefile | 55 + .../ports/win32/example_app/default_netif.c | 80 + contrib/ports/win32/include/arch/bpstruct.h | 1 + contrib/ports/win32/include/arch/cc.h | 115 + contrib/ports/win32/include/arch/epstruct.h | 1 + contrib/ports/win32/include/arch/perf.h | 40 + contrib/ports/win32/include/arch/sys_arch.h | 91 + contrib/ports/win32/msvc/build_coverity.cmd | 26 + contrib/ports/win32/msvc/libcheck.vcxproj | 102 + .../ports/win32/msvc/libcheck.vcxproj.filters | 96 + contrib/ports/win32/msvc/lwIP.vcxproj | 593 ++ contrib/ports/win32/msvc/lwIP.vcxproj.filters | 1075 ++++ contrib/ports/win32/msvc/lwIP_Test.sln | 37 + contrib/ports/win32/msvc/lwIP_Test.vcxproj | 209 + .../win32/msvc/lwIP_Test.vcxproj.filters | 252 + contrib/ports/win32/msvc/lwIP_pcapif.vcxproj | 113 + .../win32/msvc/lwIP_pcapif.vcxproj.filters | 28 + contrib/ports/win32/msvc/lwIP_unittests.sln | 31 + .../ports/win32/msvc/lwip_unittests.vcxproj | 145 + .../win32/msvc/lwip_unittests.vcxproj.filters | 168 + contrib/ports/win32/msvc/makefsdata.vcxproj | 101 + .../win32/msvc/makefsdata.vcxproj.filters | 14 + contrib/ports/win32/pcapif.c | 1124 ++++ contrib/ports/win32/pcapif.h | 32 + contrib/ports/win32/pcapif_helper.c | 172 + contrib/ports/win32/pcapif_helper.h | 31 + contrib/ports/win32/readme.txt | 26 + contrib/ports/win32/sio.c | 304 + contrib/ports/win32/sys_arch.c | 782 +++ doc/FILES | 6 + doc/NO_SYS_SampleCode.c | 121 + doc/ZeroCopyRx.c | 45 + doc/contrib.txt | 58 + doc/doxygen/generate.bat | 1 + doc/doxygen/generate.sh | 3 + doc/doxygen/lwip.Doxyfile | 2516 ++++++++ doc/doxygen/lwip.Doxyfile.cmake.in | 2516 ++++++++ doc/doxygen/main_page.h | 417 ++ doc/doxygen/output/index.html | 10 + doc/mdns.txt | 111 + doc/mqtt_client.txt | 164 + doc/ppp.txt | 529 ++ doc/savannah.txt | 122 + src/FILES | 15 + src/Filelists.cmake | 293 + src/Filelists.mk | 208 + src/api/api_lib.c | 1367 +++++ src/api/api_msg.c | 2177 +++++++ src/api/err.c | 115 + src/api/if_api.c | 102 + src/api/netbuf.c | 250 + src/api/netdb.c | 422 ++ src/api/netifapi.c | 380 ++ src/api/sockets.c | 4205 +++++++++++++ src/api/tcpip.c | 706 +++ src/apps/altcp_tls/altcp_tls_mbedtls.c | 1367 +++++ src/apps/altcp_tls/altcp_tls_mbedtls_mem.c | 210 + src/apps/altcp_tls/altcp_tls_mbedtls_mem.h | 72 + .../altcp_tls/altcp_tls_mbedtls_structs.h | 83 + src/apps/http/altcp_proxyconnect.c | 584 ++ src/apps/http/fs.c | 161 + src/apps/http/fs/404.html | 21 + src/apps/http/fs/img/sics.gif | Bin 0 -> 724 bytes src/apps/http/fs/index.html | 47 + src/apps/http/fsdata.c | 336 ++ src/apps/http/fsdata.h | 41 + src/apps/http/http_client.c | 911 +++ src/apps/http/httpd.c | 2770 +++++++++ src/apps/http/httpd_structs.h | 123 + src/apps/http/makefsdata/makefsdata | 97 + src/apps/http/makefsdata/makefsdata.c | 1307 ++++ src/apps/http/makefsdata/readme.txt | 23 + src/apps/http/makefsdata/tinydir.h | 831 +++ src/apps/lwiperf/lwiperf.c | 847 +++ src/apps/mdns/mdns.c | 2855 +++++++++ src/apps/mdns/mdns_domain.c | 635 ++ src/apps/mdns/mdns_out.c | 1163 ++++ src/apps/mqtt/mqtt.c | 1480 +++++ src/apps/netbiosns/netbiosns.c | 533 ++ src/apps/smtp/smtp.c | 1554 +++++ src/apps/snmp/snmp_asn1.c | 704 +++ src/apps/snmp/snmp_asn1.h | 113 + src/apps/snmp/snmp_core.c | 1356 +++++ src/apps/snmp/snmp_core_priv.h | 91 + src/apps/snmp/snmp_mib2.c | 116 + src/apps/snmp/snmp_mib2_icmp.c | 182 + src/apps/snmp/snmp_mib2_interfaces.c | 368 ++ src/apps/snmp/snmp_mib2_ip.c | 731 +++ src/apps/snmp/snmp_mib2_snmp.c | 227 + src/apps/snmp/snmp_mib2_system.c | 376 ++ src/apps/snmp/snmp_mib2_tcp.c | 607 ++ src/apps/snmp/snmp_mib2_udp.c | 372 ++ src/apps/snmp/snmp_msg.c | 1981 +++++++ src/apps/snmp/snmp_msg.h | 185 + src/apps/snmp/snmp_netconn.c | 122 + src/apps/snmp/snmp_pbuf_stream.c | 156 + src/apps/snmp/snmp_pbuf_stream.h | 72 + src/apps/snmp/snmp_raw.c | 103 + src/apps/snmp/snmp_scalar.c | 232 + src/apps/snmp/snmp_snmpv2_framework.c | 90 + src/apps/snmp/snmp_snmpv2_usm.c | 410 ++ src/apps/snmp/snmp_table.c | 342 ++ src/apps/snmp/snmp_threadsync.c | 231 + src/apps/snmp/snmp_traps.c | 900 +++ src/apps/snmp/snmpv3.c | 136 + src/apps/snmp/snmpv3_mbedtls.c | 342 ++ src/apps/snmp/snmpv3_priv.h | 69 + src/apps/sntp/sntp.c | 948 +++ src/apps/tftp/tftp.c | 548 ++ src/core/altcp.c | 717 +++ src/core/altcp_alloc.c | 87 + src/core/altcp_tcp.c | 578 ++ src/core/def.c | 263 + src/core/dns.c | 1657 ++++++ src/core/inet_chksum.c | 608 ++ src/core/init.c | 387 ++ src/core/ip.c | 167 + src/core/ipv4/acd.c | 557 ++ src/core/ipv4/autoip.c | 379 ++ src/core/ipv4/dhcp.c | 1999 +++++++ src/core/ipv4/etharp.c | 1251 ++++ src/core/ipv4/icmp.c | 407 ++ src/core/ipv4/igmp.c | 801 +++ src/core/ipv4/ip4.c | 1166 ++++ src/core/ipv4/ip4_addr.c | 323 + src/core/ipv4/ip4_frag.c | 894 +++ src/core/ipv6/dhcp6.c | 821 +++ src/core/ipv6/ethip6.c | 123 + src/core/ipv6/icmp6.c | 425 ++ src/core/ipv6/inet6.c | 53 + src/core/ipv6/ip6.c | 1494 +++++ src/core/ipv6/ip6_addr.c | 355 ++ src/core/ipv6/ip6_frag.c | 862 +++ src/core/ipv6/mld6.c | 626 ++ src/core/ipv6/nd6.c | 2474 ++++++++ src/core/mem.c | 1017 ++++ src/core/memp.c | 447 ++ src/core/netif.c | 1855 ++++++ src/core/pbuf.c | 1545 +++++ src/core/raw.c | 673 +++ src/core/stats.c | 168 + src/core/sys.c | 148 + src/core/tcp.c | 2696 +++++++++ src/core/tcp_in.c | 2184 +++++++ src/core/tcp_out.c | 2257 +++++++ src/core/timeouts.c | 451 ++ src/core/udp.c | 1321 +++++ src/include/compat/posix/arpa/inet.h | 33 + src/include/compat/posix/net/if.h | 36 + src/include/compat/posix/netdb.h | 33 + src/include/compat/posix/sys/socket.h | 33 + src/include/compat/stdc/errno.h | 33 + src/include/lwip/acd.h | 109 + src/include/lwip/altcp.h | 207 + src/include/lwip/altcp_tcp.h | 72 + src/include/lwip/altcp_tls.h | 196 + src/include/lwip/api.h | 434 ++ src/include/lwip/apps/FILES | 2 + src/include/lwip/apps/altcp_proxyconnect.h | 79 + .../lwip/apps/altcp_tls_mbedtls_opts.h | 111 + src/include/lwip/apps/fs.h | 139 + src/include/lwip/apps/http_client.h | 160 + src/include/lwip/apps/httpd.h | 256 + src/include/lwip/apps/httpd_opts.h | 416 ++ src/include/lwip/apps/lwiperf.h | 109 + src/include/lwip/apps/mdns.h | 154 + src/include/lwip/apps/mdns_domain.h | 80 + src/include/lwip/apps/mdns_opts.h | 121 + src/include/lwip/apps/mdns_out.h | 138 + src/include/lwip/apps/mdns_priv.h | 237 + src/include/lwip/apps/mqtt.h | 205 + src/include/lwip/apps/mqtt_opts.h | 103 + src/include/lwip/apps/mqtt_priv.h | 104 + src/include/lwip/apps/netbiosns.h | 51 + src/include/lwip/apps/netbiosns_opts.h | 66 + src/include/lwip/apps/smtp.h | 128 + src/include/lwip/apps/smtp_opts.h | 80 + src/include/lwip/apps/snmp.h | 145 + src/include/lwip/apps/snmp_core.h | 377 ++ src/include/lwip/apps/snmp_mib2.h | 78 + src/include/lwip/apps/snmp_opts.h | 297 + src/include/lwip/apps/snmp_scalar.h | 113 + src/include/lwip/apps/snmp_snmpv2_framework.h | 32 + src/include/lwip/apps/snmp_snmpv2_usm.h | 24 + src/include/lwip/apps/snmp_table.h | 134 + src/include/lwip/apps/snmp_threadsync.h | 114 + src/include/lwip/apps/snmpv3.h | 114 + src/include/lwip/apps/sntp.h | 81 + src/include/lwip/apps/sntp_opts.h | 215 + src/include/lwip/apps/tftp_client.h | 50 + src/include/lwip/apps/tftp_common.h | 108 + src/include/lwip/apps/tftp_opts.h | 106 + src/include/lwip/apps/tftp_server.h | 42 + src/include/lwip/arch.h | 402 ++ src/include/lwip/autoip.h | 90 + src/include/lwip/debug.h | 161 + src/include/lwip/def.h | 156 + src/include/lwip/dhcp.h | 155 + src/include/lwip/dhcp6.h | 104 + src/include/lwip/dns.h | 131 + src/include/lwip/err.h | 117 + src/include/lwip/errno.h | 198 + src/include/lwip/etharp.h | 110 + src/include/lwip/ethip6.h | 68 + src/include/lwip/icmp.h | 110 + src/include/lwip/icmp6.h | 72 + src/include/lwip/if_api.h | 70 + src/include/lwip/igmp.h | 115 + src/include/lwip/inet.h | 188 + src/include/lwip/inet_chksum.h | 104 + src/include/lwip/init.h | 100 + src/include/lwip/init.h.cmake.in | 100 + src/include/lwip/ip.h | 339 ++ src/include/lwip/ip4.h | 109 + src/include/lwip/ip4_addr.h | 225 + src/include/lwip/ip4_frag.h | 100 + src/include/lwip/ip6.h | 93 + src/include/lwip/ip6_addr.h | 372 ++ src/include/lwip/ip6_frag.h | 144 + src/include/lwip/ip6_zone.h | 306 + src/include/lwip/ip_addr.h | 468 ++ src/include/lwip/mem.h | 82 + src/include/lwip/memp.h | 155 + src/include/lwip/mld6.h | 99 + src/include/lwip/nd6.h | 90 + src/include/lwip/netbuf.h | 116 + src/include/lwip/netdb.h | 150 + src/include/lwip/netif.h | 698 +++ src/include/lwip/netifapi.h | 161 + src/include/lwip/opt.h | 3595 +++++++++++ src/include/lwip/pbuf.h | 326 + src/include/lwip/priv/altcp_priv.h | 159 + src/include/lwip/priv/api_msg.h | 272 + src/include/lwip/priv/mem_priv.h | 84 + src/include/lwip/priv/memp_priv.h | 161 + src/include/lwip/priv/memp_std.h | 153 + src/include/lwip/priv/nd6_priv.h | 143 + src/include/lwip/priv/raw_priv.h | 69 + src/include/lwip/priv/sockets_priv.h | 175 + src/include/lwip/priv/tcp_priv.h | 523 ++ src/include/lwip/priv/tcpip_priv.h | 176 + src/include/lwip/prot/acd.h | 91 + src/include/lwip/prot/autoip.h | 65 + src/include/lwip/prot/dhcp.h | 178 + src/include/lwip/prot/dhcp6.h | 138 + src/include/lwip/prot/dns.h | 140 + src/include/lwip/prot/etharp.h | 114 + src/include/lwip/prot/ethernet.h | 127 + src/include/lwip/prot/iana.h | 97 + src/include/lwip/prot/icmp.h | 105 + src/include/lwip/prot/icmp6.h | 172 + src/include/lwip/prot/ieee.h | 91 + src/include/lwip/prot/igmp.h | 90 + src/include/lwip/prot/ip.h | 59 + src/include/lwip/prot/ip4.h | 131 + src/include/lwip/prot/ip6.h | 235 + src/include/lwip/prot/mld6.h | 71 + src/include/lwip/prot/nd6.h | 274 + src/include/lwip/prot/tcp.h | 100 + src/include/lwip/prot/udp.h | 68 + src/include/lwip/raw.h | 143 + src/include/lwip/sio.h | 142 + src/include/lwip/snmp.h | 213 + src/include/lwip/sockets.h | 707 +++ src/include/lwip/stats.h | 491 ++ src/include/lwip/sys.h | 575 ++ src/include/lwip/tcp.h | 500 ++ src/include/lwip/tcpbase.h | 88 + src/include/lwip/tcpip.h | 114 + src/include/lwip/timeouts.h | 128 + src/include/lwip/udp.h | 195 + src/include/netif/bridgeif.h | 127 + src/include/netif/bridgeif_opts.h | 90 + src/include/netif/etharp.h | 3 + src/include/netif/ethernet.h | 77 + src/include/netif/ieee802154.h | 112 + src/include/netif/lowpan6.h | 89 + src/include/netif/lowpan6_ble.h | 78 + src/include/netif/lowpan6_common.h | 82 + src/include/netif/lowpan6_opts.h | 122 + src/include/netif/ppp/ccp.h | 164 + src/include/netif/ppp/chap-md5.h | 36 + src/include/netif/ppp/chap-new.h | 200 + src/include/netif/ppp/chap_ms.h | 44 + src/include/netif/ppp/eap.h | 169 + src/include/netif/ppp/ecp.h | 62 + src/include/netif/ppp/eui64.h | 102 + src/include/netif/ppp/fsm.h | 182 + src/include/netif/ppp/ipcp.h | 134 + src/include/netif/ppp/ipv6cp.h | 191 + src/include/netif/ppp/lcp.h | 179 + src/include/netif/ppp/magic.h | 130 + src/include/netif/ppp/mppe.h | 181 + src/include/netif/ppp/polarssl/arc4.h | 81 + src/include/netif/ppp/polarssl/des.h | 92 + src/include/netif/ppp/polarssl/md4.h | 97 + src/include/netif/ppp/polarssl/md5.h | 96 + src/include/netif/ppp/polarssl/sha1.h | 96 + src/include/netif/ppp/ppp.h | 698 +++ src/include/netif/ppp/ppp_impl.h | 736 +++ src/include/netif/ppp/ppp_opts.h | 610 ++ src/include/netif/ppp/pppapi.h | 137 + src/include/netif/ppp/pppcrypt.h | 144 + src/include/netif/ppp/pppdebug.h | 88 + src/include/netif/ppp/pppoe.h | 187 + src/include/netif/ppp/pppol2tp.h | 209 + src/include/netif/ppp/pppos.h | 125 + src/include/netif/ppp/upap.h | 131 + src/include/netif/ppp/vj.h | 169 + src/include/netif/slipif.h | 86 + src/include/netif/zepif.h | 81 + src/netif/FILES | 23 + src/netif/bridgeif.c | 563 ++ src/netif/bridgeif_fdb.c | 212 + src/netif/ethernet.c | 329 ++ src/netif/lowpan6.c | 921 +++ src/netif/lowpan6_ble.c | 447 ++ src/netif/lowpan6_common.c | 841 +++ src/netif/ppp/PPPD_FOLLOWUP | 473 ++ src/netif/ppp/auth.c | 2513 ++++++++ src/netif/ppp/ccp.c | 1740 ++++++ src/netif/ppp/chap-md5.c | 126 + src/netif/ppp/chap-new.c | 677 +++ src/netif/ppp/chap_ms.c | 962 +++ src/netif/ppp/demand.c | 465 ++ src/netif/ppp/eap.c | 2441 ++++++++ src/netif/ppp/ecp.c | 191 + src/netif/ppp/eui64.c | 56 + src/netif/ppp/fsm.c | 799 +++ src/netif/ppp/ipcp.c | 2418 ++++++++ src/netif/ppp/ipv6cp.c | 1533 +++++ src/netif/ppp/lcp.c | 2794 +++++++++ src/netif/ppp/magic.c | 286 + src/netif/ppp/mppe.c | 412 ++ src/netif/ppp/multilink.c | 609 ++ src/netif/ppp/polarssl/README | 22 + src/netif/ppp/polarssl/arc4.c | 101 + src/netif/ppp/polarssl/des.c | 422 ++ src/netif/ppp/polarssl/md4.c | 281 + src/netif/ppp/polarssl/md5.c | 300 + src/netif/ppp/polarssl/sha1.c | 335 ++ src/netif/ppp/ppp.c | 1645 ++++++ src/netif/ppp/pppapi.c | 427 ++ src/netif/ppp/pppcrypt.c | 66 + src/netif/ppp/pppoe.c | 1217 ++++ src/netif/ppp/pppol2tp.c | 1171 ++++ src/netif/ppp/pppos.c | 940 +++ src/netif/ppp/upap.c | 679 +++ src/netif/ppp/utils.c | 957 +++ src/netif/ppp/vj.c | 685 +++ src/netif/slipif.c | 558 ++ src/netif/zepif.c | 300 + test/fuzz/Makefile | 73 + test/fuzz/README | 34 + test/fuzz/config.h | 0 test/fuzz/fuzz.c | 39 + test/fuzz/fuzz2.c | 39 + test/fuzz/fuzz3.c | 40 + test/fuzz/fuzz_common.c | 702 +++ test/fuzz/fuzz_common.h | 62 + test/fuzz/inputs/arp/arp_req.bin | Bin 0 -> 42 bytes test/fuzz/inputs/icmp/icmp_ping.bin | Bin 0 -> 98 bytes .../inputs/ipv6/neighbor_solicitation.bin | Bin 0 -> 86 bytes test/fuzz/inputs/ipv6/router_adv.bin | Bin 0 -> 118 bytes test/fuzz/inputs/tcp/tcp_syn.bin | Bin 0 -> 74 bytes test/fuzz/inputs/udp/udp_port_5000.bin | Bin 0 -> 50 bytes test/fuzz/lwipopts.h | 84 + test/fuzz/output_to_pcap.sh | 31 + test/sockets/sockets_stresstest.c | 726 +++ test/sockets/sockets_stresstest.h | 40 + test/unit/Filelists.cmake | 38 + test/unit/Filelists.mk | 54 + test/unit/Makefile | 11 + test/unit/api/test_sockets.c | 852 +++ test/unit/api/test_sockets.h | 8 + test/unit/arch/sys_arch.c | 387 ++ test/unit/arch/sys_arch.h | 79 + test/unit/core/test_def.c | 84 + test/unit/core/test_def.h | 8 + test/unit/core/test_dns.c | 52 + test/unit/core/test_dns.h | 8 + test/unit/core/test_mem.c | 221 + test/unit/core/test_mem.h | 8 + test/unit/core/test_netif.c | 285 + test/unit/core/test_netif.h | 8 + test/unit/core/test_pbuf.c | 359 ++ test/unit/core/test_pbuf.h | 8 + test/unit/core/test_timers.c | 233 + test/unit/core/test_timers.h | 8 + test/unit/dhcp/test_dhcp.c | 1103 ++++ test/unit/dhcp/test_dhcp.h | 8 + test/unit/etharp/test_etharp.c | 273 + test/unit/etharp/test_etharp.h | 8 + test/unit/ip4/test_ip4.c | 342 ++ test/unit/ip4/test_ip4.h | 8 + test/unit/ip6/test_ip6.c | 469 ++ test/unit/ip6/test_ip6.h | 8 + test/unit/lwip_check.h | 52 + test/unit/lwip_unittests.c | 125 + test/unit/lwipopts.h | 94 + test/unit/mdns/test_mdns.c | 916 +++ test/unit/mdns/test_mdns.h | 8 + test/unit/mqtt/test_mqtt.c | 115 + test/unit/mqtt/test_mqtt.h | 8 + test/unit/ppp/test_pppos.c | 67 + test/unit/ppp/test_pppos.h | 13 + test/unit/tcp/tcp_helper.c | 325 + test/unit/tcp/tcp_helper.h | 58 + test/unit/tcp/test_tcp.c | 1700 ++++++ test/unit/tcp/test_tcp.h | 8 + test/unit/tcp/test_tcp_oos.c | 1018 ++++ test/unit/tcp/test_tcp_oos.h | 8 + test/unit/tcp/test_tcp_state.c | 665 +++ test/unit/tcp/test_tcp_state.h | 8 + test/unit/udp/test_udp.c | 472 ++ test/unit/udp/test_udp.h | 8 + 726 files changed, 221755 insertions(+) create mode 100644 .gitattributes create mode 100644 .github/workflows/ci-linux.yml create mode 100644 .gitignore create mode 100644 .vscode/c_cpp_properties.json create mode 100644 .vscode/launch.json create mode 100644 .vscode/settings.json create mode 100644 .vscode/tasks.json create mode 100644 BUILDING create mode 100644 CHANGELOG create mode 100644 CMakeLists.txt create mode 100644 COPYING create mode 100644 FEATURES create mode 100644 FILES create mode 100644 README create mode 100644 UPGRADING create mode 100644 codespell_changed_files.sh create mode 100755 codespell_check.sh create mode 100644 contrib/Coverity/coverity.c create mode 100644 contrib/Filelists.cmake create mode 100644 contrib/Filelists.mk create mode 100644 contrib/addons/dhcp_extra_opts/README create mode 100644 contrib/addons/dhcp_extra_opts/dhcp_extra_opts.c create mode 100644 contrib/addons/dhcp_extra_opts/dhcp_extra_opts.h create mode 100644 contrib/addons/ipv6_static_routing/README create mode 100644 contrib/addons/ipv6_static_routing/ip6_route_table.c create mode 100644 contrib/addons/ipv6_static_routing/ip6_route_table.h create mode 100644 contrib/addons/netconn/external_resolve/dnssd.c create mode 100644 contrib/addons/netconn/external_resolve/dnssd.h create mode 100644 contrib/addons/tcp_isn/tcp_isn.c create mode 100644 contrib/addons/tcp_isn/tcp_isn.h create mode 100644 contrib/addons/tcp_md5/README create mode 100644 contrib/addons/tcp_md5/tcp_md5.c create mode 100644 contrib/addons/tcp_md5/tcp_md5.h create mode 100644 contrib/apps/LwipMibCompiler/CCodeGeneration/CCodeGeneration.csproj create mode 100644 contrib/apps/LwipMibCompiler/CCodeGeneration/CFile.cs create mode 100644 contrib/apps/LwipMibCompiler/CCodeGeneration/CGenerator.cs create mode 100644 contrib/apps/LwipMibCompiler/CCodeGeneration/Code.cs create mode 100644 contrib/apps/LwipMibCompiler/CCodeGeneration/CodeContainerBase.cs create mode 100644 contrib/apps/LwipMibCompiler/CCodeGeneration/CodeElement.cs create mode 100644 contrib/apps/LwipMibCompiler/CCodeGeneration/Comment.cs create mode 100644 contrib/apps/LwipMibCompiler/CCodeGeneration/EmptyLine.cs create mode 100644 contrib/apps/LwipMibCompiler/CCodeGeneration/Function.cs create mode 100644 contrib/apps/LwipMibCompiler/CCodeGeneration/FunctionDeclaration.cs create mode 100644 contrib/apps/LwipMibCompiler/CCodeGeneration/IfThenElse.cs create mode 100644 contrib/apps/LwipMibCompiler/CCodeGeneration/PP_If.cs create mode 100644 contrib/apps/LwipMibCompiler/CCodeGeneration/PP_Ifdef.cs create mode 100644 contrib/apps/LwipMibCompiler/CCodeGeneration/PP_Include.cs create mode 100644 contrib/apps/LwipMibCompiler/CCodeGeneration/PP_Macro.cs create mode 100644 contrib/apps/LwipMibCompiler/CCodeGeneration/PlainText.cs create mode 100644 contrib/apps/LwipMibCompiler/CCodeGeneration/Properties/AssemblyInfo.cs create mode 100644 contrib/apps/LwipMibCompiler/CCodeGeneration/Switch.cs create mode 100644 contrib/apps/LwipMibCompiler/CCodeGeneration/VariableDeclaration.cs create mode 100644 contrib/apps/LwipMibCompiler/CCodeGeneration/VariablePrototype.cs create mode 100644 contrib/apps/LwipMibCompiler/CCodeGeneration/VariableType.cs create mode 100644 contrib/apps/LwipMibCompiler/LwipMibCompiler.sln create mode 100644 contrib/apps/LwipMibCompiler/LwipMibCompiler/LwipMibCompiler.csproj create mode 100644 contrib/apps/LwipMibCompiler/LwipMibCompiler/Program.cs create mode 100644 contrib/apps/LwipMibCompiler/LwipMibCompiler/Properties/AssemblyInfo.cs create mode 100644 contrib/apps/LwipMibCompiler/LwipMibCompiler/app.config create mode 100644 contrib/apps/LwipMibCompiler/LwipSnmpCodeGeneration/IRestriction.cs create mode 100644 contrib/apps/LwipMibCompiler/LwipSnmpCodeGeneration/LwipSnmp.cs create mode 100644 contrib/apps/LwipMibCompiler/LwipSnmpCodeGeneration/LwipSnmpCodeGeneration.csproj create mode 100644 contrib/apps/LwipMibCompiler/LwipSnmpCodeGeneration/MibCFile.cs create mode 100644 contrib/apps/LwipMibCompiler/LwipSnmpCodeGeneration/MibHeaderFile.cs create mode 100644 contrib/apps/LwipMibCompiler/LwipSnmpCodeGeneration/Properties/AssemblyInfo.cs create mode 100644 contrib/apps/LwipMibCompiler/LwipSnmpCodeGeneration/SnmpMib.cs create mode 100644 contrib/apps/LwipMibCompiler/LwipSnmpCodeGeneration/SnmpNode.cs create mode 100644 contrib/apps/LwipMibCompiler/LwipSnmpCodeGeneration/SnmpScalarAggregationNode.cs create mode 100644 contrib/apps/LwipMibCompiler/LwipSnmpCodeGeneration/SnmpScalarArrayNode.cs create mode 100644 contrib/apps/LwipMibCompiler/LwipSnmpCodeGeneration/SnmpScalarNode.cs create mode 100644 contrib/apps/LwipMibCompiler/LwipSnmpCodeGeneration/SnmpScalarNodeBits.cs create mode 100644 contrib/apps/LwipMibCompiler/LwipSnmpCodeGeneration/SnmpScalarNodeCounter64.cs create mode 100644 contrib/apps/LwipMibCompiler/LwipSnmpCodeGeneration/SnmpScalarNodeInt.cs create mode 100644 contrib/apps/LwipMibCompiler/LwipSnmpCodeGeneration/SnmpScalarNodeObjectIdentifier.cs create mode 100644 contrib/apps/LwipMibCompiler/LwipSnmpCodeGeneration/SnmpScalarNodeOctetString.cs create mode 100644 contrib/apps/LwipMibCompiler/LwipSnmpCodeGeneration/SnmpScalarNodeTruthValue.cs create mode 100644 contrib/apps/LwipMibCompiler/LwipSnmpCodeGeneration/SnmpScalarNodeUint.cs create mode 100644 contrib/apps/LwipMibCompiler/LwipSnmpCodeGeneration/SnmpTableNode.cs create mode 100644 contrib/apps/LwipMibCompiler/LwipSnmpCodeGeneration/SnmpTreeNode.cs create mode 100644 contrib/apps/LwipMibCompiler/MibViewer/FormMain.Designer.cs create mode 100644 contrib/apps/LwipMibCompiler/MibViewer/FormMain.cs create mode 100644 contrib/apps/LwipMibCompiler/MibViewer/FormMain.resx create mode 100644 contrib/apps/LwipMibCompiler/MibViewer/MibViewer.csproj create mode 100644 contrib/apps/LwipMibCompiler/MibViewer/Program.cs create mode 100644 contrib/apps/LwipMibCompiler/MibViewer/Properties/AssemblyInfo.cs create mode 100644 contrib/apps/LwipMibCompiler/MibViewer/Properties/Resources.Designer.cs create mode 100644 contrib/apps/LwipMibCompiler/MibViewer/Properties/Resources.resx create mode 100644 contrib/apps/LwipMibCompiler/MibViewer/Properties/Settings.Designer.cs create mode 100644 contrib/apps/LwipMibCompiler/MibViewer/Properties/Settings.settings create mode 100644 contrib/apps/LwipMibCompiler/MibViewer/app.config create mode 100644 contrib/apps/LwipMibCompiler/Mibs/IANA-ADDRESS-FAMILY-NUMBERS-MIB create mode 100644 contrib/apps/LwipMibCompiler/Mibs/IANA-CHARSET-MIB create mode 100644 contrib/apps/LwipMibCompiler/Mibs/IANA/IANA-ITU-ALARM-TC-MIB create mode 100644 contrib/apps/LwipMibCompiler/Mibs/IANA/IANA-LANGUAGE-MIB create mode 100644 contrib/apps/LwipMibCompiler/Mibs/IANA/IANA-MALLOC-MIB create mode 100644 contrib/apps/LwipMibCompiler/Mibs/IANA/IANA-MAU-MIB create mode 100644 contrib/apps/LwipMibCompiler/Mibs/IANA/IANA-PRINTER-MIB create mode 100644 contrib/apps/LwipMibCompiler/Mibs/IANA/IANA-RTPROTO-MIB create mode 100644 contrib/apps/LwipMibCompiler/Mibs/IANA/IANATn3270eTC-MIB create mode 100644 contrib/apps/LwipMibCompiler/Mibs/IANA/IANAifType-MIB create mode 100644 contrib/apps/LwipMibCompiler/Mibs/IF-MIB create mode 100644 contrib/apps/LwipMibCompiler/Mibs/INET-ADDRESS-MIB create mode 100644 contrib/apps/LwipMibCompiler/Mibs/IP-MIB create mode 100644 contrib/apps/LwipMibCompiler/Mibs/RFC-1212 create mode 100644 contrib/apps/LwipMibCompiler/Mibs/RFC-1215 create mode 100644 contrib/apps/LwipMibCompiler/Mibs/RFC1065-SMI create mode 100644 contrib/apps/LwipMibCompiler/Mibs/RFC1155-SMI create mode 100644 contrib/apps/LwipMibCompiler/Mibs/RFC1158-MIB create mode 100644 contrib/apps/LwipMibCompiler/Mibs/RFC1213-MIB create mode 100644 contrib/apps/LwipMibCompiler/Mibs/SNMPv2-CONF create mode 100644 contrib/apps/LwipMibCompiler/Mibs/SNMPv2-MIB create mode 100644 contrib/apps/LwipMibCompiler/Mibs/SNMPv2-SMI create mode 100644 contrib/apps/LwipMibCompiler/Mibs/SNMPv2-TC create mode 100644 contrib/apps/LwipMibCompiler/Mibs/SNMPv2-TM create mode 100644 contrib/apps/LwipMibCompiler/Mibs/TCP-MIB create mode 100644 contrib/apps/LwipMibCompiler/Mibs/UDP-MIB create mode 100644 contrib/apps/LwipMibCompiler/SharpSnmpLib/Mib/DisplayHint.cs create mode 100644 contrib/apps/LwipMibCompiler/SharpSnmpLib/Mib/Elements/Entities/AgentCapabilities.cs create mode 100644 contrib/apps/LwipMibCompiler/SharpSnmpLib/Mib/Elements/Entities/EntityBase.cs create mode 100644 contrib/apps/LwipMibCompiler/SharpSnmpLib/Mib/Elements/Entities/IEntity.cs create mode 100644 contrib/apps/LwipMibCompiler/SharpSnmpLib/Mib/Elements/Entities/ModuleCompliance.cs create mode 100644 contrib/apps/LwipMibCompiler/SharpSnmpLib/Mib/Elements/Entities/ModuleIdentity.cs create mode 100644 contrib/apps/LwipMibCompiler/SharpSnmpLib/Mib/Elements/Entities/NotificationGroup.cs create mode 100644 contrib/apps/LwipMibCompiler/SharpSnmpLib/Mib/Elements/Entities/NotificationType.cs create mode 100644 contrib/apps/LwipMibCompiler/SharpSnmpLib/Mib/Elements/Entities/ObjectGroup.cs create mode 100644 contrib/apps/LwipMibCompiler/SharpSnmpLib/Mib/Elements/Entities/ObjectIdentity.cs create mode 100644 contrib/apps/LwipMibCompiler/SharpSnmpLib/Mib/Elements/Entities/ObjectType.cs create mode 100644 contrib/apps/LwipMibCompiler/SharpSnmpLib/Mib/Elements/Entities/OidValueAssignment.cs create mode 100644 contrib/apps/LwipMibCompiler/SharpSnmpLib/Mib/Elements/Exports.cs create mode 100644 contrib/apps/LwipMibCompiler/SharpSnmpLib/Mib/Elements/IDeclaration.cs create mode 100644 contrib/apps/LwipMibCompiler/SharpSnmpLib/Mib/Elements/IElement.cs create mode 100644 contrib/apps/LwipMibCompiler/SharpSnmpLib/Mib/Elements/ITypeReferrer.cs create mode 100644 contrib/apps/LwipMibCompiler/SharpSnmpLib/Mib/Elements/Imports.cs create mode 100644 contrib/apps/LwipMibCompiler/SharpSnmpLib/Mib/Elements/ImportsFrom.cs create mode 100644 contrib/apps/LwipMibCompiler/SharpSnmpLib/Mib/Elements/TrapType.cs create mode 100644 contrib/apps/LwipMibCompiler/SharpSnmpLib/Mib/Elements/Types/BaseType.cs create mode 100644 contrib/apps/LwipMibCompiler/SharpSnmpLib/Mib/Elements/Types/BitsType.cs create mode 100644 contrib/apps/LwipMibCompiler/SharpSnmpLib/Mib/Elements/Types/Choice.cs create mode 100644 contrib/apps/LwipMibCompiler/SharpSnmpLib/Mib/Elements/Types/ITypeAssignment.cs create mode 100644 contrib/apps/LwipMibCompiler/SharpSnmpLib/Mib/Elements/Types/IntegerType.cs create mode 100644 contrib/apps/LwipMibCompiler/SharpSnmpLib/Mib/Elements/Types/IpAddressType.cs create mode 100644 contrib/apps/LwipMibCompiler/SharpSnmpLib/Mib/Elements/Types/Macro.cs create mode 100644 contrib/apps/LwipMibCompiler/SharpSnmpLib/Mib/Elements/Types/ObjectIdentifierType.cs create mode 100644 contrib/apps/LwipMibCompiler/SharpSnmpLib/Mib/Elements/Types/OctetStringType.cs create mode 100644 contrib/apps/LwipMibCompiler/SharpSnmpLib/Mib/Elements/Types/OpaqueType.cs create mode 100644 contrib/apps/LwipMibCompiler/SharpSnmpLib/Mib/Elements/Types/Sequence.cs create mode 100644 contrib/apps/LwipMibCompiler/SharpSnmpLib/Mib/Elements/Types/SequenceOf.cs create mode 100644 contrib/apps/LwipMibCompiler/SharpSnmpLib/Mib/Elements/Types/TextualConvention.cs create mode 100644 contrib/apps/LwipMibCompiler/SharpSnmpLib/Mib/Elements/Types/TypeAssignment.cs create mode 100644 contrib/apps/LwipMibCompiler/SharpSnmpLib/Mib/Elements/Types/UnsignedType.cs create mode 100644 contrib/apps/LwipMibCompiler/SharpSnmpLib/Mib/IModule.cs create mode 100644 contrib/apps/LwipMibCompiler/SharpSnmpLib/Mib/ISymbolEnumerator.cs create mode 100644 contrib/apps/LwipMibCompiler/SharpSnmpLib/Mib/Lexer.cs create mode 100644 contrib/apps/LwipMibCompiler/SharpSnmpLib/Mib/MaxAccess.cs create mode 100644 contrib/apps/LwipMibCompiler/SharpSnmpLib/Mib/MibDocument.cs create mode 100644 contrib/apps/LwipMibCompiler/SharpSnmpLib/Mib/MibException.cs create mode 100644 contrib/apps/LwipMibCompiler/SharpSnmpLib/Mib/MibModule.cs create mode 100644 contrib/apps/LwipMibCompiler/SharpSnmpLib/Mib/MibResolver.cs create mode 100644 contrib/apps/LwipMibCompiler/SharpSnmpLib/Mib/MibTree.cs create mode 100644 contrib/apps/LwipMibCompiler/SharpSnmpLib/Mib/MibTreeNode.cs create mode 100644 contrib/apps/LwipMibCompiler/SharpSnmpLib/Mib/MibTypesResolver.cs create mode 100644 contrib/apps/LwipMibCompiler/SharpSnmpLib/Mib/ObjectIdentifier.cs create mode 100644 contrib/apps/LwipMibCompiler/SharpSnmpLib/Mib/Status.cs create mode 100644 contrib/apps/LwipMibCompiler/SharpSnmpLib/Mib/Symbol.cs create mode 100644 contrib/apps/LwipMibCompiler/SharpSnmpLib/Mib/SymbolList.cs create mode 100644 contrib/apps/LwipMibCompiler/SharpSnmpLib/Mib/ValueMap.cs create mode 100644 contrib/apps/LwipMibCompiler/SharpSnmpLib/Mib/ValueRange.cs create mode 100644 contrib/apps/LwipMibCompiler/SharpSnmpLib/Properties/AssemblyInfo.cs create mode 100644 contrib/apps/LwipMibCompiler/SharpSnmpLib/Properties/Resources.Designer.cs create mode 100644 contrib/apps/LwipMibCompiler/SharpSnmpLib/Properties/Resources.resx create mode 100644 contrib/apps/LwipMibCompiler/SharpSnmpLib/SharpSnmpLib.Mib.csproj create mode 100644 contrib/apps/LwipMibCompiler/SharpSnmpLib/license.txt create mode 100644 contrib/apps/LwipMibCompiler/SharpSnmpLib/readme.txt create mode 100644 contrib/apps/LwipMibCompiler/SharpSnmpLib/sharpsnmplib.snk create mode 100644 contrib/apps/LwipMibCompiler/example/compile_udp_mib.cmd create mode 100644 contrib/apps/LwipMibCompiler/example/compile_udp_mib.sh create mode 100644 contrib/apps/chargen/README create mode 100644 contrib/apps/chargen/chargen.c create mode 100644 contrib/apps/chargen/chargen.h create mode 100644 contrib/apps/httpserver/README create mode 100644 contrib/apps/httpserver/httpserver-netconn.c create mode 100644 contrib/apps/httpserver/httpserver-netconn.h create mode 100644 contrib/apps/netio/netio.c create mode 100644 contrib/apps/netio/netio.h create mode 100644 contrib/apps/ping/ping.c create mode 100644 contrib/apps/ping/ping.h create mode 100644 contrib/apps/rtp/rtp.c create mode 100644 contrib/apps/rtp/rtp.h create mode 100644 contrib/apps/rtp/rtpdata.h create mode 100644 contrib/apps/shell/shell.c create mode 100644 contrib/apps/shell/shell.h create mode 100644 contrib/apps/socket_examples/socket_examples.c create mode 100644 contrib/apps/socket_examples/socket_examples.h create mode 100644 contrib/apps/tcpecho/tcpecho.c create mode 100644 contrib/apps/tcpecho/tcpecho.h create mode 100644 contrib/apps/tcpecho_raw/tcpecho_raw.c create mode 100644 contrib/apps/tcpecho_raw/tcpecho_raw.h create mode 100644 contrib/apps/udpecho/udpecho.c create mode 100644 contrib/apps/udpecho/udpecho.h create mode 100644 contrib/apps/udpecho_raw/udpecho_raw.c create mode 100644 contrib/apps/udpecho_raw/udpecho_raw.h create mode 100644 contrib/examples/ethernetif/ethernetif.c create mode 100644 contrib/examples/example_app/default_netif.h create mode 100644 contrib/examples/example_app/lwipcfg.h.ci create mode 100644 contrib/examples/example_app/lwipcfg.h.example create mode 100644 contrib/examples/example_app/lwipopts.h create mode 100644 contrib/examples/example_app/lwippools.h create mode 100644 contrib/examples/example_app/ppp_settings.h create mode 100644 contrib/examples/example_app/test.c create mode 100644 contrib/examples/example_app/test_configs/opt_default.h create mode 100644 contrib/examples/example_app/test_configs/opt_dualstack.h create mode 100644 contrib/examples/example_app/test_configs/opt_ipv4only.h create mode 100644 contrib/examples/example_app/test_configs/opt_ipv6only.h create mode 100644 contrib/examples/example_app/test_configs/opt_no_tcp_dualstack.h create mode 100644 contrib/examples/example_app/test_configs/opt_no_tcp_ipv4only.h create mode 100644 contrib/examples/example_app/test_configs/opt_no_tcp_ipv6only.h create mode 100644 contrib/examples/example_app/test_configs/opt_no_udp_dualstack.h create mode 100644 contrib/examples/example_app/test_configs/opt_no_udp_ipv4only.h create mode 100644 contrib/examples/example_app/test_configs/opt_no_udp_ipv6only.h create mode 100644 contrib/examples/example_app/test_configs/opt_none.h create mode 100644 contrib/examples/example_app/test_configs/opt_nosys_dual.h create mode 100644 contrib/examples/example_app/test_configs/opt_nosys_ipv4.h create mode 100644 contrib/examples/example_app/test_configs/opt_nosys_ipv6.h create mode 100644 contrib/examples/httpd/cgi_example/cgi_example.c create mode 100644 contrib/examples/httpd/cgi_example/cgi_example.h create mode 100644 contrib/examples/httpd/examples_fs/404.html create mode 100644 contrib/examples/httpd/examples_fs/img/sics.gif create mode 100644 contrib/examples/httpd/examples_fs/index.html create mode 100644 contrib/examples/httpd/examples_fs/login.html create mode 100644 contrib/examples/httpd/examples_fs/loginfail.html create mode 100644 contrib/examples/httpd/examples_fs/session.html create mode 100644 contrib/examples/httpd/examples_fs/ssi.shtml create mode 100644 contrib/examples/httpd/examples_fsdata.c create mode 100644 contrib/examples/httpd/fs_example/fs_example.c create mode 100644 contrib/examples/httpd/fs_example/fs_example.h create mode 100644 contrib/examples/httpd/genfiles_example/genfiles_example.c create mode 100644 contrib/examples/httpd/genfiles_example/genfiles_example.h create mode 100644 contrib/examples/httpd/https_example/https_example.c create mode 100644 contrib/examples/httpd/https_example/https_example.h create mode 100644 contrib/examples/httpd/post_example/post_example.c create mode 100644 contrib/examples/httpd/ssi_example/ssi_example.c create mode 100644 contrib/examples/httpd/ssi_example/ssi_example.h create mode 100644 contrib/examples/lwiperf/lwiperf_example.c create mode 100644 contrib/examples/lwiperf/lwiperf_example.h create mode 100644 contrib/examples/mdns/mdns_example.c create mode 100644 contrib/examples/mdns/mdns_example.h create mode 100644 contrib/examples/mqtt/mqtt_example.c create mode 100644 contrib/examples/mqtt/mqtt_example.h create mode 100644 contrib/examples/ppp/pppos_example.c create mode 100644 contrib/examples/ppp/pppos_example.h create mode 100644 contrib/examples/snmp/snmp_example.c create mode 100644 contrib/examples/snmp/snmp_example.h create mode 100644 contrib/examples/snmp/snmp_private_mib/lwip_prvmib.c create mode 100644 contrib/examples/snmp/snmp_private_mib/private_mib.h create mode 100644 contrib/examples/snmp/snmp_v3/snmpv3_dummy.c create mode 100644 contrib/examples/snmp/snmp_v3/snmpv3_dummy.h create mode 100644 contrib/examples/sntp/sntp_example.c create mode 100644 contrib/examples/sntp/sntp_example.h create mode 100644 contrib/examples/tftp/tftp_example.c create mode 100644 contrib/examples/tftp/tftp_example.h create mode 100644 contrib/ports/CMakeCommon.cmake create mode 100644 contrib/ports/Common.allports.mk create mode 100644 contrib/ports/freertos/include/arch/sys_arch.h create mode 100644 contrib/ports/freertos/sys_arch.c create mode 100644 contrib/ports/unix/Common.mk create mode 100644 contrib/ports/unix/Filelists.cmake create mode 100644 contrib/ports/unix/README create mode 100644 contrib/ports/unix/check/CMakeLists.txt create mode 100644 contrib/ports/unix/check/Makefile create mode 100644 contrib/ports/unix/check/README create mode 100644 contrib/ports/unix/check/config.h create mode 100644 contrib/ports/unix/example_app/CMakeLists.txt create mode 100644 contrib/ports/unix/example_app/Makefile create mode 100644 contrib/ports/unix/example_app/default_netif.c create mode 100755 contrib/ports/unix/example_app/iteropts.sh create mode 100644 contrib/ports/unix/lib/CMakeLists.txt create mode 100644 contrib/ports/unix/lib/README create mode 100644 contrib/ports/unix/lib/lwipopts.h create mode 100644 contrib/ports/unix/port/include/arch/cc.h create mode 100644 contrib/ports/unix/port/include/arch/perf.h create mode 100644 contrib/ports/unix/port/include/arch/sys_arch.h create mode 100644 contrib/ports/unix/port/include/netif/fifo.h create mode 100644 contrib/ports/unix/port/include/netif/list.h create mode 100644 contrib/ports/unix/port/include/netif/pcapif.h create mode 100644 contrib/ports/unix/port/include/netif/sio.h create mode 100644 contrib/ports/unix/port/include/netif/tapif.h create mode 100644 contrib/ports/unix/port/include/netif/vdeif.h create mode 100644 contrib/ports/unix/port/netif/fifo.c create mode 100644 contrib/ports/unix/port/netif/list.c create mode 100644 contrib/ports/unix/port/netif/pcapif.c create mode 100644 contrib/ports/unix/port/netif/sio.c create mode 100644 contrib/ports/unix/port/netif/tapif.c create mode 100644 contrib/ports/unix/port/netif/vdeif.c create mode 100644 contrib/ports/unix/port/perf.c create mode 100644 contrib/ports/unix/port/sys_arch.c create mode 100644 contrib/ports/unix/posixlib/CMakeLists.txt create mode 100644 contrib/ports/unix/posixlib/Uninstall.cmake create mode 100644 contrib/ports/unix/posixlib/include/posix/inet.h create mode 100644 contrib/ports/unix/posixlib/include/posix/sockets.h create mode 100644 contrib/ports/unix/posixlib/lwipopts.h create mode 100755 contrib/ports/unix/setup-tapif create mode 100644 contrib/ports/win32/Common.mk create mode 100644 contrib/ports/win32/Filelists.cmake create mode 100644 contrib/ports/win32/check/check_stdint.h create mode 100644 contrib/ports/win32/check/config.h create mode 100644 contrib/ports/win32/check/stdbool.h create mode 100644 contrib/ports/win32/check/sys/time.h create mode 100644 contrib/ports/win32/check/time.c create mode 100644 contrib/ports/win32/check/unistd.h create mode 100644 contrib/ports/win32/example_app/CMakeLists.txt create mode 100644 contrib/ports/win32/example_app/Makefile create mode 100644 contrib/ports/win32/example_app/default_netif.c create mode 100644 contrib/ports/win32/include/arch/bpstruct.h create mode 100644 contrib/ports/win32/include/arch/cc.h create mode 100644 contrib/ports/win32/include/arch/epstruct.h create mode 100644 contrib/ports/win32/include/arch/perf.h create mode 100644 contrib/ports/win32/include/arch/sys_arch.h create mode 100644 contrib/ports/win32/msvc/build_coverity.cmd create mode 100644 contrib/ports/win32/msvc/libcheck.vcxproj create mode 100644 contrib/ports/win32/msvc/libcheck.vcxproj.filters create mode 100644 contrib/ports/win32/msvc/lwIP.vcxproj create mode 100644 contrib/ports/win32/msvc/lwIP.vcxproj.filters create mode 100644 contrib/ports/win32/msvc/lwIP_Test.sln create mode 100644 contrib/ports/win32/msvc/lwIP_Test.vcxproj create mode 100644 contrib/ports/win32/msvc/lwIP_Test.vcxproj.filters create mode 100644 contrib/ports/win32/msvc/lwIP_pcapif.vcxproj create mode 100644 contrib/ports/win32/msvc/lwIP_pcapif.vcxproj.filters create mode 100644 contrib/ports/win32/msvc/lwIP_unittests.sln create mode 100644 contrib/ports/win32/msvc/lwip_unittests.vcxproj create mode 100644 contrib/ports/win32/msvc/lwip_unittests.vcxproj.filters create mode 100644 contrib/ports/win32/msvc/makefsdata.vcxproj create mode 100644 contrib/ports/win32/msvc/makefsdata.vcxproj.filters create mode 100644 contrib/ports/win32/pcapif.c create mode 100644 contrib/ports/win32/pcapif.h create mode 100644 contrib/ports/win32/pcapif_helper.c create mode 100644 contrib/ports/win32/pcapif_helper.h create mode 100644 contrib/ports/win32/readme.txt create mode 100644 contrib/ports/win32/sio.c create mode 100644 contrib/ports/win32/sys_arch.c create mode 100644 doc/FILES create mode 100644 doc/NO_SYS_SampleCode.c create mode 100644 doc/ZeroCopyRx.c create mode 100644 doc/contrib.txt create mode 100644 doc/doxygen/generate.bat create mode 100755 doc/doxygen/generate.sh create mode 100644 doc/doxygen/lwip.Doxyfile create mode 100644 doc/doxygen/lwip.Doxyfile.cmake.in create mode 100644 doc/doxygen/main_page.h create mode 100644 doc/doxygen/output/index.html create mode 100644 doc/mdns.txt create mode 100644 doc/mqtt_client.txt create mode 100644 doc/ppp.txt create mode 100644 doc/savannah.txt create mode 100644 src/FILES create mode 100644 src/Filelists.cmake create mode 100644 src/Filelists.mk create mode 100644 src/api/api_lib.c create mode 100644 src/api/api_msg.c create mode 100644 src/api/err.c create mode 100644 src/api/if_api.c create mode 100644 src/api/netbuf.c create mode 100644 src/api/netdb.c create mode 100644 src/api/netifapi.c create mode 100644 src/api/sockets.c create mode 100644 src/api/tcpip.c create mode 100644 src/apps/altcp_tls/altcp_tls_mbedtls.c create mode 100644 src/apps/altcp_tls/altcp_tls_mbedtls_mem.c create mode 100644 src/apps/altcp_tls/altcp_tls_mbedtls_mem.h create mode 100644 src/apps/altcp_tls/altcp_tls_mbedtls_structs.h create mode 100644 src/apps/http/altcp_proxyconnect.c create mode 100644 src/apps/http/fs.c create mode 100644 src/apps/http/fs/404.html create mode 100644 src/apps/http/fs/img/sics.gif create mode 100644 src/apps/http/fs/index.html create mode 100644 src/apps/http/fsdata.c create mode 100644 src/apps/http/fsdata.h create mode 100644 src/apps/http/http_client.c create mode 100644 src/apps/http/httpd.c create mode 100644 src/apps/http/httpd_structs.h create mode 100644 src/apps/http/makefsdata/makefsdata create mode 100644 src/apps/http/makefsdata/makefsdata.c create mode 100644 src/apps/http/makefsdata/readme.txt create mode 100644 src/apps/http/makefsdata/tinydir.h create mode 100644 src/apps/lwiperf/lwiperf.c create mode 100644 src/apps/mdns/mdns.c create mode 100644 src/apps/mdns/mdns_domain.c create mode 100644 src/apps/mdns/mdns_out.c create mode 100644 src/apps/mqtt/mqtt.c create mode 100644 src/apps/netbiosns/netbiosns.c create mode 100644 src/apps/smtp/smtp.c create mode 100644 src/apps/snmp/snmp_asn1.c create mode 100644 src/apps/snmp/snmp_asn1.h create mode 100644 src/apps/snmp/snmp_core.c create mode 100644 src/apps/snmp/snmp_core_priv.h create mode 100644 src/apps/snmp/snmp_mib2.c create mode 100644 src/apps/snmp/snmp_mib2_icmp.c create mode 100644 src/apps/snmp/snmp_mib2_interfaces.c create mode 100644 src/apps/snmp/snmp_mib2_ip.c create mode 100644 src/apps/snmp/snmp_mib2_snmp.c create mode 100644 src/apps/snmp/snmp_mib2_system.c create mode 100644 src/apps/snmp/snmp_mib2_tcp.c create mode 100644 src/apps/snmp/snmp_mib2_udp.c create mode 100644 src/apps/snmp/snmp_msg.c create mode 100644 src/apps/snmp/snmp_msg.h create mode 100644 src/apps/snmp/snmp_netconn.c create mode 100644 src/apps/snmp/snmp_pbuf_stream.c create mode 100644 src/apps/snmp/snmp_pbuf_stream.h create mode 100644 src/apps/snmp/snmp_raw.c create mode 100644 src/apps/snmp/snmp_scalar.c create mode 100644 src/apps/snmp/snmp_snmpv2_framework.c create mode 100644 src/apps/snmp/snmp_snmpv2_usm.c create mode 100644 src/apps/snmp/snmp_table.c create mode 100644 src/apps/snmp/snmp_threadsync.c create mode 100644 src/apps/snmp/snmp_traps.c create mode 100644 src/apps/snmp/snmpv3.c create mode 100644 src/apps/snmp/snmpv3_mbedtls.c create mode 100644 src/apps/snmp/snmpv3_priv.h create mode 100644 src/apps/sntp/sntp.c create mode 100644 src/apps/tftp/tftp.c create mode 100644 src/core/altcp.c create mode 100644 src/core/altcp_alloc.c create mode 100644 src/core/altcp_tcp.c create mode 100644 src/core/def.c create mode 100644 src/core/dns.c create mode 100644 src/core/inet_chksum.c create mode 100644 src/core/init.c create mode 100644 src/core/ip.c create mode 100644 src/core/ipv4/acd.c create mode 100644 src/core/ipv4/autoip.c create mode 100644 src/core/ipv4/dhcp.c create mode 100644 src/core/ipv4/etharp.c create mode 100644 src/core/ipv4/icmp.c create mode 100644 src/core/ipv4/igmp.c create mode 100644 src/core/ipv4/ip4.c create mode 100644 src/core/ipv4/ip4_addr.c create mode 100644 src/core/ipv4/ip4_frag.c create mode 100644 src/core/ipv6/dhcp6.c create mode 100644 src/core/ipv6/ethip6.c create mode 100644 src/core/ipv6/icmp6.c create mode 100644 src/core/ipv6/inet6.c create mode 100644 src/core/ipv6/ip6.c create mode 100644 src/core/ipv6/ip6_addr.c create mode 100644 src/core/ipv6/ip6_frag.c create mode 100644 src/core/ipv6/mld6.c create mode 100644 src/core/ipv6/nd6.c create mode 100644 src/core/mem.c create mode 100644 src/core/memp.c create mode 100644 src/core/netif.c create mode 100644 src/core/pbuf.c create mode 100644 src/core/raw.c create mode 100644 src/core/stats.c create mode 100644 src/core/sys.c create mode 100644 src/core/tcp.c create mode 100644 src/core/tcp_in.c create mode 100644 src/core/tcp_out.c create mode 100644 src/core/timeouts.c create mode 100644 src/core/udp.c create mode 100644 src/include/compat/posix/arpa/inet.h create mode 100644 src/include/compat/posix/net/if.h create mode 100644 src/include/compat/posix/netdb.h create mode 100644 src/include/compat/posix/sys/socket.h create mode 100644 src/include/compat/stdc/errno.h create mode 100644 src/include/lwip/acd.h create mode 100644 src/include/lwip/altcp.h create mode 100644 src/include/lwip/altcp_tcp.h create mode 100644 src/include/lwip/altcp_tls.h create mode 100644 src/include/lwip/api.h create mode 100644 src/include/lwip/apps/FILES create mode 100644 src/include/lwip/apps/altcp_proxyconnect.h create mode 100644 src/include/lwip/apps/altcp_tls_mbedtls_opts.h create mode 100644 src/include/lwip/apps/fs.h create mode 100644 src/include/lwip/apps/http_client.h create mode 100644 src/include/lwip/apps/httpd.h create mode 100644 src/include/lwip/apps/httpd_opts.h create mode 100644 src/include/lwip/apps/lwiperf.h create mode 100644 src/include/lwip/apps/mdns.h create mode 100644 src/include/lwip/apps/mdns_domain.h create mode 100644 src/include/lwip/apps/mdns_opts.h create mode 100644 src/include/lwip/apps/mdns_out.h create mode 100644 src/include/lwip/apps/mdns_priv.h create mode 100644 src/include/lwip/apps/mqtt.h create mode 100644 src/include/lwip/apps/mqtt_opts.h create mode 100644 src/include/lwip/apps/mqtt_priv.h create mode 100644 src/include/lwip/apps/netbiosns.h create mode 100644 src/include/lwip/apps/netbiosns_opts.h create mode 100644 src/include/lwip/apps/smtp.h create mode 100644 src/include/lwip/apps/smtp_opts.h create mode 100644 src/include/lwip/apps/snmp.h create mode 100644 src/include/lwip/apps/snmp_core.h create mode 100644 src/include/lwip/apps/snmp_mib2.h create mode 100644 src/include/lwip/apps/snmp_opts.h create mode 100644 src/include/lwip/apps/snmp_scalar.h create mode 100644 src/include/lwip/apps/snmp_snmpv2_framework.h create mode 100644 src/include/lwip/apps/snmp_snmpv2_usm.h create mode 100644 src/include/lwip/apps/snmp_table.h create mode 100644 src/include/lwip/apps/snmp_threadsync.h create mode 100644 src/include/lwip/apps/snmpv3.h create mode 100644 src/include/lwip/apps/sntp.h create mode 100644 src/include/lwip/apps/sntp_opts.h create mode 100644 src/include/lwip/apps/tftp_client.h create mode 100644 src/include/lwip/apps/tftp_common.h create mode 100644 src/include/lwip/apps/tftp_opts.h create mode 100644 src/include/lwip/apps/tftp_server.h create mode 100644 src/include/lwip/arch.h create mode 100644 src/include/lwip/autoip.h create mode 100644 src/include/lwip/debug.h create mode 100644 src/include/lwip/def.h create mode 100644 src/include/lwip/dhcp.h create mode 100644 src/include/lwip/dhcp6.h create mode 100644 src/include/lwip/dns.h create mode 100644 src/include/lwip/err.h create mode 100644 src/include/lwip/errno.h create mode 100644 src/include/lwip/etharp.h create mode 100644 src/include/lwip/ethip6.h create mode 100644 src/include/lwip/icmp.h create mode 100644 src/include/lwip/icmp6.h create mode 100644 src/include/lwip/if_api.h create mode 100644 src/include/lwip/igmp.h create mode 100644 src/include/lwip/inet.h create mode 100644 src/include/lwip/inet_chksum.h create mode 100644 src/include/lwip/init.h create mode 100644 src/include/lwip/init.h.cmake.in create mode 100644 src/include/lwip/ip.h create mode 100644 src/include/lwip/ip4.h create mode 100644 src/include/lwip/ip4_addr.h create mode 100644 src/include/lwip/ip4_frag.h create mode 100644 src/include/lwip/ip6.h create mode 100644 src/include/lwip/ip6_addr.h create mode 100644 src/include/lwip/ip6_frag.h create mode 100644 src/include/lwip/ip6_zone.h create mode 100644 src/include/lwip/ip_addr.h create mode 100644 src/include/lwip/mem.h create mode 100644 src/include/lwip/memp.h create mode 100644 src/include/lwip/mld6.h create mode 100644 src/include/lwip/nd6.h create mode 100644 src/include/lwip/netbuf.h create mode 100644 src/include/lwip/netdb.h create mode 100644 src/include/lwip/netif.h create mode 100644 src/include/lwip/netifapi.h create mode 100644 src/include/lwip/opt.h create mode 100644 src/include/lwip/pbuf.h create mode 100644 src/include/lwip/priv/altcp_priv.h create mode 100644 src/include/lwip/priv/api_msg.h create mode 100644 src/include/lwip/priv/mem_priv.h create mode 100644 src/include/lwip/priv/memp_priv.h create mode 100644 src/include/lwip/priv/memp_std.h create mode 100644 src/include/lwip/priv/nd6_priv.h create mode 100644 src/include/lwip/priv/raw_priv.h create mode 100644 src/include/lwip/priv/sockets_priv.h create mode 100644 src/include/lwip/priv/tcp_priv.h create mode 100644 src/include/lwip/priv/tcpip_priv.h create mode 100644 src/include/lwip/prot/acd.h create mode 100644 src/include/lwip/prot/autoip.h create mode 100644 src/include/lwip/prot/dhcp.h create mode 100644 src/include/lwip/prot/dhcp6.h create mode 100644 src/include/lwip/prot/dns.h create mode 100644 src/include/lwip/prot/etharp.h create mode 100644 src/include/lwip/prot/ethernet.h create mode 100644 src/include/lwip/prot/iana.h create mode 100644 src/include/lwip/prot/icmp.h create mode 100644 src/include/lwip/prot/icmp6.h create mode 100644 src/include/lwip/prot/ieee.h create mode 100644 src/include/lwip/prot/igmp.h create mode 100644 src/include/lwip/prot/ip.h create mode 100644 src/include/lwip/prot/ip4.h create mode 100644 src/include/lwip/prot/ip6.h create mode 100644 src/include/lwip/prot/mld6.h create mode 100644 src/include/lwip/prot/nd6.h create mode 100644 src/include/lwip/prot/tcp.h create mode 100644 src/include/lwip/prot/udp.h create mode 100644 src/include/lwip/raw.h create mode 100644 src/include/lwip/sio.h create mode 100644 src/include/lwip/snmp.h create mode 100644 src/include/lwip/sockets.h create mode 100644 src/include/lwip/stats.h create mode 100644 src/include/lwip/sys.h create mode 100644 src/include/lwip/tcp.h create mode 100644 src/include/lwip/tcpbase.h create mode 100644 src/include/lwip/tcpip.h create mode 100644 src/include/lwip/timeouts.h create mode 100644 src/include/lwip/udp.h create mode 100644 src/include/netif/bridgeif.h create mode 100644 src/include/netif/bridgeif_opts.h create mode 100644 src/include/netif/etharp.h create mode 100644 src/include/netif/ethernet.h create mode 100644 src/include/netif/ieee802154.h create mode 100644 src/include/netif/lowpan6.h create mode 100644 src/include/netif/lowpan6_ble.h create mode 100644 src/include/netif/lowpan6_common.h create mode 100644 src/include/netif/lowpan6_opts.h create mode 100644 src/include/netif/ppp/ccp.h create mode 100644 src/include/netif/ppp/chap-md5.h create mode 100644 src/include/netif/ppp/chap-new.h create mode 100644 src/include/netif/ppp/chap_ms.h create mode 100644 src/include/netif/ppp/eap.h create mode 100644 src/include/netif/ppp/ecp.h create mode 100644 src/include/netif/ppp/eui64.h create mode 100644 src/include/netif/ppp/fsm.h create mode 100644 src/include/netif/ppp/ipcp.h create mode 100644 src/include/netif/ppp/ipv6cp.h create mode 100644 src/include/netif/ppp/lcp.h create mode 100644 src/include/netif/ppp/magic.h create mode 100644 src/include/netif/ppp/mppe.h create mode 100644 src/include/netif/ppp/polarssl/arc4.h create mode 100644 src/include/netif/ppp/polarssl/des.h create mode 100644 src/include/netif/ppp/polarssl/md4.h create mode 100644 src/include/netif/ppp/polarssl/md5.h create mode 100644 src/include/netif/ppp/polarssl/sha1.h create mode 100644 src/include/netif/ppp/ppp.h create mode 100644 src/include/netif/ppp/ppp_impl.h create mode 100644 src/include/netif/ppp/ppp_opts.h create mode 100644 src/include/netif/ppp/pppapi.h create mode 100644 src/include/netif/ppp/pppcrypt.h create mode 100644 src/include/netif/ppp/pppdebug.h create mode 100644 src/include/netif/ppp/pppoe.h create mode 100644 src/include/netif/ppp/pppol2tp.h create mode 100644 src/include/netif/ppp/pppos.h create mode 100644 src/include/netif/ppp/upap.h create mode 100644 src/include/netif/ppp/vj.h create mode 100644 src/include/netif/slipif.h create mode 100644 src/include/netif/zepif.h create mode 100644 src/netif/FILES create mode 100644 src/netif/bridgeif.c create mode 100644 src/netif/bridgeif_fdb.c create mode 100644 src/netif/ethernet.c create mode 100644 src/netif/lowpan6.c create mode 100644 src/netif/lowpan6_ble.c create mode 100644 src/netif/lowpan6_common.c create mode 100644 src/netif/ppp/PPPD_FOLLOWUP create mode 100644 src/netif/ppp/auth.c create mode 100644 src/netif/ppp/ccp.c create mode 100644 src/netif/ppp/chap-md5.c create mode 100644 src/netif/ppp/chap-new.c create mode 100644 src/netif/ppp/chap_ms.c create mode 100644 src/netif/ppp/demand.c create mode 100644 src/netif/ppp/eap.c create mode 100644 src/netif/ppp/ecp.c create mode 100644 src/netif/ppp/eui64.c create mode 100644 src/netif/ppp/fsm.c create mode 100644 src/netif/ppp/ipcp.c create mode 100644 src/netif/ppp/ipv6cp.c create mode 100644 src/netif/ppp/lcp.c create mode 100644 src/netif/ppp/magic.c create mode 100644 src/netif/ppp/mppe.c create mode 100644 src/netif/ppp/multilink.c create mode 100644 src/netif/ppp/polarssl/README create mode 100644 src/netif/ppp/polarssl/arc4.c create mode 100644 src/netif/ppp/polarssl/des.c create mode 100644 src/netif/ppp/polarssl/md4.c create mode 100644 src/netif/ppp/polarssl/md5.c create mode 100644 src/netif/ppp/polarssl/sha1.c create mode 100644 src/netif/ppp/ppp.c create mode 100644 src/netif/ppp/pppapi.c create mode 100644 src/netif/ppp/pppcrypt.c create mode 100644 src/netif/ppp/pppoe.c create mode 100644 src/netif/ppp/pppol2tp.c create mode 100644 src/netif/ppp/pppos.c create mode 100644 src/netif/ppp/upap.c create mode 100644 src/netif/ppp/utils.c create mode 100644 src/netif/ppp/vj.c create mode 100644 src/netif/slipif.c create mode 100644 src/netif/zepif.c create mode 100644 test/fuzz/Makefile create mode 100644 test/fuzz/README create mode 100644 test/fuzz/config.h create mode 100644 test/fuzz/fuzz.c create mode 100644 test/fuzz/fuzz2.c create mode 100644 test/fuzz/fuzz3.c create mode 100644 test/fuzz/fuzz_common.c create mode 100644 test/fuzz/fuzz_common.h create mode 100644 test/fuzz/inputs/arp/arp_req.bin create mode 100644 test/fuzz/inputs/icmp/icmp_ping.bin create mode 100644 test/fuzz/inputs/ipv6/neighbor_solicitation.bin create mode 100644 test/fuzz/inputs/ipv6/router_adv.bin create mode 100644 test/fuzz/inputs/tcp/tcp_syn.bin create mode 100644 test/fuzz/inputs/udp/udp_port_5000.bin create mode 100644 test/fuzz/lwipopts.h create mode 100644 test/fuzz/output_to_pcap.sh create mode 100644 test/sockets/sockets_stresstest.c create mode 100644 test/sockets/sockets_stresstest.h create mode 100644 test/unit/Filelists.cmake create mode 100644 test/unit/Filelists.mk create mode 100644 test/unit/Makefile create mode 100644 test/unit/api/test_sockets.c create mode 100644 test/unit/api/test_sockets.h create mode 100644 test/unit/arch/sys_arch.c create mode 100644 test/unit/arch/sys_arch.h create mode 100644 test/unit/core/test_def.c create mode 100644 test/unit/core/test_def.h create mode 100644 test/unit/core/test_dns.c create mode 100644 test/unit/core/test_dns.h create mode 100644 test/unit/core/test_mem.c create mode 100644 test/unit/core/test_mem.h create mode 100644 test/unit/core/test_netif.c create mode 100644 test/unit/core/test_netif.h create mode 100644 test/unit/core/test_pbuf.c create mode 100644 test/unit/core/test_pbuf.h create mode 100644 test/unit/core/test_timers.c create mode 100644 test/unit/core/test_timers.h create mode 100644 test/unit/dhcp/test_dhcp.c create mode 100644 test/unit/dhcp/test_dhcp.h create mode 100644 test/unit/etharp/test_etharp.c create mode 100644 test/unit/etharp/test_etharp.h create mode 100644 test/unit/ip4/test_ip4.c create mode 100644 test/unit/ip4/test_ip4.h create mode 100644 test/unit/ip6/test_ip6.c create mode 100644 test/unit/ip6/test_ip6.h create mode 100644 test/unit/lwip_check.h create mode 100644 test/unit/lwip_unittests.c create mode 100644 test/unit/lwipopts.h create mode 100644 test/unit/mdns/test_mdns.c create mode 100644 test/unit/mdns/test_mdns.h create mode 100644 test/unit/mqtt/test_mqtt.c create mode 100644 test/unit/mqtt/test_mqtt.h create mode 100644 test/unit/ppp/test_pppos.c create mode 100644 test/unit/ppp/test_pppos.h create mode 100644 test/unit/tcp/tcp_helper.c create mode 100644 test/unit/tcp/tcp_helper.h create mode 100644 test/unit/tcp/test_tcp.c create mode 100644 test/unit/tcp/test_tcp.h create mode 100644 test/unit/tcp/test_tcp_oos.c create mode 100644 test/unit/tcp/test_tcp_oos.h create mode 100644 test/unit/tcp/test_tcp_state.c create mode 100644 test/unit/tcp/test_tcp_state.h create mode 100644 test/unit/udp/test_udp.c create mode 100644 test/unit/udp/test_udp.h
.gitattributes new file +10 -0
@@ -0,0 +1,10 @@ +# These files are text and should be normalized +*.txt text +*.c text +*.h text + +# For git archive +.gitignore export-ignore +.gitattributes export-ignore +.github export-ignore +.vscode export-ignore
.github/workflows/ci-linux.yml new file +43 -0
43 lines not on this page · raw message
.gitignore new file +60 -0
60 lines not on this page · raw message
.vscode/c_cpp_properties.json new file +28 -0
@@ -0,0 +1,28 @@ +{ + "configurations": [ + { + "name": "Linux", + "includePath": [ + "${workspaceFolder}/src/include", + "${workspaceFolder}/contrib", + "${workspaceFolder}/contrib/examples/example_app", + "${workspaceFolder}/contrib/ports/unix/port/include", + "${workspaceFolder}/contrib/ports/unix/example_app" + ], + "defines": [], + "intelliSenseMode": "gcc-x64", + "browse": { + "path": [ + "${workspaceFolder}/**" + ], + "limitSymbolsToIncludedHeaders": true, + "databaseFilename": "" + }, + "compilerPath": "/usr/bin/gcc", + "cStandard": "c11", + "cppStandard": "c++17", + "configurationProvider": "vector-of-bool.cmake-tools" + } + ], + "version": 4 +}
.vscode/launch.json new file +62 -0
62 lines not on this page · raw message
.vscode/settings.json new file +10 -0
@@ -0,0 +1,10 @@ +{ + "editor.tabSize": 2, + "editor.insertSpaces": true, + "files.insertFinalNewline": true, + "files.trimFinalNewlines": true, + "files.trimTrailingWhitespace": true, + "files.associations": { + "*.h": "c" + } +}
.vscode/tasks.json new file +54 -0
54 lines not on this page · raw message
BUILDING new file +119 -0
119 lines not on this page · raw message
CHANGELOG new file +4635 -0
2,613 lines not on this page · raw message
README new file +109 -0
109 lines not on this page · raw message
UPGRADING new file +288 -0
288 lines not on this page · raw message
codespell_check.sh new file +57 -0
57 lines not on this page · raw message
contrib/Coverity/coverity.c new file +106 -0
106 lines not on this page · raw message
contrib/Filelists.cmake new file +61 -0
61 lines not on this page · raw message
contrib/Filelists.mk new file +57 -0
57 lines not on this page · raw message
contrib/addons/dhcp_extra_opts/README new file +5 -0
Lines of this file are not shown. View the raw message.
contrib/addons/dhcp_extra_opts/dhcp_extra_opts.c new file +91 -0
91 lines not on this page · raw message
contrib/addons/dhcp_extra_opts/dhcp_extra_opts.h new file +61 -0
61 lines not on this page · raw message
contrib/addons/ipv6_static_routing/README new file +43 -0
43 lines not on this page · raw message
contrib/addons/ipv6_static_routing/ip6_route_table.c new file +248 -0
248 lines not on this page · raw message
contrib/addons/ipv6_static_routing/ip6_route_table.h new file +94 -0
94 lines not on this page · raw message
contrib/addons/netconn/external_resolve/dnssd.c new file +164 -0
164 lines not on this page · raw message
contrib/addons/netconn/external_resolve/dnssd.h new file +50 -0
50 lines not on this page · raw message
contrib/addons/tcp_isn/tcp_isn.c new file +182 -0
182 lines not on this page · raw message
contrib/addons/tcp_isn/tcp_isn.h new file +48 -0
48 lines not on this page · raw message
contrib/addons/tcp_md5/README new file +27 -0
Lines of this file are not shown. View the raw message.
contrib/addons/tcp_md5/tcp_md5.c new file +534 -0
534 lines not on this page · raw message
contrib/addons/tcp_md5/tcp_md5.h new file +84 -0
84 lines not on this page · raw message
contrib/apps/LwipMibCompiler/CCodeGeneration/CCodeGeneration.csproj new file +67 -0
67 lines not on this page · raw message
contrib/apps/LwipMibCompiler/CCodeGeneration/CFile.cs new file +54 -0
54 lines not on this page · raw message
contrib/apps/LwipMibCompiler/CCodeGeneration/CGenerator.cs new file +119 -0
119 lines not on this page · raw message
contrib/apps/LwipMibCompiler/CCodeGeneration/Code.cs new file +56 -0
56 lines not on this page · raw message
contrib/apps/LwipMibCompiler/CCodeGeneration/CodeContainerBase.cs new file +139 -0
139 lines not on this page · raw message
contrib/apps/LwipMibCompiler/CCodeGeneration/CodeElement.cs new file +41 -0
41 lines not on this page · raw message
contrib/apps/LwipMibCompiler/CCodeGeneration/Comment.cs new file +75 -0
75 lines not on this page · raw message
contrib/apps/LwipMibCompiler/CCodeGeneration/EmptyLine.cs new file +64 -0
64 lines not on this page · raw message
contrib/apps/LwipMibCompiler/CCodeGeneration/Function.cs new file +129 -0
129 lines not on this page · raw message
contrib/apps/LwipMibCompiler/CCodeGeneration/FunctionDeclaration.cs new file +114 -0
114 lines not on this page · raw message
contrib/apps/LwipMibCompiler/CCodeGeneration/IfThenElse.cs new file +137 -0
137 lines not on this page · raw message
contrib/apps/LwipMibCompiler/CCodeGeneration/PP_If.cs new file +67 -0
67 lines not on this page · raw message
contrib/apps/LwipMibCompiler/CCodeGeneration/PP_Ifdef.cs new file +76 -0
76 lines not on this page · raw message
contrib/apps/LwipMibCompiler/CCodeGeneration/PP_Include.cs new file +71 -0
71 lines not on this page · raw message
contrib/apps/LwipMibCompiler/CCodeGeneration/PP_Macro.cs new file +59 -0
59 lines not on this page · raw message
contrib/apps/LwipMibCompiler/CCodeGeneration/PlainText.cs new file +49 -0
49 lines not on this page · raw message
contrib/apps/LwipMibCompiler/CCodeGeneration/Properties/AssemblyInfo.cs new file +36 -0
Lines of this file are not shown. View the raw message.
contrib/apps/LwipMibCompiler/CCodeGeneration/Switch.cs new file +146 -0
146 lines not on this page · raw message
contrib/apps/LwipMibCompiler/CCodeGeneration/VariableDeclaration.cs new file +82 -0
82 lines not on this page · raw message
contrib/apps/LwipMibCompiler/CCodeGeneration/VariablePrototype.cs new file +73 -0
73 lines not on this page · raw message
contrib/apps/LwipMibCompiler/CCodeGeneration/VariableType.cs new file +130 -0
130 lines not on this page · raw message
contrib/apps/LwipMibCompiler/LwipMibCompiler.sln new file +47 -0
47 lines not on this page · raw message
contrib/apps/LwipMibCompiler/LwipMibCompiler/LwipMibCompiler.csproj new file +73 -0
73 lines not on this page · raw message
contrib/apps/LwipMibCompiler/LwipMibCompiler/Program.cs new file +480 -0
480 lines not on this page · raw message
contrib/apps/LwipMibCompiler/LwipMibCompiler/Properties/AssemblyInfo.cs new file +36 -0
Lines of this file are not shown. View the raw message.
contrib/apps/LwipMibCompiler/LwipMibCompiler/app.config new file +3 -0
Lines of this file are not shown. View the raw message.
contrib/apps/LwipMibCompiler/LwipSnmpCodeGeneration/IRestriction.cs new file +120 -0
120 lines not on this page · raw message
contrib/apps/LwipMibCompiler/LwipSnmpCodeGeneration/LwipSnmp.cs new file +199 -0
199 lines not on this page · raw message
contrib/apps/LwipMibCompiler/LwipSnmpCodeGeneration/LwipSnmpCodeGeneration.csproj new file +72 -0
72 lines not on this page · raw message
contrib/apps/LwipMibCompiler/LwipSnmpCodeGeneration/MibCFile.cs new file +196 -0
196 lines not on this page · raw message
contrib/apps/LwipMibCompiler/LwipSnmpCodeGeneration/MibHeaderFile.cs new file +129 -0
129 lines not on this page · raw message
contrib/apps/LwipMibCompiler/LwipSnmpCodeGeneration/Properties/AssemblyInfo.cs new file +36 -0
Lines of this file are not shown. View the raw message.
contrib/apps/LwipMibCompiler/LwipSnmpCodeGeneration/SnmpMib.cs new file +97 -0
97 lines not on this page · raw message
contrib/apps/LwipMibCompiler/LwipSnmpCodeGeneration/SnmpNode.cs new file +119 -0
119 lines not on this page · raw message
contrib/apps/LwipMibCompiler/LwipSnmpCodeGeneration/SnmpScalarAggregationNode.cs new file +293 -0
293 lines not on this page · raw message
contrib/apps/LwipMibCompiler/LwipSnmpCodeGeneration/SnmpScalarArrayNode.cs new file +105 -0
105 lines not on this page · raw message
contrib/apps/LwipMibCompiler/LwipSnmpCodeGeneration/SnmpScalarNode.cs new file +395 -0
395 lines not on this page · raw message
contrib/apps/LwipMibCompiler/LwipSnmpCodeGeneration/SnmpScalarNodeBits.cs new file +121 -0
121 lines not on this page · raw message
contrib/apps/LwipMibCompiler/LwipSnmpCodeGeneration/SnmpScalarNodeCounter64.cs new file +72 -0
72 lines not on this page · raw message
contrib/apps/LwipMibCompiler/LwipSnmpCodeGeneration/SnmpScalarNodeInt.cs new file +86 -0
86 lines not on this page · raw message
contrib/apps/LwipMibCompiler/LwipSnmpCodeGeneration/SnmpScalarNodeObjectIdentifier.cs new file +90 -0
90 lines not on this page · raw message
contrib/apps/LwipMibCompiler/LwipSnmpCodeGeneration/SnmpScalarNodeOctetString.cs new file +118 -0
118 lines not on this page · raw message
contrib/apps/LwipMibCompiler/LwipSnmpCodeGeneration/SnmpScalarNodeTruthValue.cs new file +66 -0
66 lines not on this page · raw message
contrib/apps/LwipMibCompiler/LwipSnmpCodeGeneration/SnmpScalarNodeUint.cs new file +91 -0
91 lines not on this page · raw message
contrib/apps/LwipMibCompiler/LwipSnmpCodeGeneration/SnmpTableNode.cs new file +332 -0
332 lines not on this page · raw message
contrib/apps/LwipMibCompiler/LwipSnmpCodeGeneration/SnmpTreeNode.cs new file +242 -0
242 lines not on this page · raw message
contrib/apps/LwipMibCompiler/MibViewer/FormMain.Designer.cs new file +166 -0
166 lines not on this page · raw message
contrib/apps/LwipMibCompiler/MibViewer/FormMain.cs new file +217 -0
217 lines not on this page · raw message
contrib/apps/LwipMibCompiler/MibViewer/FormMain.resx new file +298 -0
298 lines not on this page · raw message
contrib/apps/LwipMibCompiler/MibViewer/MibViewer.csproj new file +94 -0
94 lines not on this page · raw message
contrib/apps/LwipMibCompiler/MibViewer/Program.cs new file +51 -0
51 lines not on this page · raw message
contrib/apps/LwipMibCompiler/MibViewer/Properties/AssemblyInfo.cs new file +36 -0
Lines of this file are not shown. View the raw message.
contrib/apps/LwipMibCompiler/MibViewer/Properties/Resources.Designer.cs new file +63 -0
63 lines not on this page · raw message
contrib/apps/LwipMibCompiler/MibViewer/Properties/Resources.resx new file +117 -0
117 lines not on this page · raw message
contrib/apps/LwipMibCompiler/MibViewer/Properties/Settings.Designer.cs new file +26 -0
Lines of this file are not shown. View the raw message.
contrib/apps/LwipMibCompiler/MibViewer/Properties/Settings.settings new file +7 -0
Lines of this file are not shown. View the raw message.
contrib/apps/LwipMibCompiler/MibViewer/app.config new file +3 -0
Lines of this file are not shown. View the raw message.
contrib/apps/LwipMibCompiler/Mibs/IANA-ADDRESS-FAMILY-NUMBERS-MIB new file +131 -0
131 lines not on this page · raw message
contrib/apps/LwipMibCompiler/Mibs/IANA-CHARSET-MIB new file +345 -0
345 lines not on this page · raw message
contrib/apps/LwipMibCompiler/Mibs/IANA/IANA-ITU-ALARM-TC-MIB new file +333 -0
333 lines not on this page · raw message
contrib/apps/LwipMibCompiler/Mibs/IANA/IANA-LANGUAGE-MIB new file +127 -0
127 lines not on this page · raw message
contrib/apps/LwipMibCompiler/Mibs/IANA/IANA-MALLOC-MIB new file +67 -0
67 lines not on this page · raw message
contrib/apps/LwipMibCompiler/Mibs/IANA/IANA-MAU-MIB new file +770 -0
770 lines not on this page · raw message
contrib/apps/LwipMibCompiler/Mibs/IANA/IANA-PRINTER-MIB new file +1319 -0
1,319 lines not on this page · raw message
contrib/apps/LwipMibCompiler/Mibs/IANA/IANA-RTPROTO-MIB new file +92 -0
92 lines not on this page · raw message
contrib/apps/LwipMibCompiler/Mibs/IANA/IANATn3270eTC-MIB new file +306 -0
306 lines not on this page · raw message
contrib/apps/LwipMibCompiler/Mibs/IANA/IANAifType-MIB new file +572 -0
572 lines not on this page · raw message
contrib/apps/LwipMibCompiler/Mibs/IF-MIB new file +1899 -0
1,899 lines not on this page · raw message
contrib/apps/LwipMibCompiler/Mibs/INET-ADDRESS-MIB new file +421 -0
421 lines not on this page · raw message
contrib/apps/LwipMibCompiler/Mibs/IP-MIB new file +5254 -0
5,254 lines not on this page · raw message
contrib/apps/LwipMibCompiler/Mibs/RFC-1212 new file +75 -0
75 lines not on this page · raw message
contrib/apps/LwipMibCompiler/Mibs/RFC-1215 new file +34 -0
Lines of this file are not shown. View the raw message.
contrib/apps/LwipMibCompiler/Mibs/RFC1065-SMI new file +132 -0
132 lines not on this page · raw message
contrib/apps/LwipMibCompiler/Mibs/RFC1155-SMI new file +129 -0
129 lines not on this page · raw message
contrib/apps/LwipMibCompiler/Mibs/RFC1158-MIB new file +1493 -0
1,493 lines not on this page · raw message
contrib/apps/LwipMibCompiler/Mibs/RFC1213-MIB new file +2621 -0
2,621 lines not on this page · raw message
contrib/apps/LwipMibCompiler/Mibs/SNMPv2-CONF new file +318 -0
318 lines not on this page · raw message
contrib/apps/LwipMibCompiler/Mibs/SNMPv2-MIB new file +903 -0
903 lines not on this page · raw message
contrib/apps/LwipMibCompiler/Mibs/SNMPv2-SMI new file +352 -0
352 lines not on this page · raw message
contrib/apps/LwipMibCompiler/Mibs/SNMPv2-TC new file +786 -0
786 lines not on this page · raw message
contrib/apps/LwipMibCompiler/Mibs/SNMPv2-TM new file +194 -0
194 lines not on this page · raw message
contrib/apps/LwipMibCompiler/Mibs/TCP-MIB new file +829 -0
829 lines not on this page · raw message
contrib/apps/LwipMibCompiler/Mibs/UDP-MIB new file +579 -0
579 lines not on this page · raw message
contrib/apps/LwipMibCompiler/SharpSnmpLib/Mib/DisplayHint.cs new file +84 -0
84 lines not on this page · raw message
contrib/apps/LwipMibCompiler/SharpSnmpLib/Mib/Elements/Entities/AgentCapabilities.cs new file +29 -0
Lines of this file are not shown. View the raw message.
contrib/apps/LwipMibCompiler/SharpSnmpLib/Mib/Elements/Entities/EntityBase.cs new file +46 -0
46 lines not on this page · raw message
contrib/apps/LwipMibCompiler/SharpSnmpLib/Mib/Elements/Entities/IEntity.cs new file +62 -0
62 lines not on this page · raw message
contrib/apps/LwipMibCompiler/SharpSnmpLib/Mib/Elements/Entities/ModuleCompliance.cs new file +23 -0
Lines of this file are not shown. View the raw message.
contrib/apps/LwipMibCompiler/SharpSnmpLib/Mib/Elements/Entities/ModuleIdentity.cs new file +10 -0
Lines of this file are not shown. View the raw message.
contrib/apps/LwipMibCompiler/SharpSnmpLib/Mib/Elements/Entities/NotificationGroup.cs new file +22 -0
Lines of this file are not shown. View the raw message.
contrib/apps/LwipMibCompiler/SharpSnmpLib/Mib/Elements/Entities/NotificationType.cs new file +11 -0
Lines of this file are not shown. View the raw message.
contrib/apps/LwipMibCompiler/SharpSnmpLib/Mib/Elements/Entities/ObjectGroup.cs new file +22 -0
Lines of this file are not shown. View the raw message.
contrib/apps/LwipMibCompiler/SharpSnmpLib/Mib/Elements/Entities/ObjectIdentity.cs new file +21 -0
Lines of this file are not shown. View the raw message.
contrib/apps/LwipMibCompiler/SharpSnmpLib/Mib/Elements/Entities/ObjectType.cs new file +336 -0
336 lines not on this page · raw message
contrib/apps/LwipMibCompiler/SharpSnmpLib/Mib/Elements/Entities/OidValueAssignment.cs new file +30 -0
Lines of this file are not shown. View the raw message.
contrib/apps/LwipMibCompiler/SharpSnmpLib/Mib/Elements/Exports.cs new file +56 -0
56 lines not on this page · raw message
contrib/apps/LwipMibCompiler/SharpSnmpLib/Mib/Elements/IDeclaration.cs new file +18 -0
Lines of this file are not shown. View the raw message.
contrib/apps/LwipMibCompiler/SharpSnmpLib/Mib/Elements/IElement.cs new file +35 -0
Lines of this file are not shown. View the raw message.
contrib/apps/LwipMibCompiler/SharpSnmpLib/Mib/Elements/ITypeReferrer.cs new file +10 -0
Lines of this file are not shown. View the raw message.
contrib/apps/LwipMibCompiler/SharpSnmpLib/Mib/Elements/Imports.cs new file +81 -0
81 lines not on this page · raw message
contrib/apps/LwipMibCompiler/SharpSnmpLib/Mib/Elements/ImportsFrom.cs new file +60 -0
60 lines not on this page · raw message
contrib/apps/LwipMibCompiler/SharpSnmpLib/Mib/Elements/TrapType.cs new file +48 -0
48 lines not on this page · raw message
contrib/apps/LwipMibCompiler/SharpSnmpLib/Mib/Elements/Types/BaseType.cs new file +54 -0
54 lines not on this page · raw message
contrib/apps/LwipMibCompiler/SharpSnmpLib/Mib/Elements/Types/BitsType.cs new file +26 -0
Lines of this file are not shown. View the raw message.
contrib/apps/LwipMibCompiler/SharpSnmpLib/Mib/Elements/Types/Choice.cs new file +35 -0
Lines of this file are not shown. View the raw message.
contrib/apps/LwipMibCompiler/SharpSnmpLib/Mib/Elements/Types/ITypeAssignment.cs new file +6 -0
Lines of this file are not shown. View the raw message.
contrib/apps/LwipMibCompiler/SharpSnmpLib/Mib/Elements/Types/IntegerType.cs new file +117 -0
117 lines not on this page · raw message
contrib/apps/LwipMibCompiler/SharpSnmpLib/Mib/Elements/Types/IpAddressType.cs new file +21 -0
Lines of this file are not shown. View the raw message.
contrib/apps/LwipMibCompiler/SharpSnmpLib/Mib/Elements/Types/Macro.cs new file +34 -0
Lines of this file are not shown. View the raw message.
contrib/apps/LwipMibCompiler/SharpSnmpLib/Mib/Elements/Types/ObjectIdentifierType.cs new file +11 -0
Lines of this file are not shown. View the raw message.
contrib/apps/LwipMibCompiler/SharpSnmpLib/Mib/Elements/Types/OctetStringType.cs new file +31 -0
Lines of this file are not shown. View the raw message.
contrib/apps/LwipMibCompiler/SharpSnmpLib/Mib/Elements/Types/OpaqueType.cs new file +11 -0
Lines of this file are not shown. View the raw message.
contrib/apps/LwipMibCompiler/SharpSnmpLib/Mib/Elements/Types/Sequence.cs new file +46 -0
46 lines not on this page · raw message
contrib/apps/LwipMibCompiler/SharpSnmpLib/Mib/Elements/Types/SequenceOf.cs new file +23 -0
Lines of this file are not shown. View the raw message.
contrib/apps/LwipMibCompiler/SharpSnmpLib/Mib/Elements/Types/TextualConvention.cs new file +238 -0
238 lines not on this page · raw message
contrib/apps/LwipMibCompiler/SharpSnmpLib/Mib/Elements/Types/TypeAssignment.cs new file +147 -0
147 lines not on this page · raw message
contrib/apps/LwipMibCompiler/SharpSnmpLib/Mib/Elements/Types/UnsignedType.cs new file +103 -0
103 lines not on this page · raw message
contrib/apps/LwipMibCompiler/SharpSnmpLib/Mib/IModule.cs new file +81 -0
81 lines not on this page · raw message
contrib/apps/LwipMibCompiler/SharpSnmpLib/Mib/ISymbolEnumerator.cs new file +9 -0
Lines of this file are not shown. View the raw message.
contrib/apps/LwipMibCompiler/SharpSnmpLib/Mib/Lexer.cs new file +581 -0
581 lines not on this page · raw message
contrib/apps/LwipMibCompiler/SharpSnmpLib/Mib/MaxAccess.cs new file +17 -0
Lines of this file are not shown. View the raw message.
contrib/apps/LwipMibCompiler/SharpSnmpLib/Mib/MibDocument.cs new file +57 -0
57 lines not on this page · raw message
contrib/apps/LwipMibCompiler/SharpSnmpLib/Mib/MibException.cs new file +113 -0
113 lines not on this page · raw message
contrib/apps/LwipMibCompiler/SharpSnmpLib/Mib/MibModule.cs new file +294 -0
294 lines not on this page · raw message
contrib/apps/LwipMibCompiler/SharpSnmpLib/Mib/MibResolver.cs new file +97 -0
97 lines not on this page · raw message
contrib/apps/LwipMibCompiler/SharpSnmpLib/Mib/MibTree.cs new file +130 -0
130 lines not on this page · raw message
contrib/apps/LwipMibCompiler/SharpSnmpLib/Mib/MibTreeNode.cs new file +112 -0
112 lines not on this page · raw message
contrib/apps/LwipMibCompiler/SharpSnmpLib/Mib/MibTypesResolver.cs new file +216 -0
216 lines not on this page · raw message
contrib/apps/LwipMibCompiler/SharpSnmpLib/Mib/ObjectIdentifier.cs new file +54 -0
54 lines not on this page · raw message
contrib/apps/LwipMibCompiler/SharpSnmpLib/Mib/Status.cs new file +17 -0
Lines of this file are not shown. View the raw message.
contrib/apps/LwipMibCompiler/SharpSnmpLib/Mib/Symbol.cs new file +357 -0
357 lines not on this page · raw message
contrib/apps/LwipMibCompiler/SharpSnmpLib/Mib/SymbolList.cs new file +146 -0
146 lines not on this page · raw message
contrib/apps/LwipMibCompiler/SharpSnmpLib/Mib/ValueMap.cs new file +103 -0
103 lines not on this page · raw message
contrib/apps/LwipMibCompiler/SharpSnmpLib/Mib/ValueRange.cs new file +76 -0
76 lines not on this page · raw message
contrib/apps/LwipMibCompiler/SharpSnmpLib/Properties/AssemblyInfo.cs new file +61 -0
61 lines not on this page · raw message
contrib/apps/LwipMibCompiler/SharpSnmpLib/Properties/Resources.Designer.cs new file +63 -0
63 lines not on this page · raw message
contrib/apps/LwipMibCompiler/SharpSnmpLib/Properties/Resources.resx new file +120 -0
120 lines not on this page · raw message
contrib/apps/LwipMibCompiler/SharpSnmpLib/SharpSnmpLib.Mib.csproj new file +140 -0
140 lines not on this page · raw message
contrib/apps/LwipMibCompiler/SharpSnmpLib/license.txt new file +458 -0
458 lines not on this page · raw message
contrib/apps/LwipMibCompiler/SharpSnmpLib/readme.txt new file +1 -0
Lines of this file are not shown. View the raw message.
contrib/apps/LwipMibCompiler/SharpSnmpLib/sharpsnmplib.snk new file binary +0 -0
contrib/apps/LwipMibCompiler/example/compile_udp_mib.cmd new file +1 -0
Lines of this file are not shown. View the raw message.
contrib/apps/LwipMibCompiler/example/compile_udp_mib.sh new file +1 -0
Lines of this file are not shown. View the raw message.
contrib/apps/chargen/README new file +52 -0
52 lines not on this page · raw message
contrib/apps/chargen/chargen.c new file +274 -0
274 lines not on this page · raw message
contrib/apps/chargen/chargen.h new file +12 -0
Lines of this file are not shown. View the raw message.
contrib/apps/httpserver/README new file +12 -0
Lines of this file are not shown. View the raw message.
contrib/apps/httpserver/httpserver-netconn.c new file +103 -0
103 lines not on this page · raw message
contrib/apps/httpserver/httpserver-netconn.h new file +6 -0
Lines of this file are not shown. View the raw message.
contrib/apps/netio/netio.c new file +55 -0
55 lines not on this page · raw message
contrib/apps/ping/ping.c new file +396 -0
396 lines not on this page · raw message
contrib/apps/rtp/rtp.c new file +308 -0
308 lines not on this page · raw message
contrib/apps/rtp/rtpdata.h new file +2040 -0
2,040 lines not on this page · raw message
contrib/apps/shell/shell.c new file +1277 -0
1,277 lines not on this page · raw message
contrib/apps/socket_examples/socket_examples.c new file +680 -0
680 lines not on this page · raw message
contrib/apps/socket_examples/socket_examples.h new file +6 -0
Lines of this file are not shown. View the raw message.
contrib/apps/tcpecho/tcpecho.c new file +101 -0
101 lines not on this page · raw message
contrib/apps/tcpecho/tcpecho.h new file +38 -0
Lines of this file are not shown. View the raw message.
contrib/apps/tcpecho_raw/tcpecho_raw.c new file +301 -0
301 lines not on this page · raw message
contrib/apps/tcpecho_raw/tcpecho_raw.h new file +35 -0
Lines of this file are not shown. View the raw message.
contrib/apps/udpecho/udpecho.c new file +88 -0
88 lines not on this page · raw message
contrib/apps/udpecho/udpecho.h new file +37 -0
Lines of this file are not shown. View the raw message.
contrib/apps/udpecho_raw/udpecho_raw.c new file +88 -0
88 lines not on this page · raw message
contrib/apps/udpecho_raw/udpecho_raw.h new file +39 -0
Lines of this file are not shown. View the raw message.
contrib/examples/ethernetif/ethernetif.c new file +337 -0
337 lines not on this page · raw message
contrib/examples/example_app/default_netif.h new file +47 -0
47 lines not on this page · raw message
contrib/examples/example_app/lwipcfg.h.ci new file +73 -0
73 lines not on this page · raw message
contrib/examples/example_app/lwipcfg.h.example new file +77 -0
77 lines not on this page · raw message
contrib/examples/example_app/lwipopts.h new file +326 -0
326 lines not on this page · raw message
contrib/examples/example_app/lwippools.h new file +20 -0
Lines of this file are not shown. View the raw message.
contrib/examples/example_app/ppp_settings.h new file +6 -0
Lines of this file are not shown. View the raw message.
contrib/examples/example_app/test.c new file +773 -0
773 lines not on this page · raw message
contrib/examples/example_app/test_configs/opt_default.h new file +295 -0
295 lines not on this page · raw message
contrib/examples/example_app/test_configs/opt_dualstack.h new file +295 -0
295 lines not on this page · raw message
contrib/examples/example_app/test_configs/opt_ipv4only.h new file +295 -0
295 lines not on this page · raw message
contrib/examples/example_app/test_configs/opt_ipv6only.h new file +295 -0
295 lines not on this page · raw message
contrib/examples/example_app/test_configs/opt_no_tcp_dualstack.h new file +4 -0
Lines of this file are not shown. View the raw message.
contrib/examples/example_app/test_configs/opt_no_tcp_ipv4only.h new file +4 -0
Lines of this file are not shown. View the raw message.
contrib/examples/example_app/test_configs/opt_no_tcp_ipv6only.h new file +4 -0
Lines of this file are not shown. View the raw message.
contrib/examples/example_app/test_configs/opt_no_udp_dualstack.h new file +4 -0
Lines of this file are not shown. View the raw message.
contrib/examples/example_app/test_configs/opt_no_udp_ipv4only.h new file +4 -0
Lines of this file are not shown. View the raw message.
contrib/examples/example_app/test_configs/opt_no_udp_ipv6only.h new file +4 -0
Lines of this file are not shown. View the raw message.
contrib/examples/example_app/test_configs/opt_none.h new file +2 -0
Lines of this file are not shown. View the raw message.
contrib/examples/example_app/test_configs/opt_nosys_dual.h new file +295 -0
295 lines not on this page · raw message
contrib/examples/example_app/test_configs/opt_nosys_ipv4.h new file +295 -0
295 lines not on this page · raw message
contrib/examples/example_app/test_configs/opt_nosys_ipv6.h new file +295 -0
295 lines not on this page · raw message
contrib/examples/httpd/cgi_example/cgi_example.c new file +107 -0
107 lines not on this page · raw message
contrib/examples/httpd/cgi_example/cgi_example.h new file +38 -0
Lines of this file are not shown. View the raw message.
contrib/examples/httpd/examples_fs/404.html new file +21 -0
Lines of this file are not shown. View the raw message.
contrib/examples/httpd/examples_fs/img/sics.gif new file binary +0 -0
contrib/examples/httpd/examples_fs/index.html new file +47 -0
47 lines not on this page · raw message
contrib/examples/httpd/examples_fs/login.html new file +28 -0
Lines of this file are not shown. View the raw message.
contrib/examples/httpd/examples_fs/loginfail.html new file +25 -0
Lines of this file are not shown. View the raw message.
contrib/examples/httpd/examples_fs/session.html new file +25 -0
Lines of this file are not shown. View the raw message.
contrib/examples/httpd/examples_fs/ssi.shtml new file +315 -0
315 lines not on this page · raw message
contrib/examples/httpd/examples_fsdata.c new file +1543 -0
1,543 lines not on this page · raw message
contrib/examples/httpd/fs_example/fs_example.c new file +324 -0
324 lines not on this page · raw message
contrib/examples/httpd/fs_example/fs_example.h new file +38 -0
Lines of this file are not shown. View the raw message.
contrib/examples/httpd/genfiles_example/genfiles_example.c new file +186 -0
186 lines not on this page · raw message
contrib/examples/httpd/genfiles_example/genfiles_example.h new file +38 -0
Lines of this file are not shown. View the raw message.
contrib/examples/httpd/https_example/https_example.c new file +144 -0
144 lines not on this page · raw message
contrib/examples/httpd/https_example/https_example.h new file +38 -0
Lines of this file are not shown. View the raw message.
contrib/examples/httpd/post_example/post_example.c new file +167 -0
167 lines not on this page · raw message
contrib/examples/httpd/ssi_example/ssi_example.c new file +264 -0
264 lines not on this page · raw message
contrib/examples/httpd/ssi_example/ssi_example.h new file +38 -0
Lines of this file are not shown. View the raw message.
contrib/examples/lwiperf/lwiperf_example.c new file +50 -0
50 lines not on this page · raw message
contrib/examples/lwiperf/lwiperf_example.h new file +43 -0
43 lines not on this page · raw message
contrib/examples/mdns/mdns_example.c new file +63 -0
63 lines not on this page · raw message
contrib/examples/mdns/mdns_example.h new file +43 -0
43 lines not on this page · raw message
contrib/examples/mqtt/mqtt_example.c new file +128 -0
128 lines not on this page · raw message
contrib/examples/mqtt/mqtt_example.h new file +43 -0
43 lines not on this page · raw message
contrib/examples/ppp/pppos_example.c new file +221 -0
221 lines not on this page · raw message
contrib/examples/ppp/pppos_example.h new file +43 -0
43 lines not on this page · raw message
contrib/examples/snmp/snmp_example.c new file +80 -0
80 lines not on this page · raw message
contrib/examples/snmp/snmp_example.h new file +43 -0
43 lines not on this page · raw message
contrib/examples/snmp/snmp_private_mib/lwip_prvmib.c new file +401 -0
401 lines not on this page · raw message
contrib/examples/snmp/snmp_private_mib/private_mib.h new file +26 -0
Lines of this file are not shown. View the raw message.
contrib/examples/snmp/snmp_v3/snmpv3_dummy.c new file +395 -0
395 lines not on this page · raw message
contrib/examples/snmp/snmp_v3/snmpv3_dummy.h new file +53 -0
53 lines not on this page · raw message
contrib/examples/sntp/sntp_example.c new file +66 -0
66 lines not on this page · raw message
contrib/examples/sntp/sntp_example.h new file +45 -0
45 lines not on this page · raw message
contrib/examples/tftp/tftp_example.c new file +155 -0
155 lines not on this page · raw message
contrib/examples/tftp/tftp_example.h new file +29 -0
Lines of this file are not shown. View the raw message.
contrib/ports/CMakeCommon.cmake new file +128 -0
128 lines not on this page · raw message
contrib/ports/Common.allports.mk new file +91 -0
91 lines not on this page · raw message
contrib/ports/freertos/include/arch/sys_arch.h new file +95 -0
95 lines not on this page · raw message
contrib/ports/freertos/sys_arch.c new file +607 -0
607 lines not on this page · raw message
contrib/ports/unix/Common.mk new file +51 -0
51 lines not on this page · raw message
contrib/ports/unix/Filelists.cmake new file +44 -0
44 lines not on this page · raw message
contrib/ports/unix/check/CMakeLists.txt new file +61 -0
61 lines not on this page · raw message
contrib/ports/unix/check/Makefile new file +94 -0
94 lines not on this page · raw message
contrib/ports/unix/check/README new file +8 -0
Lines of this file are not shown. View the raw message.
contrib/ports/unix/check/config.h new file +2 -0
Lines of this file are not shown. View the raw message.
contrib/ports/unix/example_app/CMakeLists.txt new file +27 -0
Lines of this file are not shown. View the raw message.
contrib/ports/unix/example_app/Makefile new file +60 -0
60 lines not on this page · raw message
contrib/ports/unix/example_app/default_netif.c new file +68 -0
68 lines not on this page · raw message
contrib/ports/unix/example_app/iteropts.sh new file +34 -0
Lines of this file are not shown. View the raw message.
contrib/ports/unix/lib/CMakeLists.txt new file +33 -0
Lines of this file are not shown. View the raw message.
contrib/ports/unix/lib/README new file +28 -0
Lines of this file are not shown. View the raw message.
contrib/ports/unix/lib/lwipopts.h new file +436 -0
436 lines not on this page · raw message
contrib/ports/unix/port/include/arch/cc.h new file +89 -0
89 lines not on this page · raw message
contrib/ports/unix/port/include/arch/perf.h new file +63 -0
63 lines not on this page · raw message
contrib/ports/unix/port/include/arch/sys_arch.h new file +90 -0
90 lines not on this page · raw message
contrib/ports/unix/port/include/netif/fifo.h new file +54 -0
54 lines not on this page · raw message
contrib/ports/unix/port/include/netif/list.h new file +26 -0
Lines of this file are not shown. View the raw message.
contrib/ports/unix/port/include/netif/pcapif.h new file +39 -0
Lines of this file are not shown. View the raw message.
contrib/ports/unix/port/include/netif/sio.h new file +60 -0
60 lines not on this page · raw message
contrib/ports/unix/port/include/netif/tapif.h new file +43 -0
43 lines not on this page · raw message
contrib/ports/unix/port/include/netif/vdeif.h new file +43 -0
43 lines not on this page · raw message
contrib/ports/unix/port/netif/fifo.c new file +139 -0
139 lines not on this page · raw message
contrib/ports/unix/port/netif/list.c new file +152 -0
152 lines not on this page · raw message
contrib/ports/unix/port/netif/pcapif.c new file +207 -0
207 lines not on this page · raw message
contrib/ports/unix/port/netif/sio.c new file +485 -0
485 lines not on this page · raw message
contrib/ports/unix/port/netif/tapif.c new file +432 -0
432 lines not on this page · raw message
contrib/ports/unix/port/netif/vdeif.c new file +344 -0
344 lines not on this page · raw message
contrib/ports/unix/port/perf.c new file +65 -0
65 lines not on this page · raw message
contrib/ports/unix/port/sys_arch.c new file +840 -0
840 lines not on this page · raw message
contrib/ports/unix/posixlib/CMakeLists.txt new file +94 -0
94 lines not on this page · raw message
contrib/ports/unix/posixlib/Uninstall.cmake new file +22 -0
Lines of this file are not shown. View the raw message.
contrib/ports/unix/posixlib/include/posix/inet.h new file +76 -0
76 lines not on this page · raw message
contrib/ports/unix/posixlib/include/posix/sockets.h new file +150 -0
150 lines not on this page · raw message
contrib/ports/unix/posixlib/lwipopts.h new file +180 -0
180 lines not on this page · raw message
contrib/ports/unix/setup-tapif new file +22 -0
Lines of this file are not shown. View the raw message.
contrib/ports/win32/Common.mk new file +51 -0
51 lines not on this page · raw message
contrib/ports/win32/Filelists.cmake new file +46 -0
46 lines not on this page · raw message
contrib/ports/win32/check/check_stdint.h new file +1 -0
Lines of this file are not shown. View the raw message.
contrib/ports/win32/check/config.h new file +29 -0
Lines of this file are not shown. View the raw message.
contrib/ports/win32/check/stdbool.h new file +9 -0
Lines of this file are not shown. View the raw message.
contrib/ports/win32/check/sys/time.h new file +12 -0
Lines of this file are not shown. View the raw message.
contrib/ports/win32/check/time.c new file +66 -0
66 lines not on this page · raw message
contrib/ports/win32/check/unistd.h new file +7 -0
Lines of this file are not shown. View the raw message.
contrib/ports/win32/example_app/CMakeLists.txt new file +27 -0
Lines of this file are not shown. View the raw message.
contrib/ports/win32/example_app/Makefile new file +55 -0
55 lines not on this page · raw message
contrib/ports/win32/example_app/default_netif.c new file +80 -0
80 lines not on this page · raw message
contrib/ports/win32/include/arch/bpstruct.h new file +1 -0
Lines of this file are not shown. View the raw message.
contrib/ports/win32/include/arch/cc.h new file +115 -0
115 lines not on this page · raw message
contrib/ports/win32/include/arch/epstruct.h new file +1 -0
Lines of this file are not shown. View the raw message.
contrib/ports/win32/include/arch/perf.h new file +40 -0
Lines of this file are not shown. View the raw message.
contrib/ports/win32/include/arch/sys_arch.h new file +91 -0
91 lines not on this page · raw message
contrib/ports/win32/msvc/build_coverity.cmd new file +26 -0
Lines of this file are not shown. View the raw message.
contrib/ports/win32/msvc/libcheck.vcxproj new file +102 -0
102 lines not on this page · raw message
contrib/ports/win32/msvc/libcheck.vcxproj.filters new file +96 -0
96 lines not on this page · raw message
contrib/ports/win32/msvc/lwIP.vcxproj new file +593 -0
593 lines not on this page · raw message
contrib/ports/win32/msvc/lwIP.vcxproj.filters new file +1075 -0
1,075 lines not on this page · raw message
contrib/ports/win32/msvc/lwIP_Test.sln new file +37 -0
Lines of this file are not shown. View the raw message.
contrib/ports/win32/msvc/lwIP_Test.vcxproj new file +209 -0
209 lines not on this page · raw message
contrib/ports/win32/msvc/lwIP_Test.vcxproj.filters new file +252 -0
252 lines not on this page · raw message
contrib/ports/win32/msvc/lwIP_pcapif.vcxproj new file +113 -0
113 lines not on this page · raw message
contrib/ports/win32/msvc/lwIP_pcapif.vcxproj.filters new file +28 -0
Lines of this file are not shown. View the raw message.
contrib/ports/win32/msvc/lwIP_unittests.sln new file +31 -0
Lines of this file are not shown. View the raw message.
contrib/ports/win32/msvc/lwip_unittests.vcxproj new file +145 -0
145 lines not on this page · raw message
contrib/ports/win32/msvc/lwip_unittests.vcxproj.filters new file +168 -0
168 lines not on this page · raw message
contrib/ports/win32/msvc/makefsdata.vcxproj new file +101 -0
101 lines not on this page · raw message
contrib/ports/win32/msvc/makefsdata.vcxproj.filters new file +14 -0
Lines of this file are not shown. View the raw message.
contrib/ports/win32/pcapif.c new file +1124 -0
1,124 lines not on this page · raw message
contrib/ports/win32/pcapif_helper.c new file +172 -0
172 lines not on this page · raw message
contrib/ports/win32/pcapif_helper.h new file +31 -0
Lines of this file are not shown. View the raw message.
contrib/ports/win32/readme.txt new file +26 -0
Lines of this file are not shown. View the raw message.
contrib/ports/win32/sio.c new file +304 -0
304 lines not on this page · raw message
contrib/ports/win32/sys_arch.c new file +782 -0
782 lines not on this page · raw message
doc/NO_SYS_SampleCode.c new file +121 -0
121 lines not on this page · raw message
doc/ZeroCopyRx.c new file +45 -0
45 lines not on this page · raw message
doc/contrib.txt new file +58 -0
58 lines not on this page · raw message
doc/doxygen/lwip.Doxyfile new file +2516 -0
2,516 lines not on this page · raw message
doc/doxygen/lwip.Doxyfile.cmake.in new file +2516 -0
2,516 lines not on this page · raw message
doc/doxygen/main_page.h new file +417 -0
417 lines not on this page · raw message
doc/doxygen/output/index.html new file +10 -0
Lines of this file are not shown. View the raw message.
doc/mdns.txt new file +111 -0
111 lines not on this page · raw message
doc/mqtt_client.txt new file +164 -0
164 lines not on this page · raw message
doc/ppp.txt new file +529 -0
529 lines not on this page · raw message
doc/savannah.txt new file +122 -0
122 lines not on this page · raw message
src/Filelists.cmake new file +293 -0
293 lines not on this page · raw message
src/Filelists.mk new file +208 -0
208 lines not on this page · raw message
src/api/api_lib.c new file +1367 -0
1,367 lines not on this page · raw message
src/api/api_msg.c new file +2177 -0
2,177 lines not on this page · raw message
src/api/err.c new file +115 -0
115 lines not on this page · raw message
src/api/if_api.c new file +102 -0
102 lines not on this page · raw message
src/api/netbuf.c new file +250 -0
250 lines not on this page · raw message
src/api/netdb.c new file +422 -0
422 lines not on this page · raw message
src/api/netifapi.c new file +380 -0
380 lines not on this page · raw message
src/api/sockets.c new file +4205 -0
4,205 lines not on this page · raw message
src/api/tcpip.c new file +706 -0
706 lines not on this page · raw message
src/apps/altcp_tls/altcp_tls_mbedtls.c new file +1367 -0
1,367 lines not on this page · raw message
src/apps/altcp_tls/altcp_tls_mbedtls_mem.c new file +210 -0
210 lines not on this page · raw message
src/apps/altcp_tls/altcp_tls_mbedtls_mem.h new file +72 -0
72 lines not on this page · raw message
src/apps/altcp_tls/altcp_tls_mbedtls_structs.h new file +83 -0
83 lines not on this page · raw message
src/apps/http/altcp_proxyconnect.c new file +584 -0
584 lines not on this page · raw message
src/apps/http/fs.c new file +161 -0
161 lines not on this page · raw message
src/apps/http/fs/img/sics.gif new file binary +0 -0
src/apps/http/fs/index.html new file +47 -0
47 lines not on this page · raw message
src/apps/http/fsdata.c new file +336 -0
336 lines not on this page · raw message
src/apps/http/fsdata.h new file +41 -0
41 lines not on this page · raw message
src/apps/http/http_client.c new file +911 -0
911 lines not on this page · raw message
src/apps/http/httpd.c new file +2770 -0
2,770 lines not on this page · raw message
src/apps/http/httpd_structs.h new file +123 -0
123 lines not on this page · raw message
src/apps/http/makefsdata/makefsdata new file +97 -0
97 lines not on this page · raw message
src/apps/http/makefsdata/makefsdata.c new file +1307 -0
1,307 lines not on this page · raw message
src/apps/http/makefsdata/readme.txt new file +23 -0
Lines of this file are not shown. View the raw message.
src/apps/http/makefsdata/tinydir.h new file +831 -0
831 lines not on this page · raw message
src/apps/lwiperf/lwiperf.c new file +847 -0
847 lines not on this page · raw message
src/apps/mdns/mdns.c new file +2855 -0
2,855 lines not on this page · raw message
src/apps/mdns/mdns_domain.c new file +635 -0
635 lines not on this page · raw message
src/apps/mdns/mdns_out.c new file +1163 -0
1,163 lines not on this page · raw message
src/apps/mqtt/mqtt.c new file +1480 -0
1,480 lines not on this page · raw message
src/apps/netbiosns/netbiosns.c new file +533 -0
533 lines not on this page · raw message
src/apps/smtp/smtp.c new file +1554 -0
1,554 lines not on this page · raw message
src/apps/snmp/snmp_asn1.c new file +704 -0
704 lines not on this page · raw message
src/apps/snmp/snmp_asn1.h new file +113 -0
113 lines not on this page · raw message
src/apps/snmp/snmp_core.c new file +1356 -0
1,356 lines not on this page · raw message
src/apps/snmp/snmp_core_priv.h new file +91 -0
91 lines not on this page · raw message
src/apps/snmp/snmp_mib2.c new file +116 -0
116 lines not on this page · raw message
src/apps/snmp/snmp_mib2_icmp.c new file +182 -0
182 lines not on this page · raw message
src/apps/snmp/snmp_mib2_interfaces.c new file +368 -0
368 lines not on this page · raw message
src/apps/snmp/snmp_mib2_ip.c new file +731 -0
731 lines not on this page · raw message
src/apps/snmp/snmp_mib2_snmp.c new file +227 -0
227 lines not on this page · raw message
src/apps/snmp/snmp_mib2_system.c new file +376 -0
376 lines not on this page · raw message
src/apps/snmp/snmp_mib2_tcp.c new file +607 -0
607 lines not on this page · raw message
src/apps/snmp/snmp_mib2_udp.c new file +372 -0
372 lines not on this page · raw message
src/apps/snmp/snmp_msg.c new file +1981 -0
1,981 lines not on this page · raw message
src/apps/snmp/snmp_msg.h new file +185 -0
185 lines not on this page · raw message
src/apps/snmp/snmp_netconn.c new file +122 -0
122 lines not on this page · raw message
src/apps/snmp/snmp_pbuf_stream.c new file +156 -0
156 lines not on this page · raw message
src/apps/snmp/snmp_pbuf_stream.h new file +72 -0
72 lines not on this page · raw message
src/apps/snmp/snmp_raw.c new file +103 -0
103 lines not on this page · raw message
src/apps/snmp/snmp_scalar.c new file +232 -0
232 lines not on this page · raw message
src/apps/snmp/snmp_snmpv2_framework.c new file +90 -0
90 lines not on this page · raw message
src/apps/snmp/snmp_snmpv2_usm.c new file +410 -0
410 lines not on this page · raw message
src/apps/snmp/snmp_table.c new file +342 -0
342 lines not on this page · raw message
src/apps/snmp/snmp_threadsync.c new file +231 -0
231 lines not on this page · raw message
src/apps/snmp/snmp_traps.c new file +900 -0
900 lines not on this page · raw message
src/apps/snmp/snmpv3.c new file +136 -0
136 lines not on this page · raw message
src/apps/snmp/snmpv3_mbedtls.c new file +342 -0
342 lines not on this page · raw message
src/apps/snmp/snmpv3_priv.h new file +69 -0
69 lines not on this page · raw message
src/apps/sntp/sntp.c new file +948 -0
948 lines not on this page · raw message
src/apps/tftp/tftp.c new file +548 -0
548 lines not on this page · raw message
src/core/altcp.c new file +717 -0
717 lines not on this page · raw message
src/core/altcp_alloc.c new file +87 -0
87 lines not on this page · raw message
src/core/altcp_tcp.c new file +578 -0
578 lines not on this page · raw message
src/core/def.c new file +263 -0
263 lines not on this page · raw message
src/core/dns.c new file +1657 -0
1,657 lines not on this page · raw message
src/core/inet_chksum.c new file +608 -0
608 lines not on this page · raw message
src/core/init.c new file +387 -0
387 lines not on this page · raw message
src/core/ip.c new file +167 -0
167 lines not on this page · raw message
src/core/ipv4/acd.c new file +557 -0
557 lines not on this page · raw message
src/core/ipv4/autoip.c new file +379 -0
379 lines not on this page · raw message
src/core/ipv4/dhcp.c new file +1999 -0
1,999 lines not on this page · raw message
src/core/ipv4/etharp.c new file +1251 -0
1,251 lines not on this page · raw message
src/core/ipv4/icmp.c new file +407 -0
407 lines not on this page · raw message
src/core/ipv4/igmp.c new file +801 -0
801 lines not on this page · raw message
src/core/ipv4/ip4.c new file +1166 -0
1,166 lines not on this page · raw message
src/core/ipv4/ip4_addr.c new file +323 -0
323 lines not on this page · raw message
src/core/ipv4/ip4_frag.c new file +894 -0
894 lines not on this page · raw message
src/core/ipv6/dhcp6.c new file +821 -0
821 lines not on this page · raw message
src/core/ipv6/ethip6.c new file +123 -0
123 lines not on this page · raw message
src/core/ipv6/icmp6.c new file +425 -0
425 lines not on this page · raw message
src/core/ipv6/inet6.c new file +53 -0
53 lines not on this page · raw message
src/core/ipv6/ip6.c new file +1494 -0
1,494 lines not on this page · raw message
src/core/ipv6/ip6_addr.c new file +355 -0
355 lines not on this page · raw message
src/core/ipv6/ip6_frag.c new file +862 -0
862 lines not on this page · raw message
src/core/ipv6/mld6.c new file +626 -0
626 lines not on this page · raw message
src/core/ipv6/nd6.c new file +2474 -0
2,474 lines not on this page · raw message
src/core/mem.c new file +1017 -0
1,017 lines not on this page · raw message
src/core/memp.c new file +447 -0
447 lines not on this page · raw message
src/core/netif.c new file +1855 -0
1,855 lines not on this page · raw message
src/core/pbuf.c new file +1545 -0
1,545 lines not on this page · raw message
src/core/raw.c new file +673 -0
673 lines not on this page · raw message
src/core/stats.c new file +168 -0
168 lines not on this page · raw message
src/core/sys.c new file +148 -0
148 lines not on this page · raw message
src/core/tcp.c new file +2696 -0
2,696 lines not on this page · raw message
src/core/tcp_in.c new file +2184 -0
2,184 lines not on this page · raw message
src/core/tcp_out.c new file +2257 -0
2,257 lines not on this page · raw message
src/core/timeouts.c new file +451 -0
451 lines not on this page · raw message
src/core/udp.c new file +1321 -0
1,321 lines not on this page · raw message
src/include/compat/posix/arpa/inet.h new file +33 -0
Lines of this file are not shown. View the raw message.
src/include/compat/posix/net/if.h new file +36 -0
Lines of this file are not shown. View the raw message.
src/include/compat/posix/netdb.h new file +33 -0
Lines of this file are not shown. View the raw message.
src/include/compat/posix/sys/socket.h new file +33 -0
Lines of this file are not shown. View the raw message.
src/include/compat/stdc/errno.h new file +33 -0
Lines of this file are not shown. View the raw message.
src/include/lwip/acd.h new file +109 -0
109 lines not on this page · raw message
src/include/lwip/altcp.h new file +207 -0
207 lines not on this page · raw message
src/include/lwip/altcp_tcp.h new file +72 -0
72 lines not on this page · raw message
src/include/lwip/altcp_tls.h new file +196 -0
196 lines not on this page · raw message
src/include/lwip/api.h new file +434 -0
434 lines not on this page · raw message
src/include/lwip/apps/altcp_proxyconnect.h new file +79 -0
79 lines not on this page · raw message
src/include/lwip/apps/altcp_tls_mbedtls_opts.h new file +111 -0
111 lines not on this page · raw message
src/include/lwip/apps/fs.h new file +139 -0
139 lines not on this page · raw message
src/include/lwip/apps/http_client.h new file +160 -0
160 lines not on this page · raw message
src/include/lwip/apps/httpd.h new file +256 -0
256 lines not on this page · raw message
src/include/lwip/apps/httpd_opts.h new file +416 -0
416 lines not on this page · raw message
src/include/lwip/apps/lwiperf.h new file +109 -0
109 lines not on this page · raw message
src/include/lwip/apps/mdns.h new file +154 -0
154 lines not on this page · raw message
src/include/lwip/apps/mdns_domain.h new file +80 -0
80 lines not on this page · raw message
src/include/lwip/apps/mdns_opts.h new file +121 -0
121 lines not on this page · raw message
src/include/lwip/apps/mdns_out.h new file +138 -0
138 lines not on this page · raw message
src/include/lwip/apps/mdns_priv.h new file +237 -0
237 lines not on this page · raw message
src/include/lwip/apps/mqtt.h new file +205 -0
205 lines not on this page · raw message
src/include/lwip/apps/mqtt_opts.h new file +103 -0
103 lines not on this page · raw message
src/include/lwip/apps/mqtt_priv.h new file +104 -0
104 lines not on this page · raw message
src/include/lwip/apps/netbiosns.h new file +51 -0
51 lines not on this page · raw message
src/include/lwip/apps/netbiosns_opts.h new file +66 -0
66 lines not on this page · raw message
src/include/lwip/apps/smtp.h new file +128 -0
128 lines not on this page · raw message
src/include/lwip/apps/smtp_opts.h new file +80 -0
80 lines not on this page · raw message
src/include/lwip/apps/snmp.h new file +145 -0
145 lines not on this page · raw message
src/include/lwip/apps/snmp_core.h new file +377 -0
377 lines not on this page · raw message
src/include/lwip/apps/snmp_mib2.h new file +78 -0
78 lines not on this page · raw message
src/include/lwip/apps/snmp_opts.h new file +297 -0
297 lines not on this page · raw message
src/include/lwip/apps/snmp_scalar.h new file +113 -0
113 lines not on this page · raw message
src/include/lwip/apps/snmp_snmpv2_framework.h new file +32 -0
Lines of this file are not shown. View the raw message.
src/include/lwip/apps/snmp_snmpv2_usm.h new file +24 -0
Lines of this file are not shown. View the raw message.
src/include/lwip/apps/snmp_table.h new file +134 -0
134 lines not on this page · raw message
src/include/lwip/apps/snmp_threadsync.h new file +114 -0
114 lines not on this page · raw message
src/include/lwip/apps/snmpv3.h new file +114 -0
114 lines not on this page · raw message
src/include/lwip/apps/sntp.h new file +81 -0
81 lines not on this page · raw message
src/include/lwip/apps/sntp_opts.h new file +215 -0
215 lines not on this page · raw message
src/include/lwip/apps/tftp_client.h new file +50 -0
50 lines not on this page · raw message
src/include/lwip/apps/tftp_common.h new file +108 -0
108 lines not on this page · raw message
src/include/lwip/apps/tftp_opts.h new file +106 -0
106 lines not on this page · raw message
src/include/lwip/apps/tftp_server.h new file +42 -0
42 lines not on this page · raw message
src/include/lwip/arch.h new file +402 -0
402 lines not on this page · raw message
src/include/lwip/autoip.h new file +90 -0
90 lines not on this page · raw message
src/include/lwip/debug.h new file +161 -0
161 lines not on this page · raw message
src/include/lwip/def.h new file +156 -0
156 lines not on this page · raw message
src/include/lwip/dhcp.h new file +155 -0
155 lines not on this page · raw message
src/include/lwip/dhcp6.h new file +104 -0
104 lines not on this page · raw message
src/include/lwip/dns.h new file +131 -0
131 lines not on this page · raw message
src/include/lwip/err.h new file +117 -0
117 lines not on this page · raw message
src/include/lwip/errno.h new file +198 -0
198 lines not on this page · raw message
src/include/lwip/etharp.h new file +110 -0
110 lines not on this page · raw message
src/include/lwip/ethip6.h new file +68 -0
68 lines not on this page · raw message
src/include/lwip/icmp.h new file +110 -0
110 lines not on this page · raw message
src/include/lwip/icmp6.h new file +72 -0
72 lines not on this page · raw message
src/include/lwip/if_api.h new file +70 -0
70 lines not on this page · raw message
src/include/lwip/igmp.h new file +115 -0
115 lines not on this page · raw message
src/include/lwip/inet.h new file +188 -0
188 lines not on this page · raw message
src/include/lwip/inet_chksum.h new file +104 -0
104 lines not on this page · raw message
src/include/lwip/init.h new file +100 -0
100 lines not on this page · raw message
src/include/lwip/init.h.cmake.in new file +100 -0
100 lines not on this page · raw message
src/include/lwip/ip.h new file +339 -0
339 lines not on this page · raw message
src/include/lwip/ip4.h new file +109 -0
109 lines not on this page · raw message
src/include/lwip/ip4_addr.h new file +225 -0
225 lines not on this page · raw message
src/include/lwip/ip4_frag.h new file +100 -0
100 lines not on this page · raw message
src/include/lwip/ip6.h new file +93 -0
93 lines not on this page · raw message
src/include/lwip/ip6_addr.h new file +372 -0
372 lines not on this page · raw message
src/include/lwip/ip6_frag.h new file +144 -0
144 lines not on this page · raw message
src/include/lwip/ip6_zone.h new file +306 -0
306 lines not on this page · raw message
src/include/lwip/ip_addr.h new file +468 -0
468 lines not on this page · raw message
src/include/lwip/mem.h new file +82 -0
82 lines not on this page · raw message
src/include/lwip/memp.h new file +155 -0
155 lines not on this page · raw message
src/include/lwip/mld6.h new file +99 -0
99 lines not on this page · raw message
src/include/lwip/nd6.h new file +90 -0
90 lines not on this page · raw message
src/include/lwip/netbuf.h new file +116 -0
116 lines not on this page · raw message
src/include/lwip/netdb.h new file +150 -0
150 lines not on this page · raw message
src/include/lwip/netif.h new file +698 -0
698 lines not on this page · raw message
src/include/lwip/netifapi.h new file +161 -0
161 lines not on this page · raw message
src/include/lwip/opt.h new file +3595 -0
3,595 lines not on this page · raw message
src/include/lwip/pbuf.h new file +326 -0
326 lines not on this page · raw message
src/include/lwip/priv/altcp_priv.h new file +159 -0
159 lines not on this page · raw message
src/include/lwip/priv/api_msg.h new file +272 -0
272 lines not on this page · raw message
src/include/lwip/priv/mem_priv.h new file +84 -0
84 lines not on this page · raw message
src/include/lwip/priv/memp_priv.h new file +161 -0
161 lines not on this page · raw message
src/include/lwip/priv/memp_std.h new file +153 -0
153 lines not on this page · raw message
src/include/lwip/priv/nd6_priv.h new file +143 -0
143 lines not on this page · raw message
src/include/lwip/priv/raw_priv.h new file +69 -0
69 lines not on this page · raw message
src/include/lwip/priv/sockets_priv.h new file +175 -0
175 lines not on this page · raw message
src/include/lwip/priv/tcp_priv.h new file +523 -0
523 lines not on this page · raw message
src/include/lwip/priv/tcpip_priv.h new file +176 -0
176 lines not on this page · raw message
src/include/lwip/prot/acd.h new file +91 -0
91 lines not on this page · raw message
src/include/lwip/prot/autoip.h new file +65 -0
65 lines not on this page · raw message
src/include/lwip/prot/dhcp.h new file +178 -0
178 lines not on this page · raw message
src/include/lwip/prot/dhcp6.h new file +138 -0
138 lines not on this page · raw message
src/include/lwip/prot/dns.h new file +140 -0
140 lines not on this page · raw message
src/include/lwip/prot/etharp.h new file +114 -0
114 lines not on this page · raw message
src/include/lwip/prot/ethernet.h new file +127 -0
127 lines not on this page · raw message
src/include/lwip/prot/iana.h new file +97 -0
97 lines not on this page · raw message
src/include/lwip/prot/icmp.h new file +105 -0
105 lines not on this page · raw message
src/include/lwip/prot/icmp6.h new file +172 -0
172 lines not on this page · raw message
src/include/lwip/prot/ieee.h new file +91 -0
91 lines not on this page · raw message
src/include/lwip/prot/igmp.h new file +90 -0
90 lines not on this page · raw message
src/include/lwip/prot/ip.h new file +59 -0
59 lines not on this page · raw message
src/include/lwip/prot/ip4.h new file +131 -0
131 lines not on this page · raw message
src/include/lwip/prot/ip6.h new file +235 -0
235 lines not on this page · raw message
src/include/lwip/prot/mld6.h new file +71 -0
71 lines not on this page · raw message
src/include/lwip/prot/nd6.h new file +274 -0
274 lines not on this page · raw message
src/include/lwip/prot/tcp.h new file +100 -0
100 lines not on this page · raw message
src/include/lwip/prot/udp.h new file +68 -0
68 lines not on this page · raw message
src/include/lwip/raw.h new file +143 -0
143 lines not on this page · raw message
src/include/lwip/sio.h new file +142 -0
142 lines not on this page · raw message
src/include/lwip/snmp.h new file +213 -0
213 lines not on this page · raw message
src/include/lwip/sockets.h new file +707 -0
707 lines not on this page · raw message
src/include/lwip/stats.h new file +491 -0
491 lines not on this page · raw message
src/include/lwip/sys.h new file +575 -0
575 lines not on this page · raw message
src/include/lwip/tcp.h new file +500 -0
500 lines not on this page · raw message
src/include/lwip/tcpbase.h new file +88 -0
88 lines not on this page · raw message
src/include/lwip/tcpip.h new file +114 -0
114 lines not on this page · raw message
src/include/lwip/timeouts.h new file +128 -0
128 lines not on this page · raw message
src/include/lwip/udp.h new file +195 -0
195 lines not on this page · raw message
src/include/netif/bridgeif.h new file +127 -0
127 lines not on this page · raw message
src/include/netif/bridgeif_opts.h new file +90 -0
90 lines not on this page · raw message
src/include/netif/ethernet.h new file +77 -0
77 lines not on this page · raw message
src/include/netif/ieee802154.h new file +112 -0
112 lines not on this page · raw message
src/include/netif/lowpan6.h new file +89 -0
89 lines not on this page · raw message
src/include/netif/lowpan6_ble.h new file +78 -0
78 lines not on this page · raw message
src/include/netif/lowpan6_common.h new file +82 -0
82 lines not on this page · raw message
src/include/netif/lowpan6_opts.h new file +122 -0
122 lines not on this page · raw message
src/include/netif/ppp/ccp.h new file +164 -0
164 lines not on this page · raw message
src/include/netif/ppp/chap-md5.h new file +36 -0
Lines of this file are not shown. View the raw message.
src/include/netif/ppp/chap-new.h new file +200 -0
200 lines not on this page · raw message
src/include/netif/ppp/chap_ms.h new file +44 -0
44 lines not on this page · raw message
src/include/netif/ppp/eap.h new file +169 -0
169 lines not on this page · raw message
src/include/netif/ppp/ecp.h new file +62 -0
62 lines not on this page · raw message
src/include/netif/ppp/eui64.h new file +102 -0
102 lines not on this page · raw message
src/include/netif/ppp/fsm.h new file +182 -0
182 lines not on this page · raw message
src/include/netif/ppp/ipcp.h new file +134 -0
134 lines not on this page · raw message
src/include/netif/ppp/ipv6cp.h new file +191 -0
191 lines not on this page · raw message
src/include/netif/ppp/lcp.h new file +179 -0
179 lines not on this page · raw message
src/include/netif/ppp/magic.h new file +130 -0
130 lines not on this page · raw message
src/include/netif/ppp/mppe.h new file +181 -0
181 lines not on this page · raw message
src/include/netif/ppp/polarssl/arc4.h new file +81 -0
81 lines not on this page · raw message
src/include/netif/ppp/polarssl/des.h new file +92 -0
92 lines not on this page · raw message
src/include/netif/ppp/polarssl/md4.h new file +97 -0
97 lines not on this page · raw message
src/include/netif/ppp/polarssl/md5.h new file +96 -0
96 lines not on this page · raw message
src/include/netif/ppp/polarssl/sha1.h new file +96 -0
96 lines not on this page · raw message
src/include/netif/ppp/ppp.h new file +698 -0
698 lines not on this page · raw message
src/include/netif/ppp/ppp_impl.h new file +736 -0
736 lines not on this page · raw message
src/include/netif/ppp/ppp_opts.h new file +610 -0
610 lines not on this page · raw message
src/include/netif/ppp/pppapi.h new file +137 -0
137 lines not on this page · raw message
src/include/netif/ppp/pppcrypt.h new file +144 -0
144 lines not on this page · raw message
src/include/netif/ppp/pppdebug.h new file +88 -0
88 lines not on this page · raw message
src/include/netif/ppp/pppoe.h new file +187 -0
187 lines not on this page · raw message
src/include/netif/ppp/pppol2tp.h new file +209 -0
209 lines not on this page · raw message
src/include/netif/ppp/pppos.h new file +125 -0
125 lines not on this page · raw message
src/include/netif/ppp/upap.h new file +131 -0
131 lines not on this page · raw message
src/include/netif/ppp/vj.h new file +169 -0
169 lines not on this page · raw message
src/include/netif/slipif.h new file +86 -0
86 lines not on this page · raw message
src/include/netif/zepif.h new file +81 -0
81 lines not on this page · raw message
src/netif/bridgeif.c new file +563 -0
563 lines not on this page · raw message
src/netif/bridgeif_fdb.c new file +212 -0
212 lines not on this page · raw message
src/netif/ethernet.c new file +329 -0
329 lines not on this page · raw message
src/netif/lowpan6.c new file +921 -0
921 lines not on this page · raw message
src/netif/lowpan6_ble.c new file +447 -0
447 lines not on this page · raw message
src/netif/lowpan6_common.c new file +841 -0
841 lines not on this page · raw message
src/netif/ppp/PPPD_FOLLOWUP new file +473 -0
473 lines not on this page · raw message
src/netif/ppp/auth.c new file +2513 -0
2,513 lines not on this page · raw message
src/netif/ppp/ccp.c new file +1740 -0
1,740 lines not on this page · raw message
src/netif/ppp/chap-md5.c new file +126 -0
126 lines not on this page · raw message
src/netif/ppp/chap-new.c new file +677 -0
677 lines not on this page · raw message
src/netif/ppp/chap_ms.c new file +962 -0
962 lines not on this page · raw message
src/netif/ppp/demand.c new file +465 -0
465 lines not on this page · raw message
src/netif/ppp/eap.c new file +2441 -0
2,441 lines not on this page · raw message
src/netif/ppp/ecp.c new file +191 -0
191 lines not on this page · raw message
src/netif/ppp/eui64.c new file +56 -0
56 lines not on this page · raw message
src/netif/ppp/fsm.c new file +799 -0
799 lines not on this page · raw message
src/netif/ppp/ipcp.c new file +2418 -0
2,418 lines not on this page · raw message
src/netif/ppp/ipv6cp.c new file +1533 -0
1,533 lines not on this page · raw message
src/netif/ppp/lcp.c new file +2794 -0
2,794 lines not on this page · raw message
src/netif/ppp/magic.c new file +286 -0
286 lines not on this page · raw message
src/netif/ppp/mppe.c new file +412 -0
412 lines not on this page · raw message
src/netif/ppp/multilink.c new file +609 -0
609 lines not on this page · raw message
src/netif/ppp/polarssl/README new file +22 -0
Lines of this file are not shown. View the raw message.
src/netif/ppp/polarssl/arc4.c new file +101 -0
101 lines not on this page · raw message
src/netif/ppp/polarssl/des.c new file +422 -0
422 lines not on this page · raw message
src/netif/ppp/polarssl/md4.c new file +281 -0
281 lines not on this page · raw message
src/netif/ppp/polarssl/md5.c new file +300 -0
300 lines not on this page · raw message
src/netif/ppp/polarssl/sha1.c new file +335 -0
335 lines not on this page · raw message
src/netif/ppp/ppp.c new file +1645 -0
1,645 lines not on this page · raw message
src/netif/ppp/pppapi.c new file +427 -0
427 lines not on this page · raw message
src/netif/ppp/pppcrypt.c new file +66 -0
66 lines not on this page · raw message
src/netif/ppp/pppoe.c new file +1217 -0
1,217 lines not on this page · raw message
src/netif/ppp/pppol2tp.c new file +1171 -0
1,171 lines not on this page · raw message
src/netif/ppp/pppos.c new file +940 -0
940 lines not on this page · raw message
src/netif/ppp/upap.c new file +679 -0
679 lines not on this page · raw message
src/netif/ppp/utils.c new file +957 -0
957 lines not on this page · raw message
src/netif/ppp/vj.c new file +685 -0
685 lines not on this page · raw message
src/netif/slipif.c new file +558 -0
558 lines not on this page · raw message
src/netif/zepif.c new file +300 -0
300 lines not on this page · raw message
test/fuzz/Makefile new file +73 -0
73 lines not on this page · raw message
test/fuzz/config.h new file +0 -0
test/fuzz/fuzz_common.c new file +702 -0
702 lines not on this page · raw message
test/fuzz/fuzz_common.h new file +62 -0
62 lines not on this page · raw message
test/fuzz/inputs/arp/arp_req.bin new file binary +0 -0
test/fuzz/inputs/icmp/icmp_ping.bin new file binary +0 -0
test/fuzz/inputs/ipv6/neighbor_solicitation.bin new file binary +0 -0
test/fuzz/inputs/ipv6/router_adv.bin new file binary +0 -0
test/fuzz/inputs/tcp/tcp_syn.bin new file binary +0 -0
test/fuzz/inputs/udp/udp_port_5000.bin new file binary +0 -0
test/fuzz/lwipopts.h new file +84 -0
84 lines not on this page · raw message
test/sockets/sockets_stresstest.c new file +726 -0
726 lines not on this page · raw message
test/sockets/sockets_stresstest.h new file +40 -0
Lines of this file are not shown. View the raw message.
test/unit/Filelists.mk new file +54 -0
54 lines not on this page · raw message
test/unit/api/test_sockets.c new file +852 -0
852 lines not on this page · raw message
test/unit/arch/sys_arch.c new file +387 -0
387 lines not on this page · raw message
test/unit/arch/sys_arch.h new file +79 -0
79 lines not on this page · raw message
test/unit/core/test_def.c new file +84 -0
84 lines not on this page · raw message
test/unit/core/test_dns.c new file +52 -0
52 lines not on this page · raw message
test/unit/core/test_mem.c new file +221 -0
221 lines not on this page · raw message
test/unit/core/test_netif.c new file +285 -0
285 lines not on this page · raw message
test/unit/core/test_pbuf.c new file +359 -0
359 lines not on this page · raw message
test/unit/core/test_timers.c new file +233 -0
233 lines not on this page · raw message
test/unit/dhcp/test_dhcp.c new file +1103 -0
1,103 lines not on this page · raw message
test/unit/etharp/test_etharp.c new file +273 -0
273 lines not on this page · raw message
test/unit/etharp/test_etharp.h new file +8 -0
Lines of this file are not shown. View the raw message.
test/unit/ip4/test_ip4.c new file +342 -0
342 lines not on this page · raw message
test/unit/ip6/test_ip6.c new file +469 -0
469 lines not on this page · raw message
test/unit/lwip_check.h new file +52 -0
52 lines not on this page · raw message
test/unit/lwip_unittests.c new file +125 -0
125 lines not on this page · raw message
test/unit/lwipopts.h new file +94 -0
94 lines not on this page · raw message
test/unit/mdns/test_mdns.c new file +916 -0
916 lines not on this page · raw message
test/unit/mqtt/test_mqtt.c new file +115 -0
115 lines not on this page · raw message
test/unit/ppp/test_pppos.c new file +67 -0
67 lines not on this page · raw message
test/unit/tcp/tcp_helper.c new file +325 -0
325 lines not on this page · raw message
test/unit/tcp/tcp_helper.h new file +58 -0
58 lines not on this page · raw message
test/unit/tcp/test_tcp.c new file +1700 -0
1,700 lines not on this page · raw message
test/unit/tcp/test_tcp_oos.c new file +1018 -0
1,018 lines not on this page · raw message
test/unit/tcp/test_tcp_state.c new file +665 -0
665 lines not on this page · raw message
test/unit/tcp/test_tcp_state.h new file +8 -0
Lines of this file are not shown. View the raw message.
test/unit/udp/test_udp.c new file +472 -0
472 lines not on this page · raw message
The rest of this diff is not shown. View the raw message.
Signature · 1 line
2.40.1
Part of the diff is not shown here. View the raw message.
PATCH v2 4/14 net-lwip: add DHCP support and dhcp commmand
In reply to Jerome ForissierAdd what it takes to enable NETDEVICES with NET_LWIP and enable DHCP as well as the dhcp command.
- net-lwip/net-lwip.c is mostly empty for now. It will provide functions similar to net/net.c except based on the lwIP stack
- include/net-lwip.h is a replacement for include/net.h which is unused when NET_LWIP is enabled. Declarations from the latter will be transferred to the former as needed when new network commands are ported on top of lwIP.
- CMD_TFTPBOOT is selected by BOOTMETH_EFI due to this code having an implicit dependency on do_tftpb().
--- Makefile | 1 + boot/Kconfig | 3 +- cmd/Kconfig | 26 +++++ cmd/Makefile | 4 + cmd/net-lwip.c | 13 +++ common/board_r.c | 4 +- drivers/net/Kconfig | 2 +- include/net-lwip.h | 85 +++++++++++++++ include/net.h | 2 +- net-lwip/Kconfig | 41 +++++++- net-lwip/Makefile | 15 +++ net-lwip/dhcp.c | 105 +++++++++++++++++++ net-lwip/eth_internal.h | 35 +++++++ net-lwip/net-lwip.c | 224 ++++++++++++++++++++++++++++++++++++++++ net-lwip/tftp.c | 11 ++ 15 files changed, 564 insertions(+), 7 deletions(-) create mode 100644 cmd/net-lwip.c create mode 100644 include/net-lwip.h create mode 100644 net-lwip/Makefile create mode 100644 net-lwip/dhcp.c create mode 100644 net-lwip/eth_internal.h create mode 100644 net-lwip/net-lwip.c create mode 100644 net-lwip/tftp.c
Makefile +1 -0
@@ -860,6 +860,7 @@ libs-y += env/ libs-y += lib/ libs-y += fs/ libs-$(CONFIG_NET) += net/ +libs-$(CONFIG_NET_LWIP) += net-lwip/ libs-y += disk/ libs-y += drivers/ libs-$(CONFIG_SYS_FSL_DDR) += drivers/ddr/fsl/
boot/Kconfig +2 -1
@@ -378,7 +378,7 @@ config BOOT_DEFAULTS_CMDS select CMD_FAT select CMD_FS_GENERIC select CMD_PART if PARTITIONS - select CMD_DHCP if CMD_NET + select CMD_DHCP if CMD_NET || CMD_NET_LWIP select CMD_PING if CMD_NET select CMD_PXE if CMD_NET select CMD_BOOTI if ARM64
@@ -540,6 +540,7 @@ config BOOTMETH_EXTLINUX_PXE config BOOTMETH_EFILOADER bool "Bootdev support for EFI boot" depends on EFI_BINARY_EXEC + select CMD_TFTPBOOT if CMD_NET_LWIP default y help Enables support for EFI boot using bootdevs. This makes the
cmd/Kconfig +26 -0
@@ -2084,6 +2084,32 @@ config CMD_WOL endif +if NET_LWIP + +menuconfig CMD_NET_LWIP + bool "Network commands (lwIP)" + default y + +if CMD_NET_LWIP + +config CMD_DHCP + bool "dhcp" + select PROT_DHCP_LWIP + help + Boot image via network using DHCP/TFTP protocol + +config CMD_TFTPBOOT + bool "tftp" + select PROT_UDP_LWIP + default n + help + tftpboot - load file via network using TFTP protocol + Currently a placeholder (not implemented) + +endif + +endif + menu "Misc commands" config CMD_2048
cmd/Makefile +4 -0
@@ -128,6 +128,10 @@ endif obj-$(CONFIG_CMD_MUX) += mux.o obj-$(CONFIG_CMD_NAND) += nand.o obj-$(CONFIG_CMD_NET) += net.o +obj-$(CONFIG_CMD_NET_LWIP) += net-lwip.o +ifdef CONFIG_CMD_NET_LWIP +CFLAGS_net-lwip.o := -I$(srctree)/lib/lwip/lwip/src/include -I$(srctree)/lib/lwip/u-boot +endif obj-$(CONFIG_ENV_SUPPORT) += nvedit.o obj-$(CONFIG_CMD_NVEDIT_EFI) += nvedit_efi.o obj-$(CONFIG_CMD_ONENAND) += onenand.o
cmd/net-lwip.c new file +13 -0
@@ -0,0 +1,13 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* Copyright (C) 2024 Linaro Ltd. */ + +#include <command.h> +#include <net-lwip.h> + +#if defined(CONFIG_CMD_DHCP ) +U_BOOT_CMD ( + dhcp,3 ,1 , do_dhcp, +"boot image via network using DHCP/TFTP protocol" , +"[loadAddress] [[hostIPaddr:]bootfilename]" +); +#endif
common/board_r.c +2 -2
@@ -472,7 +472,7 @@ static int initr_status_led(void) }#endif -#ifdef CONFIG_CMD_NET +#if defined(CONFIG_CMD_NET ) || defined(CONFIG_CMD_NET_LWIP )static int initr_net (void ) {puts ("Net: " );
@@ -727,7 +727,7 @@ static init_fnc_t init_sequence_r[] = {#ifdef CONFIG_PCI_ENDPOINT pci_ep_init,#endif -#ifdef CONFIG_CMD_NET +#if defined(CONFIG_CMD_NET ) || defined(CONFIG_CMD_NET_LWIP ) INIT_FUNC_WATCHDOG_RESET initr_net,#endif
drivers/net/Kconfig +1 -1
@@ -96,7 +96,7 @@ config DSA_SANDBOX menuconfig NETDEVICES bool "Network device support" - depends on NET + depends on NET || NET_LWIP select DM_ETH help You must select Y to enable any network device support
include/net-lwip.h new file +85 -0
85 lines not on this page · raw message
include/net.h +1 -1
@@ -914,7 +914,7 @@ static inline struct in_addr env_get_ip(char *var)*/ void reset_phy (void ); -#if CONFIG_IS_ENABLED (NET ) +#if CONFIG_IS_ENABLED (NET ) ||CONFIG_IS_ENABLED (NET_LWIP )/** * eth_set_enable_bootdevs() - Enable or disable binding of Ethernet bootdevs *
net-lwip/Kconfig +39 -2
50 lines not on this page · raw message
net-lwip/Makefile new file +15 -0
@@ -0,0 +1,15 @@ +ccflags-y += -I$(srctree)/lib/lwip/lwip/src/include -I$(srctree)/lib/lwip/u-boot + +obj-$(CONFIG_$(SPL_TPL_)BOOTDEV_ETH) += ../net/eth_bootdev.o +obj-$(CONFIG_DM_MDIO) += ../net/mdio-uclass.o +obj-$(CONFIG_DM_MDIO_MUX) += ../net/mdio-mux-uclass.o +obj-$(CONFIG_$(SPL_)DM_ETH) += ../net/eth_common.o +obj-$(CONFIG_$(SPL_)DM_ETH) += ../net/eth-uclass.o +obj-$(CONFIG_$(SPL_)DM_ETH) += net-lwip.o +obj-$(CONFIG_CMD_DHCP) += dhcp.o +obj-$(CONFIG_CMD_TFTPBOOT) += tftp.o + +# Disable this warning as it is triggered by: +# sprintf(buf, index ? "foo%d" : "foo", index) +# and this is intentional usage. +CFLAGS_eth_common.o += -Wno-format-extra-args
net-lwip/dhcp.c new file +105 -0
105 lines not on this page · raw message
net-lwip/eth_internal.h new file +35 -0
@@ -0,0 +1,35 @@ +/* SPDX-License-Identifier: GPL-2.0+ */ +/* +* (C) Copyright 2001-2015 +* Wolfgang Denk, DENX Software Engineering, [email protected]. +* Joe Hershberger, National Instruments +*/ + +#ifndef __ETH_INTERNAL_H +#define __ETH_INTERNAL_H + +/* Do init that is common to driver model and legacy networking */ +void eth_common_init (void ); + +/** +* eth_env_set_enetaddr_by_index() - set the MAC address environment variable +* +* This sets up an environment variable with the given MAC address (@enetaddr). +* The environment variable to be set is defined by <@base_name><@index>addr. +* If @index is 0 it is omitted. For common Ethernet this means ethaddr, +* eth1addr, etc. +* +* @base_name: Base name for variable, typically "eth" +* @index: Index of interface being updated (>=0) +* @enetaddr: Pointer to MAC address to put into the variable +* Return: 0 if OK, other value on error +*/ +int eth_env_set_enetaddr_by_index (const char *base_name,int index, +uchar *enetaddr); + +int eth_mac_skip (int index); +void eth_current_changed (void ); +void eth_set_dev (struct udevice *dev); +void eth_set_current_to_next (void ); + +#endif
net-lwip/net-lwip.c new file +224 -0
224 lines not on this page · raw message
net-lwip/tftp.c new file +11 -0
@@ -0,0 +1,11 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* Copyright (C) 2024 Linaro Ltd. */ + +#include <command.h> +#include <net-lwip.h> + +int do_tftpb (struct cmd_tbl *cmdtp,int flag,int argc,char *const argv[]) +{ +/* Not implemented */ +return CMD_RET_FAILURE ; +}
Signature · 1 line
2.40.1
Hello Jerome,
Quoted 4 lines · Jerome Forissier
- Make the support of HTTPS in the wget command easier. Javier T. (CC'd) has some additional lwIP and Mbed TLS patches to do so. With that it becomes possible to fetch and launch a distro installer such as Debian etc. directly from the U-Boot shell.
Why this is enabling this use case? Or it is just that currently, without TLS, is not supposed to be something you should do? I am a little bit confused reading this sentence, since to me this is already possible using tftp.
Francesco
Hi Francesco,
Quoted 8 lines · Francesco Dolcini
Hello Jerome,
Quoted 4 lines · Jerome Forissier
- Make the support of HTTPS in the wget command easier. Javier T. (CC'd) has some additional lwIP and Mbed TLS patches to do so. With that it becomes possible to fetch and launch a distro installer such as Debian etc. directly from the U-Boot shell.
Quoted 4 lines
Why this is enabling this use case? Or it is just that currently, without TLS, is not supposed to be something you should do? I am a little bit confused reading this sentence, since to me this is already possible using tftp.
You're correct. The point I am making is about using a secure (authenticated) connection, and I should have clarified that. While using HTTPS might not be critical on a local network, things are different when downloading from the internet (think man-in-the-middle attacks). Also, many web sites are switching off HTTP in favor of HTTPS so it could be that your favorite distro becomes unavailable without it.
Thanks,
Signature · 1 line
Jerome
Quoted 3 lines
Francesco
Quoted 4 lines · Jerome Forissier
You're correct. The point I am making is about using a secure (authenticated) connection, and I should have clarified that. While using HTTPS might not be critical on a local network, things are different when downloading from the internet (think man-in-the-middle attacks).
(Sorry if this sounds like nitpkicking, but I am genuinely curious) How is it supposed to work?
You need not only https but also verify the presented certificate chain, and for that you need up-to-date root certificates (e.g. the bundle available from mozilla).
This sounds a bit outside the scope of u-boot to me (or you should avoid the man-in-the-middle argument, which leaves the still valid "sites stop offering plain http" argument).
If you really worry about man-in-the-middle you need to download via https in an environment that does certificate validation, and then even better verify the hash of the downloaded image. After that you can offer the image locally - via http, https or tftp - for installations.
Martin
Quoted 7 lines · Martin Husemann
Quoted 4 lines · Jerome Forissier
You're correct. The point I am making is about using a secure (authenticated) connection, and I should have clarified that. While using HTTPS might not be critical on a local network, things are different when downloading from the internet (think man-in-the-middle attacks).
(Sorry if this sounds like nitpkicking, but I am genuinely curious)
No worries. Well-defined use cases are certainly essential to proper implementations.
Quoted 5 lines
How is it supposed to work?
You need not only https but also verify the presented certificate chain, and for that you need up-to-date root certificates (e.g. the bundle available from mozilla).
Yes. I will let Javier comment further since he's more directly concerned with that part.
Quoted 1 line
This sounds a bit outside the scope of u-boot to me
Maybe, maybe not. I would argue it is a matter of deployment policy. For example assume the device is an IP camera or some other IoT thing that comes with the bare minimum to boot and fetch its OS on first power up. No guarantee about what is on the local network -- just plain internet access. https would be quite helpful in such a case.
Quoted 3 lines
(or you should
avoid the man-in-the-middle argument, which leaves the still valid "sites stop offering plain http" argument).
As long as there is at least one valid argument then I'm fine :)
Quoted 4 lines
If you really worry about man-in-the-middle you need to download via https in an environment that does certificate validation, and then even better verify the hash of the downloaded image. After that you can offer the image locally - via http, https or tftp - for installations.
That certainly would work but again, isn't it a decision to be made by the device manufacturer or more generally the one who builds u-boot for the device?
Signature · 1 line
Jerome
Quoted 3 lines · Jerome Forissier
That certainly would work but again, isn't it a decision to be made by the device manufacturer or more generally the one who builds u-boot for the device?
Very true, and if you get the verification part working, your full solution is better!
Martin
Quoted 20 lines · Jerome Forissier
This is a rework of a patch series by Maxim Uvarov: "net/lwip: add lwip library for the network stack" [1]. The goal is to introduce the lwIP TCP/IP stack [2] [3] as an alternative to the current implementation in
net/, selectable withKconfig, and ultimately keep only lwIP if possible. Some reasons for doing so are:
- Make the support of HTTPS in the wget command easier. Javier T. (CC'd) has some additional lwIP and Mbed TLS patches to do so. With that it becomes possible to fetch and launch a distro installer such as Debian etc. directly from the U-Boot shell.
- Possibly benefit from additional features implemented in lwIP
- Less code to maintain in U-BootThe first patch introduces a new
Kconfigsymbol:NET_LWIP, which selects the lwIP implementation instead of the current one (NET). Contrary to the approach chosen by Maxim in [1],NET_LWIPand NET cannot be enabled simultaneously. The rationale is we want to start from a clean state and not pull potentially duplicated functionality from both stacks. Note however that a few files are still built innet/, they are the ones related to ethernet device management and the ethernet bootflow.
Quoted 2 lines
The second patch imports the lwIP code as a Git subtree under
lib/lwip/lwip. Some glue code is added underlib/lwip/u-boot.
For next time, please just make it a pre-req to run the git subtree command (and note it in the cover letter).
In more specific feedback, I tried this on a Pi 3, and:
U-Boot> tftpboot 200000 EFI/arm64/helloworld.efi
TFTP from server 192.168.1.10; our IP address is 192.168.1.100
Filename 'EFI/arm64/helloworld.efi'.
Load address: 0x200000
Loading:
....
FAILED test/py/tests/test_efi_loader.py::test_efi_helloworld_net - u_boot_spawn.Timeout
So some amount of networking is working (that's a reasonable dhcp response it got), but tftp'ing a file fails.
Signature · 1 line
Tom
Re: [PATCH v2 01/14] net: introduce alternative implementation as net-lwip/
In reply to Jerome ForissierQuoted 16 lines · Jerome Forissier
Prepare the introduction of the lwIP (lightweight IP) TCP/IP stack by adding a new net-lwip/ directory and the
NET_LWIPsymbol. At this point, enablingNET_LWIPsimply disables NET. Subsequent commits will introduce the lwIP code, re-work the NETDEVICE integration and port some of the NET commands and features to lwIP.
SPL_NETcannot be enabled when NET_LWIP=y.SPL_NETpulls some symbols that are part of NET (such asarp_init(),arp_timeout_check(),arp_receive(),net_arp_wait_packet_ip()). lwIP support in SPL may be added later.Similarly,
DFU_TFTPis not compatible withNET_LWIPbecause it depends onnet_loop(),tftp_timeout_ms,tftp_timeout_count_max. Let's add a dependency on !NET_LWIP for now.Signed-off-by Jerome Forissier <[email protected]>
[snip]
Kconfig source "env/Kconfig" · line 754
Quoted 13 lines
Kconfig +2
-0@@ -747,6 +747,8 @@ source "env/Kconfig" source "net/Kconfig" +source "net-lwip/Kconfig" + source "drivers/Kconfig" source "fs/Kconfig"
I think we need to instead rework this to a choice statement instead so that in the end we have something like:
choice "Networking stack"
config NO_NET
bool "No networking support"
config NET
bool "Legacy U-Boot networking stack"
config NET_LWIP
bool "Use lwIP for networking stack"
if NET_LEGACY
source "net/Kconfig"
endif
if NET_LWIP
source "net-lwip/Kconfig"
endif
And then SPL_NET still depends on !NET_LWIP for now and we sort out the problems with different networking stacks in SPL vs full U-Boot later on.
Signature · 1 line
Tom
Re: [PATCH v2 12/14] test/py: net: add _lwip variants of dhcp, ping and tftpboot tests
In reply to Jerome ForissierQuoted 65 lines · Jerome Forissier
WHen
NET_LWIPis enabled, the dhcp/ping/tftpboot commands are enabled viaCMD_DHCP_LWIP,CMD_PING_LWIPandCMD_TFTPBOOT_LWIP, respectively; therefore the config annotations in the Python test scripts need to becmd_dhcp_lwip,cmd_ping_lwipandcmd_tftpboot_lwip.The console output of the tftpboot command with lwIP is slightly different from the non-lwIP implementation. This is taken care of in
test_net_tftpboot().Signed-off-by Jerome Forissier <[email protected]>--- test/py/tests/test_net.py | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-)test/py/tests/test_net.py +13
-4@@ -127,6 +127,10 @@ def test_net_dhcp(u_boot_console): global net_set_up net_set_up = True [email protected]('cmd_dhcp_lwip') +def test_net_dhcp_lwip(u_boot_console): + test_net_dhcp(u_boot_console) + @pytest.mark.buildconfigspec('cmd_dhcp') @pytest.mark.buildconfigspec('cmd_mii') def test_net_dhcp_abort(u_boot_console):@@ -230,6 +234,10 @@ def test_net_ping(u_boot_console): output = u_boot_console.run_command('ping $serverip') assert 'is alive' in output [email protected]('cmd_ping_lwip') +def test_net_ping_lwip(u_boot_console): + test_net_ping(u_boot_console) + @pytest.mark.buildconfigspec('IPV6_ROUTER_DISCOVERY') def test_net_network_discovery(u_boot_console): """Test the network discovery feature of IPv6.@@ -255,7 +263,7 @@ def test_net_network_discovery(u_boot_console): assert '0000:0000:0000:0000:0000:0000:0000:0000' not in output @pytest.mark.buildconfigspec('cmd_net') -def test_net_tftpboot(u_boot_console): +def test_net_tftpboot(u_boot_console, lwip = False): """Test the tftpboot command. A file is downloaded from the TFTP server, its size and optionally its@@ -279,10 +287,11 @@ def test_net_tftpboot(u_boot_console): output = u_boot_console.run_command('tftpboot %s' % (fn)) else: output = u_boot_console.run_command('tftpboot %x %s' % (addr, fn)) - expected_text = 'Bytes transferred = ' sz = f.get('size', None) - if sz: - expected_text += '%d' % sz + if lwip: + expected_text = f'{sz} bytes transferred' + else: + expected_text = f'Bytes transferred = {sz}' assert expected_text in output expected_crc = f.get('crc32', None)
test/py/tests/test_net.py def test_net_tftpboot(u_boot_console): · line 313
Quoted 10 lines
test/py/tests/test_net.py +4
-0@@ -295,6 +304,10 @@ def test_net_tftpboot(u_boot_console): output = u_boot_console.run_command('crc32 $fileaddr $filesize') assert expected_crc in output [email protected]("cmd_net_lwip") +def test_net_tftpboot_lwip(u_boot_console): + test_net_tftpboot(u_boot_console, True) + @pytest.mark.buildconfigspec('cmd_nfs') def test_net_nfs(u_boot_console): """Test the nfs command.
Hi all
Quoted 8 lines · Martin Husemann
Quoted 3 lines · Jerome Forissier
That certainly would work but again, isn't it a decision to be made by the device manufacturer or more generally the one who builds u-boot for the device?
Very true, and if you get the verification part working, your full solution is better!
Just to chime in a bit on the why. HTTPs is one of the options we can easily plug in with LWIP & mbedTLS. But apart from that, getting a richer TCP/IP stack that has been used for years in RTOSes is a win on its own.
We can now easily add multiple net-based applications without having to implement the underlying TCP/IP stack. LWIP is a very slight increase in size (~1%) and the advantages are well worth it.
Cheers
/Ilias
Quoted 2 lines
Martin
Re: [PATCH v2 12/14] test/py: net: add _lwip variants of dhcp, ping and tftpboot tests
In reply to Jerome Forissierпт, 24 мая 2024 г. в 19:22, Jerome Forissier <[email protected]>:
Quoted 51 lines
WHen
NET_LWIPis enabled, the dhcp/ping/tftpboot commands are enabled viaCMD_DHCP_LWIP,CMD_PING_LWIPandCMD_TFTPBOOT_LWIP, respectively; therefore the config annotations in the Python test scripts need to becmd_dhcp_lwip,cmd_ping_lwipandcmd_tftpboot_lwip.The console output of the tftpboot command with lwIP is slightly different from the non-lwIP implementation. This is taken care of in
test_net_tftpboot().Signed-off-by Jerome Forissier <[email protected]>--- test/py/tests/test_net.py | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-)test/py/tests/test_net.py +9
-1@@ -127,6 +127,10 @@ def test_net_dhcp(u_boot_console): global net_set_up net_set_up = True [email protected]('cmd_dhcp_lwip') +def test_net_dhcp_lwip(u_boot_console): + test_net_dhcp(u_boot_console) + @pytest.mark.buildconfigspec('cmd_dhcp') @pytest.mark.buildconfigspec('cmd_mii') def test_net_dhcp_abort(u_boot_console):@@ -230,6 +234,10 @@ def test_net_ping(u_boot_console): output = u_boot_console.run_command('ping $serverip') assert 'is alive' in output [email protected]('cmd_ping_lwip') +def test_net_ping_lwip(u_boot_console): + test_net_ping(u_boot_console) + @pytest.mark.buildconfigspec('IPV6_ROUTER_DISCOVERY') def test_net_network_discovery(u_boot_console): """Test the network discovery feature of IPv6.@@ -255,7 +263,7 @@ def test_net_network_discovery(u_boot_console): assert '0000:0000:0000:0000:0000:0000:0000:0000' not in output @pytest.mark.buildconfigspec('cmd_net') -def test_net_tftpboot(u_boot_console): +def test_net_tftpboot(u_boot_console, lwip = False): """Test the tftpboot command. A file is downloaded from the TFTP server, its size and optionally its
test/py/tests/test_net.py def test_net_tftpboot(u_boot_console): · line 292
Quoted 9 lines
test/py/tests/test_net.py +2
-3@@ -279,10 +287,11 @@ def test_net_tftpboot(u_boot_console): output = u_boot_console.run_command('tftpboot %s' % (fn)) else: output = u_boot_console.run_command('tftpboot %x %s' % (addr, fn)) - expected_text = 'Bytes transferred = ' sz = f.get('size', None) - if sz: - expected_text += '%d' % sz + if lwip: + expected_text = f'{sz} bytes transferred'
Why not change patch 5 to print with capital character to match this pattern?
BR,
Maxim.
Quoted 19 lines
test/py/tests/test_net.py +6
-1+ else: + expected_text = f'Bytes transferred = {sz}' assert expected_text in output expected_crc = f.get('crc32', None)@@ -295,6 +304,10 @@ def test_net_tftpboot(u_boot_console): output = u_boot_console.run_command('crc32 $fileaddr $filesize') assert expected_crc in output [email protected]("cmd_net_lwip") +def test_net_tftpboot_lwip(u_boot_console): + test_net_tftpboot(u_boot_console, True) + @pytest.mark.buildconfigspec('cmd_nfs') def test_net_nfs(u_boot_console): """Test the nfs command. --2.40.1
Signature · 2 lines
Best regards, Maxim Uvarov
Re: [PATCH v2 01/14] net: introduce alternative implementation as net-lwip/
In reply to Tom RiniQuoted 27 lines · Tom Rini
Quoted 16 lines · Jerome Forissier
Prepare the introduction of the lwIP (lightweight IP) TCP/IP stack by adding a new net-lwip/ directory and the
NET_LWIPsymbol. At this point, enablingNET_LWIPsimply disables NET. Subsequent commits will introduce the lwIP code, re-work the NETDEVICE integration and port some of the NET commands and features to lwIP.
SPL_NETcannot be enabled when NET_LWIP=y.SPL_NETpulls some symbols that are part of NET (such asarp_init(),arp_timeout_check(),arp_receive(),net_arp_wait_packet_ip()). lwIP support in SPL may be added later.Similarly,
DFU_TFTPis not compatible withNET_LWIPbecause it depends onnet_loop(),tftp_timeout_ms,tftp_timeout_count_max. Let's add a dependency on !NET_LWIP for now.Signed-off-by Jerome Forissier <[email protected]>[snip]
Quoted 8 lines
Kconfig +0
-0@@ -747,6 +747,8 @@ source "env/Kconfig" source "net/Kconfig"
Quoted 8 lines
Kconfig source "env/Kconfig" · line 754
Quoted 5 lines
Kconfig +2
-0+source "net-lwip/Kconfig" + source "drivers/Kconfig" source "fs/Kconfig"I think we need to instead rework this to a choice statement instead so that in the end we have something like:
+ 1
Quoted 12 lines
choice "Networking stack"
configNO_NET
bool "No networking support"
config NET
bool "Legacy U-Boot networking stack"
configNET_LWIP
bool "Use lwIP for networking stack"if
NET_LEGACY
source "net/Kconfig"
endif
Quoted 7 lines
if
NET_LWIP
source "net-lwip/Kconfig"
endifAnd then
SPL_NETstill depends on !NET_LWIP for now and we sort out the problems with different networking stacks in SPL vs full U-Boot later on.
That's an excellent idea tbh. We can now decouple SPL and u-boot proper using different stacks and fix the more difficult to debug SPL issues in time. Once we feel happy we can switch over to LWIP completely
Thanks
/Ilias
Quoted 3 lines
--
Tom
Re: [PATCH v2 08/14] net-lwip: add wget command
In reply to Jerome Forissierпт, 24 мая 2024 г. в 19:22, Jerome Forissier <[email protected]>:
Quoted 153 lines
Add support for the wget command with
NET_LWIP.About the small change in
cmd/efidebug.c: when the wget command based on the lwIP stack is used the wget command has a built-in URL validation function since it needs to parse it anyways (inparse_url()). Thereforewget_validate_uri()doesn't exist. So, guard the call inefidebug.cwithCONFIG_CMD_WGET.Based on code initially developed by Maxim U.
Signed-off-by Jerome Forissier <[email protected]>Co-developed-by Maxim Uvarov <[email protected]>Cc Maxim Uvarov <[email protected]>--- cmd/Kconfig | 7 ++ cmd/Makefile | 5 +- cmd/efidebug.c | 8 +- cmd/net-common.c | 112 ++++++++++++++++++++++++++++ cmd/net-lwip.c | 12 +++ cmd/net.c | 115 ----------------------------- include/net-lwip.h | 51 +++++++++++++ net-lwip/Makefile | 1 + net-lwip/wget.c | 180 +++++++++++++++++++++++++++++++++++++++++++++ 9 files changed, 372 insertions(+), 119 deletions(-) create mode 100644 cmd/net-common.c create mode 100644 net-lwip/wget.ccmd/Kconfig +7
-0@@ -2117,6 +2117,13 @@ config CMD_TFTPBOOT help tftpboot - load file via network using TFTP protocol +config CMD_WGET + bool "wget" + select PROT_TCP_LWIP + help + wget is a simple command to download kernel, or other files, + from a http server over TCP. + endif endifcmd/Makefile +4
-1@@ -129,8 +129,11 @@ obj-$(CONFIG_CMD_MUX) += mux.o obj-$(CONFIG_CMD_NAND) += nand.o obj-$(CONFIG_CMD_NET) += net.o obj-$(CONFIG_CMD_NET_LWIP) += net-lwip.o +obj-$(filter y,$(CONFIG_CMD_NET) $(CONFIG_CMD_NET_LWIP)) += net-common.o ifdef CONFIG_CMD_NET_LWIP -CFLAGS_net-lwip.o := -I$(srctree)/lib/lwip/lwip/src/include -I$(srctree)/lib/lwip/u-boot +lwip-includes := -I$(srctree)/lib/lwip/lwip/src/include -I$(srctree)/lib/lwip/u-boot +CFLAGS_net-lwip.o := $(lwip-includes) +CFLAGS_net-common.o := $(lwip-includes) endif obj-$(CONFIG_ENV_SUPPORT) += nvedit.o obj-$(CONFIG_CMD_NVEDIT_EFI) += nvedit_efi.ocmd/efidebug.c +5
-3@@ -741,9 +741,11 @@ static int efi_boot_add_uri(int argc, char *const argv[], u16 *var_name16,if (!label)return CMD_RET_FAILURE ; -if (!wget_validate_uri (argv[3 ])) { -printf ("ERROR: invalid URI\n" ); -return CMD_RET_FAILURE ; +if (IS_ENABLED (CONFIG_CMD_WGET )) { +if (!wget_validate_uri (argv[3 ])) { +printf ("ERROR: invalid URI\n" ); +return CMD_RET_FAILURE ; + } }efi_create_indexed_name (var_name16, var_name16_size,"Boot" , id);cmd/net-common.c new file +65
-0@@ -0,0 +1,112 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* +* (C) Copyright 2000 +* Wolfgang Denk, DENX Software Engineering, [email protected]. +*/ + +#include <command.h> +#include <dm/device.h> +#include <dm/uclass.h> +#ifdef CONFIG_NET +#include <net.h> +#elif definedCONFIG_NET_LWIP +#include <net-lwip.h> +#else +#error Either NET or NET_LWIP must be enabled +#endif +#include <linux/compat.h> +#include <linux/ethtool.h> + +static int do_net_list (struct cmd_tbl *cmdtp,int flag,int argc,char *const argv[]) +{ +const struct udevice *current =eth_get_dev (); +unsigned char env_enetaddr[ARP_HLEN ]; +const struct udevice *dev; +struct uclass *uc; + + uclass_id_foreach_dev(UCLASS_ETH, dev, uc) { +eth_env_get_enetaddr_by_index ("eth" ,dev_seq (dev), env_enetaddr); +printf ("eth%d : %s %pM %s\n" ,dev_seq (dev), dev->name, env_enetaddr, + current == dev ?"active" :"" ); + } +return CMD_RET_SUCCESS ; +} + +static int do_net_stats (struct cmd_tbl *cmdtp,int flag,int argc,char *const argv[]) +{ +int nstats, err, i, off; +struct udevice *dev; +u64 *values; +u8 *strings; + +if (argc <2 ) +return CMD_RET_USAGE ; + + err =uclass_get_device_by_name (UCLASS_ETH , argv[1 ], &dev); +if (err) { +printf ("Could not find device %s\n" , argv[1 ]); +return CMD_RET_FAILURE ; + } + +if (!eth_get_ops (dev)->get_sset_count || + !eth_get_ops (dev)->get_strings || + !eth_get_ops (dev)->get_stats) { +printf ("Driver does not implement stats dump!\n" ); +return CMD_RET_FAILURE ; + } + + nstats =eth_get_ops (dev)->get_sset_count (dev); + strings =kcalloc (nstats,ETH_GSTRING_LEN ,GFP_KERNEL ); +if (!strings) +return CMD_RET_FAILURE ; + + values =kcalloc (nstats,sizeof (u64),GFP_KERNEL ); +if (!values) + goto err_free_strings;
cmd/net-common.c line 75
Quoted 10 lines
cmd/net-common.c new file +10
-0+ +eth_get_ops (dev)->get_strings (dev, strings); +eth_get_ops (dev)->get_stats (dev, values); + + off =0 ; +for (i =0 ; i < nstats; i++) { +printf (" %s: %llu\n" , &strings[off], values[i]); + off +=ETH_GSTRING_LEN ; + }; +
It looks like here you missed kfree().
Quoted 369 lines
cmd/net-common.c new file +37
-0+return CMD_RET_SUCCESS ; + +err_free_strings: +kfree (strings); + +return CMD_RET_FAILURE ; +} + +static struct cmd_tbl cmd_net[] = { +U_BOOT_CMD_MKENT (list,1 ,0 , do_net_list,"" ,"" ), +U_BOOT_CMD_MKENT (stats,2 ,0 , do_net_stats,"" ,"" ), +}; + +static int do_net (struct cmd_tbl *cmdtp,int flag,int argc,char *const argv[]) +{ +struct cmd_tbl *cp; + + cp =find_cmd_tbl (argv[1 ], cmd_net,ARRAY_SIZE (cmd_net)); + +/* Drop the net command */ + argc--; + argv++; + +if (!cp || argc > cp->maxargs) +return CMD_RET_USAGE ; +if (flag ==CMD_FLAG_REPEAT && !cmd_is_repeatable (cp)) +return CMD_RET_SUCCESS ; + +return cp->cmd (cmdtp, flag, argc, argv); +} + +U_BOOT_CMD ( + net,3 ,1 , do_net, +"NET sub-system" , +"list - list available devices\n" +"stats <device> - dump statistics for specified device\n" +);cmd/net-lwip.c +12
-0@@ -2,6 +2,10 @@/* Copyright (C) 2024 Linaro Ltd. */ #include <command.h> +#include <dm/device.h> +#include <dm/uclass.h> +#include <linux/compat.h> +#include <linux/ethtool.h> #include <net-lwip.h> #if defined(CONFIG_CMD_DHCP )@@ -35,3 +39,11 @@ U_BOOT_CMD("hostname [envvar]" );#endif + +#if defined(CONFIG_CMD_WGET ) +U_BOOT_CMD ( + wget,3 ,1 , do_wget, +"boot image via network using HTTP protocol" , +"[loadAddress] URL" +); +#endif cmd/net.c +0
-115@@ -676,118 +676,3 @@ U_BOOT_CMD( );#endif /* CONFIG_CMD_LINK_LOCAL */ - -static int do_net_list (struct cmd_tbl *cmdtp,int flag,int argc,char *const argv[]) -{ -const struct udevice *current =eth_get_dev (); -unsigned char env_enetaddr[ARP_HLEN ]; -const struct udevice *dev; -struct uclass *uc; - - uclass_id_foreach_dev(UCLASS_ETH, dev, uc) { -eth_env_get_enetaddr_by_index ("eth" ,dev_seq (dev), env_enetaddr); -printf ("eth%d : %s %pM %s\n" ,dev_seq (dev), dev->name, env_enetaddr, - current == dev ?"active" :"" ); - } -return CMD_RET_SUCCESS ; -} - -static int do_net_stats (struct cmd_tbl *cmdtp,int flag,int argc,char *const argv[]) -{ -int nstats, err, i, off; -struct udevice *dev; -u64 *values; -u8 *strings; - -if (argc <2 ) -return CMD_RET_USAGE ; - - err =uclass_get_device_by_name (UCLASS_ETH , argv[1 ], &dev); -if (err) { -printf ("Could not find device %s\n" , argv[1 ]); -return CMD_RET_FAILURE ; - } - -if (!eth_get_ops (dev)->get_sset_count || - !eth_get_ops (dev)->get_strings || - !eth_get_ops (dev)->get_stats) { -printf ("Driver does not implement stats dump!\n" ); -return CMD_RET_FAILURE ; - } - - nstats =eth_get_ops (dev)->get_sset_count (dev); - strings =kcalloc (nstats,ETH_GSTRING_LEN ,GFP_KERNEL ); -if (!strings) -return CMD_RET_FAILURE ; - - values =kcalloc (nstats,sizeof (u64),GFP_KERNEL ); -if (!values) - goto err_free_strings; - -eth_get_ops (dev)->get_strings (dev, strings); -eth_get_ops (dev)->get_stats (dev, values); - - off =0 ; -for (i =0 ; i < nstats; i++) { -printf (" %s: %llu\n" , &strings[off], values[i]); - off +=ETH_GSTRING_LEN ; - }; - -return CMD_RET_SUCCESS ; - -err_free_strings: -kfree (strings); - -return CMD_RET_FAILURE ; -} - -static struct cmd_tbl cmd_net[] = { -U_BOOT_CMD_MKENT (list,1 ,0 , do_net_list,"" ,"" ), -U_BOOT_CMD_MKENT (stats,2 ,0 , do_net_stats,"" ,"" ), -}; - -static int do_net (struct cmd_tbl *cmdtp,int flag,int argc,char *const argv[]) -{ -struct cmd_tbl *cp; - - cp =find_cmd_tbl (argv[1 ], cmd_net,ARRAY_SIZE (cmd_net)); - -/* Drop the net command */ - argc--; - argv++; - -if (!cp || argc > cp->maxargs) -return CMD_RET_USAGE ; -if (flag ==CMD_FLAG_REPEAT && !cmd_is_repeatable (cp)) -return CMD_RET_SUCCESS ; - -return cp->cmd (cmdtp, flag, argc, argv); -} - -U_BOOT_CMD ( - net,3 ,1 , do_net, -"NET sub-system" , -"list - list available devices\n" -"stats <device> - dump statistics for specified device\n" -); - -#if defined(CONFIG_CMD_NCSI ) -static int do_ncsi (struct cmd_tbl *cmdtp,int flag,int argc,char *const argv[]) -{ -if (!phy_interface_is_ncsi () || !ncsi_active ()) { -printf ("Device not configured for NC-SI\n" ); -return CMD_RET_FAILURE ; - } - -if (net_loop (NCSI ) <0 ) -return CMD_RET_FAILURE ; - -return CMD_RET_SUCCESS ; -} - -U_BOOT_CMD ( - ncsi,1 ,1 , do_ncsi, -"Configure attached NIC via NC-SI" , -"" -); -#endif /* CONFIG_CMD_NCSI */ include/net-lwip.h +51
-0@@ -51,6 +51,56 @@ int eth_env_get_enetaddr_by_index(const char *base_name, int index,int eth_init (void );/* Initialize the device */ int eth_send (void *packet,int length);/* Send a packet */ int eth_rx (void ); + +/** +* struct eth_ops - functions of Ethernet MAC controllers +* +* start: Prepare the hardware to send and receive packets +* send: Send the bytes passed in "packet" as a packet on the wire +* recv: Check if the hardware received a packet. If so, set the pointer to the +* packet buffer in the packetp parameter. If not, return an error or 0 to +* indicate that the hardware receive FIFO is empty. If 0 is returned, the +* network stack will not process the empty packet, but free_pkt() will be +* called if supplied +* free_pkt: Give the driver an opportunity to manage its packet buffer memory +* when the network stack is finished processing it. This will only be +* called when no error was returned from recv - optional +* stop: Stop the hardware from looking for packets - may be called even if +* state == PASSIVE +* mcast: Join or leave a multicast group (for TFTP) - optional +* write_hwaddr: Write a MAC address to the hardware (used to pass it to Linux +* on some platforms like ARM). This function expects the +* eth_pdata::enetaddr field to be populated. The method can +* return -ENOSYS to indicate that this is not implemented for +this hardware - optional. +* read_rom_hwaddr: Some devices have a backup of the MAC address stored in a +* ROM on the board. This is how the driver should expose it +* to the network stack. This function should fill in the +* eth_pdata::enetaddr field - optional +* set_promisc: Enable or Disable promiscuous mode +* get_sset_count: Number of statistics counters +* get_string: Names of the statistic counters +* get_stats: The values of the statistic counters +*/ +struct eth_ops { +int (*start)(struct udevice *dev); +int (*send)(struct udevice *dev,void *packet,int length); +int (*recv)(struct udevice *dev,int flags,uchar **packetp); +int (*free_pkt)(struct udevice *dev,uchar *packet,int length); +void (*stop)(struct udevice *dev); +int (*mcast)(struct udevice *dev,const u8 *enetaddr,int join); +int (*write_hwaddr)(struct udevice *dev); +int (*read_rom_hwaddr)(struct udevice *dev); +int (*set_promisc)(struct udevice *dev,bool enable); +int (*get_sset_count)(struct udevice *dev); +void (*get_strings)(struct udevice *dev,u8 *data); +void (*get_stats)(struct udevice *dev,u64 *data); +}; + +#define eth_get_ops (dev) ((struct eth_ops *)(dev)->driver->ops) + +struct udevice *eth_get_dev (void );/* get the current device */ +int eth_get_dev_index (void );const char *eth_get_name (void );int eth_get_dev_index (void );int eth_init_state_only (void );/* Set active state */ @@ -85,5 +135,6 @@ int do_dhcp(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]);int do_dns (struct cmd_tbl *cmdtp,int flag,int argc,char *const argv[]);int do_ping (struct cmd_tbl *cmdtp,int flag,int argc,char *const argv[]);int do_tftpb (struct cmd_tbl *cmdtp,int flag,int argc,char *const argv[]); +int do_wget (struct cmd_tbl *cmdtp,int flag,int argc,char *const argv[]);#endif /* __NET_LWIP_H__ */ net-lwip/Makefile +1
-0@@ -10,6 +10,7 @@ obj-$(CONFIG_CMD_DHCP) += dhcp.o obj-$(CONFIG_CMD_DNS) += dns.o obj-$(CONFIG_CMD_PING) += ping.o obj-$(CONFIG_CMD_TFTPBOOT) += tftp.o +obj-$(CONFIG_CMD_WGET) += wget.o # Disable this warning as it is triggered by: # sprintf(buf, index ? "foo%d" : "foo", index)net-lwip/wget.c new file +96
-0@@ -0,0 +1,180 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* Copyright (C) 2024 Linaro Ltd. */ + +#include <command.h> +#include <console.h> +#include <display_options.h> +#include <image.h> +#include <lwip/apps/http_client.h> +#include <lwip/timeouts.h> +#include <net-lwip.h> +#include <time.h> + +#define SERVER_NAME_SIZE 200 +#define HTTP_PORT_DEFAULT 80 + +static ulong daddr; +static ulong saved_daddr; +static ulong size; +static ulong prevsize; +#define PROGRESS_PRINT_STEP_BYTES (100 * 1024) +static ulong start_time; +static enum done_state { +NOT_DONE =0 , +SUCCESS =1 , +FAILURE =2 +} done; + +static int parse_url (char *url,char *host,u16 *port,char **path) +{ +char *p, *pp; +long lport; + + p =strstr (url,"http://" ); +if (!p) +return -EINVAL ; + + p +=strlen ("http://" ); + +/* Parse hostname */ + pp =strchr (p,':' ); +if (!pp) + pp =strchr (p,'/' ); +if (!pp) +return -EINVAL ; + +if (p +SERVER_NAME_SIZE <= pp) +return -EINVAL ; + +memcpy (host, p, pp - p); + host[pp - p +1 ] ='\0' ; + +if (*pp ==':' ) { +/* Parse port number */ + p = pp +1 ; + lport =simple_strtol (p, &pp,10 ); +if (pp && *pp !='/' ) +return -EINVAL ; +if (lport >65535 ) +return -EINVAL ; + *port = (u16 )lport; + }else { + *port =HTTP_PORT_DEFAULT ; + } +if (*pp !='/' ) +return -EINVAL ; + *path = pp; + +return 0 ; +} + +static err_t httpc_recv_cb (void *arg,struct altcp_pcb *pcb,struct pbuf *pbuf, +err_t err) +{ +struct pbuf *buf; + +if (!pbuf) +return ERR_BUF ; + +for (buf = pbuf; buf; buf = buf->next) { +memcpy ((void *)daddr, buf->payload, buf->len); + daddr += buf->len; + size += buf->len; +if (size - prevsize >PROGRESS_PRINT_STEP_BYTES ) { +printf ("#" ); + prevsize = size; + } + } + +altcp_recved (pcb, pbuf->tot_len); +pbuf_free (pbuf); +return ERR_OK ; +} + +static void httpc_result_cb (void *arg,httpc_result_t httpc_result, +u32_t rx_content_len,u32_t srv_res,err_t err) +{
net-lwip/wget.c line 106
Quoted 10 lines
net-lwip/wget.c new file +10
-0+ulong elapsed; + +if (httpc_result !=HTTPC_RESULT_OK ) { +log_err ("\nHTTP client error %d\n" , httpc_result); + done =FAILURE ; +return ; + } + + elapsed =get_timer (start_time); + log_info("\n%u bytes transferred in %lu ms (", rx_content_len,
This print I commented for another patch to match current python tests.
Quoted 4 lines
net-lwip/wget.c new file +4
-0+ get_timer(start_time)); +print_size (rx_content_len / elapsed *1000 ,"/s)\n" ); + + if (env_set_hex("filesize", rx_content_len) ||
net-lwip/wget.c line 120
Quoted 10 lines
net-lwip/wget.c new file +10
-0+ env_set_hex("fileaddr", saved_daddr)) { +log_err ("Could not set filesize or fileaddr\n" ); + done =FAILURE ; +return ; + } + + done =SUCCESS ; +} + +int wget_with_dns (ulong dst_addr,char *uri)
static?
Quoted 37 lines
net-lwip/wget.c new file +37
-0+{ +char server_name[SERVER_NAME_SIZE ]; +httpc_connection_t conn; +httpc_state_t *state; +char *path; +u16 port; + + daddr = dst_addr; + saved_daddr = dst_addr; + done =NOT_DONE ; + size =0 ; + prevsize =0 ; + +if (parse_url (uri, server_name, &port, &path)) +return CMD_RET_USAGE ; + +memset (&conn,0 ,sizeof (conn)); + conn.result_fn = httpc_result_cb; + start_time =get_timer (0 ); +if (httpc_get_file_dns (server_name, port, path, &conn, httpc_recv_cb, +NULL , &state)) +return CMD_RET_FAILURE ; + +while (!done) { +eth_rx (); +sys_check_timeouts (); +if (ctrlc ()) +break ; + } + +if (done ==SUCCESS ) +return 0 ; + +return -1 ; +} + +int do_wget (struct cmd_tbl *cmdtp,int flag,int argc,char *const argv[])
net-lwip/wget.c line 167
Quoted 10 lines
net-lwip/wget.c new file +10
-0+{ +char *url; +ulong dst_addr; + +if (argc <2 || argc >3 ) +return CMD_RET_USAGE ; + + dst_addr = image_load_addr; + +if (!strncmp (argv[1 ],"0x" ,2 )) {
As I remember u-boot can eat hex and decimal numbers for arguments for most of the commands.
Quoted 16 lines
net-lwip/wget.c new file +13
-1+if (argc <3 ) +return CMD_RET_USAGE ; + dst_addr =hextoul (argv[1 ],NULL ); + url = argv[2 ]; + }else { + url = argv[1 ]; + } + +if (wget_with_dns (dst_addr, url)) +return CMD_RET_FAILURE ; + +return CMD_RET_SUCCESS ; +} --2.40.1
Signature · 2 lines
Best regards, Maxim Uvarov
Re: [PATCH v2 12/14] test/py: net: add _lwip variants of dhcp, ping and tftpboot tests
In reply to Maxim UvarovQuoted 50 lines · Maxim Uvarov
пт, 24 мая 2024 г. в 19:22, Jerome Forissier <[email protected]>:
Quoted 49 lines
WHen
NET_LWIPis enabled, the dhcp/ping/tftpboot commands are enabled viaCMD_DHCP_LWIP,CMD_PING_LWIPandCMD_TFTPBOOT_LWIP, respectively; therefore the config annotations in the Python test scripts need to becmd_dhcp_lwip,cmd_ping_lwipandcmd_tftpboot_lwip.The console output of the tftpboot command with lwIP is slightly different from the non-lwIP implementation. This is taken care of in
test_net_tftpboot().Signed-off-by Jerome Forissier <[email protected]>--- test/py/tests/test_net.py | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-)test/py/tests/test_net.py +9
-1@@ -127,6 +127,10 @@ def test_net_dhcp(u_boot_console): global net_set_up net_set_up = True [email protected]('cmd_dhcp_lwip') +def test_net_dhcp_lwip(u_boot_console): + test_net_dhcp(u_boot_console) + @pytest.mark.buildconfigspec('cmd_dhcp') @pytest.mark.buildconfigspec('cmd_mii') def test_net_dhcp_abort(u_boot_console):@@ -230,6 +234,10 @@ def test_net_ping(u_boot_console): output = u_boot_console.run_command('ping $serverip') assert 'is alive' in output [email protected]('cmd_ping_lwip') +def test_net_ping_lwip(u_boot_console): + test_net_ping(u_boot_console) + @pytest.mark.buildconfigspec('IPV6_ROUTER_DISCOVERY') def test_net_network_discovery(u_boot_console): """Test the network discovery feature of IPv6.@@ -255,7 +263,7 @@ def test_net_network_discovery(u_boot_console): assert '0000:0000:0000:0000:0000:0000:0000:0000' not in output @pytest.mark.buildconfigspec('cmd_net') -def test_net_tftpboot(u_boot_console): +def test_net_tftpboot(u_boot_console, lwip = False): """Test the tftpboot command.
Quoted 13 lines
test/py/tests/test_net.py def test_net_tftpboot(u_boot_console): · line 292
Quoted 11 lines
test/py/tests/test_net.py +2
-3A file is downloaded from the TFTP server, its size and optionally its@@ -279,10 +287,11 @@ def test_net_tftpboot(u_boot_console): output = u_boot_console.run_command('tftpboot %s' % (fn)) else: output = u_boot_console.run_command('tftpboot %x %s' % (addr, fn)) - expected_text = 'Bytes transferred = ' sz = f.get('size', None) - if sz: - expected_text += '%d' % sz + if lwip: + expected_text = f'{sz} bytes transferred'Why not change patch 5 to print with capital character to match this pattern?
I thought unifying the messages of wget and tftp would be a good idea. With this series, both commands print hash signs followed by:
"xxx bytes transferred (yy MB/s)".
Would a patch updating the tftp message when the legacy stack is used be acceptable?
Signature · 1 line
Jerome
Quoted 24 lines
BR,
Maxim.Quoted 19 lines
test/py/tests/test_net.py +6
-1+ else: + expected_text = f'Bytes transferred = {sz}' assert expected_text in output expected_crc = f.get('crc32', None)@@ -295,6 +304,10 @@ def test_net_tftpboot(u_boot_console): output = u_boot_console.run_command('crc32 $fileaddr $filesize') assert expected_crc in output [email protected]("cmd_net_lwip") +def test_net_tftpboot_lwip(u_boot_console): + test_net_tftpboot(u_boot_console, True) + @pytest.mark.buildconfigspec('cmd_nfs') def test_net_nfs(u_boot_console): """Test the nfs command. --2.40.1
Re: [PATCH v2 12/14] test/py: net: add _lwip variants of dhcp, ping and tftpboot tests
чт, 30 мая 2024 г. в 17:11, Jerome Forissier <[email protected]>:
Quoted 72 lines · Maxim Uvarov
Quoted 50 lines
пт, 24 мая 2024 г. в 19:22, Jerome Forissier <[email protected]>:
Quoted 49 lines
WHen
NET_LWIPis enabled, the dhcp/ping/tftpboot commands are enabled viaCMD_DHCP_LWIP,CMD_PING_LWIPandCMD_TFTPBOOT_LWIP, respectively; therefore the config annotations in the Python test scripts need to becmd_dhcp_lwip,cmd_ping_lwipandcmd_tftpboot_lwip.The console output of the tftpboot command with lwIP is slightly different from the non-lwIP implementation. This is taken care of in
test_net_tftpboot().Signed-off-by Jerome Forissier <[email protected]>--- test/py/tests/test_net.py | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-)test/py/tests/test_net.py +9
-1@@ -127,6 +127,10 @@ def test_net_dhcp(u_boot_console): global net_set_up net_set_up = True [email protected]('cmd_dhcp_lwip') +def test_net_dhcp_lwip(u_boot_console): + test_net_dhcp(u_boot_console) + @pytest.mark.buildconfigspec('cmd_dhcp') @pytest.mark.buildconfigspec('cmd_mii') def test_net_dhcp_abort(u_boot_console):@@ -230,6 +234,10 @@ def test_net_ping(u_boot_console): output = u_boot_console.run_command('ping $serverip') assert 'is alive' in output [email protected]('cmd_ping_lwip') +def test_net_ping_lwip(u_boot_console): + test_net_ping(u_boot_console) + @pytest.mark.buildconfigspec('IPV6_ROUTER_DISCOVERY') def test_net_network_discovery(u_boot_console): """Test the network discovery feature of IPv6.@@ -255,7 +263,7 @@ def test_net_network_discovery(u_boot_console): assert '0000:0000:0000:0000:0000:0000:0000:0000' not in output @pytest.mark.buildconfigspec('cmd_net') -def test_net_tftpboot(u_boot_console): +def test_net_tftpboot(u_boot_console, lwip = False): """Test the tftpboot command.Quoted 13 lines
test/py/tests/test_net.py def test_net_tftpboot(u_boot_console): · line 292
Quoted 11 lines
test/py/tests/test_net.py +2
-3A file is downloaded from the TFTP server, its size and optionally its@@ -279,10 +287,11 @@ def test_net_tftpboot(u_boot_console): output = u_boot_console.run_command('tftpboot %s' % (fn)) else: output = u_boot_console.run_command('tftpboot %x %s' % (addr, fn)) - expected_text = 'Bytes transferred = ' sz = f.get('size', None) - if sz: - expected_text += '%d' % sz + if lwip: + expected_text = f'{sz} bytes transferred'Why not change patch 5 to print with capital character to match this pattern?
I thought unifying the messages of wget and tftp would be a good idea. With this series, both commands print hash signs followed by:
"xxx bytes transferred (yy MB/s)".
Quoted 6 lines
Would a patch updating the tftp message when the legacy stack is used be acceptable?
--
Jerome
I think yes.
BR,
Maxim.
Quoted 24 lines
Quoted 24 lines
BR,
Maxim.Quoted 19 lines
test/py/tests/test_net.py +6
-1+ else: + expected_text = f'Bytes transferred = {sz}' assert expected_text in output expected_crc = f.get('crc32', None)@@ -295,6 +304,10 @@ def test_net_tftpboot(u_boot_console): output = u_boot_console.run_command('crc32 $fileaddr $filesize') assert expected_crc in output [email protected]("cmd_net_lwip") +def test_net_tftpboot_lwip(u_boot_console): + test_net_tftpboot(u_boot_console, True) + @pytest.mark.buildconfigspec('cmd_nfs') def test_net_nfs(u_boot_console): """Test the nfs command. --2.40.1
Signature · 2 lines
Best regards, Maxim Uvarov
Quoted 10 lines · Jerome Forissier
Quoted 4 lines
- Make the support of HTTPS in the wget command easier. Javier T. (CC'd) has some additional lwIP and Mbed TLS patches to do so. With that it becomes possible to fetch and launch a distro installer such as Debian etc. directly from the U-Boot shell.
Why this is enabling this use case? Or it is just that currently, without TLS, is not supposed to be something you should do? I am a little bit confused reading this sentence, since to me this is already possible using tftp.
A lot of companies don't want to run tftp any more when http(s) is more straight forward, especially when used outside of the data centre, it can be cached/proxied etc and has a bunch of other benefits before you even get to things like security and auth. Also a lot of FW vendors are starting to drop PXE/TFTP support in standards due to various things like standards requirements from governments.
Peter
Re: [PATCH v2 01/14] net: introduce alternative implementation as net-lwip/
In reply to Tom RiniQuoted 47 lines · Tom Rini
Quoted 16 lines · Jerome Forissier
Prepare the introduction of the lwIP (lightweight IP) TCP/IP stack by adding a new net-lwip/ directory and the
NET_LWIPsymbol. At this point, enablingNET_LWIPsimply disables NET. Subsequent commits will introduce the lwIP code, re-work the NETDEVICE integration and port some of the NET commands and features to lwIP.
SPL_NETcannot be enabled when NET_LWIP=y.SPL_NETpulls some symbols that are part of NET (such asarp_init(),arp_timeout_check(),arp_receive(),net_arp_wait_packet_ip()). lwIP support in SPL may be added later.Similarly,
DFU_TFTPis not compatible withNET_LWIPbecause it depends onnet_loop(),tftp_timeout_ms,tftp_timeout_count_max. Let's add a dependency on !NET_LWIP for now.Signed-off-by Jerome Forissier <[email protected]>[snip]
Kconfig source "env/Kconfig" · line 754
Quoted 13 lines
Kconfig +2
-0@@ -747,6 +747,8 @@ source "env/Kconfig" source "net/Kconfig" +source "net-lwip/Kconfig" + source "drivers/Kconfig" source "fs/Kconfig"I think we need to instead rework this to a choice statement instead so that in the end we have something like:
choice "Networking stack"
configNO_NET
bool "No networking support"
config NET
bool "Legacy U-Boot networking stack"
configNET_LWIP
bool "Use lwIP for networking stack"if
NET_LEGACY
source "net/Kconfig"
endif
Quoted 7 lines
if
NET_LWIP
source "net-lwip/Kconfig"
endifAnd then
SPL_NETstill depends on !NET_LWIP for now and we sort out the problems with different networking stacks in SPL vs full U-Boot later on.
Done in v3. Thanks.
Signature · 1 line
Jerome
Re: [PATCH v2 07/14] net-lwip: add dns command
In reply to Jerome ForissierHi Jerome,
[...]
net-lwip/dns.c line 25
Quoted 13 lines
net-lwip/dns.c new file +13
-0+ +static ulong start; +static ip_addr_t host_ipaddr; +static bool done; + +static void do_dns_tmr (void *arg) +{ +dns_tmr (); +} + +static void dns_cb (const char *name,const ip_addr_t *ipaddr,void *arg) +{ +char *var = (char *)arg;
const char *
Quoted 65 lines
net-lwip/dns.c new file +65
-0+char *ipstr =ip4addr_ntoa (ipaddr); + + done = true; + +if (!ipaddr) { +printf ("DNS: host not found\n" ); + host_ipaddr.addr =0 ; +return ; + } + +if (var) +env_set (var, ipstr); + +printf ("%s\n" , ipstr); +} + +int do_dns (struct cmd_tbl *cmdtp,int flag,int argc,char *const argv[]) +{ +bool has_server = false; +ip_addr_t ipaddr; +ip_addr_t ns; +char *nsenv; +char *name; +char *var; +int ret; + +if (argc ==1 || argc >3 ) +return CMD_RET_USAGE ; + +if (argc >=2 ) + name = argv[1 ]; + +if (argc ==3 ) + var = argv[2 ]; + +dns_init (); + + nsenv =env_get ("dnsip" ); +if (nsenv &&ipaddr_aton (nsenv, &ns)) { +dns_setserver (0 , &ns); + has_server = true; + } + + nsenv =env_get ("dnsip2" ); +if (nsenv &&ipaddr_aton (nsenv, &ns)) { +dns_setserver (1 , &ns); + has_server = true; + } + +if (!has_server) { +log_err ("No valid name server (dnsip/dnsip2)\n" ); +return CMD_RET_FAILURE ; + } + + done = false; + + ret =dns_gethostbyname (name, &ipaddr, dns_cb, var); + +if (ret ==ERR_OK ) { +dns_cb (name, &ipaddr, var); + }else if (ret ==ERR_INPROGRESS ) { + start =get_timer (0 ); +sys_timeout (DNS_RESEND_MS , do_dns_tmr,NULL ); + do { + eth_rx();
net-lwip/dns.c line 100
Quoted 10 lines
net-lwip/dns.c new file +10
-0+if (done) +break ; +sys_check_timeouts (); +if (ctrlc ()) { +printf ("\nAbort\n" ); +break ; + } + }while (get_timer (start) <DNS_TIMEOUT_MS ); +sys_untimeout (do_dns_tmr,NULL ); + }
Looking at the lwip code there are other ret values than just ERR_OK, ERR_INPROGRESS. Should we have an 'else' handling the rest?
Quoted 10 lines
net-lwip/dns.c new file +7
-1+ +if (done && host_ipaddr.addr !=0 ) +return CMD_RET_SUCCESS ; + +return CMD_RET_FAILURE ; +} + --2.40.1
Thanks
/Ilias
Re: [PATCH v2 06/14] net-lwip: add ping command
In reply to Jerome Forissiernet-lwip/ping.c line 24
Quoted 13 lines
net-lwip/ping.c new file +13
-0+#include <net-lwip.h> +#include <time.h> + +#define PING_DELAY_MS 1000 +#define PING_TIMEOUT_MS 10000 +/* Additional data size to include in the packet */ +#define PING_DATA_SIZE 32 +/* Ping identifier - must fit on a u16_t */ +#define PING_ID 0xAFAF + +static const ip_addr_t *ping_target; +static struct raw_pcb *ping_pcb; +static u16_t ping_seq_num;
As a general note, u8_t u16_t etc are lwip constructs.
Can we not use them and instead use the original definition? uint8_t etc. I am not sure introducing another define is what we want. Tom?
Quoted 25 lines
net-lwip/ping.c new file +25
-0+static bool ping_target_alive; + +static u8_t ping_recv (void *arg,struct raw_pcb *pcb,struct pbuf *p, +const ip_addr_t *addr) +{ +struct icmp_echo_hdr *iecho; + +if (addr->addr != ping_target->addr) +return 0 ; + +if ((p->tot_len >= (IP_HLEN +sizeof (struct icmp_echo_hdr ))) && +pbuf_remove_header (p,IP_HLEN ) ==0 ) { + iecho = (struct icmp_echo_hdr *)p->payload; + +if ((iecho->id ==PING_ID ) && + (iecho->seqno ==lwip_htons (ping_seq_num))) { + ping_target_alive = true; +printf ("host %s is alive\n" ,ipaddr_ntoa (addr)); +pbuf_free (p); +return 1 ;/* eat the packet */ + } +/* not eaten, restore original packet */ +pbuf_add_header (p,IP_HLEN ); + } +
net-lwip/ping.c line 59
Quoted 10 lines
net-lwip/ping.c new file +10
-0+return 0 ;/* don't eat the packet */ +} + +static int ping_raw_init (void ) +{ + ping_pcb =raw_new (IP_PROTO_ICMP ); +if (!ping_pcb) +return -ENOMEM ; + +raw_recv (ping_pcb, ping_recv,NULL );
Instead of defining a global variable ping_target_alive can we instead pass the ptr of void *recv_arg? We can then fill in that private ptr with the status
Quoted 18 lines
net-lwip/ping.c new file +18
-0+raw_bind (ping_pcb,IP_ADDR_ANY ); + +return 0 ; +} + +static void ping_raw_stop (void ) +{ +if (ping_pcb !=NULL ) { +raw_remove (ping_pcb); + ping_pcb =NULL ; + } +} + +static void ping_prepare_echo (struct icmp_echo_hdr *iecho,u16_t len) +{ +size_t i; +size_t data_len = len -sizeof (struct icmp_echo_hdr ); +
net-lwip/ping.c line 87
Quoted 10 lines
net-lwip/ping.c new file +10
-0+ICMPH_TYPE_SET (iecho,ICMP_ECHO ); +ICMPH_CODE_SET (iecho,0 ); + iecho->chksum =0 ; + iecho->id =PING_ID ; + iecho->seqno =lwip_htons (++ping_seq_num); + +/* Fill the additional data buffer with some data */ +for (i =0 ; i < data_len; i++) { + ((char *)iecho)[sizeof (struct icmp_echo_hdr ) + i] = (char )i; + }
is this additional data used? And if they are shouldn't we care about endianess?
Quoted 38 lines
net-lwip/ping.c new file +38
-0+ + iecho->chksum =inet_chksum (iecho, len); +} + +static void ping_send_icmp (struct raw_pcb *raw,const ip_addr_t *addr) +{ +struct pbuf *p; +struct icmp_echo_hdr *iecho; +size_t ping_size =sizeof (struct icmp_echo_hdr ) +PING_DATA_SIZE ; + + p =pbuf_alloc (PBUF_IP , (u16_t )ping_size,PBUF_RAM ); +if (!p) +return ; + +if ((p->len == p->tot_len) && (p->next ==NULL )) { + iecho = (struct icmp_echo_hdr *)p->payload; +ping_prepare_echo (iecho, (u16_t )ping_size); +raw_sendto (raw, p, addr); + } + +pbuf_free (p); +} + +static void ping_send (void *arg) +{ +struct raw_pcb *pcb = (struct raw_pcb *)arg; + +ping_send_icmp (pcb, ping_target); +sys_timeout (PING_DELAY_MS , ping_send, ping_pcb); +} + +static int ping_loop (const ip_addr_t * addr) +{ +ulong start; +int ret; + +printf ("Using %s device\n" ,eth_get_name ()); +
net-lwip/ping.c line 135
Quoted 10 lines
net-lwip/ping.c new file +10
-0+ ret =ping_raw_init (); +if (ret <0 ) +return ret; + ping_target = addr; + + start =get_timer (0 ); +ping_send (ping_pcb); + + do { + eth_rx();
eth_rx() has a ret value. Don't we have to check it here?
Quoted 37 lines
net-lwip/ping.c new file +36
-1+if (ping_target_alive) +break ; +sys_check_timeouts (); +if (ctrlc ()) { +printf ("\nAbort\n" ); +break ; + } + }while (get_timer (start) <PING_TIMEOUT_MS ); + +sys_untimeout (ping_send, ping_pcb); +ping_raw_stop (); + ping_target =NULL ; + +if (ping_target_alive) { + ping_target_alive = false; +return 0 ; + } +printf ("ping failed; host %s is not alive\n" ,ipaddr_ntoa (addr)); +return -1 ; +} + +int do_ping (struct cmd_tbl *cmdtp,int flag,int argc,char *const argv[]) +{ +ip_addr_t addr; + +if (argc <2 ) +return CMD_RET_USAGE ; + +if (!ipaddr_aton (argv[1 ], &addr)) +return CMD_RET_USAGE ; + +if (ping_loop (&addr) <0 ) +return CMD_RET_FAILURE ; + +return CMD_RET_SUCCESS ; +} --
Quoted 2 lines
2.40.1
Regards
/Ilias
Quoted 37 lines · Tom Rini
Quoted 20 lines · Jerome Forissier
This is a rework of a patch series by Maxim Uvarov: "net/lwip: add lwip library for the network stack" [1]. The goal is to introduce the lwIP TCP/IP stack [2] [3] as an alternative to the current implementation in
net/, selectable withKconfig, and ultimately keep only lwIP if possible. Some reasons for doing so are:
- Make the support of HTTPS in the wget command easier. Javier T. (CC'd) has some additional lwIP and Mbed TLS patches to do so. With that it becomes possible to fetch and launch a distro installer such as Debian etc. directly from the U-Boot shell.
- Possibly benefit from additional features implemented in lwIP
- Less code to maintain in U-BootThe first patch introduces a new
Kconfigsymbol:NET_LWIP, which selects the lwIP implementation instead of the current one (NET). Contrary to the approach chosen by Maxim in [1],NET_LWIPand NET cannot be enabled simultaneously. The rationale is we want to start from a clean state and not pull potentially duplicated functionality from both stacks. Note however that a few files are still built innet/, they are the ones related to ethernet device management and the ethernet bootflow.Quoted 2 lines
The second patch imports the lwIP code as a Git subtree under
lib/lwip/lwip. Some glue code is added underlib/lwip/u-boot.For next time, please just make it a pre-req to run the git subtree command (and note it in the cover letter).
In more specific feedback, I tried this on a Pi 3, and:
U-Boot> tftpboot 200000 EFI/arm64/helloworld.efi
TFTP from server 192.168.1.10; our IP address is 192.168.1.100
Filename 'EFI/arm64/helloworld.efi'.
Load address:0x200000
Loading:
....
FAILED test/py/tests/test_efi_loader.py::test_efi_helloworld_net - u_boot_spawn.Timeout
Quoted 2 lines
So some amount of networking is working (that's a reasonable dhcp response it got), but tftp'ing a file fails.
Thanks for testing! This fails because I changed the command output. The legacy command prints "Bytes transferred =" while the newer one prints "%lu bytes transferred" plus throughput information. I will use the older message in v3 because several tests as well as documentation would need updating. We'll do that later if desired.
Thanks,
Signature · 1 line
Jerome
Re: [PATCH v2 12/14] test/py: net: add _lwip variants of dhcp, ping and tftpboot tests
In reply to Maxim UvarovQuoted 73 lines · Maxim Uvarov
чт, 30 мая 2024 г. в 17:11, Jerome Forissier <[email protected]>:
Quoted 72 lines · Maxim Uvarov
Quoted 50 lines
пт, 24 мая 2024 г. в 19:22, Jerome Forissier <[email protected]>:
Quoted 49 lines
WHen
NET_LWIPis enabled, the dhcp/ping/tftpboot commands are enabled viaCMD_DHCP_LWIP,CMD_PING_LWIPandCMD_TFTPBOOT_LWIP, respectively; therefore the config annotations in the Python test scripts need to becmd_dhcp_lwip,cmd_ping_lwipandcmd_tftpboot_lwip.The console output of the tftpboot command with lwIP is slightly different from the non-lwIP implementation. This is taken care of in
test_net_tftpboot().Signed-off-by Jerome Forissier <[email protected]>--- test/py/tests/test_net.py | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-)test/py/tests/test_net.py +9
-1@@ -127,6 +127,10 @@ def test_net_dhcp(u_boot_console): global net_set_up net_set_up = True [email protected]('cmd_dhcp_lwip') +def test_net_dhcp_lwip(u_boot_console): + test_net_dhcp(u_boot_console) + @pytest.mark.buildconfigspec('cmd_dhcp') @pytest.mark.buildconfigspec('cmd_mii') def test_net_dhcp_abort(u_boot_console):@@ -230,6 +234,10 @@ def test_net_ping(u_boot_console): output = u_boot_console.run_command('ping $serverip') assert 'is alive' in output [email protected]('cmd_ping_lwip') +def test_net_ping_lwip(u_boot_console): + test_net_ping(u_boot_console) + @pytest.mark.buildconfigspec('IPV6_ROUTER_DISCOVERY') def test_net_network_discovery(u_boot_console): """Test the network discovery feature of IPv6.@@ -255,7 +263,7 @@ def test_net_network_discovery(u_boot_console): assert '0000:0000:0000:0000:0000:0000:0000:0000' not in output @pytest.mark.buildconfigspec('cmd_net') -def test_net_tftpboot(u_boot_console): +def test_net_tftpboot(u_boot_console, lwip = False): """Test the tftpboot command.Quoted 13 lines
test/py/tests/test_net.py def test_net_tftpboot(u_boot_console): · line 292
Quoted 11 lines
test/py/tests/test_net.py +2
-3A file is downloaded from the TFTP server, its size and optionally its@@ -279,10 +287,11 @@ def test_net_tftpboot(u_boot_console): output = u_boot_console.run_command('tftpboot %s' % (fn)) else: output = u_boot_console.run_command('tftpboot %x %s' % (addr, fn)) - expected_text = 'Bytes transferred = ' sz = f.get('size', None) - if sz: - expected_text += '%d' % sz + if lwip: + expected_text = f'{sz} bytes transferred'Why not change patch 5 to print with capital character to match this pattern?
I thought unifying the messages of wget and tftp would be a good idea. With this series, both commands print hash signs followed by:
"xxx bytes transferred (yy MB/s)".
Quoted 8 lines
Quoted 6 lines
Would a patch updating the tftp message when the legacy stack is used be acceptable?
--
JeromeI think yes.
I changed my mind. As I replied to Tom, I will stick with the older message format for now.
Thanks,
Signature · 1 line
Jerome
Re: [PATCH v2 08/14] net-lwip: add wget command
In reply to Jerome ForissierHi Jerome
cmd/efidebug.c static int efi_boot_add_uri(int argc, char *const argv[], u16 *var_name16, · line 744
Quoted 7 lines
cmd/efidebug.c +1
-3if (!label)return CMD_RET_FAILURE ; -if (!wget_validate_uri (argv[3 ])) { -printf ("ERROR: invalid URI\n" ); -return CMD_RET_FAILURE ; +if (IS_ENABLED (CONFIG_CMD_WGET )) {
efi_boot_add_uri() is only called if CONFIG_EFI_HTTP_BOOT which selectes WGET
Quoted 13 lines
cmd/efidebug.c +4
-0+if (!wget_validate_uri (argv[3 ])) { +printf ("ERROR: invalid URI\n" ); +return CMD_RET_FAILURE ; + } }efi_create_indexed_name (var_name16, var_name16_size,"Boot" , id);cmd/net-common.c new file +0
-0@@ -0,0 +1,112 @@
[...]
Quoted 47 lines
cmd/net-common.c new file +47
-0+ +static void httpc_result_cb (void *arg,httpc_result_t httpc_result, +u32_t rx_content_len,u32_t srv_res,err_t err) +{ +ulong elapsed; + +if (httpc_result !=HTTPC_RESULT_OK ) { +log_err ("\nHTTP client error %d\n" , httpc_result); + done =FAILURE ; +return ; + } + + elapsed =get_timer (start_time); +log_info ("\n%u bytes transferred in %lu ms (" , rx_content_len, +get_timer (start_time)); +print_size (rx_content_len / elapsed *1000 ,"/s)\n" ); + +if (env_set_hex ("filesize" , rx_content_len) || +env_set_hex ("fileaddr" , saved_daddr)) { +log_err ("Could not set filesize or fileaddr\n" ); + done =FAILURE ; +return ; + } + + done =SUCCESS ; +} + +int wget_with_dns (ulong dst_addr,char *uri) +{ +char server_name[SERVER_NAME_SIZE ]; +httpc_connection_t conn; +httpc_state_t *state; +char *path; +u16 port; + + daddr = dst_addr; + saved_daddr = dst_addr; + done =NOT_DONE ; + size =0 ; + prevsize =0 ; + +if (parse_url (uri, server_name, &port, &path)) +return CMD_RET_USAGE ; + +memset (&conn,0 ,sizeof (conn)); + conn.result_fn = httpc_result_cb; + start_time =get_timer (0 );
cmd/net-common.c
Quoted 10 lines
cmd/net-common.c new file +10
-0+if (httpc_get_file_dns (server_name, port, path, &conn, httpc_recv_cb, +NULL , &state)) +return CMD_RET_FAILURE ; + +while (!done) { +eth_rx (); +sys_check_timeouts (); +if (ctrlc ()) +break ; + }
You probably don't need the 'done' enum here. There's a state->rx_status, which if I am reading tlwip correctly should be filled in with the results of httpc_result_t
Quoted 32 lines
cmd/net-common.c new file +31
-1+ +if (done ==SUCCESS ) +return 0 ; + +return -1 ; +} + +int do_wget (struct cmd_tbl *cmdtp,int flag,int argc,char *const argv[]) +{ +char *url; +ulong dst_addr; + +if (argc <2 || argc >3 ) +return CMD_RET_USAGE ; + + dst_addr = image_load_addr; + +if (!strncmp (argv[1 ],"0x" ,2 )) { +if (argc <3 ) +return CMD_RET_USAGE ; + dst_addr =hextoul (argv[1 ],NULL ); + url = argv[2 ]; + }else { + url = argv[1 ]; + } + +if (wget_with_dns (dst_addr, url)) +return CMD_RET_FAILURE ; + +return CMD_RET_SUCCESS ; +} --
Quoted 2 lines
2.40.1
Cheers
/Ilias
Re: [PATCH v2 08/14] net-lwip: add wget command
In reply to Maxim UvarovQuoted 158 lines · Maxim Uvarov
пт, 24 мая 2024 г. в 19:22, Jerome Forissier <[email protected]>:
Quoted 157 lines
Add support for the wget command with
NET_LWIP.About the small change in
cmd/efidebug.c: when the wget command based on the lwIP stack is used the wget command has a built-in URL validation function since it needs to parse it anyways (inparse_url()). Thereforewget_validate_uri()doesn't exist. So, guard the call inefidebug.cwithCONFIG_CMD_WGET.Based on code initially developed by Maxim U.
Signed-off-by Jerome Forissier <[email protected]>Co-developed-by Maxim Uvarov <[email protected]>Cc Maxim Uvarov <[email protected]>--- cmd/Kconfig | 7 ++ cmd/Makefile | 5 +- cmd/efidebug.c | 8 +- cmd/net-common.c | 112 ++++++++++++++++++++++++++++ cmd/net-lwip.c | 12 +++ cmd/net.c | 115 ----------------------------- include/net-lwip.h | 51 +++++++++++++ net-lwip/Makefile | 1 + net-lwip/wget.c | 180 +++++++++++++++++++++++++++++++++++++++++++++ 9 files changed, 372 insertions(+), 119 deletions(-) create mode 100644 cmd/net-common.c create mode 100644 net-lwip/wget.ccmd/Kconfig +7
-0@@ -2117,6 +2117,13 @@ config CMD_TFTPBOOT help tftpboot - load file via network using TFTP protocol +config CMD_WGET + bool "wget" + select PROT_TCP_LWIP + help + wget is a simple command to download kernel, or other files, + from a http server over TCP. + endif endifcmd/Makefile +4
-1@@ -129,8 +129,11 @@ obj-$(CONFIG_CMD_MUX) += mux.o obj-$(CONFIG_CMD_NAND) += nand.o obj-$(CONFIG_CMD_NET) += net.o obj-$(CONFIG_CMD_NET_LWIP) += net-lwip.o +obj-$(filter y,$(CONFIG_CMD_NET) $(CONFIG_CMD_NET_LWIP)) += net-common.o ifdef CONFIG_CMD_NET_LWIP -CFLAGS_net-lwip.o := -I$(srctree)/lib/lwip/lwip/src/include -I$(srctree)/lib/lwip/u-boot +lwip-includes := -I$(srctree)/lib/lwip/lwip/src/include -I$(srctree)/lib/lwip/u-boot +CFLAGS_net-lwip.o := $(lwip-includes) +CFLAGS_net-common.o := $(lwip-includes) endif obj-$(CONFIG_ENV_SUPPORT) += nvedit.o obj-$(CONFIG_CMD_NVEDIT_EFI) += nvedit_efi.ocmd/efidebug.c +5
-3@@ -741,9 +741,11 @@ static int efi_boot_add_uri(int argc, char *const argv[], u16 *var_name16,if (!label)return CMD_RET_FAILURE ; -if (!wget_validate_uri (argv[3 ])) { -printf ("ERROR: invalid URI\n" ); -return CMD_RET_FAILURE ; +if (IS_ENABLED (CONFIG_CMD_WGET )) { +if (!wget_validate_uri (argv[3 ])) { +printf ("ERROR: invalid URI\n" ); +return CMD_RET_FAILURE ; + } }efi_create_indexed_name (var_name16, var_name16_size,"Boot" , id);cmd/net-common.c new file +69
-0@@ -0,0 +1,112 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* +* (C) Copyright 2000 +* Wolfgang Denk, DENX Software Engineering, [email protected]. +*/ + +#include <command.h> +#include <dm/device.h> +#include <dm/uclass.h> +#ifdef CONFIG_NET +#include <net.h> +#elif definedCONFIG_NET_LWIP +#include <net-lwip.h> +#else +#error Either NET or NET_LWIP must be enabled +#endif +#include <linux/compat.h> +#include <linux/ethtool.h> + +static int do_net_list (struct cmd_tbl *cmdtp,int flag,int argc,char *const argv[]) +{ +const struct udevice *current =eth_get_dev (); +unsigned char env_enetaddr[ARP_HLEN ]; +const struct udevice *dev; +struct uclass *uc; + + uclass_id_foreach_dev(UCLASS_ETH, dev, uc) { +eth_env_get_enetaddr_by_index ("eth" ,dev_seq (dev), env_enetaddr); +printf ("eth%d : %s %pM %s\n" ,dev_seq (dev), dev->name, env_enetaddr, + current == dev ?"active" :"" ); + } +return CMD_RET_SUCCESS ; +} + +static int do_net_stats (struct cmd_tbl *cmdtp,int flag,int argc,char *const argv[]) +{ +int nstats, err, i, off; +struct udevice *dev; +u64 *values; +u8 *strings; + +if (argc <2 ) +return CMD_RET_USAGE ; + + err =uclass_get_device_by_name (UCLASS_ETH , argv[1 ], &dev); +if (err) { +printf ("Could not find device %s\n" , argv[1 ]); +return CMD_RET_FAILURE ; + } + +if (!eth_get_ops (dev)->get_sset_count || + !eth_get_ops (dev)->get_strings || + !eth_get_ops (dev)->get_stats) { +printf ("Driver does not implement stats dump!\n" ); +return CMD_RET_FAILURE ; + } + + nstats =eth_get_ops (dev)->get_sset_count (dev); + strings =kcalloc (nstats,ETH_GSTRING_LEN ,GFP_KERNEL ); +if (!strings) +return CMD_RET_FAILURE ; + + values =kcalloc (nstats,sizeof (u64),GFP_KERNEL ); +if (!values) + goto err_free_strings; + +eth_get_ops (dev)->get_strings (dev, strings); +eth_get_ops (dev)->get_stats (dev, values); +
Quoted 8 lines
cmd/net-common.c line 75
Quoted 6 lines
cmd/net-common.c new file +6
-0+ off =0 ; +for (i =0 ; i < nstats; i++) { +printf (" %s: %llu\n" , &strings[off], values[i]); + off +=ETH_GSTRING_LEN ; + }; +It looks like here you missed
kfree().
Good catch! This is already missing in master (cmd/net.c). I will fix in v3 and also send a patch for master.
Quoted 8 lines
Quoted 8 lines
cmd/net-common.c new file +8
-0+return CMD_RET_SUCCESS ; + +err_free_strings: +kfree (strings); + +return CMD_RET_FAILURE ; +} +
[...]
Quoted 18 lines
Quoted 18 lines
net-lwip/wget.c new file +12
-0@@ -0,0 +1,180 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* Copyright (C) 2024 Linaro Ltd. */ + +#include <command.h> +#include <console.h> +#include <display_options.h> +#include <image.h> +#include <lwip/apps/http_client.h> +#include <lwip/timeouts.h> +#include <net-lwip.h> +#include <time.h> +
[...]
Quoted 8 lines
Quoted 8 lines
net-lwip/wget.c new file +8
-0+ +static void httpc_result_cb (void *arg,httpc_result_t httpc_result, +u32_t rx_content_len,u32_t srv_res,err_t err) +{ +ulong elapsed; + +if (httpc_result !=HTTPC_RESULT_OK ) { +log_err ("\nHTTP client error %d\n" , httpc_result);
Quoted 8 lines
net-lwip/wget.c line 106
Quoted 6 lines
net-lwip/wget.c new file +6
-0+ done =FAILURE ; +return ; + } + + elapsed =get_timer (start_time); + log_info("\n%u bytes transferred in %lu ms (", rx_content_len,This print I commented for another patch to match current python tests.
What do you mean? Is this text incorrect because some tests expect something else? Which ones?
Quoted 8 lines
Quoted 8 lines
net-lwip/wget.c new file +8
-0+ get_timer(start_time)); +print_size (rx_content_len / elapsed *1000 ,"/s)\n" ); + +if (env_set_hex ("filesize" , rx_content_len) || +env_set_hex ("fileaddr" , saved_daddr)) { +log_err ("Could not set filesize or fileaddr\n" ); + done =FAILURE ; +return ;
Quoted 8 lines
net-lwip/wget.c line 120
Quoted 6 lines
net-lwip/wget.c new file +6
-0+ } + + done =SUCCESS ; +} + +int wget_with_dns (ulong dst_addr,char *uri)static?
No, this function is called from lib/efi_loader/efi_bootmgr.c.
Quoted 42 lines
Quoted 42 lines
net-lwip/wget.c new file +42
-0+{ +char server_name[SERVER_NAME_SIZE ]; +httpc_connection_t conn; +httpc_state_t *state; +char *path; +u16 port; + + daddr = dst_addr; + saved_daddr = dst_addr; + done =NOT_DONE ; + size =0 ; + prevsize =0 ; + +if (parse_url (uri, server_name, &port, &path)) +return CMD_RET_USAGE ; + +memset (&conn,0 ,sizeof (conn)); + conn.result_fn = httpc_result_cb; + start_time =get_timer (0 ); +if (httpc_get_file_dns (server_name, port, path, &conn, httpc_recv_cb, +NULL , &state)) +return CMD_RET_FAILURE ; + +while (!done) { +eth_rx (); +sys_check_timeouts (); +if (ctrlc ()) +break ; + } + +if (done ==SUCCESS ) +return 0 ; + +return -1 ; +} + +int do_wget (struct cmd_tbl *cmdtp,int flag,int argc,char *const argv[]) +{ +char *url; +ulong dst_addr; + +if (argc <2 || argc >3 )
Quoted 8 lines
net-lwip/wget.c line 167
Quoted 5 lines
net-lwip/wget.c new file +5
-0+return CMD_RET_USAGE ; + + dst_addr = image_load_addr; + +if (!strncmp (argv[1 ],"0x" ,2 )) {As I remember u-boot can eat hex and decimal numbers for arguments for most of the commands.
Right. I'll use hextoul() properly in v3.
Quoted 7 lines
Quoted 7 lines
net-lwip/wget.c new file +7
-0+if (argc <3 ) +return CMD_RET_USAGE ; + dst_addr =hextoul (argv[1 ],NULL ); + url = argv[2 ]; + }else { + url = argv[1 ]; + }
Quoted 8 lines
Quoted 8 lines
net-lwip/wget.c new file +6
-1+ +if (wget_with_dns (dst_addr, url)) +return CMD_RET_FAILURE ; + +return CMD_RET_SUCCESS ; +} --2.40.1
Thanks,
Signature · 1 line
Jerome
Re: [PATCH v2 06/14] net-lwip: add ping command
In reply to Ilias ApalodimasQuoted 9 lines · Ilias Apalodimas
Quoted 9 lines
net-lwip/ping.c new file +9
-0+#include <net-lwip.h> +#include <time.h> + +#define PING_DELAY_MS 1000 +#define PING_TIMEOUT_MS 10000 +/* Additional data size to include in the packet */ +#define PING_DATA_SIZE 32 +/* Ping identifier - must fit on a u16_t */ +#define PING_ID 0xAFAF
Quoted 8 lines
net-lwip/ping.c line 24
Quoted 4 lines
net-lwip/ping.c new file +4
-0+ +static const ip_addr_t *ping_target; +static struct raw_pcb *ping_pcb; +static u16_t ping_seq_num;As a general note,
u8_tu16_tetc are lwip constructs.
Can we not use them and instead use the original definition?uint8_tetc. I am not sure introducing another define is what we want. Tom?
I think it makes sense to use the more standard type (uint16_t etc.) when defining variables like here. However I'd rather keep the lwIP types in the function definitions to reflect the function prototype exactly.
Quoted 31 lines
Quoted 31 lines
net-lwip/ping.c new file +31
-0+static bool ping_target_alive; + +static u8_t ping_recv (void *arg,struct raw_pcb *pcb,struct pbuf *p, +const ip_addr_t *addr) +{ +struct icmp_echo_hdr *iecho; + +if (addr->addr != ping_target->addr) +return 0 ; + +if ((p->tot_len >= (IP_HLEN +sizeof (struct icmp_echo_hdr ))) && +pbuf_remove_header (p,IP_HLEN ) ==0 ) { + iecho = (struct icmp_echo_hdr *)p->payload; + +if ((iecho->id ==PING_ID ) && + (iecho->seqno ==lwip_htons (ping_seq_num))) { + ping_target_alive = true; +printf ("host %s is alive\n" ,ipaddr_ntoa (addr)); +pbuf_free (p); +return 1 ;/* eat the packet */ + } +/* not eaten, restore original packet */ +pbuf_add_header (p,IP_HLEN ); + } + +return 0 ;/* don't eat the packet */ +} + +static int ping_raw_init (void ) +{ + ping_pcb =raw_new (IP_PROTO_ICMP );
Quoted 8 lines
net-lwip/ping.c line 59
Quoted 4 lines
net-lwip/ping.c new file +4
-0+if (!ping_pcb) +return -ENOMEM ; + +raw_recv (ping_pcb, ping_recv,NULL );Instead of defining a global variable
ping_target_alivecan we instead pass the ptr of void*recv_arg? We can then fill in that private ptr with the status
Sure. Fixed in v3.
Quoted 23 lines
Quoted 23 lines
net-lwip/ping.c new file +23
-0+raw_bind (ping_pcb,IP_ADDR_ANY ); + +return 0 ; +} + +static void ping_raw_stop (void ) +{ +if (ping_pcb !=NULL ) { +raw_remove (ping_pcb); + ping_pcb =NULL ; + } +} + +static void ping_prepare_echo (struct icmp_echo_hdr *iecho,u16_t len) +{ +size_t i; +size_t data_len = len -sizeof (struct icmp_echo_hdr ); + +ICMPH_TYPE_SET (iecho,ICMP_ECHO ); +ICMPH_CODE_SET (iecho,0 ); + iecho->chksum =0 ; + iecho->id =PING_ID ; + iecho->seqno =lwip_htons (++ping_seq_num);
Quoted 8 lines
net-lwip/ping.c line 87
Quoted 5 lines
net-lwip/ping.c new file +5
-0+ +/* Fill the additional data buffer with some data */ +for (i =0 ; i < data_len; i++) { + ((char *)iecho)[sizeof (struct icmp_echo_hdr ) + i] = (char )i; + }is this additional data used? And if they are shouldn't we care about endianess?
It's a random payload for the ICMP packet. TBH it's totally useless here, I will just remove the additional data in v3.
Quoted 43 lines
Quoted 43 lines
net-lwip/ping.c new file +42
-0+ + iecho->chksum =inet_chksum (iecho, len); +} + +static void ping_send_icmp (struct raw_pcb *raw,const ip_addr_t *addr) +{ +struct pbuf *p; +struct icmp_echo_hdr *iecho; +size_t ping_size =sizeof (struct icmp_echo_hdr ) +PING_DATA_SIZE ; + + p =pbuf_alloc (PBUF_IP , (u16_t )ping_size,PBUF_RAM ); +if (!p) +return ; + +if ((p->len == p->tot_len) && (p->next ==NULL )) { + iecho = (struct icmp_echo_hdr *)p->payload; +ping_prepare_echo (iecho, (u16_t )ping_size); +raw_sendto (raw, p, addr); + } + +pbuf_free (p); +} + +static void ping_send (void *arg) +{ +struct raw_pcb *pcb = (struct raw_pcb *)arg; + +ping_send_icmp (pcb, ping_target); +sys_timeout (PING_DELAY_MS , ping_send, ping_pcb); +} + +static int ping_loop (const ip_addr_t * addr) +{ +ulong start; +int ret; + +printf ("Using %s device\n" ,eth_get_name ()); + + ret =ping_raw_init (); +if (ret <0 ) +return ret; + ping_target = addr;
Quoted 8 lines
net-lwip/ping.c line 135
Quoted 6 lines
net-lwip/ping.c new file +6
-0+ + start =get_timer (0 ); +ping_send (ping_pcb); + + do { + eth_rx();
eth_rx()has a ret value. Don't we have to check it here?
We would not do anything different on error because an error might be transient, we don't want too much complexity. Letting the loop run until success (which is determined by the proper ICMP echo reply being received) or timeout or Ctrl-C is good enough.
BTW net_loop() in net/net.c doesn't check the return status, either.
Quoted 43 lines
Quoted 38 lines
net-lwip/ping.c new file +36
-1+if (ping_target_alive) +break ; +sys_check_timeouts (); +if (ctrlc ()) { +printf ("\nAbort\n" ); +break ; + } + }while (get_timer (start) <PING_TIMEOUT_MS ); + +sys_untimeout (ping_send, ping_pcb); +ping_raw_stop (); + ping_target =NULL ; + +if (ping_target_alive) { + ping_target_alive = false; +return 0 ; + } +printf ("ping failed; host %s is not alive\n" ,ipaddr_ntoa (addr)); +return -1 ; +} + +int do_ping (struct cmd_tbl *cmdtp,int flag,int argc,char *const argv[]) +{ +ip_addr_t addr; + +if (argc <2 ) +return CMD_RET_USAGE ; + +if (!ipaddr_aton (argv[1 ], &addr)) +return CMD_RET_USAGE ; + +if (ping_loop (&addr) <0 ) +return CMD_RET_FAILURE ; + +return CMD_RET_SUCCESS ; +} --Quoted 2 lines
2.40.1
Regards
/Ilias
Re: [PATCH v2 08/14] net-lwip: add wget command
In reply to Maxim UvarovQuoted 1 line · Maxim Uvarov
чт, 6 июн. 2024 г. в 12:56, Jerome Forissier <[email protected]>:
[...]
Quoted 37 lines
Quoted 37 lines
Quoted 18 lines
Quoted 18 lines
net-lwip/wget.c new file +12
-0@@ -0,0 +1,180 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* Copyright (C) 2024 Linaro Ltd. */ + +#include <command.h> +#include <console.h> +#include <display_options.h> +#include <image.h> +#include <lwip/apps/http_client.h> +#include <lwip/timeouts.h> +#include <net-lwip.h> +#include <time.h> +[...]
Quoted 16 lines
Quoted 4 lines
net-lwip/wget.c new file +4
-0+ +static void httpc_result_cb (void *arg,httpc_result_t httpc_result, +u32_t rx_content_len,u32_t srv_res,err_t err) +{net-lwip/wget.c line 106
Quoted 10 lines
net-lwip/wget.c new file +10
-0+ulong elapsed; + +if (httpc_result !=HTTPC_RESULT_OK ) { +log_err ("\nHTTP client error %d\n" , httpc_result); + done =FAILURE ; +return ; + } + + elapsed =get_timer (start_time); + log_info("\n%u bytes transferred in %lu ms (", rx_content_len,This print I commented for another patch to match current python tests.
Quoted 4 lines
Quoted 2 lines
What do you mean? Is this text incorrect because some tests expect something else? Which ones?
You modified the python test to expect this output if LWIP is enabled.
It was in the TFTP test.
Quoted 5 lines
Instead of adding one
more 'if LWIP' to the python test you can make thislog_info()output the same as the original code.
But this is up to you. Somebody sometime later will need to drop 'if LWIP' from python code.
I dropped the TFTP message change in v3. I will not change the message for wget since I don't see any issue with that.
Thanks,
Signature · 1 line
Jerome
Quoted 3 lines
BR,
Maxim.
Re: [PATCH v2 07/14] net-lwip: add dns command
In reply to Ilias ApalodimasQuoted 4 lines · Ilias Apalodimas
Hi Jerome,
[...]
Quoted 15 lines
net-lwip/dns.c line 25
Quoted 13 lines
net-lwip/dns.c new file +13
-0+ +static ulong start; +static ip_addr_t host_ipaddr; +static bool done; + +static void do_dns_tmr (void *arg) +{ +dns_tmr (); +} + +static void dns_cb (const char *name,const ip_addr_t *ipaddr,void *arg) +{ +char *var = (char *)arg;const char *
Fixed in v3.
Quoted 71 lines
Quoted 71 lines
net-lwip/dns.c new file +70
-0+char *ipstr =ip4addr_ntoa (ipaddr); + + done = true; + +if (!ipaddr) { +printf ("DNS: host not found\n" ); + host_ipaddr.addr =0 ; +return ; + } + +if (var) +env_set (var, ipstr); + +printf ("%s\n" , ipstr); +} + +int do_dns (struct cmd_tbl *cmdtp,int flag,int argc,char *const argv[]) +{ +bool has_server = false; +ip_addr_t ipaddr; +ip_addr_t ns; +char *nsenv; +char *name; +char *var; +int ret; + +if (argc ==1 || argc >3 ) +return CMD_RET_USAGE ; + +if (argc >=2 ) + name = argv[1 ]; + +if (argc ==3 ) + var = argv[2 ]; + +dns_init (); + + nsenv =env_get ("dnsip" ); +if (nsenv &&ipaddr_aton (nsenv, &ns)) { +dns_setserver (0 , &ns); + has_server = true; + } + + nsenv =env_get ("dnsip2" ); +if (nsenv &&ipaddr_aton (nsenv, &ns)) { +dns_setserver (1 , &ns); + has_server = true; + } + +if (!has_server) { +log_err ("No valid name server (dnsip/dnsip2)\n" ); +return CMD_RET_FAILURE ; + } + + done = false; + + ret =dns_gethostbyname (name, &ipaddr, dns_cb, var); + +if (ret ==ERR_OK ) { +dns_cb (name, &ipaddr, var); + }else if (ret ==ERR_INPROGRESS ) { + start =get_timer (0 ); +sys_timeout (DNS_RESEND_MS , do_dns_tmr,NULL ); + do { + eth_rx(); + if (done) + break; + sys_check_timeouts(); + if (ctrlc()) { + printf("\nAbort\n");
Quoted 8 lines
net-lwip/dns.c line 100
Quoted 5 lines
net-lwip/dns.c new file +5
-0+break ; + } + }while (get_timer (start) <DNS_TIMEOUT_MS ); +sys_untimeout (do_dns_tmr,NULL ); + }Looking at the lwip code there are other ret values than just
ERR_OK,ERR_INPROGRESS. Should we have an 'else' handling the rest?
Not needed, since in this case we will reach the next line 'if (done && host_ipaddr.addr != 0)' which is the true success condition.
Thanks,
Signature · 1 line
Jerome
Re: [PATCH v2 07/14] net-lwip: add dns command
In reply to Ilias Apalodimasчт, 6 июн. 2024 г. в 09:29, Ilias Apalodimas <[email protected]>:
Quoted 92 lines
Hi Jerome,
[...]
net-lwip/dns.c line 25
Quoted 13 lines
net-lwip/dns.c new file +13
-0+ +static ulong start; +static ip_addr_t host_ipaddr; +static bool done; + +static void do_dns_tmr (void *arg) +{ +dns_tmr (); +} + +static void dns_cb (const char *name,const ip_addr_t *ipaddr,void *arg) +{ +char *var = (char *)arg;const char *
Quoted 70 lines
net-lwip/dns.c new file +70
-0+char *ipstr =ip4addr_ntoa (ipaddr); + + done = true; + +if (!ipaddr) { +printf ("DNS: host not found\n" ); + host_ipaddr.addr =0 ; +return ; + } + +if (var) +env_set (var, ipstr); + +printf ("%s\n" , ipstr); +} + +int do_dns (struct cmd_tbl *cmdtp,int flag,int argc,char *const argv[]) +{ +bool has_server = false; +ip_addr_t ipaddr; +ip_addr_t ns; +char *nsenv; +char *name; +char *var; +int ret; + +if (argc ==1 || argc >3 ) +return CMD_RET_USAGE ; + +if (argc >=2 ) + name = argv[1 ]; + +if (argc ==3 ) + var = argv[2 ]; + +dns_init (); + + nsenv =env_get ("dnsip" ); +if (nsenv &&ipaddr_aton (nsenv, &ns)) { +dns_setserver (0 , &ns); + has_server = true; + } + + nsenv =env_get ("dnsip2" ); +if (nsenv &&ipaddr_aton (nsenv, &ns)) { +dns_setserver (1 , &ns); + has_server = true; + } + +if (!has_server) { +log_err ("No valid name server (dnsip/dnsip2)\n" ); +return CMD_RET_FAILURE ; + } + + done = false; + + ret =dns_gethostbyname (name, &ipaddr, dns_cb, var); + +if (ret ==ERR_OK ) { +dns_cb (name, &ipaddr, var); + }else if (ret ==ERR_INPROGRESS ) { + start =get_timer (0 ); +sys_timeout (DNS_RESEND_MS , do_dns_tmr,NULL ); + do { + eth_rx(); + if (done) + break; + sys_check_timeouts(); + if (ctrlc()) { + printf("\nAbort\n");
Quoted 9 lines
net-lwip/dns.c line 100
Quoted 5 lines
net-lwip/dns.c new file +5
-0+break ; + } + }while (get_timer (start) <DNS_TIMEOUT_MS ); +sys_untimeout (do_dns_tmr,NULL ); + }Looking at the lwip code there are other ret values than just
ERR_OK,ERR_INPROGRESS. Should we have an 'else' handling the rest?
+1
And check the return code of eth_rx(), that is int function and current code for some reason skips this check.
BR,
Maxim.
Quoted 13 lines
Quoted 10 lines
net-lwip/dns.c new file +7
-1+ +if (done && host_ipaddr.addr !=0 ) +return CMD_RET_SUCCESS ; + +return CMD_RET_FAILURE ; +} + --2.40.1
Thanks
/Ilias
Signature · 2 lines
Best regards, Maxim Uvarov
Re: [PATCH v2 08/14] net-lwip: add wget command
In reply to Jerome Forissierчт, 6 июн. 2024 г. в 12:56, Jerome Forissier <[email protected]>:
Quoted 222 lines · Maxim Uvarov
Quoted 158 lines
пт, 24 мая 2024 г. в 19:22, Jerome Forissier <[email protected]>:
Quoted 157 lines
Add support for the wget command with
NET_LWIP.About the small change in
cmd/efidebug.c: when the wget command based on the lwIP stack is used the wget command has a built-in URL validation function since it needs to parse it anyways (inparse_url()). Thereforewget_validate_uri()doesn't exist. So, guard the call inefidebug.cwithCONFIG_CMD_WGET.Based on code initially developed by Maxim U.
Signed-off-by Jerome Forissier <[email protected]>Co-developed-by Maxim Uvarov <[email protected]>Cc Maxim Uvarov <[email protected]>--- cmd/Kconfig | 7 ++ cmd/Makefile | 5 +- cmd/efidebug.c | 8 +- cmd/net-common.c | 112 ++++++++++++++++++++++++++++ cmd/net-lwip.c | 12 +++ cmd/net.c | 115 ----------------------------- include/net-lwip.h | 51 +++++++++++++ net-lwip/Makefile | 1 + net-lwip/wget.c | 180 +++++++++++++++++++++++++++++++++++++++++++++ 9 files changed, 372 insertions(+), 119 deletions(-) create mode 100644 cmd/net-common.c create mode 100644 net-lwip/wget.ccmd/Kconfig +7
-0@@ -2117,6 +2117,13 @@ config CMD_TFTPBOOT help tftpboot - load file via network using TFTP protocol +config CMD_WGET + bool "wget" + select PROT_TCP_LWIP + help + wget is a simple command to download kernel, or other files, + from a http server over TCP. + endif endifcmd/Makefile +4
-1@@ -129,8 +129,11 @@ obj-$(CONFIG_CMD_MUX) += mux.o obj-$(CONFIG_CMD_NAND) += nand.o obj-$(CONFIG_CMD_NET) += net.o obj-$(CONFIG_CMD_NET_LWIP) += net-lwip.o +obj-$(filter y,$(CONFIG_CMD_NET) $(CONFIG_CMD_NET_LWIP)) += net-common.o ifdef CONFIG_CMD_NET_LWIP -CFLAGS_net-lwip.o := -I$(srctree)/lib/lwip/lwip/src/include -I$(srctree)/lib/lwip/u-boot +lwip-includes := -I$(srctree)/lib/lwip/lwip/src/include -I$(srctree)/lib/lwip/u-boot +CFLAGS_net-lwip.o := $(lwip-includes) +CFLAGS_net-common.o := $(lwip-includes) endif obj-$(CONFIG_ENV_SUPPORT) += nvedit.o obj-$(CONFIG_CMD_NVEDIT_EFI) += nvedit_efi.ocmd/efidebug.c +5
-3@@ -741,9 +741,11 @@ static int efi_boot_add_uri(int argc, char *const argv[], u16 *var_name16,if (!label)return CMD_RET_FAILURE ; -if (!wget_validate_uri (argv[3 ])) { -printf ("ERROR: invalid URI\n" ); -return CMD_RET_FAILURE ; +if (IS_ENABLED (CONFIG_CMD_WGET )) { +if (!wget_validate_uri (argv[3 ])) { +printf ("ERROR: invalid URI\n" ); +return CMD_RET_FAILURE ; + } }efi_create_indexed_name (var_name16, var_name16_size,"Boot" , id);cmd/net-common.c new file +69
-0@@ -0,0 +1,112 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* +* (C) Copyright 2000 +* Wolfgang Denk, DENX Software Engineering, [email protected]. +*/ + +#include <command.h> +#include <dm/device.h> +#include <dm/uclass.h> +#ifdef CONFIG_NET +#include <net.h> +#elif definedCONFIG_NET_LWIP +#include <net-lwip.h> +#else +#error Either NET or NET_LWIP must be enabled +#endif +#include <linux/compat.h> +#include <linux/ethtool.h> + +static int do_net_list (struct cmd_tbl *cmdtp,int flag,int argc,char *const argv[]) +{ +const struct udevice *current =eth_get_dev (); +unsigned char env_enetaddr[ARP_HLEN ]; +const struct udevice *dev; +struct uclass *uc; + + uclass_id_foreach_dev(UCLASS_ETH, dev, uc) { +eth_env_get_enetaddr_by_index ("eth" ,dev_seq (dev), env_enetaddr); +printf ("eth%d : %s %pM %s\n" ,dev_seq (dev), dev->name, env_enetaddr, + current == dev ?"active" :"" ); + } +return CMD_RET_SUCCESS ; +} + +static int do_net_stats (struct cmd_tbl *cmdtp,int flag,int argc,char *const argv[]) +{ +int nstats, err, i, off; +struct udevice *dev; +u64 *values; +u8 *strings; + +if (argc <2 ) +return CMD_RET_USAGE ; + + err =uclass_get_device_by_name (UCLASS_ETH , argv[1 ], &dev); +if (err) { +printf ("Could not find device %s\n" , argv[1 ]); +return CMD_RET_FAILURE ; + } + +if (!eth_get_ops (dev)->get_sset_count || + !eth_get_ops (dev)->get_strings || + !eth_get_ops (dev)->get_stats) { +printf ("Driver does not implement stats dump!\n" ); +return CMD_RET_FAILURE ; + } + + nstats =eth_get_ops (dev)->get_sset_count (dev); + strings =kcalloc (nstats,ETH_GSTRING_LEN ,GFP_KERNEL ); +if (!strings) +return CMD_RET_FAILURE ; + + values =kcalloc (nstats,sizeof (u64),GFP_KERNEL ); +if (!values) + goto err_free_strings; + +eth_get_ops (dev)->get_strings (dev, strings); +eth_get_ops (dev)->get_stats (dev, values); +Quoted 8 lines
cmd/net-common.c line 75
Quoted 6 lines
cmd/net-common.c new file +6
-0+ off =0 ; +for (i =0 ; i < nstats; i++) { +printf (" %s: %llu\n" , &strings[off], values[i]); + off +=ETH_GSTRING_LEN ; + }; +It looks like here you missed
kfree().Good catch! This is already missing in master (
cmd/net.c). I will fix in v3 and also send a patch for master.Quoted 8 lines
Quoted 8 lines
cmd/net-common.c new file +8
-0+return CMD_RET_SUCCESS ; + +err_free_strings: +kfree (strings); + +return CMD_RET_FAILURE ; +} +[...]
Quoted 18 lines
Quoted 18 lines
net-lwip/wget.c new file +12
-0@@ -0,0 +1,180 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* Copyright (C) 2024 Linaro Ltd. */ + +#include <command.h> +#include <console.h> +#include <display_options.h> +#include <image.h> +#include <lwip/apps/http_client.h> +#include <lwip/timeouts.h> +#include <net-lwip.h> +#include <time.h> +[...]
Quoted 8 lines
Quoted 8 lines
net-lwip/wget.c new file +8
-0+ +static void httpc_result_cb (void *arg,httpc_result_t httpc_result, +u32_t rx_content_len,u32_t srv_res,err_t err) +{ +ulong elapsed; + +if (httpc_result !=HTTPC_RESULT_OK ) { +log_err ("\nHTTP client error %d\n" , httpc_result);Quoted 8 lines
net-lwip/wget.c line 106
Quoted 6 lines
net-lwip/wget.c new file +6
-0+ done =FAILURE ; +return ; + } + + elapsed =get_timer (start_time); + log_info("\n%u bytes transferred in %lu ms (", rx_content_len,This print I commented for another patch to match current python tests.
Quoted 2 lines
What do you mean? Is this text incorrect because some tests expect something else? Which ones?
You modified the python test to expect this output if LWIP is enabled. Instead of adding one
more 'if LWIP' to the python test you can make this log_info() output the same as the original code.
But this is up to you. Somebody sometime later will need to drop 'if LWIP' from python code.
BR,
Maxim.
Quoted 92 lines
Quoted 17 lines
Quoted 5 lines
net-lwip/wget.c new file +4
-0+ get_timer(start_time)); +print_size (rx_content_len / elapsed *1000 ,"/s)\n" ); + + if (env_set_hex("filesize", rx_content_len) ||net-lwip/wget.c line 120
Quoted 10 lines
net-lwip/wget.c new file +10
-0+ env_set_hex("fileaddr", saved_daddr)) { +log_err ("Could not set filesize or fileaddr\n" ); + done =FAILURE ; +return ; + } + + done =SUCCESS ; +} + +int wget_with_dns (ulong dst_addr,char *uri)static?
No, this function is called from
lib/efi_loader/efi_bootmgr.c.Quoted 42 lines
Quoted 42 lines
net-lwip/wget.c new file +42
-0+{ +char server_name[SERVER_NAME_SIZE ]; +httpc_connection_t conn; +httpc_state_t *state; +char *path; +u16 port; + + daddr = dst_addr; + saved_daddr = dst_addr; + done =NOT_DONE ; + size =0 ; + prevsize =0 ; + +if (parse_url (uri, server_name, &port, &path)) +return CMD_RET_USAGE ; + +memset (&conn,0 ,sizeof (conn)); + conn.result_fn = httpc_result_cb; + start_time =get_timer (0 ); +if (httpc_get_file_dns (server_name, port, path, &conn, httpc_recv_cb, +NULL , &state)) +return CMD_RET_FAILURE ; + +while (!done) { +eth_rx (); +sys_check_timeouts (); +if (ctrlc ()) +break ; + } + +if (done ==SUCCESS ) +return 0 ; + +return -1 ; +} + +int do_wget (struct cmd_tbl *cmdtp,int flag,int argc,char *const argv[]) +{ +char *url; +ulong dst_addr; + +if (argc <2 || argc >3 )Quoted 8 lines
net-lwip/wget.c line 167
Quoted 5 lines
net-lwip/wget.c new file +5
-0+return CMD_RET_USAGE ; + + dst_addr = image_load_addr; + +if (!strncmp (argv[1 ],"0x" ,2 )) {As I remember u-boot can eat hex and decimal numbers for arguments for most of the commands.
Right. I'll use
hextoul()properly in v3.Quoted 7 lines
Quoted 7 lines
net-lwip/wget.c new file +7
-0+if (argc <3 ) +return CMD_RET_USAGE ; + dst_addr =hextoul (argv[1 ],NULL ); + url = argv[2 ]; + }else { + url = argv[1 ]; + }Quoted 8 lines
Quoted 8 lines
net-lwip/wget.c new file +6
-1+ +if (wget_with_dns (dst_addr, url)) +return CMD_RET_FAILURE ; + +return CMD_RET_SUCCESS ; +} --2.40.1
Thanks,
--
Jerome
Signature · 2 lines
Best regards, Maxim Uvarov
Quoted 40 lines · Jerome Forissier
Quoted 37 lines · Tom Rini
Quoted 20 lines · Jerome Forissier
This is a rework of a patch series by Maxim Uvarov: "net/lwip: add lwip library for the network stack" [1]. The goal is to introduce the lwIP TCP/IP stack [2] [3] as an alternative to the current implementation in
net/, selectable withKconfig, and ultimately keep only lwIP if possible. Some reasons for doing so are:
- Make the support of HTTPS in the wget command easier. Javier T. (CC'd) has some additional lwIP and Mbed TLS patches to do so. With that it becomes possible to fetch and launch a distro installer such as Debian etc. directly from the U-Boot shell.
- Possibly benefit from additional features implemented in lwIP
- Less code to maintain in U-BootThe first patch introduces a new
Kconfigsymbol:NET_LWIP, which selects the lwIP implementation instead of the current one (NET). Contrary to the approach chosen by Maxim in [1],NET_LWIPand NET cannot be enabled simultaneously. The rationale is we want to start from a clean state and not pull potentially duplicated functionality from both stacks. Note however that a few files are still built innet/, they are the ones related to ethernet device management and the ethernet bootflow.Quoted 2 lines
The second patch imports the lwIP code as a Git subtree under
lib/lwip/lwip. Some glue code is added underlib/lwip/u-boot.For next time, please just make it a pre-req to run the git subtree command (and note it in the cover letter).
In more specific feedback, I tried this on a Pi 3, and:
U-Boot> tftpboot 200000 EFI/arm64/helloworld.efi
TFTP from server 192.168.1.10; our IP address is 192.168.1.100
Filename 'EFI/arm64/helloworld.efi'.
Load address:0x200000
Loading:
....
FAILED test/py/tests/test_efi_loader.py::test_efi_helloworld_net - u_boot_spawn.Timeout
Quoted 8 lines
Quoted 2 lines
So some amount of networking is working (that's a reasonable dhcp response it got), but tftp'ing a file fails.
Thanks for testing! This fails because I changed the command output. The legacy command prints "Bytes transferred =" while the newer one prints "%lu bytes transferred" plus throughput information. I will use the older message in v3 because several tests as well as documentation would need updating. We'll do that later if desired.
Thanks. And yeah, I would like to keep the output unchanged as much as is feasible, it's in many ways a form of ABI.
Signature · 1 line
Tom