Commit Graph

240 Commits

Author SHA1 Message Date
Abhik Roy
9cf70e0c98 Merge branch 'lwip/restrict_dhcp_server_client_together' into 'master'
esp-lwip: Restrict configuring DHCP server and client together

See merge request espressif/esp-idf!22137
2023-01-27 22:36:30 +08:00
Abhik Roy
d762f9a1a5 esp-lwip: Added check in esp_netif_new() to restrict configuring DHCP
server and client together.
2023-01-26 20:59:04 +05:30
Abhik Roy
7e81518a57 esp-lwip: Added API to expose default esp-netif. 2023-01-25 12:03:02 +05:30
David Čermák
2f1d30d155 Merge branch 'bugfix/lwip_core_locking' into 'master'
esp_netif/lwip: Fix core-locking config

Closes IDFGH-8445, IDFGH-9098, and IDFGH-9063

See merge request espressif/esp-idf!20840
2023-01-18 20:31:25 +08:00
David Cermak
a71fa82177 esp_netif/lwip: Fix core-locking config
* Fix thread safety issues in non-core locking
* Add option to verify thread safety issues in lwip (core-lock assertion)
* Make esp_sntp.h thread safe API
* Fix sntp examples
* Fix openthread libs

Closes https://github.com/espressif/esp-idf/issues/9908
Closes https://github.com/espressif/esp-idf/issues/10502
Closes https://github.com/espressif/esp-idf/issues/10466
2023-01-17 16:15:58 +01:00
Cao Sen Miao
94120b82c2 esp32h2: add build test 2023-01-17 10:29:04 +08:00
David Cermak
d16c422b11 esp_netif: Allow set_dns_info() for PPP netifs
esp_netif_set_dns_info() was available only for standard interfaces, not
for Point to point types (PPP, SLIP), but it should be normally
supported. Moreover DNS servers are global in lwip, so it doesn't really
depend on type of the interface.

