diff --git a/sys/include/net/netopt.h b/sys/include/net/netopt.h index 3809898235..d5fb9273c1 100644 --- a/sys/include/net/netopt.h +++ b/sys/include/net/netopt.h @@ -519,6 +519,13 @@ typedef enum { */ NETOPT_IQ_INVERT, + /** + * @brief (@ref netopt_enable_t) 6Lo support + * + * @see [RFC 4944](https://tools.ietf.org/html/rfc4944) + */ + NETOPT_6LO, + /** * @brief (@ref netopt_enable_t) header compression * diff --git a/sys/net/crosslayer/netopt/netopt.c b/sys/net/crosslayer/netopt/netopt.c index ac04811054..177ab6ef10 100644 --- a/sys/net/crosslayer/netopt/netopt.c +++ b/sys/net/crosslayer/netopt/netopt.c @@ -88,6 +88,7 @@ static const char *_netopt_strmap[] = { [NETOPT_FIXED_HEADER] = "NETOPT_FIXED_HEADER", [NETOPT_IQ_INVERT] = "NETOPT_IQ_INVERT", [NETOPT_TX_RETRIES_NEEDED] = "NETOPT_TX_RETRIES_NEEDED", + [NETOPT_6LO] = "NETOPT_6LO", [NETOPT_6LO_IPHC] = "NETOPT_6LO_IPHC", [NETOPT_BLE_CTX] = "NETOPT_BLE_CTX", [NETOPT_CHECKSUM] = "NETOPT_CHECKSUM", diff --git a/sys/net/gnrc/netif/gnrc_netif.c b/sys/net/gnrc/netif/gnrc_netif.c index 05fedf6725..74845ae7ff 100644 --- a/sys/net/gnrc/netif/gnrc_netif.c +++ b/sys/net/gnrc/netif/gnrc_netif.c @@ -106,6 +106,12 @@ int gnrc_netif_get_from_netdev(gnrc_netif_t *netif, gnrc_netapi_opt_t *opt) gnrc_netif_acquire(netif); switch (opt->opt) { + case NETOPT_6LO: + assert(opt->data_len == sizeof(netopt_enable_t)); + *((netopt_enable_t *)opt->data) = + (netopt_enable_t)gnrc_netif_is_6ln(netif); + res = sizeof(netopt_enable_t); + break; case NETOPT_HOP_LIMIT: assert(opt->data_len == sizeof(uint8_t)); *((uint8_t *)opt->data) = netif->cur_hl; diff --git a/sys/shell/commands/sc_gnrc_netif.c b/sys/shell/commands/sc_gnrc_netif.c index 304b869e3f..a124f9ca36 100644 --- a/sys/shell/commands/sc_gnrc_netif.c +++ b/sys/shell/commands/sc_gnrc_netif.c @@ -523,6 +523,9 @@ static void _netif_list(kernel_pid_t iface) #endif line_thresh = _netif_list_flag(iface, NETOPT_IPV6_SND_RTR_ADV, "RTR_ADV ", line_thresh); +#ifdef MODULE_GNRC_SIXLOWPAN + line_thresh = _netif_list_flag(iface, NETOPT_6LO, "6LO ", line_thresh); +#endif #ifdef MODULE_GNRC_SIXLOWPAN_IPHC line_thresh += _LINE_THRESHOLD + 1; /* enforce linebreak after this option */ line_thresh = _netif_list_flag(iface, NETOPT_6LO_IPHC, "IPHC ",