1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2025-12-29 00:11:16 +01:00

gnrc/nib: Move GNRC_IPV6_NIB_DEFAULT_ROUTER_NUMOF to 'CONFIG_' namespace

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

View File

@ -244,8 +244,8 @@ extern "C" {
* @attention This number has direct influence on the maximum number of
* default routers
*/
#ifndef GNRC_IPV6_NIB_DEFAULT_ROUTER_NUMOF
#define GNRC_IPV6_NIB_DEFAULT_ROUTER_NUMOF (1)
#ifndef CONFIG_GNRC_IPV6_NIB_DEFAULT_ROUTER_NUMOF
#define CONFIG_GNRC_IPV6_NIB_DEFAULT_ROUTER_NUMOF (1)
#endif
/**

View File

@ -38,7 +38,7 @@ static clist_node_t _next_removable = { NULL };
static _nib_onl_entry_t _nodes[CONFIG_GNRC_IPV6_NIB_NUMOF];
static _nib_offl_entry_t _dsts[GNRC_IPV6_NIB_OFFL_NUMOF];
static _nib_dr_entry_t _def_routers[GNRC_IPV6_NIB_DEFAULT_ROUTER_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];
@ -345,7 +345,7 @@ _nib_dr_entry_t *_nib_drl_add(const ipv6_addr_t *router_addr, unsigned iface)
DEBUG("nib: Allocating default router list entry "
"(router_addr = %s, iface = %u)\n",
ipv6_addr_to_str(addr_str, router_addr, sizeof(addr_str)), iface);
for (unsigned i = 0; i < GNRC_IPV6_NIB_DEFAULT_ROUTER_NUMOF; i++) {
for (unsigned i = 0; i < CONFIG_GNRC_IPV6_NIB_DEFAULT_ROUTER_NUMOF; i++) {
_nib_dr_entry_t *tmp = &_def_routers[i];
_nib_onl_entry_t *tmp_node = tmp->next_hop;
@ -389,7 +389,7 @@ void _nib_drl_remove(_nib_dr_entry_t *nib_dr)
_nib_dr_entry_t *_nib_drl_iter(const _nib_dr_entry_t *last)
{
for (const _nib_dr_entry_t *def_router = (last) ? (last + 1) : _def_routers;
def_router < (_def_routers + GNRC_IPV6_NIB_DEFAULT_ROUTER_NUMOF);
def_router < (_def_routers + CONFIG_GNRC_IPV6_NIB_DEFAULT_ROUTER_NUMOF);
def_router++) {
_nib_onl_entry_t *node = def_router->next_hop;
if ((node != NULL) && (node->mode != _EMPTY)) {
@ -403,7 +403,7 @@ _nib_dr_entry_t *_nib_drl_iter(const _nib_dr_entry_t *last)
_nib_dr_entry_t *_nib_drl_get(const ipv6_addr_t *router_addr, unsigned iface)
{
for (unsigned i = 0; i < GNRC_IPV6_NIB_DEFAULT_ROUTER_NUMOF; i++) {
for (unsigned i = 0; i < CONFIG_GNRC_IPV6_NIB_DEFAULT_ROUTER_NUMOF; i++) {
_nib_dr_entry_t *def_router = &_def_routers[i];
_nib_onl_entry_t *node = def_router->next_hop;

View File

@ -4,7 +4,7 @@ USEMODULE += gnrc_sixlowpan_nd # required for CONFIG_GNRC_IPV6_NIB_MULTIHOP_P6C
CFLAGS += -DCONFIG_GNRC_IPV6_NIB_ROUTER=1
CFLAGS += -DCONFIG_GNRC_IPV6_NIB_NUMOF=16
CFLAGS += -DGNRC_IPV6_NIB_OFFL_NUMOF=25
CFLAGS += -DGNRC_IPV6_NIB_DEFAULT_ROUTER_NUMOF=4
CFLAGS += -DCONFIG_GNRC_IPV6_NIB_DEFAULT_ROUTER_NUMOF=4
CFLAGS += -DGNRC_IPV6_NIB_ABR_NUMOF=4
CFLAGS += -DCONFIG_GNRC_IPV6_NIB_6LBR=1
CFLAGS += -DCONFIG_GNRC_IPV6_NIB_MULTIHOP_P6C=1

View File

@ -219,7 +219,7 @@ static void test_nib_ft_add__EINVAL_iface0(void)
#endif
/*
* Creates GNRC_IPV6_NIB_DEFAULT_ROUTER_NUMOF default route entries and then
* Creates CONFIG_GNRC_IPV6_NIB_DEFAULT_ROUTER_NUMOF default route entries and then
* tries to create another one
* Expected result: gnrc_ipv6_nib_ft_add() returns -ENOMEM
*/
@ -228,7 +228,7 @@ static void test_nib_ft_add__ENOMEM_diff_def_router(void)
ipv6_addr_t next_hop = { .u64 = { { .u8 = LINK_LOCAL_PREFIX },
{ .u64 = TEST_UINT64 } } };
for (unsigned i = 0; i < GNRC_IPV6_NIB_DEFAULT_ROUTER_NUMOF; i++) {
for (unsigned i = 0; i < CONFIG_GNRC_IPV6_NIB_DEFAULT_ROUTER_NUMOF; i++) {
TEST_ASSERT_EQUAL_INT(0, gnrc_ipv6_nib_ft_add(NULL, 0, &next_hop,
IFACE, 0));
next_hop.u64[1].u64++;

View File

@ -586,7 +586,7 @@ static void test_nib_nc_remove__cleared(void)
}
/*
* Creates GNRC_IPV6_NIB_DEFAULT_ROUTER_NUMOF default router list entries with
* Creates CONFIG_GNRC_IPV6_NIB_DEFAULT_ROUTER_NUMOF default router list entries with
* different IP addresses and then tries to add another.
* Expected result: should return NULL
*/
@ -595,7 +595,7 @@ static void test_nib_drl_add__no_space_left_diff_addr(void)
ipv6_addr_t addr = { .u64 = { { .u8 = GLOBAL_PREFIX },
{ .u64 = TEST_UINT64 } } };
for (int i = 0; i < GNRC_IPV6_NIB_DEFAULT_ROUTER_NUMOF; i++) {
for (int i = 0; i < CONFIG_GNRC_IPV6_NIB_DEFAULT_ROUTER_NUMOF; i++) {
TEST_ASSERT_NOT_NULL(_nib_drl_add(&addr, IFACE));
addr.u64[1].u64++;
}
@ -624,7 +624,7 @@ static void test_nib_drl_add__no_space_left_nib_full(void)
}
/*
* Creates GNRC_IPV6_NIB_DEFAULT_ROUTER_NUMOF default router list entries with
* Creates CONFIG_GNRC_IPV6_NIB_DEFAULT_ROUTER_NUMOF default router list entries with
* different interface identifiers and then tries to add another.
* Expected result: should return NULL
*/
@ -634,7 +634,7 @@ static void test_nib_drl_add__no_space_left_diff_iface(void)
{ .u64 = TEST_UINT64 } } };
unsigned iface = 1;
for (int i = 0; i < GNRC_IPV6_NIB_DEFAULT_ROUTER_NUMOF; i++) {
for (int i = 0; i < CONFIG_GNRC_IPV6_NIB_DEFAULT_ROUTER_NUMOF; i++) {
TEST_ASSERT_NOT_NULL(_nib_drl_add(&addr, iface));
iface++;
}
@ -642,7 +642,7 @@ static void test_nib_drl_add__no_space_left_diff_iface(void)
}
/*
* Creates GNRC_IPV6_NIB_DEFAULT_ROUTER_NUMOF default router list entries with
* Creates CONFIG_GNRC_IPV6_NIB_DEFAULT_ROUTER_NUMOF default router list entries with
* different IP addresses and interface identifiers and then tries to add
* another.
* Expected result: should return NULL
@ -653,7 +653,7 @@ static void test_nib_drl_add__no_space_left_diff_addr_iface(void)
{ .u64 = TEST_UINT64 } } };
unsigned iface = 1;
for (int i = 0; i < GNRC_IPV6_NIB_DEFAULT_ROUTER_NUMOF; i++) {
for (int i = 0; i < CONFIG_GNRC_IPV6_NIB_DEFAULT_ROUTER_NUMOF; i++) {
TEST_ASSERT_NOT_NULL(_nib_drl_add(&addr, iface));
addr.u64[1].u64++;
iface++;
@ -662,7 +662,7 @@ static void test_nib_drl_add__no_space_left_diff_addr_iface(void)
}
/*
* Creates GNRC_IPV6_NIB_DEFAULT_ROUTER_NUMOF default router list entries with
* Creates CONFIG_GNRC_IPV6_NIB_DEFAULT_ROUTER_NUMOF default router list entries with
* different IP addresses and interface identifiers and then tries to add
* another that is equal to the last.
* Expected result: should return not NULL (the last)
@ -674,7 +674,7 @@ static void test_nib_drl_add__success_duplicate(void)
{ .u64 = TEST_UINT64 } } };
unsigned iface = 1;
for (int i = 0; i < GNRC_IPV6_NIB_DEFAULT_ROUTER_NUMOF; i++) {
for (int i = 0; i < CONFIG_GNRC_IPV6_NIB_DEFAULT_ROUTER_NUMOF; i++) {
addr.u64[1].u64++;
iface++;
TEST_ASSERT_NOT_NULL((nib_dr = _nib_drl_add(&addr, iface)));