Also added some minor fixes to the esp_netif_get_dns_info() to allow for
NULL parameters (as it's a public API) and hardcode the IPv4 type in
case of DHCP server capable interface.

Updated logs and added error checks to the original API, before we
launch the lwIP counterpart.

Closes https://github.com/espressif/esp-idf/issues/8648
2023-01-13 10:31:28 +00:00
David Čermák
c498017df6 Merge branch 'unit_test_for_C2_netif' into 'master'
lwip: Re-enable esp-netif unit tests for ESP32C2 target

See merge request espressif/esp-idf!21372
2023-01-05 18:56:23 +08:00
David Čermák
bef3f2ce9e Merge branch 'bugfix/esp_netif_ip_reconnect' into 'master'
esp_netif: Post IP event for PPP netifs unconditionally

Closes IDFGH-8893 and IDFGH-8899

See merge request espressif/esp-idf!21666
2023-01-03 01:10:07 +08:00
David Cermak
12fd9029bf esp_netif: Post IP event for PPP netifs unconditionally
IP update notification for "point to point" interfaces is performed
via the same callback function as for any other interfaces (dhcp_cb,
although it's not DHCP related). In P2P interfaces we have to assure
that we always get a notification, so we can set the interface up.
This was omitted when getting the same IP address for the second
time, causing the PPPoS interface (in esp-modem applications) failing
to reconnect if disconnected.

Closes https://github.com/espressif/esp-idf/issues/10308
Closes https://github.com/espressif/esp-protocols/issues/188
2022-12-16 18:07:32 +01:00
David Cermak
38dec0be48 esp-netif: Support non-lwip mode, add test
It is required to define a mandatory dependency on lwip, so we
introduced esp_netif_stack component and made it require lwip, instead
of directly depending on lwip.
This enables building w-out lwip and support other TCP/IP stacks.
2022-12-14 14:12:50 +00:00
David Cermak
678d7aadd9 esp-netif/lwip: Introduce TCP/IP stack has BSD API
* This variable is automatically selected when lwip stack is chosen
* This commit also fixes lwip loopback configuration
2022-12-14 14:12:50 +00:00
David Cermak
fab39d2c4b esp_netif: Make GARP default netif flags only if enabled in lwip
Closes https://github.com/espressif/esp-idf/issues/8641
2022-12-14 14:12:50 +00:00
David Cermak
0309e0eb03 ci/esp-netif: Update build/test rules for netif tests 2022-12-14 14:12:50 +00:00
AndriiFilippov
4417d49333 Re-enable esp-netif unit tests for ESP32C2 target 2022-12-14 14:07:28 +01:00
Abhik Roy
c92f5faa70 components/lwip: Add menuconfig option to enable NAPT debugging,
removed L2_TO_L3_COPY in LWIP Kconfig,
Also added DHCP server start log.
2022-12-02 21:57:53 +05:30
Ondrej Kosta
4ded1ea4cf Merge branch 'feature/eth_bridge_test' into 'master'
lwIP bridge FDB add entry fix and bridge test

Closes IDF-5394

See merge request espressif/esp-idf!20464
2022-12-01 17:51:11 +08:00
Ondrej Kosta
d849f290d1 Merge branch 'feature/eth_test_all_chips' into 'master'
Ethernet related tests improvements

Closes IDF-5387

See merge request espressif/esp-idf!20982
2022-11-30 17:53:48 +08:00
Ondrej
2bf7255285 Ethernet related tests improvements
esp_eth: tests migrated to pytest and added support of multiple Ethernet devices

esp_netif: l2tap test migrated to pytest
2022-11-28 11:34:34 +00:00
Song Ruo Jing
e13a4ad963 ci: Disable some unit-test-apps for esp32c6 to pass ci build stage 2022-11-28 11:58:30 +08:00
nvmd
8906a68108 Remove trailing semicolons from netif IF's 2022-11-21 07:03:35 +00:00
Ondrej
0f939e7ace esp_netif: lwIP bridge FDB add entry minor fix
examples: extended Bridge example by interactive console to manage FDB entries
2022-11-08 14:16:21 +00:00
Song Ruo Jing
2557e24a28 ci: Enable esp32c6 example, test_apps, and unit tests CI build stage 2022-11-01 11:23:21 +08:00
David Cermak
83b8556f10 esp_netif: Migrate SLIP interface to user-space 2022-08-16 14:08:15 +00:00
Ivan Grokhotkov
401c10ecfb build system: re-add -Wno-format as private flag for some components 2022-08-03 16:42:47 +04:00
David Cermak
64f4f0ac1e esp_netif/lwip: Use netif-client-data to store esp_netif ptr
lwip/netif struct has two places to store user's data
* netif->state (1 void*) but that might be occupied in special cases
* netif->client_dtat (n void*s) but that must be enabled in opts.h
This commit stores esp_netif_t* primarily in state, but if any special
netif is enabled in menuconfig (bridgeif, pppos), it uses netif->client_data.
This commit also fixes incorrect esp_netif that is attached to
IP_EVENT_GOT_IP6 event posted by pppos interfaces in:
c585618b97/components/esp_netif/lwip/esp_netif_lwip_ppp.c (L114)

Closes https://github.com/espressif/esp-idf/issues/9345
2022-07-27 11:55:18 +00:00
David Cermak
e7afdff6ca esp_netif: Make set_link_speed() conditional on MIB2_STATS 2022-07-20 14:59:34 +02:00
David Cermak
89bb1fdec1 esp_netif: Add error checks to dhcp server state transitions 2022-07-20 14:59:34 +02:00
David Cermak
5c383d7b73 esp_netif/lwip: Fix deps cycles to "lwip -> esp_netif -> phy-drivers"
Fix dependency tree so that lwip doesn't depend on any specific network
interface component.
Network interface drivers shall depend on esp_netif.
esp_netif shall depend on lwip (but not on any specific interface
driver) -- it optionally depends on vfs and esp_eth (need ethernet
header for L2/bridge mode)
2022-07-20 14:59:07 +02:00
David Čermák
c65d818c1d Merge branch 'bugfix/set_ipv6_dns_error' into 'master'
lw ip: Fixed that ipv6 dns cannot work

See merge request espressif/esp-idf!19018
2022-07-15 14:50:02 +08:00
Fu Hanxi
c0568611dd docs: changes docs supported targets tables 2022-07-14 08:26:32 +08:00
Fu Hanxi
05d2357062 feat: use standalone project idf-build-apps for find/build apps utils 2022-07-14 08:26:31 +08:00
Chen Wu
f65071000a lwip: Fixed that ipv6 dns cannot work 2022-07-13 11:48:04 +08:00
Ondrej Kosta
53082a22f7 esp_netif: added support for LwIP bridge
examples: created bridge example
2022-06-14 15:29:44 +02:00
David Cermak
343cf2696e esp_eth: Reduce internal deps onto netif-glue 2022-06-09 07:55:40 +00:00
David Cermak
5e19b9c951 esp-netif: Make dependency on esp-eth optional
* esp-netif to optionally depend on esp-eth (only for l2tap config)
* esp_eth.h now includes the original ethernet header and the
ethernet-netif glue layer
* Updated examples and test to explicitely use esp-eth dependency if
needed
2022-06-09 07:55:40 +00:00
morris
aa3ddbc3c6 Merge branch 'test/enable_c2_target_tests' into 'master'
ci: enable target tests for ESP32-C2

Closes IDF-4989

See merge request espressif/esp-idf!18182
2022-06-03 16:41:24 +08:00
David Čermák
46e599c56d Merge branch 'feature/lwip_rework_patches' into 'master'
lw-IP: Reworked patches

Closes IDFGH-6197

See merge request espressif/esp-idf!17388
2022-06-03 15:26:55 +08:00
David Cermak
c67f4c2b4c lwip: Remove vanilla-lwip config until it's fully deployable 2022-06-02 20:45:24 +02:00
Michael (XIAO Xufeng)
6a8aed12ee ci: partially enable ut tests for esp32c2
Disabled test cases are tracked in:

 IDF-4465, IDF-5045, IDF-5057, IDF-5058, IDF-5059, IDF-5060, IDF-5061, IDF-5131

- test_fatfs: IDF-5136

- test_pm: IDF-5053

- test_cache_mmu: IDF-5138

- test_partitions: IDF-5137

- test_vfs: IDF-5139

- test_freertos: IDF-5140

- test_wpa_supplicant: IDF-5046

- test_mbedtls: IDF-5141

- test_pthread: IDF-5142

- test_protocomm: IDF-5143

- test_lightsleep: IDF-5053

- test_taskwdt: IDF-5055

- test_tcp_transport: IDF-5144

- test_app_update: IDF-5145

- test_timer: IDF-5052

- test_spi: IDF-5146

- test_rtc_clk: IDF-5060

- test_heap: IDF-5167

ci: fixed issues for tests of libgcc, ets_timer, newlib

test_pm: support on C2
2022-06-02 14:23:35 +08:00
David Cermak
7efcb5e625 lwip: Add missing null-checks, rename to vanilla-lwip 2022-06-01 20:38:40 +02:00
Djordje Nedic
facab8c5a7 tools: Increase the minimal supported CMake version to 3.16
This updates the minimal supported version of CMake to 3.16, which in turn enables us to use more CMake features and have a cleaner build system.
This is the version that provides most new features and also the one we use in our latest docker image for CI.
2022-06-01 06:35:02 +00:00
Jessy Chen
7b9b448041 esp_wifi: optimize wifi kconfig 2022-05-28 08:52:55 +00:00
Richard Retanubun
bd3db823b1 Fixup inversion error causing error prints
ESP_RETURN_ON_FALSE(a, err_code, ...) macro

Will print and return err_code
if (unlikely(!(a)))

so "a" needs to state what we expect to be TRUE
which in this case means:

mld6_leavegroup_netif(...) == ERR_OK
2022-05-19 16:58:47 -04:00
David Cermak
09aa24632a esp_netif: Support IPv6 autoconfig is enabled in menuconfig 2022-05-18 17:11:35 +02:00
David Cermak
356bc603c4 lwip: Support DHCP restore last IP 2022-05-18 17:11:35 +02:00
David Cermak
44a9620c17 esp_netif: Add thread safe pppapi set_auth API to esp-netif 2022-05-18 17:10:42 +02:00
David Cermak
5b471a1848 esp_netif/lwip: Implement basic support for vanilla-lwip (2.1.3-REL)
* Reference lwip-2.1.3-REL vanilla lwip version
* Use inherent NETIF callbacks instead of dhcp/ipv6/autoip
2022-05-18 17:10:42 +02:00
Marius Vikhammer
c8617fe965 docs: fix all doxygen warnings
Doxygen warnings would previously not result in a failed pipeline.
Fixed this as well as all current warnings.
2022-05-12 14:50:03 +08:00
xueyunfei
26fa8260b1 Doc:update wifi api docs
* Add documents related to espnow config rate

* Optimization set dns server api description
2022-04-24 21:20:54 +08:00
morris
cc71e645be Merge branch 'feature/ksz8863rll_support' into 'master'
ESP IDF infrastructure preparation for ksz8863rll support

See merge request espressif/esp-idf!17203
2022-04-14 10:51:27 +08:00
Mahavir Jain
467e9c07d6 lwip: fix build with CONFIG_LWIP_DHCPS disabled
Also added example build configuration for this option.
2022-04-11 12:31:17 +00:00
Ondrej Kosta
4051b80b4d esp_netif: remove dependency of L2 TAP Interface from netif_lwip
esp_eth: extended infrastructure to optionally provide more advanced access to MAC/PHY layers
2022-04-08 16:40:29 +02:00
David Cermak
27375c7917 esp_netif: Cleanup dhcp-server allocations 2022-03-13 19:40:00 +01:00
David Cermak
3d1c05aefb lwip/dhcps: Add dhcps callback argument for associated netif 2022-03-13 19:40:00 +01:00
David Cermak
5f135741a1 lwip/dhcpserver: Add return value to API that could fail 2022-03-13 19:40:00 +01:00
David Cermak
c005b04d1c lwip/dhcps: Support for dynamic dhcp server instances 2022-03-13 19:39:21 +01:00
David Cermak
bab051f450 lwip/dhcps: Cleanup internal lwip and esp-netif dependency 2022-03-13 19:38:15 +01:00
David Cermak
fabad2a13a esp_netif: Extend unit test to validate route_prio
Also updates the auto routing loop after a netif is destroyed
2022-03-11 14:02:17 +01:00
David Cermak
f8907b7884 esp_netif: Support for manual set-default-netif
Closes https://github.com/espressif/esp-idf/issues/8330
2022-03-11 14:02:17 +01:00
David Cermak
795b7ed993 esp_netif: Remove tcpip_adapter compatibility layer 2022-03-10 08:19:43 +01:00
Sagar Bijwe
6501eff7f5 Remove legacy system event framework. 2022-03-09 15:53:45 +05:30
Sudeep Mohanty
a9fda54d39 esp_hw_support/esp_system: Re-evaluate header inclusions and include directories
This commit updates the visibility of various header files and cleans up
some unnecessary inclusions. Also, this commit removes certain header
include paths which were maintained for backward compatibility.
2022-03-07 11:18:08 +05:30
Omar Chebib
2571aaf3c9 G0: target component (components/esp32*) doesn't depend on driver anymore 2022-03-02 04:21:00 +00:00
David Cermak
8da2e4088c esp_eth: Update esp32's EMAC API to decouple driver and vendor config 2022-02-14 16:17:29 +00:00
Darian Leung
57fd78f5ba freertos: Remove legacy data types
This commit removes the usage of all legacy FreeRTOS data types that
are exposed via configENABLE_BACKWARD_COMPATIBILITY. Legacy types can
still be used by enabling CONFIG_FREERTOS_ENABLE_BACKWARD_COMPATIBILITY.
2022-02-09 23:05:45 +08:00
David Čermák
95c3f96801 Merge branch 'bugfix/wundef_wsign_compare' into 'master'
esp_netif: Fix -Wundef issues with esp_netif.h (GitHub PR)

Closes IDFGH-6598

See merge request espressif/esp-idf!16801
2022-02-07 09:03:52 +00:00
David Čermák
5dcd630444 Merge branch 'feature/dhcps_more_client_info' into 'master'
lw-IP: Add more client's infor to dhcp server cb

Closes IDFGH-5839

See merge request espressif/esp-idf!16433
2022-01-28 07:31:32 +00:00
David Cermak
e3d71c984a lwip: Add client's MAC addr to dhcp server cb
* Extended storage for staipassigned events to pass client's MAC address.
* Added client's MAC to dhcp server callback
* Posting the staipassigned events with clients IP and MAC address
2022-01-25 13:08:43 +01:00
Fu Hanxi
a801555299 ci: replace all component ut with pytest-embedded 2022-01-24 16:37:23 +08:00
laokaiyao
cf049e15ed esp8684: rename target to esp32c2 2022-01-19 11:08:57 +08:00
Scott Shawcroft
94ce8444fc esp_netif: Fix -Wundef issues with esp_netif.h
Partially addresses https://github.com/espressif/esp-idf/pull/5179
2022-01-14 16:19:31 +01:00
Cao Sen Miao
e81841318f CI: Enable ESP8684 build stage CI on master 2021-12-13 19:18:47 +08:00
Ondrej Kosta
7e864d6856 netif_glue: Removed deprecated esp_eth_set_default_handlers and esp_eth_clear_default_handlers 2021-12-08 09:21:30 +01:00
Ondrej Kosta
3a7a67f174 netif: added ESP-NETIF L2 TAP interface 2021-11-23 11:17:22 +01:00
Roland Dobai
766aa57084 Build & config: Remove leftover files from the unsupported "make" build system 2021-11-11 15:32:36 +01:00
Zhang Jun Hao
a568b4fddf esp_wifi: support station only mode for code size down 2021-10-27 11:48:22 +08:00
Liu Han
49cd81ccf3 lwip/dhcp: add configure for enable vendor class identify option
Closes https://github.com/espressif/esp-idf/issues/6786
2021-10-22 11:17:59 +08:00
0xFEEDC0DE64
822129e234 esp_netif: Fix implicit includes in public headers
Merges https://github.com/espressif/esp-idf/pull/7690
2021-10-18 10:01:52 +02:00
David Cermak
825bbb08e3 esp_netif: Added argument checks for PPP public API 2021-09-07 09:03:15 +02:00
David Cermak
2f6c60573e esp_netif: Extend PPP netif API to control connection failure 2021-09-07 09:03:15 +02:00
xueyunfei
0d07569fff optimization config option LWIP_TCPIP_CORE_LOCKING 2021-08-18 21:32:13 +08:00
David Čermák
d2fe8bfd15 Merge branch 'experimental/mdns_with_sockets' into 'master'
mdns: Add optional networking layer on BSD socket

Closes IDF-1849

See merge request espressif/esp-idf!9857
2021-08-17 14:12:30 +00:00
David Cermak
9f17f586f4 esp_netif: Set default netif with lwip_netif
Make use of lwip_netif pointer for setting the default interface in lwip,
since the  is a generic pointer used in I/O functions wheras the former is always the  type.
More importantly the netif_handle could be set to another context ptr
used in I/O functions, as as for the SLIP netif.

This change fixes the issue of incorrect settings of a default interface
if any SLIP netif is involved.

Closes https://github.com/espressif/esp-idf/issues/7246
2021-08-17 19:10:49 +08:00
David Cermak
09f10f326a esp_netif: Add support for linux target as header only library 2021-08-17 18:39:40 +08:00
David Čermák
cd47ba03bc Merge branch 'bugfix/mdns_lwip_agnostic' into 'master'
mdns: Clean the main mdns module from lwip dependencies

See merge request espressif/esp-idf!14187
2021-07-07 11:58:18 +00:00
David Cermak
7cab3d48e6 esp_netif: IP Address: Add esp-ip addr copy API, IP init macros 2021-07-01 15:01:39 +02:00
David Cermak
d542edbb3d esp_netif: Fix dhcps state transitions
When the DHCP server is stopped before starting the netif,
it should remain stopped -- as per compatibility with previous tcpip_adapter behavior
2021-07-01 10:17:19 +02:00
yuanjm
56b9bebe41 esp_netif: Correct spelling mistakes 2021-06-25 14:52:34 +08:00
yuanjm
d93b3d304e slip: Fix the definition of cplusplus in the code 2021-06-25 14:51:24 +08:00
yuanjm
bda8cf0c14 esp_netif: Add CONFIG_PPP_SUPPORT and CONFIG_LWIP_SLIP_SUPPORT to sperate the code 2021-06-25 14:51:24 +08:00
liuhan
7d5ae1ee26 esp_netif: Add CONFIG_LWIP_DHCPS to sperate the code 2021-06-24 09:49:45 +08:00
Shu Chen
e470e7c4c3 Merge branch 'feature/ot-lwip-interface' into 'master'
openthread: add lwIP network interface

See merge request espressif/esp-idf!13188
2021-06-03 01:46:17 +00:00
Jiacheng Guo
52a68cb7fe openthread: integrate OpenThread network interface with esp_netif 2021-06-02 17:03:54 +08:00
David Čermák
4b7a7e559a Merge branch 'bugfix/esp_netif_list_match_improvement' into 'master'
esp-netif: Improve netif list operations (GitHub PR)

Closes IDFGH-5289

See merge request espressif/esp-idf!13636
2021-06-01 12:47:18 +00:00
David Cermak
8ae19ed332 esp_netif: Fix failing ppp_set_auth() due to wrong arg check
Closes https://github.com/espressif/esp-idf/issues/7047
2021-06-01 05:32:39 +00:00
David Cermak
c991af7ac5 esp_netif: Update the test to exercise netif list matching APIs 2021-05-21 09:44:08 +02:00
yuanjm
7256cfe5a4 ppp: Fix disable IPv6 will make esp_netif_lwip_ppp build fail
Closes https://github.com/espressif/esp-idf/issues/6935
2021-05-20 09:45:17 +00:00
Axel Lin
5209af379a esp-netif: Improve esp_netif_is_netif_listed and esp_netif_get_handle_from_ifkey
Each esp_netif_next_unsafe() call needs to iterate the s_head list.
It is inefficient with a do-while loop + esp_netif_next_unsafe() call.
Use SLIST_FOREACH instead to simplify the code and speed-up the matching.

While at it, also fix returning NULL from esp_netif_is_netif_listed().

Signed-off-by: Axel Lin <axel.lin@gmail.com>
2021-05-20 13:51:22 +08:00
David Čermák
2e4d5d8765 Merge branch 'feature/add_eth_lost_ip_event' into 'master'
event: Add IP_EVENT_ETH_LOST_IP event

Closes IDFGH-5198

See merge request espressif/esp-idf!13466
2021-05-10 07:27:16 +00:00