1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00
Commit Graph

240 Commits

Author SHA1 Message Date
Erik Ekman
9844953da4 sys/net: Add ipv4 pseudomodule
Enabled when lwIP uses IPv4.
2021-10-11 21:37:47 +02:00
Erik Ekman
ff7bf09313 sys/net/sock: Set SOCK_HAS_IPV6 in one place
Based on ipv6 pseudomodule
2021-10-11 21:37:39 +02:00
Erik Ekman
3df56d576f sys/net: Add ipv6 pseudomodule
Enabled when GNRC, lwIP or OpenWSN uses IPv6
2021-10-08 10:27:22 +02:00
benpicco
149de73160
Merge pull request #16741 from benpicco/net_lwip_netif_get_name
pkg/lwip: implement netif_get_name()
2021-08-26 14:37:58 +02:00
Benjamin Valentin
b6b48535fb pkg/lwip: implement netif_get_name() 2021-08-26 13:20:24 +02:00
benpicco
16f7c94875
Merge pull request #16761 from benpicco/pkg/lwip/init_devs
pkg/lwip: add auto-init for DOSE & at86rf215, cc2538_rf
2021-08-24 12:16:14 +02:00
Erik Ekman
adccbc9f2a pkg/lwip: Fix compilation without IPv6
RIOT/pkg/lwip/init_devs/init.c:65:61: error: 'tcpip_6lowpan_input' undeclared (first use in this function)
     return netif_add_noaddr(netif, state, lwip_netdev_init, tcpip_6lowpan_input);
                                                             ^
2021-08-20 17:52:37 +02:00
Benjamin Valentin
5b83475ffe pkg/lwip: add auto-init for cc2538_rf 2021-08-20 16:48:25 +02:00
Benjamin Valentin
6d468f8044 pkg/lwip: add auto-init for at86rf215 2021-08-20 16:48:25 +02:00
Benjamin Valentin
b39390ed93 pkg/lwip: add auto-init for DOSE 2021-08-20 16:37:53 +02:00
Erik Ekman
9459dfaf68 pkg/lwip: Use XFA to initialize network interfaces 2021-08-20 14:58:29 +02:00
Erik Ekman
11f8ba89ae pkg/lwip: Move ethos to netif auto init 2021-08-20 14:57:39 +02:00
Erik Ekman
06dfcdd3fa pkg/lwip: Move socket_zep to netif auto init 2021-08-20 14:57:39 +02:00
Erik Ekman
9002da3d80 pkg/lwip: Move nrf802154 to netif auto init 2021-08-20 14:57:39 +02:00
Erik Ekman
1897b57d8e pkg/lwip: Move at86rf2xx to netif auto init 2021-08-20 14:57:39 +02:00
Erik Ekman
fff95fc882 pkg/lwip: Add 6lowpan helper, do auto init for mrf24j40 2021-08-20 14:57:37 +02:00
Erik Ekman
cdc8c35e13 pkg/lwip: Move stm32_eth to netif auto init 2021-08-20 14:56:48 +02:00
Erik Ekman
c631c0fddd pkg/lwip: Move sam0_eth to netif auto init 2021-08-20 14:56:48 +02:00
Erik Ekman
e8c5ff162a pkg/lwip: Move enc28j60 to netif auto init 2021-08-20 14:56:48 +02:00
Erik Ekman
fea0c8d453 pkg/lwip: Move atwinc15x0 to netif auto init 2021-08-20 14:56:48 +02:00
Erik Ekman
a18b24c7ed pkg/lwip: Move esp_wifi to netif auto init 2021-08-20 14:56:48 +02:00
Erik Ekman
c9116f5570 pkg/lwip: Move esp_eth to netif auto init 2021-08-20 14:56:48 +02:00
Erik Ekman
9a089d412b pkg/lwip: Set first netif as default
Set at create time, as all netifs will no longer be in one array.
2021-08-20 14:56:48 +02:00
Erik Ekman
2816ade5f8 pkg/lwip: Start rework of netif initialisation
Use separate files with auto_init
Proof of concept with only moving netdev_tap
2021-08-20 14:56:46 +02:00
Jose Alamos
ddc9c7c686
ieee802154/radio_hal: detach hal descriptor from driver 2021-08-18 15:24:10 +02:00
Benjamin Valentin
5117da1cb0 lwip_tcp: fix build with DEVELHELP=0
If DEVELHELP is not set `LOCK_TCPIP_CORE()`/`UNLOCK_TCPIP_CORE()`
are not defined, leading to a build failure.

Defining them to no-op leads to a run-time segmentation fault, so
better always use those functions.
2021-08-15 12:50:33 +02:00
Erik Ekman
e04da0d828 pkg/lwip: Lock core before calling netif_get_ip6_addr_match in sock 2021-07-15 15:46:10 +02:00
Erik Ekman
c50604b63c pkg/lwip: Add assert on incorrect thread usage 2021-07-15 15:46:10 +02:00
Erik Ekman
4e01900108 pkg/lwip: Start DHCP on correct interface
Fix for #16229
2021-07-13 13:45:16 +02:00
Erik Ekman
c7d24f7912 pkg/lwip: Add patch to fix netif_is_flag_set macro
Had spelling mistake: `nefif` instead of `netif`.
2021-07-13 13:07:38 +02:00
Jose Alamos
4e6f299af0
lwip: avoid explicit cast to netdev 2021-07-09 11:35:16 +02:00
iosabi
e469f2dea4 lwip_sock: Make sock_tcp_read return data if available
When reading from the socket with `sock_tcp_read()` it would only return
data from at most one internal connection buffer, even if the buffer
passed to `sock_tcp_read()` is larger and there is more data available
in the connection. This patch makes `sock_tcp_read` process all the
available data so long as there's more data to read available
immediately.
2021-04-10 18:45:57 +02:00
iosabi
afddb46c51 lwip_sock: Fix computation of last_offset on partial reads.
lwip receives network buffers that are made available to lwip_sock_tcp
calling `netconn_recv_tcp_pbuf`. The size of these buffers depends on
the size of the network packets. An application calling `sock_tcp_read`
can pass any arbitrary buffer size to read (copy) from these internal
network buffers, which may be smaller. lwip_sock_tcp keeps around the
last network buffer (`struct pbuf last_buf`) and the offset into this
buffer already consumed by the application (`last_offset`).

However, when multiple application reads from the same `pbuf` buffer
occur, the `last_offset` must be updated incrementing it. The code had
a bug that would work only when `last_offset` was either 0 (no previous
partial read) or when the current read was consuming all the remaining
data (when `buf_len == copylen`).

This patch fixes the issue an allows multiple reads from the same
buffer.
2021-04-04 12:45:54 +02:00
Francisco
7d2eb7efad
Merge pull request #16229 from yarrick/dhcp_start
pkg/lwip: Start DHCP early for all Ethernet interfaces
2021-03-30 15:54:11 +02:00
Francisco
7b65dda691
Merge pull request #16190 from aabadie/pr/pkg/make_silent_ci_build
pkg: silent make commands with RIOT_CI_BUILD=1
2021-03-30 10:28:12 +02:00
Erik Ekman
6b89f4f34b pkg/lwip: Start DHCP early for all Ethernet netifs
Netifs without link status support will keep sending discover
messages with increasing time between.

Netifs that support link status will wait for the link to be up,
and then start sending.

