aboutsummaryrefslogtreecommitdiffstats
path: root/hicn-light/src
diff options
context:
space:
mode:
authorJordan Augé <jordan.auge+fdio@cisco.com>2021-04-21 01:25:44 +0200
committerJordan Augé <jordan.auge+fdio@cisco.com>2021-04-21 01:25:44 +0200
commitd896148988beb4704428fe338e9c1c7364725acb (patch)
treed76181ba90657377137d9c4c3bf3ab7528c84f5f /hicn-light/src
parenta1a165c48c5422d9b302a6abec51e706f7cda934 (diff)
[HICN-700] hicn-light: more informative MAP-Me logs
Change-Id: I6e6b5ca716e029f6dff539730ddf3a877fd80b41 Signed-off-by: Jordan Augé <jordan.auge+fdio@cisco.com>
Diffstat (limited to 'hicn-light/src')
-rw-r--r--hicn-light/src/hicn/core/mapme.c22
1 files changed, 20 insertions, 2 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);
}