diff options
author | 2016-08-24 11:28:02 +0200 | |
---|---|---|
committer | 2016-08-25 12:49:37 +0000 | |
commit | 50a4e1429477e41848b1cdb632aab20cb8154386 (patch) | |
tree | 21f68eab2e1261481f070794842bdf789a2d4075 /vpp | |
parent | 082b39dc6764c883bdda647c610065b506d4ba2d (diff) |
VPP-328: Add dump call for listing LISP VNIs
Change-Id: I45c054ad638a0e918dddefa4468ff65452949970
Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
Diffstat (limited to 'vpp')
-rw-r--r-- | vpp/vpp-api/api.c | 49 | ||||
-rw-r--r-- | vpp/vpp-api/custom_dump.c | 2 | ||||
-rw-r--r-- | vpp/vpp-api/vpe.api | 22 |
3 files changed, 73 insertions, 0 deletions
diff --git a/vpp/vpp-api/api.c b/vpp/vpp-api/api.c index 15a7bf41..b10baf08 100644 --- a/vpp/vpp-api/api.c +++ b/vpp/vpp-api/api.c @@ -345,6 +345,7 @@ _(LISP_EID_TABLE_DUMP, lisp_eid_table_dump) \ _(LISP_GPE_TUNNEL_DUMP, lisp_gpe_tunnel_dump) \ _(LISP_MAP_RESOLVER_DUMP, lisp_map_resolver_dump) \ _(LISP_EID_TABLE_MAP_DUMP, lisp_eid_table_map_dump) \ +_(LISP_EID_TABLE_VNI_DUMP, lisp_eid_table_vni_dump) \ _(SHOW_LISP_STATUS, show_lisp_status) \ _(LISP_ADD_DEL_MAP_REQUEST_ITR_RLOCS, \ lisp_add_del_map_request_itr_rlocs) \ @@ -5922,6 +5923,54 @@ vl_api_lisp_eid_table_map_dump_t_handler (vl_api_lisp_eid_table_map_dump_t * } static void +send_eid_table_vni (u32 vni, unix_shared_memory_queue_t * q, u32 context) +{ + vl_api_lisp_eid_table_vni_details_t *rmp = 0; + + rmp = vl_msg_api_alloc (sizeof (*rmp)); + memset (rmp, 0, sizeof (*rmp)); + rmp->_vl_msg_id = ntohs (VL_API_LISP_EID_TABLE_VNI_DETAILS); + rmp->context = context; + rmp->vni = clib_host_to_net_u32 (vni); + vl_msg_api_send_shmem (q, (u8 *) & rmp); +} + +static void +vl_api_lisp_eid_table_vni_dump_t_handler (vl_api_lisp_eid_table_vni_dump_t * + mp) +{ + hash_pair_t *p; + u32 *vnis = 0; + unix_shared_memory_queue_t *q = 0; + lisp_cp_main_t *lcm = vnet_lisp_cp_get_main (); + + q = vl_api_client_index_to_input_queue (mp->client_index); + if (q == 0) + { + return; + } + + /* *INDENT-OFF* */ + hash_foreach_pair (p, lcm->table_id_by_vni, + ({ + hash_set (vnis, p->key, 0); + })); + + hash_foreach_pair (p, lcm->bd_id_by_vni, + ({ + hash_set (vnis, p->key, 0); + })); + + hash_foreach_pair (p, vnis, + ({ + send_eid_table_vni (p->key, q, mp->context); + })); + /* *INDENT-ON* */ + + hash_free (vnis); +} + +static void vl_api_show_lisp_status_t_handler (vl_api_show_lisp_status_t * mp) { unix_shared_memory_queue_t *q = NULL; diff --git a/vpp/vpp-api/custom_dump.c b/vpp/vpp-api/custom_dump.c index db5ea646..4737d3b2 100644 --- a/vpp/vpp-api/custom_dump.c +++ b/vpp/vpp-api/custom_dump.c @@ -2572,6 +2572,7 @@ static void *vl_api_ipsec_gre_tunnel_dump_t_print #define foreach_custom_print_no_arg_function \ _(lisp_eid_table_map_dump) \ +_(lisp_eid_table_vni_dump) \ _(lisp_map_resolver_dump) \ _(lisp_gpe_tunnel_dump) @@ -2711,6 +2712,7 @@ _(LISP_ADD_DEL_MAP_RESOLVER, lisp_add_del_map_resolver) \ _(LISP_ADD_DEL_LOCATOR, lisp_add_del_locator) \ _(LISP_EID_TABLE_DUMP, lisp_eid_table_dump) \ _(LISP_EID_TABLE_MAP_DUMP, lisp_eid_table_map_dump) \ +_(LISP_EID_TABLE_VNI_DUMP, lisp_eid_table_vni_dump) \ _(LISP_GPE_TUNNEL_DUMP, lisp_gpe_tunnel_dump) \ _(LISP_MAP_RESOLVER_DUMP, lisp_map_resolver_dump) \ _(LISP_LOCATOR_SET_DUMP, lisp_locator_set_dump) \ diff --git a/vpp/vpp-api/vpe.api b/vpp/vpp-api/vpe.api index 3b3025d4..fb0a4145 100644 --- a/vpp/vpp-api/vpe.api +++ b/vpp/vpp-api/vpe.api @@ -2881,6 +2881,28 @@ define lisp_eid_table_map_dump u32 context; }; +/** \brief Dumps all VNIs used in mappings + @param client_index - opaque cookie to identify the sender + @param context - sender context, to match reply w/ request + */ +define lisp_eid_table_vni_dump +{ + u32 client_index; + u32 context; +}; + +/** \brief reply to lisp_eid_table_vni_dump + @param client_index - opaque cookie to identify the sender + @param context - sender context, to match reply w/ request + @param vni - virtual network instance + */ +define lisp_eid_table_vni_details +{ + u32 client_index; + u32 context; + u32 vni; +}; + define lisp_gpe_tunnel_details { u32 context; |