diff options
author | Andrej Kozemcak <akozemca@cisco.com> | 2016-07-18 13:55:37 +0200 |
---|---|---|
committer | Andrej Kozemcak <akozemca@cisco.com> | 2016-07-20 15:03:18 +0200 |
commit | 914f91b837564416b3a8b15566c627aae6d567d2 (patch) | |
tree | b8753123f5b3881dccf0f8984338afa10696e98a /vpp/vpp-api | |
parent | 08e0312fe2ecb10e10acf334c71440df7be95cac (diff) |
Add new lisp API - Show pitr
VAT API:
- show_lisp_pitr
CLI API:
- show lisp pitr
Change-Id: Ibd31cb09efc34a49b439338e9467faf7a151f2cd
Signed-off-by: Andrej Kozemcak <akozemca@cisco.com>
Diffstat (limited to 'vpp/vpp-api')
-rw-r--r-- | vpp/vpp-api/api.c | 38 | ||||
-rw-r--r-- | vpp/vpp-api/vpe.api | 21 |
2 files changed, 59 insertions, 0 deletions
diff --git a/vpp/vpp-api/api.c b/vpp/vpp-api/api.c index 6a5a152e..4fe183bc 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) \ @@ -5609,6 +5610,43 @@ vl_api_lisp_get_map_request_itr_rlocs_t_handler ( } 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) { vl_api_interface_name_renumber_reply_t * rmp; diff --git a/vpp/vpp-api/vpe.api b/vpp/vpp-api/vpe.api index 841f3088..78a87f36 100644 --- a/vpp/vpp-api/vpe.api +++ b/vpp/vpp-api/vpe.api @@ -2661,6 +2661,27 @@ define lisp_get_map_request_itr_rlocs_reply { u8 locator_set_name[64]; }; +/** \brief Request for lisp pitr status + @param client_index - opaque cookie to identify the sender + @param context - sender context, to match reply w/ request +*/ +define show_lisp_pitr { + u32 client_index; + u32 context; +}; + +/** \brief Status of lisp pitr, enable or disable + @param context - sender context, to match reply w/ request + @param status - lisp pitr enable if non-zero, else disable + @param locator_set_name - name of the locator_set +*/ +define show_lisp_pitr_reply { + u32 context; + i32 retval; + u8 status; + u8 locator_set_name[64]; +}; + /* Gross kludge, DGMS */ define interface_name_renumber { u32 client_index; |