aboutsummaryrefslogtreecommitdiffstats
path: root/hicn-plugin/src/params.h
diff options
context:
space:
mode:
Diffstat (limited to 'hicn-plugin/src/params.h')
-rw-r--r--hicn-plugin/src/params.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/hicn-plugin/src/params.h b/hicn-plugin/src/params.h
index f3af714ec..1ca9ba08b 100644
--- a/hicn-plugin/src/params.h
+++ b/hicn-plugin/src/params.h
@@ -16,6 +16,8 @@
#ifndef __HICN_PARAM_H__
#define __HICN_PARAM_H__
+#include <math.h>
+
/*
* Features
*/
@@ -50,9 +52,13 @@ STATIC_ASSERT ((HICN_PARAM_FACES_MAX & (HICN_PARAM_FACES_MAX - 1)) == 0,
// aggregation limit(interest previous hops)
// Supported up to 516. For more than 4 faces this param must
-// satisfy the equation (HICN_PARAM_PIT_ENTRY_PHOPS_MAX - 4) % 2 = 0
+// HICN_PARAM_PIT_ENTRY_PHOPS_MAX - 4 must be a power of two
#define HICN_PARAM_PIT_ENTRY_PHOPS_MAX 20
+STATIC_ASSERT ((ceil (log2 ((HICN_PARAM_PIT_ENTRY_PHOPS_MAX - 4)))) ==
+ (floor (log2 ((HICN_PARAM_PIT_ENTRY_PHOPS_MAX - 4)))),
+ "HICN_PARAM_PIT_ENTRY_PHOPS_MAX - 4 must be a power of two");
+
STATIC_ASSERT ((HICN_PARAM_PIT_ENTRY_PHOPS_MAX <= HICN_PARAM_FACES_MAX),
"HICN_PARAM_PIT_ENTRY_PHOP_MAX must be <= than HICN_PARAM_FACES_MAX");