Netifs that support link status but send no link status events
will continue to not work (unless link status is up from the
first check when setting it up).
2021-03-25 16:01:27 +01:00
benpicco
9cad382dc8
Merge pull request #16153 from yarrick/netif_add
pkg/lwip: Add netifs with netif_add_noaddr
2021-03-25 13:36:17 +01:00
benpicco
b0364941b5
Merge pull request #16082 from yarrick/link_state
pkg/lwip: Set netif link state properly when supported
2021-03-25 13:36:07 +01:00
benpicco
3fabafa0d9
Merge pull request #16152 from yarrick/foreach_netif
pkg/lwip: Use NETIF_FOREACH macro in sock implementation
2021-03-18 11:49:19 +01:00
9bd22dba79
pkg: silent make commands with RIOT_CI_BUILD=1 2021-03-12 16:05:18 +01:00
Leandro Lanzieri
fe5c982fa6
drivers/Makefile.dep: don't pull netdev on netdev_default
netdev_default should enable the network devices, which do not
necessarily use netdev.
2021-03-10 14:18:12 +01:00
Erik Ekman
d3ba3117f2 pkg/lwip: Use NETIF_FOREACH macro in sock implementation
Decreases dependency on lwIP internals, and will handle LWIP_SINGLE_NETIF.
2021-03-06 11:27:14 +01:00
Erik Ekman
9b03b79a85 pkg/lwip: Add netifs with netif_add_noaddr
Makes 6lowpan netifs work even if dual stack is enabled,
and one less static method needed.
2021-03-05 00:17:17 +01:00
Erik Ekman
60d5d1aa74 pkg/lwip: Set link state properly when supported
Set link state correctly in lwIP for interfaces that support
the NETOPT_LINK option. Interfaces that do not support it
(like tap for native arch) remain up all the time.

Netdevs that support NETOPT_LINK but do not send NETDEV_EVENT_LINK_UP/DOWN
events will end up with a mismatched link state - but DHCP would
already not start for them either.

Use netifapi to signal lwIP to do the work in its own thread.
2021-03-01 23:55:08 +01:00
Benjamin Valentin
a57e58d6ef lwip: hook up sam0_eth support 2021-02-26 12:54:40 +01:00
Martine Lenders
afb027852d
Merge pull request #15992 from yarrick/more_lwip
Add lwIP ifconfig shell command
2021-02-23 16:59:41 +01:00
Erik Ekman
ccd4c71110 pkg/lwip: Add patch for lowpan6 printf formatters 2021-02-23 11:48:13 +01:00
Erik Ekman
eab317749f sys/shell: Add lwIP ifconfig shell command
Lists state, link type, v4/v6 addresses.
Currently read-only.

Using lwIP debug system to print addresses, to limit dependencies
and work with dual stack setup. Most other code seems to only
allow either v4 or v6 networking. For that to compile I
had to change the `SZT_F` format string due to this error:
```
error: format '%lu' expects argument of type 'long unsigned int',
but argument 2 has type 'size_t {aka unsigned int}'
```
Switching to the lwIP default format string here.

