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

gnrc/nib: Move GNRC_IPV6_NIB_ABR_NUMOF to 'CONFIG_' namespace

This commit is contained in:
Leandro Lanzieri 2020-03-12 17:26:21 +01:00
parent a77d0dd9c5
commit 64dde8f317
No known key found for this signature in database
GPG Key ID: 39607DE6080007A3
5 changed files with 14 additions and 14 deletions

View File

@ -272,8 +272,8 @@ extern "C" {
/**
* @brief Number of authoritative border router entries in NIB
*/
#ifndef GNRC_IPV6_NIB_ABR_NUMOF
#define GNRC_IPV6_NIB_ABR_NUMOF (1)
#ifndef CONFIG_GNRC_IPV6_NIB_ABR_NUMOF
#define CONFIG_GNRC_IPV6_NIB_ABR_NUMOF (1)
#endif
#endif

View File

@ -41,7 +41,7 @@ static _nib_offl_entry_t _dsts[CONFIG_GNRC_IPV6_NIB_OFFL_NUMOF];
static _nib_dr_entry_t _def_routers[CONFIG_GNRC_IPV6_NIB_DEFAULT_ROUTER_NUMOF];
#if IS_ACTIVE(CONFIG_GNRC_IPV6_NIB_MULTIHOP_P6C)
static _nib_abr_entry_t _abrs[GNRC_IPV6_NIB_ABR_NUMOF];
static _nib_abr_entry_t _abrs[CONFIG_GNRC_IPV6_NIB_ABR_NUMOF];
#endif /* CONFIG_GNRC_IPV6_NIB_MULTIHOP_P6C */
static rmutex_t _nib_mutex = RMUTEX_INIT;
@ -530,7 +530,7 @@ static inline unsigned _idx_dsts(const _nib_offl_entry_t *dst)
static inline bool _in_abrs(const _nib_abr_entry_t *abr)
{
return (abr < (_abrs + GNRC_IPV6_NIB_ABR_NUMOF));
return (abr < (_abrs + CONFIG_GNRC_IPV6_NIB_ABR_NUMOF));
}
#endif /* CONFIG_GNRC_IPV6_NIB_MULTIHOP_P6C */
@ -686,7 +686,7 @@ _nib_abr_entry_t *_nib_abr_add(const ipv6_addr_t *addr)
assert(addr != NULL);
DEBUG("nib: Allocating authoritative border router entry (addr = %s)\n",
ipv6_addr_to_str(addr_str, addr, sizeof(addr_str)));
for (unsigned i = 0; i < GNRC_IPV6_NIB_ABR_NUMOF; i++) {
for (unsigned i = 0; i < CONFIG_GNRC_IPV6_NIB_ABR_NUMOF; i++) {
_nib_abr_entry_t *tmp = &_abrs[i];
if (ipv6_addr_equal(addr, &tmp->addr)) {

View File

@ -5,7 +5,7 @@ CFLAGS += -DCONFIG_GNRC_IPV6_NIB_ROUTER=1
CFLAGS += -DCONFIG_GNRC_IPV6_NIB_NUMOF=16
CFLAGS += -DCONFIG_GNRC_IPV6_NIB_OFFL_NUMOF=25
CFLAGS += -DCONFIG_GNRC_IPV6_NIB_DEFAULT_ROUTER_NUMOF=4
CFLAGS += -DGNRC_IPV6_NIB_ABR_NUMOF=4
CFLAGS += -DCONFIG_GNRC_IPV6_NIB_ABR_NUMOF=4
CFLAGS += -DCONFIG_GNRC_IPV6_NIB_6LBR=1
CFLAGS += -DCONFIG_GNRC_IPV6_NIB_MULTIHOP_P6C=1
CFLAGS += -DCONFIG_GNRC_IPV6_NIB_DC=1

View File

@ -40,7 +40,7 @@ static void set_up(void)
}
/*
* Creates GNRC_IPV6_NIB_ABR_NUMOF authoritative border router list entries with
* Creates CONFIG_GNRC_IPV6_NIB_ABR_NUMOF authoritative border router list entries with
* different addresses and then tries to create another one
* Expected result: gnrc_ipv6_nib_abr_add() returns -ENOMEM
*/
@ -51,7 +51,7 @@ static void test_nib_abr_add__ENOMEM(void)
{ .u64 = TEST_UINT64 } } };
gnrc_ipv6_nib_abr_t abr;
for (unsigned i = 0; i < GNRC_IPV6_NIB_ABR_NUMOF; i++) {
for (unsigned i = 0; i < CONFIG_GNRC_IPV6_NIB_ABR_NUMOF; i++) {
TEST_ASSERT_EQUAL_INT(0, gnrc_ipv6_nib_abr_add(&addr));
addr.u16[0].u16++;
TEST_ASSERT(gnrc_ipv6_nib_abr_iter(&iter_state, &abr));
@ -61,7 +61,7 @@ static void test_nib_abr_add__ENOMEM(void)
}
/*
* Creates GNRC_IPV6_NIB_ABR_NUMOF authoritative border router list entries with
* Creates CONFIG_GNRC_IPV6_NIB_ABR_NUMOF authoritative border router list entries with
* different addresses and then tries to add another equal to the last.
* Expected result: should return 0.
*/
@ -72,7 +72,7 @@ static void test_nib_abr_add__success(void)
{ .u64 = TEST_UINT64 } } };
gnrc_ipv6_nib_abr_t abr;
for (unsigned i = 0; i < GNRC_IPV6_NIB_ABR_NUMOF; i++) {
for (unsigned i = 0; i < CONFIG_GNRC_IPV6_NIB_ABR_NUMOF; i++) {
addr.u16[0].u16++;
TEST_ASSERT_EQUAL_INT(0, gnrc_ipv6_nib_abr_add(&addr));
TEST_ASSERT(gnrc_ipv6_nib_abr_iter(&iter_state, &abr));

View File

@ -1756,7 +1756,7 @@ static void test_nib_ft_remove(void)
#if IS_ACTIVE(CONFIG_GNRC_IPV6_NIB_MULTIHOP_P6C)
/*
* Creates GNRC_IPV6_NIB_ABR_NUMOF ABR entries with different addresses and
* Creates CONFIG_GNRC_IPV6_NIB_ABR_NUMOF ABR entries with different addresses and
* then tries to add another.
* Expected result: should return NULL
*/
@ -1765,7 +1765,7 @@ static void test_nib_abr_add__no_space_left(void)
ipv6_addr_t addr = { .u64 = { { .u8 = LINK_LOCAL_PREFIX },
{ .u64 = TEST_UINT64 } } };
for (int i = 0; i < GNRC_IPV6_NIB_ABR_NUMOF; i++) {
for (int i = 0; i < CONFIG_GNRC_IPV6_NIB_ABR_NUMOF; i++) {
TEST_ASSERT_NOT_NULL(_nib_abr_add(&addr));
addr.u64[1].u64++;
}
@ -1773,7 +1773,7 @@ static void test_nib_abr_add__no_space_left(void)
}
/*
* Creates GNRC_IPV6_NIB_ABR_NUMOF ABR entries with different addresses and then
* Creates CONFIG_GNRC_IPV6_NIB_ABR_NUMOF ABR entries with different addresses and then
* tries to add another that is equal to the last.
* Expected result: should return not NULL (the last)
*/
@ -1783,7 +1783,7 @@ static void test_nib_abr_add__success_duplicate(void)
ipv6_addr_t addr = { .u64 = { { .u8 = GLOBAL_PREFIX },
{ .u64 = TEST_UINT64 } } };
for (int i = 0; i < GNRC_IPV6_NIB_ABR_NUMOF; i++) {
for (int i = 0; i < CONFIG_GNRC_IPV6_NIB_ABR_NUMOF; i++) {
addr.u64[1].u64++;
TEST_ASSERT_NOT_NULL((abr = _nib_abr_add(&addr)));
}