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

Merge pull request #10666 from miri64/netopt/new/6lo

netopt: provide option to (de-)activate 6Lo
This commit is contained in:
Alexandre Abadie 2019-01-03 18:50:31 +01:00 committed by GitHub
commit b77c802f9b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 17 additions and 0 deletions

View File

@ -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
*

View File

@ -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",

View File

@ -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;

View File

@ -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 ",