Outputs the following on my ESP32 board with Ethernet,
when both v4 and v6 are enabled in examples/paho-mqtt:
```
> ifconfig
Iface ET0 HWaddr: 24:0a:c4:e6:0e:9f Link: up State: up
        Link type: wired
        inet addr: 10.4.4.81 mask: 255.255.254.0 gw: 10.4.4.1
        inet6 addr: fe80:0:0:0:260a:c4ff:fee6:e9f scope: link
        inet6 addr: 2001:db8:1000:0:260a:c4ff:fee6:e9f scope: global
Iface ET1 HWaddr: 24:0a:c4:e6:0e:9c Link: up State: up
        Link type: wireless
        inet addr: 10.4.4.82 mask: 255.255.254.0 gw: 10.4.4.1
        inet6 addr: fe80:0:0:0:260a:c4ff:fee6:e9c scope: link
        inet6 addr: 2001:db8:1000:0:260a:c4ff:fee6:e9c scope: global
>
```
2021-02-23 11:47:45 +01:00
Erik Ekman
9da7ea2dec pkg/lwip: Name sixlowpan netifs 2021-02-23 11:47:33 +01:00
Martine Lenders
de4ee0f934
Merge pull request #15562 from benpicco/socket_zep_register
socket_zep: register with netdev, provide EUI-64 as command line parameter
2021-02-20 20:32:01 +01:00
Erik Ekman
a29c835b2e lwip/esp: Support adding both netifs (eth/wifi) 2021-02-13 15:42:33 +01:00
Benjamin Valentin
d8918c24fa socket_zep: register with netdev 2021-01-25 22:59:01 +01:00
f4523140f1
pkg/lwip: fix typo (semaphor => semaphore) 2021-01-08 10:15:33 +01:00
Marian Buschsieweke
77b39c5550
pkg/lwip: Implement sock_aux_local
Provide address the IP packet / UDP datagram was received on in the auxiliary
data, if module sock_aux_local is used.
2020-12-04 12:51:48 +01:00
Marian Buschsieweke
9d46bc7d7f
Merge pull request #14703 from maribu/sock-aux-api
net/sock: Add access to auxiliary data (API only)
2020-12-03 12:08:49 +01:00
Marian Buschsieweke
893bfd13d0
net/sock_udp: Extend API for auxiliary data 2020-12-02 17:56:13 +01:00
Marian Buschsieweke
ebcf1c0ab4
net/sock_ip: Extend API for auxiliary data 2020-12-02 17:56:13 +01:00
bc34c85226 pkg/lwip: add mips32 ssize_t fix 2020-11-25 17:52:34 +01:00
0b801c4de0 all: adapt to moved sched defines 2020-11-23 16:56:34 +01:00
Martine Lenders
71224b4b1e
lwip_sock: use new mbox_avail() function 2020-11-20 13:09:42 +01:00
Bas Stottelaar
38a5ff7d4b pkg/*: realign ENABLE_DEBUG 2020-10-23 02:43:10 +02:00
Bas Stottelaar
7088db3636 pkg/*: remove unused assert.h include 2020-10-22 11:29:27 +02:00
Bas Stottelaar
970c72a0cb pkg/*: add missing include of assert.h 2020-10-22 11:13:08 +02:00
Jose Alamos
246acb311f lwip: adapt bootstrap for nrf802154 2020-10-19 15:18:35 +02:00
Benjamin Valentin
1afe72a5e5 drivers/enc28j60: register with netdev 2020-10-08 10:36:56 +02:00
Benjamin Valentin
988ee1648f drivers/mrf24j40: register with netdev 2020-10-07 16:39:39 +02:00
Karl Fessel
9a89b84c2c Makefile.dep: sort dependencies
move most dependencies from <RIOTBASE>/Makefile.dep to the Makefile.dep where
dependant module resides
2020-10-05 18:27:58 +02:00
benpicco
df913bf9bf
Merge pull request #14906 from miri64/sock/cleanup/deps
sock: cleanup dependencies
2020-09-09 12:01:28 +02:00
Jannes
f3e934988c drivers/stm32_eth: add 'NETDEV_EVENT_LINK_UP' event 2020-08-31 20:50:47 +02:00
Martine S. Lenders
8386ec9fac
sock: make sock implementation dependency of sock API + stack
This is the logical continuation of [#12931] for _all_ `sock`
implementations.

[#12931]: https://github.com/RIOT-OS/RIOT/pull/12931
2020-08-31 15:17:22 +02:00
Leandro Lanzieri
84ed96c125
pkg/{lwip,ubasic}: use + in recursive make call 2020-08-26 19:12:14 +02:00
Benjamin Valentin
53eedc283b drivers/at86rf2xx: register driver with netdev 2020-08-17 22:53:51 +02:00
Marian Buschsieweke
00c44b0924
pkg/lwip: Use IS_ACTIVE() & NETCONNTYPE_ISIPV6()
This also fixes an issue detected by `tests/lwip_sock_udp` when both IPv4 and
IPv6 are enabled.
2020-07-31 13:27:09 +02:00
Marian Buschsieweke
5be2d082b9
pkg/lwip: Compatibility with IS_USED()
The `IS_USED()` macro doesn't work if macros are defined to `(1)` instead of `1`
2020-07-31 10:51:12 +02:00
Gunar Schorcht
b64ce62a8f pkg/lwip: fixes the netif handling for atwinc15x0
With PR #14349 the double stack mode for lwIP was activated. The ATWINC15x0 driver was provided before the changes in PR #14349 but merged after that. Therefore, the changes for the driver were not taken into account anymore and have to be applied accordingly.
2020-06-27 11:09:50 +02:00
Gunar Schorcht
f92d2acb0a pkg/lwip: support of ATWINC15x0 WiFi netdev 2020-06-26 12:33:38 +02:00
385ad95701
pkg: adapt 'simple' packages to the new organization 2020-06-26 09:25:43 +02:00
Martine S. Lenders
e80c473830
pkg/lwip: only use ip4_addr_t component of IP4_ADDR_ANY at bootstrap
IP4_ADDR_ANY is a generic address of type IPv4 when lwIP is compiled
with both IPv4 and IPv6, so we need to extract the `ip4_addr_t`
component when using with `netif_add()` as that is the expected type.
2020-06-25 12:45:37 +02:00
Martine S. Lenders
c0b7560dde
pkg/lwip: remove code duplication for IPv4-based netif initialization 2020-06-25 12:45:37 +02:00
Martine S. Lenders
035acc2e53
pkg/lwip: remove ipv6only clause for AF_INET6 sockets 2020-06-24 18:44:06 +02:00
2778e037fe
Merge pull request #14220 from aabadie/pr/pkg/lwip_nrf802154
pkg/lwip: add support for nrf802154
2020-06-16 11:13:33 +02:00
MichelRottleuthner
bd44f63557
Merge pull request #14150 from miri64/lwip/enh/netdev_tap_ipv4
lwip: add IPv4 support for `netdev_tap`
2020-06-09 14:30:02 +02:00
Martine S. Lenders
f5c4a05281
lwip: add IPv4 support for netdev_tap 2020-06-09 12:12:54 +02:00
b3620b35b8
pkg/lwip: add support for nrf802154 2020-06-07 21:24:14 +02:00
Martine Lenders
a38428b8f2
Merge pull request #13701 from miri64/lwip_sock/enh/recv_buf
lwip_sock: provide implementation for `sock_*_recv_buf()`
2020-05-26 21:33:09 +02:00
Martine S. Lenders
ef1d458089
lwip_sock: re-issue receive events if there are still received messages
... after `*_recv()` or `*_accept()` was called.

This prevents a client from needing to call `*_recv()` or `*_accept()`
in a loop.
2020-05-12 14:19:34 +02:00
Martine S. Lenders
77b89bb968
lwip_sock: provide implementation for sock_*_recv_buf() 2020-04-28 09:46:07 +02:00
Martine S. Lenders
29651da8f4
lwip_sock: update implementation for async callback argument 2020-03-11 16:54:12 +01:00
Martine S. Lenders
612e782b3c
sock_async: supply optional callback argument with callback setter 2020-03-11 16:54:11 +01:00
Martine S. Lenders
6e6e435c65
sock_async: add optional callback argument 2020-03-11 16:54:11 +01:00
Martine Lenders
a7ef50636e
lwip: activate TCP_LISTEN_BACKLOG per default with sock_tcp
Prevents unnecessary usage of resources, as the queue of `sock_tcp` is
restricted.
2020-03-06 11:29:46 +01:00
Martine Lenders
1a4e6e9cdb
lwip_sock_tcp: close accepted connection if queue is full 2020-03-06 11:29:45 +01:00
Martine S. Lenders
e98e2f6143
lwip: fix style errors found by Vera++ 2020-03-06 11:29:45 +01:00
Martine S. Lenders
fc67e6143a
lwip: provide sock_async support 2020-03-06 11:28:16 +01:00
Martine S. Lenders
20805548b3 lwip: introduce sock base-type 2020-02-21 19:07:47 +01:00
Benjamin Valentin
f295e6061a pkg/lwip: use GitHub mirror
git.savannah.nongnu.org seems to be rate-limiting us, so switch to
a mirror on GitHub.
2020-02-21 14:40:38 +01:00
Francisco Molina
afc43bf314
Makefile.dep: add auto_init_lwip MODULE 2020-02-12 16:51:29 +01:00
Giuseppe Tipaldi
c8426ce8f5 pkg/lwip: add auto-init support for transciever ENC28J60 2020-01-31 22:01:49 +01:00
Martine Lenders
87d00ab294
Merge pull request #12932 from miri64/lwip_sock/fix/sock-cleanup
lwip_sock: clean-up connection handling without a sock.
2020-01-09 15:00:55 +01:00
Gaëtan Harter
ca5d13cc2a pkg/*: adapt to new state file targets
Prepare for handling pkg state with files. So it requires having the
path defined before declaring targets. In addition, it cleans up the
old git-download target.
2020-01-08 20:55:19 +01:00