gnrc/nib: Move GNRC_IPV6_NIB_CONF_QUEUE_PKT to 'CONFIG_' namespace
Also evaluate it using IS_ACTIVE macro.
This commit is contained in:
parent
ce931f179c
commit
f23267b67b
@ -56,8 +56,8 @@ extern "C" {
|
||||
#ifndef CONFIG_GNRC_IPV6_NIB_SLAAC
|
||||
#define CONFIG_GNRC_IPV6_NIB_SLAAC 0
|
||||
#endif
|
||||
#ifndef GNRC_IPV6_NIB_CONF_QUEUE_PKT
|
||||
#define GNRC_IPV6_NIB_CONF_QUEUE_PKT 0
|
||||
#ifndef CONFIG_GNRC_IPV6_NIB_QUEUE_PKT
|
||||
#define CONFIG_GNRC_IPV6_NIB_QUEUE_PKT 0
|
||||
#endif
|
||||
#if !CONFIG_GNRC_IPV6_NIB_6LR
|
||||
# ifndef GNRC_IPV6_NIB_CONF_ARSM
|
||||
@ -145,11 +145,11 @@ extern "C" {
|
||||
/**
|
||||
* @brief queue packets for address resolution
|
||||
*/
|
||||
#ifndef GNRC_IPV6_NIB_CONF_QUEUE_PKT
|
||||
#ifndef CONFIG_GNRC_IPV6_NIB_QUEUE_PKT
|
||||
#if CONFIG_GNRC_IPV6_NIB_6LN
|
||||
#define GNRC_IPV6_NIB_CONF_QUEUE_PKT 0
|
||||
#define CONFIG_GNRC_IPV6_NIB_QUEUE_PKT 0
|
||||
#else
|
||||
#define GNRC_IPV6_NIB_CONF_QUEUE_PKT 1
|
||||
#define CONFIG_GNRC_IPV6_NIB_QUEUE_PKT 1
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
@ -376,7 +376,7 @@ void _handle_adv_l2(gnrc_netif_t *netif, _nib_onl_entry_t *nce,
|
||||
nce->info &= ~GNRC_IPV6_NIB_NC_INFO_IS_ROUTER;
|
||||
}
|
||||
}
|
||||
#if GNRC_IPV6_NIB_CONF_QUEUE_PKT && MODULE_GNRC_IPV6
|
||||
#if IS_ACTIVE(CONFIG_GNRC_IPV6_NIB_QUEUE_PKT) && MODULE_GNRC_IPV6
|
||||
/* send queued packets */
|
||||
gnrc_pktqueue_t *ptr;
|
||||
DEBUG("nib: Sending queued packets\n");
|
||||
@ -389,7 +389,7 @@ void _handle_adv_l2(gnrc_netif_t *netif, _nib_onl_entry_t *nce,
|
||||
}
|
||||
ptr->pkt = NULL;
|
||||
}
|
||||
#endif /* GNRC_IPV6_NIB_CONF_QUEUE_PKT */
|
||||
#endif /* CONFIG_GNRC_IPV6_NIB_QUEUE_PKT */
|
||||
if ((icmpv6->type == ICMPV6_NBR_ADV) &&
|
||||
!_sflag_set((ndp_nbr_adv_t *)icmpv6) &&
|
||||
(_get_nud_state(nce) == GNRC_IPV6_NIB_NC_INFO_NUD_STATE_REACHABLE) &&
|
||||
|
||||
@ -276,7 +276,7 @@ void _nib_nc_remove(_nib_onl_entry_t *node)
|
||||
#if IS_ACTIVE(CONFIG_GNRC_IPV6_NIB_6LR)
|
||||
evtimer_del((evtimer_t *)&_nib_evtimer, &node->addr_reg_timeout.event);
|
||||
#endif /* CONFIG_GNRC_IPV6_NIB_6LR */
|
||||
#if GNRC_IPV6_NIB_CONF_QUEUE_PKT
|
||||
#if IS_ACTIVE(CONFIG_GNRC_IPV6_NIB_QUEUE_PKT)
|
||||
gnrc_pktqueue_t *tmp;
|
||||
for (gnrc_pktqueue_t *ptr = node->pktqueue;
|
||||
(ptr != NULL) && (tmp = (ptr->next), 1);
|
||||
@ -287,7 +287,7 @@ void _nib_nc_remove(_nib_onl_entry_t *node)
|
||||
gnrc_pktbuf_release_error(entry->pkt, EHOSTUNREACH);
|
||||
entry->pkt = NULL;
|
||||
}
|
||||
#endif /* GNRC_IPV6_NIB_CONF_QUEUE_PKT */
|
||||
#endif /* CONFIG_GNRC_IPV6_NIB_QUEUE_PKT */
|
||||
/* remove from cache-out procedure */
|
||||
clist_remove(&_next_removable, (clist_node_t *)node);
|
||||
_nib_onl_clear(node);
|
||||
|
||||
@ -92,11 +92,11 @@ extern "C" {
|
||||
*/
|
||||
typedef struct _nib_onl_entry {
|
||||
struct _nib_onl_entry *next; /**< next removable entry */
|
||||
#if GNRC_IPV6_NIB_CONF_QUEUE_PKT || defined(DOXYGEN)
|
||||
#if IS_ACTIVE(CONFIG_GNRC_IPV6_NIB_QUEUE_PKT) || defined(DOXYGEN)
|
||||
/**
|
||||
* @brief queue for packets currently in address resolution
|
||||
*
|
||||
* @note Only available if @ref GNRC_IPV6_NIB_CONF_QUEUE_PKT != 0.
|
||||
* @note Only available if @ref CONFIG_GNRC_IPV6_NIB_QUEUE_PKT != 0.
|
||||
*/
|
||||
gnrc_pktqueue_t *pktqueue;
|
||||
#endif
|
||||
|
||||
@ -47,9 +47,9 @@
|
||||
|
||||
static char addr_str[IPV6_ADDR_MAX_STR_LEN];
|
||||
|
||||
#if GNRC_IPV6_NIB_CONF_QUEUE_PKT
|
||||
#if IS_ACTIVE(CONFIG_GNRC_IPV6_NIB_QUEUE_PKT)
|
||||
static gnrc_pktqueue_t _queue_pool[GNRC_IPV6_NIB_NUMOF];
|
||||
#endif /* GNRC_IPV6_NIB_CONF_QUEUE_PKT */
|
||||
#endif /* CONFIG_GNRC_IPV6_NIB_QUEUE_PKT */
|
||||
|
||||
#if GNRC_IPV6_NIB_CONF_DNS
|
||||
static evtimer_msg_event_t _rdnss_timeout;
|
||||
@ -1115,7 +1115,7 @@ static void _handle_nbr_adv(gnrc_netif_t *netif, const ipv6_hdr_t *ipv6,
|
||||
}
|
||||
}
|
||||
|
||||
#if GNRC_IPV6_NIB_CONF_QUEUE_PKT
|
||||
#if IS_ACTIVE(CONFIG_GNRC_IPV6_NIB_QUEUE_PKT)
|
||||
static gnrc_pktqueue_t *_alloc_queue_entry(gnrc_pktsnip_t *pkt)
|
||||
{
|
||||
for (int i = 0; i < GNRC_IPV6_NIB_NUMOF; i++) {
|
||||
@ -1126,7 +1126,7 @@ static gnrc_pktqueue_t *_alloc_queue_entry(gnrc_pktsnip_t *pkt)
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
#endif /* GNRC_IPV6_NIB_CONF_QUEUE_PKT */
|
||||
#endif /* CONFIG_GNRC_IPV6_NIB_QUEUE_PKT */
|
||||
|
||||
static bool _resolve_addr(const ipv6_addr_t *dst, gnrc_netif_t *netif,
|
||||
gnrc_pktsnip_t *pkt, gnrc_ipv6_nib_nc_t *nce,
|
||||
@ -1198,7 +1198,7 @@ static bool _resolve_addr(const ipv6_addr_t *dst, gnrc_netif_t *netif,
|
||||
}
|
||||
#endif /* GNRC_IPV6_NIB_CONF_ARSM */
|
||||
if (pkt != NULL) {
|
||||
#if GNRC_IPV6_NIB_CONF_QUEUE_PKT
|
||||
#if IS_ACTIVE(CONFIG_GNRC_IPV6_NIB_QUEUE_PKT)
|
||||
if (_get_nud_state(entry) == GNRC_IPV6_NIB_NC_INFO_NUD_STATE_INCOMPLETE) {
|
||||
gnrc_pktqueue_t *queue_entry = _alloc_queue_entry(pkt);
|
||||
|
||||
@ -1231,11 +1231,11 @@ static bool _resolve_addr(const ipv6_addr_t *dst, gnrc_netif_t *netif,
|
||||
pkt);
|
||||
gnrc_pktbuf_release_error(pkt, EHOSTUNREACH);
|
||||
}
|
||||
#else /* GNRC_IPV6_NIB_CONF_QUEUE_PKT */
|
||||
#else /* CONFIG_GNRC_IPV6_NIB_QUEUE_PKT */
|
||||
gnrc_icmpv6_error_dst_unr_send(ICMPV6_ERROR_DST_UNR_ADDR,
|
||||
pkt);
|
||||
gnrc_pktbuf_release_error(pkt, EHOSTUNREACH);
|
||||
#endif /* GNRC_IPV6_NIB_CONF_QUEUE_PKT */
|
||||
#endif /* CONFIG_GNRC_IPV6_NIB_QUEUE_PKT */
|
||||
}
|
||||
#if GNRC_IPV6_NIB_CONF_ARSM
|
||||
_probe_nbr(entry, reset);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user