From 3a83460868d580adc7b51398bfd4093730cf0ed6 Mon Sep 17 00:00:00 2001 From: Filip Tehlar Date: Thu, 11 Aug 2016 12:21:37 +0200 Subject: VPP-323: Add LISP locator set index to reply API message Change-Id: Id798f63f4cf1a8aa7a75931bc23d3c7f5d738938 Signed-off-by: Filip Tehlar --- vpp-api-test/vat/api_format.c | 35 ++++++++++++++++++++++++++++++++++- vpp/vpp-api/api.c | 7 ++++++- vpp/vpp-api/vpe.api | 2 ++ 3 files changed, 42 insertions(+), 2 deletions(-) diff --git a/vpp-api-test/vat/api_format.c b/vpp-api-test/vat/api_format.c index c12b2470..5ddb7f7f 100644 --- a/vpp-api-test/vat/api_format.c +++ b/vpp-api-test/vat/api_format.c @@ -1555,6 +1555,40 @@ static void vl_api_l2tpv3_create_tunnel_reply_t_handler_json vam->result_ready = 1; } + +static void vl_api_lisp_add_del_locator_set_reply_t_handler + (vl_api_lisp_add_del_locator_set_reply_t * mp) +{ + vat_main_t *vam = &vat_main; + i32 retval = ntohl (mp->retval); + if (vam->async_mode) + { + vam->async_errors += (retval < 0); + } + else + { + vam->retval = retval; + vam->result_ready = 1; + } +} + +static void vl_api_lisp_add_del_locator_set_reply_t_handler_json + (vl_api_lisp_add_del_locator_set_reply_t * mp) +{ + vat_main_t *vam = &vat_main; + vat_json_node_t node; + + vat_json_init_object (&node); + vat_json_object_add_int (&node, "retval", ntohl (mp->retval)); + vat_json_object_add_uint (&node, "locator_set_index", ntohl (mp->ls_index)); + + vat_json_print (vam->ofp, &node); + vat_json_free (&node); + + vam->retval = ntohl (mp->retval); + vam->result_ready = 1; +} + static void vl_api_vxlan_add_del_tunnel_reply_t_handler (vl_api_vxlan_add_del_tunnel_reply_t * mp) { @@ -3306,7 +3340,6 @@ _(sw_interface_clear_stats_reply) \ _(trace_profile_add_reply) \ _(trace_profile_apply_reply) \ _(trace_profile_del_reply) \ -_(lisp_add_del_locator_set_reply) \ _(lisp_add_del_locator_reply) \ _(lisp_add_del_local_eid_reply) \ _(lisp_add_del_remote_mapping_reply) \ diff --git a/vpp/vpp-api/api.c b/vpp/vpp-api/api.c index db818fdf..17893f12 100644 --- a/vpp/vpp-api/api.c +++ b/vpp/vpp-api/api.c @@ -5160,7 +5160,12 @@ vl_api_lisp_add_del_locator_set_t_handler (vl_api_lisp_add_del_locator_set_t * vec_free (locator_name); vec_free (a->locators); - REPLY_MACRO (VL_API_LISP_ADD_DEL_LOCATOR_SET_REPLY); + /* *INDENT-OFF* */ + REPLY_MACRO2 (VL_API_LISP_ADD_DEL_LOCATOR_SET_REPLY, + ({ + rmp->ls_index = clib_host_to_net_u32 (ls_index); + })); + /* *INDENT-ON* */ } static void diff --git a/vpp/vpp-api/vpe.api b/vpp/vpp-api/vpe.api index 0685d21e..3b3025d4 100644 --- a/vpp/vpp-api/vpe.api +++ b/vpp/vpp-api/vpe.api @@ -2362,11 +2362,13 @@ define lisp_add_del_locator_set /** \brief Reply for locator_set add/del @param context - returned sender context, to match reply w/ request @param retval - return code + @param ls_index - locator set index */ define lisp_add_del_locator_set_reply { u32 context; i32 retval; + u32 ls_index; }; /** \brief add or delete locator for locator_set -- cgit 1.2.3-korg