aboutsummaryrefslogtreecommitdiffstats
path: root/ctrl/facemgr/src/facelet.c
diff options
context:
space:
mode:
authorJordan Augé <jordan.auge+fdio@cisco.com>2019-12-10 23:57:37 +0100
committerJordan Augé <jordan.auge+fdio@cisco.com>2019-12-10 23:59:48 +0100
commit2f8f60f943b71e1caab14856c6a03c81e5ba6c9c (patch)
treebfe69da25a7b8b27f67d4206e5ba17a2fb4a1497 /ctrl/facemgr/src/facelet.c
parenta40a23b0d7fc5ebecbb97a5213646add5eeadc5b (diff)
[HICN-438] facemgr should allow face creation with physical interface down
Change-Id: I6487fbec0607464a625daa01455ddac8fdd75ee2 Signed-off-by: Jordan Augé <jordan.auge+fdio@cisco.com>
Diffstat (limited to 'ctrl/facemgr/src/facelet.c')
-rw-r--r--ctrl/facemgr/src/facelet.c25
1 files changed, 13 insertions, 12 deletions
diff --git a/ctrl/facemgr/src/facelet.c b/ctrl/facemgr/src/facelet.c
index cce7fe611..ac84f5f70 100644
--- a/ctrl/facemgr/src/facelet.c
+++ b/ctrl/facemgr/src/facelet.c
@@ -149,6 +149,12 @@ ERR_MALLOC:
return NULL;
}
+unsigned
+facelet_get_id(facelet_t * facelet)
+{
+ return facelet->id;
+}
+
void
facelet_set_id(facelet_t * facelet, unsigned id)
{
@@ -378,18 +384,7 @@ void
facelet_free(facelet_t * facelet)
{
/* Free up routes */
- hicn_route_t ** route_array;
- int n = route_set_get_array(facelet->routes, &route_array);
- if (n < 0) {
- ERROR("[facelet_free] Error getting route set associated to facelet");
- } else {
- for (unsigned i = 0; i < n; i++) {
- hicn_route_t * route = route_array[i];
- route_set_remove(facelet->routes, route, NULL);
- hicn_route_free(route);
- }
- }
- free(route_array);
+ route_set_clear(facelet->routes);
route_set_free(facelet->routes);
free(facelet);
}
@@ -1012,6 +1007,12 @@ facelet_remove_route(facelet_t * facelet, hicn_route_t * route, hicn_route_t **
}
int
+facelet_clear_routes(facelet_t * facelet)
+{
+ return route_set_clear(facelet->routes);
+}
+
+int
facelet_get_route_array(const facelet_t * facelet, hicn_route_t *** route_array)
{
return route_set_get_array(facelet->routes, route_array);