aboutsummaryrefslogtreecommitdiffstats
path: root/hicn-light/src/hicn/core
diff options
context:
space:
mode:
Diffstat (limited to 'hicn-light/src/hicn/core')
-rw-r--r--hicn-light/src/hicn/core/mapme.c22
-rw-r--r--hicn-light/src/hicn/core/nameBitvector.c6
2 files changed, 23 insertions, 5 deletions
diff --git a/hicn-light/src/hicn/core/mapme.c b/hicn-light/src/hicn/core/mapme.c
index 2a64833a8..3a1c9777b 100644
--- a/hicn-light/src/hicn/core/mapme.c
+++ b/hicn-light/src/hicn/core/mapme.c
@@ -536,13 +536,31 @@ mapme_send_updates(const MapMe * mapme, FibEntry * fibEntry, const NumberSet * n
const Name *name = fibEntry_GetPrefix(fibEntry);
char *name_str = name_ToString(name);
bool clear_tfib = true;
+
+ INFO(mapme, "[MAP-Me] Candidate next hops changed");
for (size_t j = 0; j < numberSet_Length(nexthops); j++) {
unsigned nexthop_id = numberSet_GetItem(nexthops, j);
- INFO(mapme, "[MAP-Me] sending IU/IN for name %s on connection %d", name_str,
- nexthop_id);
+
+ /* We extract the nexthop type based on tags */
+ const char * nexthop_type;
+ ConnectionTable * table = forwarder_GetConnectionTable(mapme->forwarder);
+ const Connection * conn = connectionTable_FindById(table, nexthop_id);
+ if (connection_HasTag(conn, POLICY_TAG_WIRED)) {
+ nexthop_type = "WIRED";
+ } else if (connection_HasTag(conn, POLICY_TAG_WIFI)) {
+ nexthop_type = "WIFI";
+ } else if (connection_HasTag(conn, POLICY_TAG_CELLULAR)) {
+ nexthop_type = "CELLULAR";
+ } else {
+ nexthop_type = "UNKNOWN";
+ }
+
+ INFO(mapme, "[MAP-Me] sending IU/IN for name %s on connection %d - %s (%s)", name_str,
+ nexthop_id, connection_GetInterfaceName(conn), nexthop_type);
mapme_setFacePending(mapme, name, fibEntry, nexthop_id, true, true, clear_tfib, 0);
clear_tfib = false;
}
+ INFO(mapme, "[MAP-Me] Done sending MAP-Me update");
free(name_str);
}
diff --git a/hicn-light/src/hicn/core/nameBitvector.c b/hicn-light/src/hicn/core/nameBitvector.c
index cc13bf610..653560750 100644
--- a/hicn-light/src/hicn/core/nameBitvector.c
+++ b/hicn-light/src/hicn/core/nameBitvector.c
@@ -243,13 +243,13 @@ uint32_t nameBitvector_lpm(const NameBitvector *a,
prefix_len = (uint32_t)(BV_SIZE - (_diff_bit_log2(diff) + 1));
//printf("if 1 diff = %lu plen = %d\n", diff, prefix_len);
}else{
- prefix_len = BV_SIZE;
+ prefix_len = (uint32_t)BV_SIZE;
diff = a->bits[1] ^ b->bits[1];
if(diff){
- prefix_len += (BV_SIZE - (_diff_bit_log2(diff) + 1));
+ prefix_len += (uint32_t)(BV_SIZE - (_diff_bit_log2(diff) + 1));
//printf("if 2 diff = %lu plen = %d\n", diff, prefix_len);
}else{
- prefix_len += BV_SIZE;
+ prefix_len += (uint32_t)BV_SIZE;
}
}