Skip to content
Snippets Groups Projects
Commit 7d2f4144 authored by Oleg Hahm's avatar Oleg Hahm
Browse files

universal_address: make size dependent on FIB size

parent 076e9db3
No related branches found
No related tags found
No related merge requests found
...@@ -27,6 +27,7 @@ extern "C" { ...@@ -27,6 +27,7 @@ extern "C" {
#include <stdint.h> #include <stdint.h>
#include <stdlib.h> #include <stdlib.h>
#include "net/ipv6/addr.h"
#define UNIVERSAL_ADDRESS_SIZE (16) /**< size of the used addresses in bytes */ #define UNIVERSAL_ADDRESS_SIZE (16) /**< size of the used addresses in bytes */
......
...@@ -19,6 +19,12 @@ ...@@ -19,6 +19,12 @@
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include <errno.h> #include <errno.h>
#ifdef MODULE_FIB
#include "net/fib.h"
#ifdef MODULE_GNRC_IPV6
#include "net/gnrc/ipv6.h"
#endif
#endif
#include "mutex.h" #include "mutex.h"
#define ENABLE_DEBUG (0) #define ENABLE_DEBUG (0)
...@@ -28,7 +34,17 @@ ...@@ -28,7 +34,17 @@
/** /**
* @brief Maximum number of entries handled * @brief Maximum number of entries handled
*/ */
#define UNIVERSAL_ADDRESS_MAX_ENTRIES (40) /* determine the maximum numer of entries */
#ifndef UNIVERSAL_ADDRESS_MAX_ENTRIES
/* all potential users of universal addresses have to add their requirements here */
# if defined(MODULE_FIB) && defined(MODULE_GNRC_IPV6)
# define UA_ADD0 (2 * GNRC_IPV6_FIB_TABLE_SIZE)
# else
# define UA_ADD0 (0)
# endif
# define UNIVERSAL_ADDRESS_MAX_ENTRIES (UA_ADD0)
#endif
/** /**
* @brief counter indicating the number of entries allocated * @brief counter indicating the number of entries allocated
......
CFLAGS += -DFIB_DEVEL_HELPER CFLAGS += -DFIB_DEVEL_HELPER -DUNIVERSAL_ADDRESS_SIZE=16 -DUNIVERSAL_ADDRESS_MAX_ENTRIES=40
USEMODULE += fib USEMODULE += fib
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment