From 3e949f72778dd076fffecd7da2fb83cbb1ccb428 Mon Sep 17 00:00:00 2001 From: Alberto Compagno Date: Tue, 19 Nov 2019 17:57:20 +0000 Subject: [HICN-398] Added face create/delete/list and listener list on libctrl for hicn-plugin Listener list returns the list of interfaces and their ip addresses Signed-off-by: Alberto Compagno Change-Id: I2582cf29d4f1f60964766d47ad8d6dc64504fd62 --- hicn-plugin/src/hicn.api | 4 ++-- hicn-plugin/src/hicn_api.c | 4 ++-- hicn-plugin/src/hicn_api_test.c | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) (limited to 'hicn-plugin/src') diff --git a/hicn-plugin/src/hicn.api b/hicn-plugin/src/hicn.api index ba776c5f6..50a6f6a64 100644 --- a/hicn-plugin/src/hicn.api +++ b/hicn-plugin/src/hicn.api @@ -16,13 +16,13 @@ option version = "5.1.0"; import "vnet/ip/ip_types.api"; -enum face_type : u8 +enum face_type { IP_FACE = 0, UDP_FACE, }; -enum punt_type : u8 +enum punt_type { IP_PUNT = 0, UDP_PUNT, diff --git a/hicn-plugin/src/hicn_api.c b/hicn-plugin/src/hicn_api.c index 4c75d406d..df3365999 100644 --- a/hicn-plugin/src/hicn_api.c +++ b/hicn-plugin/src/hicn_api.c @@ -352,7 +352,7 @@ vl_api_hicn_api_face_add_t_handler (vl_api_hicn_api_face_add_t * mp) hicn_main_t *sm = &hicn_main; hicn_face_id_t face_id; - vl_api_face_type_t face_type = mp->type; + vl_api_face_type_t face_type = clib_net_to_host_u32(mp->type); switch (face_type) { @@ -371,7 +371,7 @@ vl_api_hicn_api_face_add_t_handler (vl_api_hicn_api_face_add_t * mp) REPLY_MACRO2 (VL_API_HICN_API_FACE_ADD_REPLY /* , rmp, mp, rv */ ,( { rmp->faceid = clib_host_to_net_u32 ((u32) face_id); - rmp->retval = rv; + rmp->retval = clib_host_to_net_u32 (rv); })); /* *INDENT-ON* */ } diff --git a/hicn-plugin/src/hicn_api_test.c b/hicn-plugin/src/hicn_api_test.c index bf58cf245..704e66352 100644 --- a/hicn-plugin/src/hicn_api_test.c +++ b/hicn-plugin/src/hicn_api_test.c @@ -515,7 +515,7 @@ api_hicn_api_face_ip_add (vat_main_t * vam) } /* Construct the API message */ M (HICN_API_FACE_ADD, mp); - mp->type = IP_FACE; + mp->type = clib_host_to_net_u32(IP_FACE); ip_address_encode (&local_addr, IP46_TYPE_ANY, &mp->face.ip.local_addr); ip_address_encode (&remote_addr, IP46_TYPE_ANY, &mp->face.ip.remote_addr); mp->face.ip.swif = clib_host_to_net_u32 (sw_if); @@ -592,7 +592,7 @@ api_hicn_api_face_udp_add (vat_main_t * vam) } /* Construct the API message */ M (HICN_API_FACE_ADD, mp); - mp->type = UDP_FACE; + mp->type = clib_host_to_net_u32(UDP_FACE); ip_address_encode (&local_addr, IP46_TYPE_ANY, &mp->face.udp.local_addr); ip_address_encode (&remote_addr, IP46_TYPE_ANY, &mp->face.udp.remote_addr); mp->face.udp.lport = clib_host_to_net_u16 (sport); -- cgit 1.2.3-korg