From d896148988beb4704428fe338e9c1c7364725acb Mon Sep 17 00:00:00 2001 From: Jordan Augé Date: Wed, 21 Apr 2021 01:25:44 +0200 Subject: [HICN-700] hicn-light: more informative MAP-Me logs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I6e6b5ca716e029f6dff539730ddf3a877fd80b41 Signed-off-by: Jordan Augé --- hicn-light/src/hicn/core/mapme.c | 22 ++++++++++++++++++++-- 1 file 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); } -- cgit 1.2.3-korg