- pool_foreach (mapit, lcm->mapping_pool,
- ({
- locator_set_t * ls = pool_elt_at_index (lcm->locator_set_pool,
- mapit->locator_set_index);
- vlib_cli_output (vm, "%U", format_eid_entry, lcm->vnet_main,
- lcm, &mapit->eid, ls);
- }));
+
+ if (print_all)
+ {
+ pool_foreach (mapit, lcm->mapping_pool,
+ ({
+ locator_set_t * ls = pool_elt_at_index (lcm->locator_set_pool,
+ mapit->locator_set_index);
+ vlib_cli_output (vm, "%U", format_eid_entry, lcm->vnet_main,
+ lcm, &mapit->eid, ls);
+ }));
+ }
+ else
+ {
+ mi = gid_dictionary_lookup (&lcm->mapping_index_by_gid, &eid);
+ if ((u32)~0 == mi)
+ return 0;
+
+ mapit = pool_elt_at_index (lcm->mapping_pool, mi);
+ locator_set_t * ls = pool_elt_at_index (lcm->locator_set_pool,
+ mapit->locator_set_index);
+ vlib_cli_output (vm, "%U", format_eid_entry, lcm->vnet_main,
+ lcm, &mapit->eid, ls);
+ }