Merge pull request #10665 from miri64/gnrc_sixloenc/feat/initial
gnrc_sixloenc: introduce pseudo-module to send 6Lo frames over Ethernet
This commit is contained in:
commit
aa2de01b56
@ -154,7 +154,7 @@ ifneq (,$(filter gnrc_netif,$(USEMODULE)))
|
||||
endif
|
||||
endif
|
||||
|
||||
ifneq (,$(filter ieee802154 nrfmin esp_now,$(USEMODULE)))
|
||||
ifneq (,$(filter ieee802154 nrfmin esp_now gnrc_sixloenc,$(USEMODULE)))
|
||||
ifneq (,$(filter gnrc_ipv6, $(USEMODULE)))
|
||||
USEMODULE += gnrc_sixlowpan
|
||||
endif
|
||||
|
||||
@ -25,6 +25,7 @@ PSEUDOMODULES += gnrc_neterr
|
||||
PSEUDOMODULES += gnrc_netapi_callbacks
|
||||
PSEUDOMODULES += gnrc_netapi_mbox
|
||||
PSEUDOMODULES += gnrc_pktbuf_cmd
|
||||
PSEUDOMODULES += gnrc_sixloenc
|
||||
PSEUDOMODULES += gnrc_sixlowpan_border_router_default
|
||||
PSEUDOMODULES += gnrc_sixlowpan_default
|
||||
PSEUDOMODULES += gnrc_sixlowpan_iphc_nhc
|
||||
|
||||
@ -37,6 +37,7 @@ extern "C" {
|
||||
#define ETHERTYPE_CCNX (0x0801) /**< Parc CCNX */
|
||||
#define ETHERTYPE_NDN (0x8624) /**< NDN Protocol (http://named-data.net/) */
|
||||
#define ETHERTYPE_IPV6 (0x86dd) /**< Internet protocol version 6 */
|
||||
#define ETHERTYPE_6LOENC (0xa0ed) /**< 6LoWPAN encapsulation */
|
||||
#define ETHERTYPE_UNKNOWN (0xffff) /**< Reserved (no protocol specified) */
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
@ -158,6 +158,10 @@ static inline gnrc_nettype_t gnrc_nettype_from_ethertype(uint16_t type)
|
||||
#elif defined(MODULE_NDN_RIOT)
|
||||
return GNRC_NETTYPE_NDN;
|
||||
#endif
|
||||
#endif
|
||||
#ifdef MODULE_GNRC_SIXLOENC
|
||||
case ETHERTYPE_6LOENC:
|
||||
return GNRC_NETTYPE_SIXLOWPAN;
|
||||
#endif
|
||||
default:
|
||||
return GNRC_NETTYPE_UNDEF;
|
||||
@ -178,6 +182,10 @@ static inline gnrc_nettype_t gnrc_nettype_from_ethertype(uint16_t type)
|
||||
static inline uint16_t gnrc_nettype_to_ethertype(gnrc_nettype_t type)
|
||||
{
|
||||
switch (type) {
|
||||
#ifdef MODULE_GNRC_SIXLOENC
|
||||
case GNRC_NETTYPE_SIXLOWPAN:
|
||||
return ETHERTYPE_6LOENC;
|
||||
#endif
|
||||
#ifdef MODULE_GNRC_IPV6
|
||||
case GNRC_NETTYPE_IPV6:
|
||||
return ETHERTYPE_IPV6;
|
||||
|
||||
@ -1114,6 +1114,9 @@ static ipv6_addr_t *_src_addr_selection(gnrc_netif_t *netif,
|
||||
bool gnrc_netif_is_6ln(const gnrc_netif_t *netif)
|
||||
{
|
||||
switch (netif->device_type) {
|
||||
#ifdef MODULE_GNRC_SIXLOENC
|
||||
case NETDEV_TYPE_ETHERNET:
|
||||
#endif
|
||||
case NETDEV_TYPE_IEEE802154:
|
||||
case NETDEV_TYPE_CC110X:
|
||||
case NETDEV_TYPE_BLE:
|
||||
@ -1177,7 +1180,9 @@ static void _init_from_device(gnrc_netif_t *netif)
|
||||
assert(res == sizeof(tmp));
|
||||
netif->device_type = (uint8_t)tmp;
|
||||
switch (netif->device_type) {
|
||||
#if defined(MODULE_NETDEV_IEEE802154) || defined(MODULE_NRFMIN) || defined(MODULE_XBEE) || defined(MODULE_ESP_NOW)
|
||||
#if defined(MODULE_NETDEV_IEEE802154) || defined(MODULE_NRFMIN) || \
|
||||
defined(MODULE_XBEE) || defined(MODULE_ESP_NOW) || \
|
||||
defined(MODULE_GNRC_SIXLOENC)
|
||||
case NETDEV_TYPE_IEEE802154:
|
||||
case NETDEV_TYPE_NRFMIN:
|
||||
#ifdef MODULE_GNRC_SIXLOWPAN_IPHC
|
||||
@ -1201,6 +1206,9 @@ static void _init_from_device(gnrc_netif_t *netif)
|
||||
case NETDEV_TYPE_ETHERNET:
|
||||
#ifdef MODULE_GNRC_IPV6
|
||||
netif->ipv6.mtu = ETHERNET_DATA_LEN;
|
||||
#endif
|
||||
#if defined(MODULE_GNRC_SIXLOWPAN_IPHC) && defined(MODULE_GNRC_SIXLOENC)
|
||||
netif->flags |= GNRC_NETIF_FLAGS_6LO_HC;
|
||||
#endif
|
||||
break;
|
||||
#endif
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user