diff options
author | Filip Tehlar <ftehlar@cisco.com> | 2016-07-04 11:43:11 +0200 |
---|---|---|
committer | Filip Tehlar <ftehlar@cisco.com> | 2016-07-07 08:13:47 +0200 |
commit | 1b1ee4f2e550d2cf98e5e5f718ad5543389c8c37 (patch) | |
tree | f1be22d0f6929819f7a7ca9cb5b775ce175dc635 /vpp | |
parent | 137c7c612641b5056bc20e64e8ef75df0c775629 (diff) |
Add an option to dump details about specific LISP EID in API/CLI
Change-Id: Ie5e6751fd791e7ca728522632332abe442a1a75b
Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
Diffstat (limited to 'vpp')
-rw-r--r-- | vpp/vpp-api/api.c | 33 | ||||
-rw-r--r-- | vpp/vpp-api/vpe.api | 15 |
2 files changed, 47 insertions, 1 deletions
diff --git a/vpp/vpp-api/api.c b/vpp/vpp-api/api.c index 58f7aeff..767b9d5d 100644 --- a/vpp/vpp-api/api.c +++ b/vpp/vpp-api/api.c @@ -5337,19 +5337,50 @@ static void vl_api_lisp_local_eid_table_dump_t_handler ( vl_api_lisp_local_eid_table_dump_t *mp) { + u32 mi; unix_shared_memory_queue_t * q = NULL; lisp_cp_main_t * lcm = vnet_lisp_cp_get_main(); mapping_t * mapit = NULL; + gid_address_t _eid, * eid = &_eid; q = vl_api_client_index_to_input_queue (mp->client_index); if (q == 0) { return; } - pool_foreach (mapit, lcm->mapping_pool, + if (mp->eid_set) { + memset (eid, 0, sizeof (*eid)); + gid_address_vni(eid) = ntohl(mp->vni); + switch (mp->eid_type) { + case 0: + gid_address_type(eid) = GID_ADDR_IP_PREFIX; + gid_address_ippref_len(eid) = mp->prefix_length; + gid_address_ip_version(eid) = IP4; + clib_memcpy (&gid_address_ippref(eid), mp->eid, 4); + break; + case 1: + gid_address_type(eid) = GID_ADDR_IP_PREFIX; + gid_address_ippref_len(eid) = mp->prefix_length; + gid_address_ip_version(eid) = IP6; + clib_memcpy (&gid_address_ippref(eid), mp->eid, 16); + break; + case 2: + gid_address_type(eid) = GID_ADDR_MAC; + clib_memcpy (gid_address_mac(eid), mp->eid, 6); + break; + } + mi = gid_dictionary_lookup (&lcm->mapping_index_by_gid, eid); + if ((u32)~0 == mi) + return; + + mapit = pool_elt_at_index (lcm->mapping_pool, mi); + send_lisp_local_eid_table_details(mapit, q, mp->context); + } else { + pool_foreach (mapit, lcm->mapping_pool, ({ send_lisp_local_eid_table_details(mapit, q, mp->context); })); + } } static void diff --git a/vpp/vpp-api/vpe.api b/vpp/vpp-api/vpe.api index 9057de9d..bf13efb8 100644 --- a/vpp/vpp-api/vpe.api +++ b/vpp/vpp-api/vpe.api @@ -2542,10 +2542,25 @@ manual_java define lisp_local_eid_table_details { /** \brief Request for local eid table summary status @param client_index - opaque cookie to identify the sender @param context - sender context, to match reply w/ request + @param eid_set - if non-zero request info about specific mapping + @param vni - virtual network instance; valid only if eid_set != 0 + @param prefix_length - prefix length if EID is IP address; + valid only if eid_set != 0 + @param eid_type - EID type; valid only if eid_set != 0 + Supported values: + 0: EID is IPv4 + 1: EID is IPv6 + 2: EID is ethernet address + @param eid - endpoint identifier */ define lisp_local_eid_table_dump { u32 client_index; u32 context; + u8 eid_set; + u8 prefix_length; + u32 vni; + u8 eid_type; + u8 eid[16]; }; /** \brief Shows relationship between vni and vrf |