X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=vpp%2Fvpp-api%2Fapi.c;h=4fe183bc57928943ad4d902a7212001dc70aaa99;hb=914f91b837564416b3a8b15566c627aae6d567d2;hp=6a5a152ea56d8c49d8b9b56cdb63c91b6d4778ea;hpb=08e0312fe2ecb10e10acf334c71440df7be95cac;p=vpp.git diff --git a/vpp/vpp-api/api.c b/vpp/vpp-api/api.c index 6a5a152ea56..4fe183bc579 100644 --- a/vpp/vpp-api/api.c +++ b/vpp/vpp-api/api.c @@ -347,6 +347,7 @@ _(LISP_ENABLE_DISABLE_STATUS_DUMP, \ _(LISP_ADD_DEL_MAP_REQUEST_ITR_RLOCS, \ lisp_add_del_map_request_itr_rlocs) \ _(LISP_GET_MAP_REQUEST_ITR_RLOCS, lisp_get_map_request_itr_rlocs) \ +_(SHOW_LISP_PITR, show_lisp_pitr) \ _(SR_MULTICAST_MAP_ADD_DEL, sr_multicast_map_add_del) \ _(AF_PACKET_CREATE, af_packet_create) \ _(AF_PACKET_DELETE, af_packet_delete) \ @@ -5608,6 +5609,43 @@ vl_api_lisp_get_map_request_itr_rlocs_t_handler ( vec_free(tmp_str); } +static void +vl_api_show_lisp_pitr_t_handler (vl_api_show_lisp_pitr_t * mp) +{ + unix_shared_memory_queue_t * q = NULL; + vl_api_show_lisp_pitr_reply_t * rmp = NULL; + lisp_cp_main_t * lcm = vnet_lisp_cp_get_main(); + mapping_t * m; + locator_set_t * ls = 0; + u8 * tmp_str = 0; + int rv = 0; + + q = vl_api_client_index_to_input_queue (mp->client_index); + if (q == 0) { + return; + } + + if (~0 == lcm->pitr_map_index) { + tmp_str = format(0, "N/A"); + } else { + m = pool_elt_at_index (lcm->mapping_pool, lcm->pitr_map_index); + if (~0 != m->locator_set_index) { + ls = pool_elt_at_index (lcm->locator_set_pool, m->locator_set_index); + tmp_str = format(0, "%s", ls->name); + } else { + tmp_str = format(0, "N/A"); + } + } + vec_add1(tmp_str, 0); + + REPLY_MACRO2(VL_API_SHOW_LISP_PITR_REPLY, + ({ + rmp->status = lcm->lisp_pitr; + strncpy((char *) rmp->locator_set_name, (char *) tmp_str, + ARRAY_LEN(rmp->locator_set_name) - 1); + })); +} + static void vl_api_interface_name_renumber_t_handler (vl_api_interface_name_renumber_t *mp) {