summaryrefslogtreecommitdiffstats
path: root/ctrl
diff options
context:
space:
mode:
authorAlberto Compagno <acompagn+fdio@cisco.com>2019-12-12 10:57:55 +0000
committerGerrit Code Review <gerrit@fd.io>2019-12-12 10:57:55 +0000
commit44ecc43d1680bfb5d338a649f235b15d45b00695 (patch)
treee6ac1bb52493cb2f2a644bbfdaffc45faccbabc4 /ctrl
parentabc8c3c68b45567b4bbc2c851a944b778e79331c (diff)
parent5025893d25112d52760d5fa311e9592d66122e54 (diff)
Merge "[HICN-448] Returning face id when creating a face through libctrl in hicn-plugin"
Diffstat (limited to 'ctrl')
-rw-r--r--ctrl/libhicnctrl/includes/hicn/ctrl/api.h1
-rw-r--r--ctrl/libhicnctrl/src/hicn_plugin_api.c10
2 files changed, 9 insertions, 2 deletions
diff --git a/ctrl/libhicnctrl/includes/hicn/ctrl/api.h b/ctrl/libhicnctrl/includes/hicn/ctrl/api.h
index 65633c249..e7cd39ebf 100644
--- a/ctrl/libhicnctrl/includes/hicn/ctrl/api.h
+++ b/ctrl/libhicnctrl/includes/hicn/ctrl/api.h
@@ -387,6 +387,7 @@ int hc_sock_reset(hc_sock_t *s);
#else
#define INTERFACE_LEN IFNAMSIZ
#endif
+
#define MAXSZ_HC_NAME_ SYMBOLIC_NAME_LEN
#define MAXSZ_HC_NAME MAXSZ_HC_NAME_ + NULLTERM
diff --git a/ctrl/libhicnctrl/src/hicn_plugin_api.c b/ctrl/libhicnctrl/src/hicn_plugin_api.c
index 233abb0f8..b2de6cc2f 100644
--- a/ctrl/libhicnctrl/src/hicn_plugin_api.c
+++ b/ctrl/libhicnctrl/src/hicn_plugin_api.c
@@ -1337,8 +1337,14 @@ int hc_face_create(hc_sock_t *s, hc_face_t *face) {
.parse = (HC_PARSE)parse_face_create,
};
- return hc_execute_command(s, (hc_msg_t *)&msg, sizeof(msg), &params, NULL,
- false);
+ hc_data_t *data;
+
+ int ret = hc_execute_command(s, (hc_msg_t *)&msg, sizeof(msg), &params, &data,
+ false);
+ if (ret == 0)
+ face->id = ((hc_face_t *)data->buffer)->id;
+
+ return ret;
}
/* FACE DELETE */