diff options
author | Jordan Augé <jordan.auge+fdio@cisco.com> | 2021-04-19 23:57:14 +0200 |
---|---|---|
committer | Jordan Augé <jordan.auge+fdio@cisco.com> | 2021-04-19 23:57:14 +0200 |
commit | a1a165c48c5422d9b302a6abec51e706f7cda934 (patch) | |
tree | bef0fe413a040b23f7cb5cbafeca6959eb8ba8c7 /ctrl/facemgr/src/interfaces/hicn_light/hicn_light.c | |
parent | e92e9e839ca2cf42b56322b2489ccc0d8bf767af (diff) |
[HICN-699] facemgr: cleaner logs for face interaction
Change-Id: Ic0c941812f758868498e4d087e237047f91d452b
Signed-off-by: Jordan Augé <jordan.auge+fdio@cisco.com>
Diffstat (limited to 'ctrl/facemgr/src/interfaces/hicn_light/hicn_light.c')
-rw-r--r-- | ctrl/facemgr/src/interfaces/hicn_light/hicn_light.c | 23 |
1 files changed, 15 insertions, 8 deletions
diff --git a/ctrl/facemgr/src/interfaces/hicn_light/hicn_light.c b/ctrl/facemgr/src/interfaces/hicn_light/hicn_light.c index 74a0cd62b..b6e0e605a 100644 --- a/ctrl/facemgr/src/interfaces/hicn_light/hicn_light.c +++ b/ctrl/facemgr/src/interfaces/hicn_light/hicn_light.c @@ -327,13 +327,12 @@ int hl_on_event(interface_t * interface, facelet_t * facelet) switch(facelet_get_event(facelet)) { case FACELET_EVENT_CREATE: - - /* Create face */ { + /* Create face */ char buf[MAXSZ_FACELET]; facelet_snprintf(buf, MAXSZ_FACELET, facelet); DEBUG("Create facelet %s", buf); - } + hc_face.face = *face; rc = hc_face_create(data->s, &hc_face); if (rc < 0) { @@ -341,7 +340,8 @@ int hl_on_event(interface_t * interface, facelet_t * facelet) ret = -FACELET_ERROR_REASON_UNSPECIFIED_ERROR; goto ERR; } - INFO("Created face id=%d", hc_face.id); + INFO("Created face id=%d - %s", hc_face.id, buf); + } hicn_route_t ** route_array; int n = facelet_get_route_array(facelet, &route_array); @@ -413,7 +413,6 @@ int hl_on_event(interface_t * interface, facelet_t * facelet) case FACELET_EVENT_DELETE: /* Removing a face should also remove associated routes */ - /* Create face */ hc_face.face = *face; rc = hc_face_delete(data->s, &hc_face); if (rc < 0) { @@ -421,6 +420,11 @@ int hl_on_event(interface_t * interface, facelet_t * facelet) ret = -FACELET_ERROR_REASON_UNSPECIFIED_ERROR; goto ERR; } + + char buf[MAXSZ_FACELET]; + facelet_snprintf(buf, MAXSZ_FACELET, facelet); + INFO("Deleted face id=%d", hc_face.id); + break; case FACELET_EVENT_UPDATE: @@ -457,7 +461,8 @@ int hl_on_event(interface_t * interface, facelet_t * facelet) goto ERR; } facelet_set_admin_state_status(facelet, FACELET_ATTR_STATUS_CLEAN); - INFO("Admin state updated"); + INFO("Updated face id=%d - admin_state=%s", hc_face.id, + face_state_str[admin_state]); } #ifdef WITH_POLICY if (facelet_get_netdevice_type_status(facelet) == FACELET_ATTR_STATUS_DIRTY) { @@ -517,7 +522,8 @@ int hl_on_event(interface_t * interface, facelet_t * facelet) goto ERR; } facelet_set_netdevice_type_status(facelet, FACELET_ATTR_STATUS_CLEAN); - INFO("Tags updated"); + INFO("Updated face id=%d - netdevice_type=%s", hc_face.id, + netdevice_type_str[netdevice_type]); } if (facelet_get_priority_status(facelet) == FACELET_ATTR_STATUS_DIRTY) { INFO("Updating priority..."); @@ -549,7 +555,8 @@ int hl_on_event(interface_t * interface, facelet_t * facelet) goto ERR; } facelet_set_priority_status(facelet, FACELET_ATTR_STATUS_CLEAN); - INFO("Priority updated"); + + INFO("Updated face id=%d - priority=%d", hc_face.id, priority); } #endif /* WITH_POLICY */ break; |