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

358 Commits

Author SHA1 Message Date
Benjamin Valentin
d8918c24fa socket_zep: register with netdev 2021-01-25 22:59:01 +01:00
Fabian Hüßler
7d618afa17 nrf24l01p_ng: make use of netdev_register() 2021-01-24 20:49:39 +01:00
fabian18
f7a77ebb04 drivers/nrf24l01p_ng: netdev driver for nrf24l01+
The driver uses the netdev interface. Due to the limited
capabilities of the transceiver (32 byte FIFO and no source address in the layer2 frame),
it relies on 6LowPAN compression and adds the source address to the frame for that.
2021-01-24 20:49:39 +01:00
Martine Lenders
640ff4f5d8
Merge pull request #15609 from maribu/ethernet-rx-timestamp
sys/net/gnrc/netif/ethernet: Support RX timestamp
2021-01-07 19:53:52 +01:00
Marian Buschsieweke
f6bca70d11
sys/net/gnrc/netif/ethernet: Support RX timestamp 2021-01-06 20:30:14 +01:00
Martine S. Lenders
1cd1716280
gnrc_sixlowpan_frag: initial import of Selective Fragment Recovery 2020-12-14 13:00:36 +01:00
dylad
5b7961b747 sys/net: add sam0 eth auto init 2020-12-13 22:01:50 +01:00
benpicco
1477a340fe
Merge pull request #15150 from fabian18/ieee802154_security
Initial implementation of IEEE 802.15.4 security
2020-12-09 14:14:27 +01:00
Benjamin Valentin
518c95e0ee gnrc_netif_ieee802154_create: use byteorder_htols() 2020-12-08 16:31:20 +01:00
Fabian Hüßler
7b5391b7ce sys/net/gnrc/netif/init_devs: IEEE802154_STACKSIZE_DEFAULT 2020-12-04 09:40:55 +01:00
Fabian Hüßler
dc16c14b3d sys: Add IEEE 802.15.4 security 2020-12-04 09:40:55 +01:00
benpicco
665c07eb53
Merge pull request #15120 from benpicco/driver/at86rf215-trim
driver/at86rf215: add functions to configure trim & clock output at run-time
2020-12-02 16:53:02 +01:00
Benjamin Valentin
b866b5ef2b sys/net/gnrc/netif: add gnrc_netif_get_netdev()
Add a function to retrieve a netdev from the list of interfaces.
2020-12-02 14:59:17 +01:00
Fabian Hüßler
c526a34770 sx127x: make use of netdev_register()
Call netdev_register() in sx127x_setup()
and pass the index in auto_init_sx127x()
and semtech_loramac_init()
2020-12-01 16:34:11 +01:00
Fabian Hüßler
39adf908ce cc110x: make use of netdev_register()
Call netdev_register() in cc110x_setup()
and pass the index in auto_init_cc110x()
2020-12-01 12:11:20 +01:00
c1874c8d89 all: add missing limits.h includes
Removal of kernel_types.h make these necessary.
2020-11-25 17:52:34 +01:00
Jose Alamos
dfb214ab98 gnrc_netif: add missing pktbuf release 2020-11-19 11:13:58 +01:00
Jose Alamos
53348e3a8c gnrc_netif: add missing netdev events 2020-11-12 16:12:22 +01:00
Bas Stottelaar
922e2ac1c9 sys/*: replace #if ENABLE_DEBUG with IS_ACTIVE 2020-11-02 21:49:39 +01:00
benpicco
e77d12da26
Merge pull request #15188 from benpicco/drivers/kw41zrf-register
drivers/kw41zrf: register with netdev
2020-10-31 14:30:00 +01:00
benpicco
9e4dd8e451
Merge pull request #15287 from miri64/ethernet/enh/join-leave-mcast-group
gnrc_netif: add capability to join or leave link layer multicast groups
2020-10-29 16:03:32 +01:00
Martine Lenders
ad3c8ba5a4
gnrc_netif_ethernet: use new helper function to generate MC address 2020-10-29 14:38:52 +01:00
Martine Lenders
d8c78a9910
gnrc_netif: add capability to join or leave link-layer multicast groups
The request is forwarded to the device.
2020-10-29 14:38:51 +01:00
68d3f2ee6c
sys/net: remove nordic softdevice specific handling 2020-10-29 09:02:12 +01:00
José Alamos
60b5a6b35e
Merge pull request #15268 from benpicco/gnrc_netif_ieee802154_create-const
drivers/at86rf215: give driver threads different names
2020-10-23 17:14:19 +02:00
Bas Stottelaar
1b35d06a51 sys/*: realign ENABLE_DEBUG 2020-10-23 11:27:48 +02:00
Bas Stottelaar
80d9da90df sys/*: add missing include of assert.h 2020-10-22 11:13:09 +02:00
Benjamin Valentin
eb3daf4c22 drivers/at86rf215: give driver threads different names
Use different names for the sub-GHz and 2.4 GHz driver thread to make
it easier to tell which is which.

```
2020-10-21 19:53:50,608 # 	pid | name                 | state    Q | pri | stack  ( used) ( free) | base addr  | current
2020-10-21 19:53:50,622 # 	  - | isr_stack            | -        - |   - |    512 (  232) (  280) | 0x20000000 | 0x200001c8
2020-10-21 19:53:50,623 # 	  1 | main                 | running  Q |   7 |   1536 (  660) (  876) | 0x200002f8 | 0x2000075c
2020-10-21 19:53:50,639 # 	  2 | pktdump              | bl rx    _ |   6 |   1536 (  236) ( 1300) | 0x200035a8 | 0x20003abc
2020-10-21 19:53:50,653 # 	  3 | 6lo                  | bl rx    _ |   3 |   1024 (  332) (  692) | 0x2000420c | 0x2000450c
2020-10-21 19:53:50,655 # 	  4 | ipv6                 | bl rx    _ |   4 |   1024 (  376) (  648) | 0x200009d4 | 0x20000cd4
2020-10-21 19:53:50,670 # 	  5 | udp                  | bl rx    _ |   5 |   1024 (  252) (  772) | 0x200049f0 | 0x20004cf4
2020-10-21 19:53:50,672 # 	  6 | at86rf215 [sub GHz]  | bl rx    _ |   2 |   1024 (  536) (  488) | 0x20001200 | 0x200014c4
2020-10-21 19:53:50,687 # 	  7 | at86rf215 [2.4 GHz]  | bl rx    _ |   2 |   1024 (  536) (  488) | 0x20001600 | 0x200018c4
2020-10-21 19:53:50,689 # 	    | SUM                  |            |     |   8704 ( 3160) ( 5544)
```
2020-10-21 19:59:42 +02:00
Benjamin Valentin
671c882d4f gnrc_netif_ieee802154_create: make name argument const
`gnrc_netif_create()` already expects a `const` name parameter,
also make the name parameter in `gnrc_netif_ieee802154_create()` const.
2020-10-21 19:49:34 +02:00
János Brodbeck
5a75eb29c3
net/netif/gnrc_netif: allow larger IPv6 MTU than minimum for BLE 2020-10-20 14:20:51 +02:00
Jose Alamos
46600adf22 nrf802154: unify auto_init for HAL and netdev 2020-10-19 15:18:35 +02:00
Jose Alamos
c1a9d352f3 cc2538_rf: unify auto_init for HAL and netdev 2020-10-19 15:18:34 +02:00
Marian Buschsieweke
c38ca6d718
Merge pull request #15212 from miri64/gnrc_pkt/enh/pkt-list-ops
gnrc_pkt: introduce packet list operations
2020-10-15 12:13:03 +02:00
Francisco Acosta
05b089b3c4 gnrc_netif: remove unused event_netdev_t struct 2020-10-14 14:46:35 +02:00
Martine Lenders
45144fb4a4
treewide: use new gnrc_pkt API functions instead of utlist.h macros 2020-10-13 13:32:53 +02:00
Sören Tempel
af03cd8f4f gnrc_netif: add missing gnrc_netif_release() to early return
The gnrc_netif_ipv6_addr_add_internal() function unconditionally
acquires the global netif rmutex lock but doesn't release this lock on
this specific path (i.e. if gnrc_netif_ipv6_group_join_internal failed).
This can cause a deadlock as no other thread will afterwards be capable
of acquiring the netif lock.
2020-10-13 04:42:52 +02:00
benpicco
3384c327a7
Merge pull request #15194 from miri64/gnrc_netif_raw/fix/netif-hdr
gnrc_netif_raw: add NETIF header on receive
2020-10-09 14:35:54 +02:00
Martine Lenders
6991ad5910
gnrc_netif_raw: add NETIF header on receive
... to give upper layer a hint on the interface the packet came from.
2020-10-09 11:51:18 +02:00
Benjamin Valentin
b32bc3dbd1 drivers/kw41zrf: register with netdev 2020-10-08 16:19:23 +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
Leandro Lanzieri
e1418e0972
Merge pull request #14065 from jia200x/pr/improve_gnrc_lorawan
gnrc_lorawan: refactor
2020-10-05 15:56:00 +02:00
Jose Alamos
9ebc3f8bd8 auto_init/nrf52840: add support for SubMAC 2020-10-01 10:55:55 +02:00
Jose Alamos
1de5b34adf auto_init/cc2538_rf: add support for SubMAC 2020-10-01 10:55:55 +02:00
Jose Alamos
fda73fdf0a gnrc_lorawan: uncrustify files 2020-09-30 14:18:54 +02:00
Jose Alamos
71bda3bcd8 gnrc_lorawan: remove GNRC specific dependencies 2020-09-30 14:18:54 +02:00
Jose Alamos
2e6ba90435 gnrc_lorawan: refactor rx_done callback 2020-09-30 14:18:54 +02:00
Jose Alamos
5146261f03 gnrc_lorawan: rename radio event functions 2020-09-30 14:18:54 +02:00
Marian Buschsieweke
8a5d301caa
sys/net/gnrc/netif: Fix compilation on waspmote-pro
xtimer.h must not be included, when the xtimer module is not use. Otherwise
compilation on the waspmote-pro with https://github.com/RIOT-OS/RIOT/pull/14799
will not longer work. gnrc_netif_pktq includes xtimer.h and uses xtimer, but
gnrc_netif includes gnrc_netif_pktq.h regardless of whether gnrc_netif_pktq
is used. This makes sure that gnrc_netif_pktq.h is only included when actually
used.
2020-09-22 11:51:09 +02:00
Marian Buschsieweke
1d1b446d6b
sys/net/gnrc/netif: use IS_USED macro 2020-09-22 11:50:18 +02:00
Marian Buschsieweke
0cb274c1eb
sys/net/gnrc: Fix include of xtimer.h
Make sure xtimer.h is only included if the xtimer module is actually used, as
otherwise compilation for the waspmote-pro fails.
2020-09-16 19:55:43 +02:00
Francisco
cb6b65e7ff
Merge pull request #14886 from miri64/gnrc/fix/circ-deps
gnrc: remove circular module dependencies
2020-09-09 09:06:28 +02:00
Martine S. Lenders
0e3443d006
gnrc_netif: guard usage of gnrc_ipv6 member 2020-09-08 12:53:29 +02:00
Martine Lenders
a72d0ef3e8
gnrc_netif: add packet to queue when device is busy
... and also send on send error (i.e. when *medium* was busy)
2020-09-02 12:30:23 +02:00
Martine Lenders
7c7f667108
gnrc_netif: add a send queue 2020-09-02 12:30:22 +02:00
Leandro Lanzieri
d25fc243c4
treewide: change prefix for generated Kconfig symbols.
This changes the prefixes of the symbols generated from USEMODULE and
USEPKG variables. The changes are as follow:

   KCONFIG_MODULE_ => KCONFIG_USEMODULE_
   KCONFIG_PKG_ => KCONFIG_USEPKG_
   MODULE_ => USEMODULE_
   PKG_ => USEPKG_
2020-08-31 09:37:09 +02:00
benpicco
9f2475dc14
Merge pull request #14832 from maribu/sys-cleanup
sys: Cleanup access to internal variables
2020-08-26 17:07:19 +02:00
benpicco
2eb6d752df
Merge pull request #14770 from benpicco/netif_addr_to_str
net/netif: move gnrc_netif_addr_to/from_str() to netif
2020-08-25 18:52:55 +02:00
Marian Buschsieweke
3b6fa61829
sys: Cleanup access to internal variables
Replace direct accesses to sched_active_thread and sched_active_pid with
the helper functions thread_getpid() and thread_get_active(). This serves
two purposes:

1. It makes accidental writes to those variable from outside core less likely.
2. Casting off the volatile qualifier is now well contained to those two
   functions
2020-08-24 20:28:11 +02:00
Benjamin Valentin
decadc41a0 drivers/dose: register driver with netdev 2020-08-17 22:53:51 +02:00
Benjamin Valentin
4f19b54b7b drivers/at86rf215: register driver with netdev 2020-08-17 22:53:51 +02:00
Benjamin Valentin
53eedc283b drivers/at86rf2xx: register driver with netdev 2020-08-17 22:53:51 +02:00
Benjamin Valentin
39951a948e net/netif: move gnrc_netif_addr_to/from_str() to netif
These functions are independent from GNRC and can be used by stack-agnistoc
code.
Avoid pulling in a GNRC dependency by moving those two helper functions to
`netif`.

The old function names are kept as `static inline` wrapper functions to avoid
breaking API users.
2020-08-16 23:52:32 +02:00
Jose Alamos
96ee1d2bf8 net/gnrc_netif_lorawan: fix unaligned copy 2020-07-13 16:57:26 +02:00
Gunar Schorcht
b51ac69d0a sys/net/gnrc: add netif support for ATWINC15x0 netdef driver 2020-06-26 12:33:38 +02:00
Martine Lenders
09d097c934
Merge pull request #14214 from btcven/2020_06_06-6lo-mtu
net/gnrc/netif: add option for non-std 6lo MTU
2020-06-18 15:25:01 +02:00
Jean Pierre Dudey
e1ef082d49
net/gnrc/netif: disable 6lo fragmentation when unneeded
Signed-off-by: Jean Pierre Dudey <jeandudey@hotmail.com>
2020-06-18 07:16:16 -05:00
Jean Pierre Dudey
d47f4a1caa
net/gnrc/netif: add option for non-std 6lo MTU
Signed-off-by: Jean Pierre Dudey <jeandudey@hotmail.com>
2020-06-18 07:16:16 -05:00
Leandro Lanzieri
05962fe3ef
gnrc/netif: Configure queue size with exponent
This changes the configuration macro to be the exponent of 2^n, as the
message queue size needs to be always power of 2.
2020-06-15 07:30:52 +02:00
Martine Lenders
f9bed00701
Merge pull request #12738 from miri64/netif/enh/id-functions
netif: add functions to get and get by identifier
2020-06-09 15:12:06 +02:00
821eb5bc76
sys/net/auto_init: remove useless preprocessor directives
The files are now built only when the corresponding module is used
2020-06-08 11:10:39 +02:00
29c5c54fe2
sys/net/auto_init: only build files when related module is used 2020-06-08 11:10:22 +02:00
3fe35e755c
sys/net/auto_init: rename cdcecm source file
Use a name that corresponds to the related module name
2020-06-08 10:27:35 +02:00
Jean Pierre Dudey
60385d2c24
net/gnrc/netif: limit 6lo frag size
The 6Lo network interfaces can only support a max_frag_size of
SIXLOWPAN_FRAG_MAX_LEN (2047 bytes) as the length field is only 11-bits.

This limits the max_frag_size in the case that the L2-PDU is higher than
that.

Signed-off-by: Jean Pierre Dudey <jeandudey@hotmail.com>
2020-06-07 15:43:33 -05:00
Benjamin Valentin
840be824d4 gnrc_netif: relax 6lo MTU assertion for 802.15.4g
802.15.4g devices have a 2047 byte PDU.
So the assertion `netif->ipv6.mtu == IPV6_MIN_MTU` is too strict here.

This is only enforced on init, so changing the modulation at run-time
did not catch this bug.

To test, use e.g. `at86rf215` with

    CFLAGS += -DAT86RF215_DEFAULT_PHY_MODE=IEEE802154_PHY_MR_OQPSK

fixes #14164
2020-05-29 15:59:23 +02:00
Benjamin Valentin
3974a04623 gnrc/nib: add NIB event bus
Add a message bus where threads can listen for nib events.

Currently only the GNRC_IPV6_NIB_EVENT_ADDR_VALID event is
implemented which informs subscribers that an address got
valid.
2020-05-20 10:44:11 +02:00
Benjamin Valentin
85100ad61a gnrc_netif: add message bus to interface
Allow threads to listen for events on an interface.
2020-05-20 10:44:11 +02:00
Leandro Lanzieri
16113afb1e
Merge pull request #14026 from miri64/gnrc_netif/fix/deps
gnrc_netif: use gnrc_netif-submodules to pull in upper-layer struct members
2020-05-19 16:36:18 +02:00
Martine S. Lenders
a48629b395
gnrc_netif: introduce gnrc_netif_ipv6 pseudo-module for IPv6 members
This aims to reduce circular dependencies in GNRC.
2020-05-19 16:10:59 +02:00
Martine S. Lenders
9801a439fc
gnrc_netif: introduce gnrc_netif_6lo pseudo-module for 6LoWPAN members
This aims to reduce circular dependencies in GNRC.
2020-05-19 16:10:59 +02:00
Martine S. Lenders
0d2f0a5ba4
gnrc_netif: fix gnrc_netif_lorawan dependencies 2020-05-19 16:10:58 +02:00
José Alamos
089e0a2b44
Merge pull request #14048 from jue89/fix/gnrc_lorawan_abp
net/gnrc/netif/lorawan: fix ABP device activation
2020-05-11 11:34:59 +02:00
Juergen Fitschen
1eb3b596c4 net/gnrc/netif/lorawan: fixed ABP device activation 2020-05-09 20:16:29 +02:00
Juergen Fitschen
255c76ff35 net/gnrc/netif/lorawan: fixed deprecated NETOPT_LINK_CONNECTED 2020-05-09 20:11:16 +02:00
Benjamin Valentin
18651eb399 gnrc_netif: Use full L2-PDU as IPv6 MTU
If the L2-PDU is greater than IPV6_MIN_MTU, use that as the MTU instead.
2020-04-29 12:49:36 +02:00
Francisco
80b300289d
Merge pull request #13912 from benpicco/at86rf215-mr-qpsk
drivers/at86rf215: implement MR-O-QPSK
2020-04-29 12:44:00 +02:00
Benjamin Valentin
504d02038d gnrc_netif: update PDU after changing PHY mode 2020-04-29 10:41:37 +02:00
Martine Lenders
652276f00f
gnrc_netif: provide PID-based version for netif ID 2020-04-17 16:59:21 +02:00
Joakim Nohlgård
2013ac75f5
gnrc_netif: Add support for internal event loop
Enabled by the gnrc_netif_events pseudo module. Using an internal event
loop within the gnrc_netif thread eliminates the risk of lost interrupts
and lets ISR events always be handled before any send/receive requests
from other threads are processed.
The events in the event loop is also a potential hook for MAC layers and
other link layer modules which may need to inject and process events
before any external IPC messages are handled.

Co-Authored-By: Koen Zandberg <koen@bergzand.net>
2020-04-17 12:02:39 +02:00
Leandro Lanzieri
184bbd32e5
gnrc/netif: Fix lines lengths 2020-03-31 19:02:54 +02:00
Leandro Lanzieri
e52b93cef0
gnrc/nib: Move GNRC_IPV6_NIB_CONF_ARSM to 'CONFIG_' namespace
Also evaluate it using IS_ACTIVE macro.
2020-03-31 18:07:07 +02:00
Leandro Lanzieri
ce931f179c
gnrc/nib: Move GNRC_IPV6_NIB_CONF_SLAAC to 'CONFIG_' namespace
Also evaluate it using IS_ACTIVE macro.
2020-03-31 18:07:05 +02:00
Leandro Lanzieri
49ec28867c
gnrc/nib: Move GNRC_IPV6_NIB_CONF_ROUTER to 'CONFIG_' namespace
Also evaluate it using IS_ACTIVE macro.
2020-03-31 18:07:05 +02:00
Leandro Lanzieri
1acfe7ae19
gnrc/nib: Move GNRC_IPV6_NIB_CONF_6LN to 'CONFIG_' namespace
Also evaluate it using IS_ACTIVE macro.
2020-03-31 18:07:04 +02:00
Jose Alamos
44f7cb712c gnrc_netif: add GNRC_NETIF_SINGLE macro 2020-03-26 14:19:02 +01:00
Jose Alamos
e451570219 gnrc_netif: remove GNRC_NETIF_NUMOF macro 2020-03-26 11:12:23 +01:00
Jose Alamos
67ed9defbe gnrc_netif_xxx_create: use external netif allocation 2020-03-26 11:12:23 +01:00
Francisco
cdbf0b2d69
Merge pull request #13583 from benpicco/at86rf215-minimal
drivers/at86rf215: add basic support for AT86RF215 dual-band radio
2020-03-20 09:33:50 +01:00
benpicco
5435792034
Merge pull request #12277 from benemorius/pr/kw41zrf
drivers: add kw41zrf
2020-03-20 00:49:56 +01:00
Joakim Nohlgård
5bd67d88a8 drivers/kw41zrf: Transceiver driver for the KW41Z radio
This is the radio found in NXP Kinetis KW41Z, KW21Z. Only 802.15.4 mode
is implemented (KW41Z also supports BLE on the same transceiver).

The driver uses vendor supplied initialization code for the low level
XCVR hardware, these files were imported from KSDK 2.2.0 (framework_5.3.5)
2020-03-19 17:00:04 -05:00
Benjamin Valentin
d35511bee7 drivers/at86rf215: Add basic driver for the AT86RF215 radio
This adds a driver for the SPI based AT86RF215 transceiver.
The chip supports the IEEE Std 802.15.4-2015 and IEEE Std 802.15.4g-2012 standard.

This driver supports two versions of the chip:
    - AT86RF215:  dual sub-GHz & 2.4 GHz radio & baseband
    - AT86RF215M: sub-GHz radio & baseband only

Both radios support the following PHY modes:
    - MR-FSK
    - MR-OFDM
    - MR-O-QPKS
    - O-QPSK (legacy)

The driver currently only implements support for legacy O-QPSK.

To use both interfaces, add

    GNRC_NETIF_NUMOF := 2

to your Makefile.

The transceiver is able to send frames of up to 2047 bytes according to
IEEE 802.15.4g-2012 when operating in non-legacy mode.

Known issues:

 - [ ] dBm setting values are bogus
 - [ ] Channel spacing for sub-GHz MR-O-QPSK might be wrong
 - [ ] TX/RX stress test will lock up the driver on openmote-b
2020-03-19 14:39:18 +01:00
Jose Alamos
4393822b0f gnrc_netif: add function to check if device requires 6Lo 2020-03-17 10:54:30 +01:00
Jose Alamos
6ace7b5472 gnrc_netif: use gnrc_netif_single where possible 2020-03-17 10:54:30 +01:00
benpicco
7af046d740
Merge pull request #13548 from benpicco/sys/auto_init/netif-manual
sys/auto_init: allow delayed initialisation of SAUL & gnrc_netif
2020-03-05 17:05:02 +01:00
Benjamin Valentin
4f7d5b105b sys/net/gnrc: Flag esp_now as 6LN
In gnrc_netif_init_6ln() the flag GNRC_NETIF_FLAGS_6LN is accidentally not set
for esp_now devices. This commit fixes this.
2020-03-05 15:18:43 +01:00
Benjamin Valentin
d765098d72 sys/auto_init: allow delayed initialisation of gnrc_netif
Co-authored-by: Martine S. Lenders <m.lenders@fu-berlin.de>
2020-03-04 16:13:40 +01:00
Sebastian Meiling
a4c4c25b3b
Merge pull request #12866 from jia200x/pr/gnrc_lorawan_remove_netdev
net/gnrc_lorawan: remove netdev layer from MAC
2020-01-30 14:02:59 +01:00
Jose Alamos
cc2fd97194 net/gnrc_lorawan: remove netdev abstraction from MAC layer 2020-01-27 10:10:24 +01:00
Francisco
1d206bca24
Merge pull request #12409 from miri64/gnrc_netif/fix/highest-source-scope-wins
gnrc_netif: highest source address scope wins selection
2020-01-14 10:43:24 +01:00
Martine S. Lenders
018e3dd437
gnrc_netif: use scope directly from address for multicast 2020-01-14 09:54:18 +01:00
Martine S. Lenders
85737a0436
gnrc_netif: remove misleading comment
The comment exists since the introduction of the [original
implementation], but its meaning is unclear and misleading, as the code
doesn't do anything with link-local.

[original implementation]: https://github.com/RIOT-OS/RIOT/pull/3561
2020-01-14 09:54:18 +01:00
Martine S. Lenders
46fd632e91
gnrc_netif: highest source address scope wins selection
Rule 2 of the source address algorithm outlined in [RFC6724] states the
possible source addresses must also be compared among each other:

>     Rule 2: Prefer appropriate scope.
>     If Scope(SA) < Scope(SB): If Scope(SA) < Scope(D), then prefer SB and
>     otherwise prefer SA.  Similarly, if Scope(SB) < Scope(SA): If
>     Scope(SB) < Scope(D), then prefer SA and otherwise prefer SB.

Our current implementation doesn't do that. It just checks if the scope
of a possible source is lesser than the scope of the destination
(which involves the second "If" in the rule).

This fix grants points according to the scope of an address. If the
scope matches, they get the highest points, ensuring that the selected
source will always be reachable from the destination.

[RFC6724]: https://tools.ietf.org/html/rfc6724
2020-01-14 09:54:17 +01:00
PeterKietzmann
fb71ccc098 net/gnrc/netif:GNRC_NETIF_MIN_WAIT_AFTER_SEND_US to 'CONFIG_' namespace 2020-01-13 12:28:37 +01:00
PeterKietzmann
9e83d12bc0 net/gnrc/netif: Move GNRC_NETIF_IPV6_ADDRS_NUMOF to 'CONFIG_' namespace 2020-01-13 12:28:37 +01:00
PeterKietzmann
724d58b074 net/gnrc/netif: Move GNRC_NETIF_MSG_QUEUE_SIZE to 'CONFIG_' namespace 2020-01-13 12:28:37 +01:00
PeterKietzmann
b28a586702 net/gnrc/netif: Move GNRC_NETIF_DEFAULT_HL to 'CONFIG_' namespace 2020-01-13 12:28:37 +01:00
PeterKietzmann
c654d1fc8b Kconfig: Expose gnrc/netif configurations 2020-01-13 12:28:31 +01:00
Francisco
dcc5299682
Merge pull request #10667 from miri64/gnrc_sixloenc/enh/6lo-config
gnrc_netif: make 6LoENC dynamically configurable
2020-01-06 13:19:24 +01:00
Jose Alamos
8999528390 net/gnrc_lorawan: add MIB for setting RX2 datarate 2019-12-03 14:48:29 +01:00
Jose Alamos
1e9bb7c175 net/gnrc_lorawan: add MIB for setting L2 address 2019-12-03 14:27:56 +01:00
Jose Alamos
99dbcecc3a net/gnrc_lorawan: remove netdev SAP interface 2019-12-03 14:08:35 +01:00
Leandro Lanzieri
8aa66e94ea net/gnrc/netif: Remove 'if' prefix from interface names 2019-11-29 10:22:00 +01:00
MichelRottleuthner
bf676d4728
Merge pull request #11022 from jia200x/pr/gnrc_lorawan
gnrc_lorawan: add support for GNRC based LoRaWAN stack
2019-11-27 09:25:20 +01:00
Jose Alamos
2edaead13e gnrc_netif: add gnrc_lorawan adaption layer 2019-11-26 21:52:06 +01:00
Marian Buschsieweke
bd8c4b36aa
sys/net/gnrc: Flag cc110x as 6LN
In gnrc_netif_init_6ln() the flag GNRC_NETIF_FLAGS_6LN is accidentally not set
for cc110x devices. This commit fixes this.
2019-11-11 09:24:01 +01:00
Martine Lenders
6493a9e69f gnrc_netif: assume netif->ops->init() to be set 2019-11-07 11:00:36 +01:00
Martine Lenders
14a2f6bc18 gnrc: use gnrc_netif_default_init() for all implementations 2019-11-07 11:00:36 +01:00
Martine Lenders
09b5db28f1 gnrc_netif: expose common init function as default 2019-11-06 18:45:16 +01:00
Martine Lenders
4b82a56c89 gnrc_netif: introduce common init function 2019-11-06 18:45:15 +01:00
Martine Lenders
5d11cf26f0 gnrc_netif: use 6LoENC only when 6Lo flag is set 2019-10-30 17:10:34 +01:00
Martine Lenders
e04a190511 gnrc_netif_ethernet: make 6LO configurable for 6LoEnc 2019-10-30 17:10:34 +01:00
Francisco
0364c39694
Merge pull request #12408 from miri64/gnrc_netif/fix/src-addr-selection
gnrc_netif: only use prefix matching as tie-breaker in source selection
2019-10-24 17:14:17 +02:00
Martine S. Lenders
e9d75f5655 gnrc_netif: remove filter parameter from _match_to_idx()
`_match_to_idx()` was removed from source address selection (which was
the only one setting the filter parameter to a non-NULL value), so it
is the parameter is not needed anymore.
2019-10-24 16:04:41 +02:00
Martine S. Lenders
e787f6b60d gnrc_netif: only use prefix matching as tie-breaker in source selection
When source address selection is done, both RFC and comments in the code
state, that a longest prefix match should *only* be used as a
tie-breaker between more than one viable candidate. If there is only one
address, there is

a) no need for a tie-breaker
b) in the case of either the destination address or the single remaining
   address being ULAs ([which are considered to be of global scope]
   [RFC4193]) possibly not matching, as `fd00::/7` and e.g. `2001::/8`
   do not have a common prefix.

(b) in fact causes the match function to return -1, causing the source
address selection to return -1, causing the outer function to return the
first address it found (which most often is the link-local address),
causing e.g. a ping to an ULA to fail, even is there is a global
address.

[RFC4193]: https://tools.ietf.org/html/rfc4193
2019-10-24 16:04:41 +02:00
Martine Lenders
88090bc0f6 gnrc_netif: warn when not joining solicited-nodes from non-6LN netif
Similar as with #12513, when the NIB is compiled in 6LN mode (but not
6LR mode), the address-resolution state-machine (ARSM) functionality is
disabled in favor of the more simpler address resolution proposed in RFC
6775.

However, if a non-6LN interface is also compiled in (without making it
a router or border router) it will never join the solicited-nodes
multicast address of addresses added to it, resulting in address
resolution to that interface to fail.

If the interface is not a 6LN (which in case 6LN mode is disabled is
always false), a warning is now printed, encouraging the user to
activate the ARSM functionality if needed.
2019-10-22 22:14:03 +02:00
Martine S. Lenders
2458a612b6 gnrc_netif: reduce code duplication 2019-10-21 16:09:37 +02:00
Martine S. Lenders
e96faca739 gnrc_netif: add code comments on source candidate set selection 2019-10-21 16:09:37 +02:00
f8de22a985 gnrc/netif: _match_to_idx(): don't treat link local differently
Cherry-picked from 811c1ee70e (#12404)
2019-10-21 16:09:37 +02:00
Martine Lenders
6ad62b01a4 gnrc_netif: distinct is_6lo() and is_6ln()
The functions now are semantic distinct:

- gnrc_netif_is_6lo(): the interface is a 6Lo interface
- gnrc_netif_is_6ln(): the interface is using Neighbor Discovery
  according to RFC 6775
2019-10-20 15:38:14 +02:00
Martine Lenders
363afa62ee gnrc_netif: introduce 6LN flag
This makes it dynamically configurable if an interface actually want's
to use 6Lo ND (according to RFC 6775) or not.
2019-10-20 15:38:13 +02:00
Martine Lenders
8bcce5615e gnrc_netif: use is_6lo() instead of is_6ln() 2019-10-20 15:38:13 +02:00
Jose Alamos
8fd0c2b60f gnrc_netif: adapt to new netif_t abstraction 2019-10-11 10:59:14 +02:00
Martine S. Lenders
ada7c0b7db gnrc_netif: avoid deprecated addresses, don't prefer them! 2019-10-09 15:18:14 +02:00
Martine S. Lenders
1ca05f0c08 gnrc_netif_ethernet: fix debug output for received packet
A received packet is outputted in DEBUG _after_ it was already parsed,
but with a reference to the already parsed header. The result is that
there can be some garbage in the output and the packet is not dumped in
total. As without parsing we do not have access to the header yet, we
use the `gnrc_netif_addr_to_str()` helper function instead of parsing
the destination address by hand.
2019-09-16 14:01:16 +02:00
Hauke Petersen
504acc5097 net/l2util: add nimble opt for addr resolution 2019-08-28 16:48:03 +02:00
Francisco
fde50372c3
Merge pull request #11837 from miri64/gnrc_netif/enh/inter-tx-wait
gnrc_netif: allow for wait of minimum time between sends
2019-08-09 10:53:26 +02:00
Martine Lenders
488c47cbf3 gnrc_netif: allow for wait of minimum time between sends 2019-08-09 10:21:42 +02:00
Martine S. Lenders
4a38dabc70 gnrc_netif_ieee802154: use gnrc_netif_hdr_set_netif() 2019-07-25 14:56:47 +02:00
Martine S. Lenders
006f10c2af gnrc_netif_ethernet: use gnrc_netif_hdr_set_netif() 2019-07-25 14:15:37 +02:00
Martine Lenders
3c19aa7dfc gnrc_netif_ieee802154: check if mhr_len is lesser than nread 2019-04-15 16:36:31 +02:00