From 2f653d08f4647905b241508e282a491794a54285 Mon Sep 17 00:00:00 2001 From: Filip Tehlar Date: Wed, 13 Jul 2016 13:17:15 +0200 Subject: Add API dump call for vrf/vni mapping to vpp-api-test Change-Id: I7a028ce9ddf21bd3a7d4991ba1be05e5e74202d6 Signed-off-by: Filip Tehlar --- vpp/vpp-api/api.c | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) (limited to 'vpp') diff --git a/vpp/vpp-api/api.c b/vpp/vpp-api/api.c index 9acda745..63e0ed25 100644 --- a/vpp/vpp-api/api.c +++ b/vpp/vpp-api/api.c @@ -5453,6 +5453,23 @@ vl_api_lisp_map_resolver_dump_t_handler ( } +static void +send_eid_table_map_pair (hash_pair_t * p, + unix_shared_memory_queue_t * q, + u32 context) +{ + vl_api_lisp_eid_table_map_details_t * rmp = NULL; + + rmp = vl_msg_api_alloc (sizeof (*rmp)); + memset (rmp, 0, sizeof (*rmp)); + rmp->_vl_msg_id = ntohs(VL_API_LISP_EID_TABLE_MAP_DETAILS); + + rmp->vni = clib_host_to_net_u32 (p->key); + rmp->vrf = clib_host_to_net_u32 (p->value[0]); + rmp->context = context; + vl_msg_api_send_shmem (q, (u8 *)&rmp); +} + static void vl_api_lisp_eid_table_map_dump_t_handler ( vl_api_lisp_eid_table_map_dump_t *mp) @@ -5466,12 +5483,7 @@ vl_api_lisp_eid_table_map_dump_t_handler ( return; } hash_foreach_pair (p, lcm->table_id_by_vni, { - vl_api_lisp_eid_table_map_details_t * rmp = NULL; - memset (rmp, 0, sizeof (*rmp)); - rmp->_vl_msg_id = ntohs(VL_API_LISP_EID_TABLE_MAP_DETAILS); - rmp->vni = p->key; - rmp->vrf = p->value[0]; - rmp->context = mp->context; + send_eid_table_map_pair (p, q, mp->context); }); } -- cgit 1.2.3-korg