summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--vnet/vnet/lisp-cp/control.c36
-rw-r--r--vpp-api-test/vat/api_format.c39
-rw-r--r--vpp/vpp-api/api.c15
-rw-r--r--vpp/vpp-api/custom_dump.c16
-rw-r--r--vpp/vpp-api/vpe.api8
5 files changed, 101 insertions, 13 deletions
diff --git a/vnet/vnet/lisp-cp/control.c b/vnet/vnet/lisp-cp/control.c
index d7ac3c52d2a..9941af3b01a 100644
--- a/vnet/vnet/lisp-cp/control.c
+++ b/vnet/vnet/lisp-cp/control.c
@@ -2005,12 +2005,42 @@ lisp_show_eid_table_map_command_fn (vlib_main_t * vm,
vlib_cli_command_t * cmd)
{
hash_pair_t *p;
+ unformat_input_t _line_input, *line_input = &_line_input;
lisp_cp_main_t *lcm = vnet_lisp_cp_get_main ();
+ uword *vni_table = 0;
+ u8 is_l2 = 0;
+
+ /* Get a line of input. */
+ if (!unformat_user (input, unformat_line_input, line_input))
+ return 0;
+
+ while (unformat_check_input (line_input) != UNFORMAT_END_OF_INPUT)
+ {
+ if (unformat (line_input, "l2"))
+ {
+ vni_table = lcm->bd_id_by_vni;
+ is_l2 = 1;
+ }
+ else if (unformat (line_input, "l3"))
+ {
+ vni_table = lcm->table_id_by_vni;
+ is_l2 = 0;
+ }
+ else
+ return clib_error_return (0, "parse error: '%U'",
+ format_unformat_error, line_input);
+ }
+
+ if (!vni_table)
+ {
+ vlib_cli_output (vm, "Error: expected l2|l3 param!\n");
+ return 0;
+ }
- vlib_cli_output (vm, "%=10s%=10s", "VNI", "VRF");
+ vlib_cli_output (vm, "%=10s%=10s", "VNI", is_l2 ? "BD" : "VRF");
/* *INDENT-OFF* */
- hash_foreach_pair (p, lcm->table_id_by_vni,
+ hash_foreach_pair (p, vni_table,
({
vlib_cli_output (vm, "%=10d%=10d", p->key, p->value[0]);
}));
@@ -2022,7 +2052,7 @@ lisp_show_eid_table_map_command_fn (vlib_main_t * vm,
/* *INDENT-OFF* */
VLIB_CLI_COMMAND (lisp_show_eid_table_map_command) = {
.path = "show lisp eid-table map",
- .short_help = "show lisp eid-table vni to vrf mappings",
+ .short_help = "show lisp eid-table l2|l3",
.function = lisp_show_eid_table_map_command_fn,
};
/* *INDENT-ON* */
diff --git a/vpp-api-test/vat/api_format.c b/vpp-api-test/vat/api_format.c
index 7dcd0597a64..7369714b0a0 100644
--- a/vpp-api-test/vat/api_format.c
+++ b/vpp-api-test/vat/api_format.c
@@ -2405,7 +2405,7 @@ static void
u8 *line = format (0, "%=10d%=10d",
clib_net_to_host_u32 (mp->vni),
- clib_net_to_host_u32 (mp->vrf));
+ clib_net_to_host_u32 (mp->dp_table));
fformat (vam->ofp, "%v\n", line);
vec_free (line);
}
@@ -2424,7 +2424,8 @@ static void
}
node = vat_json_array_add (&vam->json_tree);
vat_json_init_object (node);
- vat_json_object_add_uint (node, "vrf", clib_net_to_host_u32 (mp->vrf));
+ vat_json_object_add_uint (node, "dp_table",
+ clib_net_to_host_u32 (mp->dp_table));
vat_json_object_add_uint (node, "vni", clib_net_to_host_u32 (mp->vni));
}
@@ -13117,15 +13118,45 @@ api_lisp_locator_set_dump (vat_main_t * vam)
static int
api_lisp_eid_table_map_dump (vat_main_t * vam)
{
+ u8 is_l2 = 0;
+ u8 mode_set = 0;
+ unformat_input_t *input = vam->input;
vl_api_lisp_eid_table_map_dump_t *mp;
f64 timeout = ~0;
+ /* Parse args required to build the message */
+ while (unformat_check_input (input) != UNFORMAT_END_OF_INPUT)
+ {
+ if (unformat (input, "l2"))
+ {
+ is_l2 = 1;
+ mode_set = 1;
+ }
+ else if (unformat (input, "l3"))
+ {
+ is_l2 = 0;
+ mode_set = 1;
+ }
+ else
+ {
+ errmsg ("parse error '%U'", format_unformat_error, input);
+ return -99;
+ }
+ }
+
+ if (!mode_set)
+ {
+ errmsg ("expected one of 'l2' or 'l3' parameter!\n");
+ return -99;
+ }
+
if (!vam->json_output)
{
- fformat (vam->ofp, "%=10s%=10s\n", "VNI", "VRF");
+ fformat (vam->ofp, "%=10s%=10s\n", "VNI", is_l2 ? "BD" : "VRF");
}
M (LISP_EID_TABLE_MAP_DUMP, lisp_eid_table_map_dump);
+ mp->is_l2 = is_l2;
/* send it... */
S;
@@ -15707,8 +15738,8 @@ _(lisp_locator_set_dump, "[locator-set-index <ls-index> | " \
"locator-set <loc-set-name>] [local | remote]")\
_(lisp_eid_table_dump, "[eid <ipv4|ipv6>/<prefix> | <mac>] [vni] " \
"[local] | [remote]") \
-_(lisp_eid_table_map_dump, "") \
_(lisp_eid_table_vni_dump, "") \
+_(lisp_eid_table_map_dump, "l2|l3") \
_(lisp_gpe_tunnel_dump, "") \
_(lisp_map_resolver_dump, "") \
_(show_lisp_status, "") \
diff --git a/vpp/vpp-api/api.c b/vpp/vpp-api/api.c
index b10baf08628..f4f085166fe 100644
--- a/vpp/vpp-api/api.c
+++ b/vpp/vpp-api/api.c
@@ -5896,7 +5896,7 @@ send_eid_table_map_pair (hash_pair_t * p,
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->dp_table = clib_host_to_net_u32 (p->value[0]);
rmp->context = context;
vl_msg_api_send_shmem (q, (u8 *) & rmp);
}
@@ -5908,14 +5908,25 @@ vl_api_lisp_eid_table_map_dump_t_handler (vl_api_lisp_eid_table_map_dump_t *
unix_shared_memory_queue_t *q = NULL;
lisp_cp_main_t *lcm = vnet_lisp_cp_get_main ();
hash_pair_t *p;
+ uword *vni_table = 0;
q = vl_api_client_index_to_input_queue (mp->client_index);
if (q == 0)
{
return;
}
+
+ if (mp->is_l2)
+ {
+ vni_table = lcm->bd_id_by_vni;
+ }
+ else
+ {
+ vni_table = lcm->table_id_by_vni;
+ }
+
/* *INDENT-OFF* */
- hash_foreach_pair (p, lcm->table_id_by_vni,
+ hash_foreach_pair (p, vni_table,
({
send_eid_table_map_pair (p, q, mp->context);
}));
diff --git a/vpp/vpp-api/custom_dump.c b/vpp/vpp-api/custom_dump.c
index 4737d3b2126..d1098d36d2f 100644
--- a/vpp/vpp-api/custom_dump.c
+++ b/vpp/vpp-api/custom_dump.c
@@ -2534,6 +2534,21 @@ static void *vl_api_lisp_eid_table_dump_t_print
FINISH;
}
+static void *vl_api_lisp_eid_table_map_dump_t_print
+ (vl_api_lisp_eid_table_map_dump_t * mp, void *handle)
+{
+ u8 *s;
+
+ s = format (0, "SCRIPT: lisp_eid_table_map_dump ");
+
+ if (mp->is_l2)
+ s = format (s, "l2");
+ else
+ s = format (s, "l3");
+
+ FINISH;
+}
+
static void *vl_api_ipsec_gre_add_del_tunnel_t_print
(vl_api_ipsec_gre_add_del_tunnel_t * mp, void *handle)
{
@@ -2571,7 +2586,6 @@ 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)
diff --git a/vpp/vpp-api/vpe.api b/vpp/vpp-api/vpe.api
index fb0a4145c00..1143c436d81 100644
--- a/vpp/vpp-api/vpe.api
+++ b/vpp/vpp-api/vpe.api
@@ -2860,25 +2860,27 @@ define lisp_eid_table_dump
u8 filter;
};
-/** \brief Shows relationship between vni and vrf
- @param vrf - VRF index
+/** \brief Shows relationship between vni and vrf/bd
+ @param dp_table - VRF index or bridge domain index
@param vni - vitual network instance
*/
define lisp_eid_table_map_details
{
u32 context;
u32 vni;
- u32 vrf;
+ u32 dp_table;
};
/** \brief Request for lisp_eid_table_map_details
@param client_index - opaque cookie to identify the sender
@param context - sender context, to match reply w/ request
+ @param is_l2 - if set dump vni/bd mappings else vni/vrf
*/
define lisp_eid_table_map_dump
{
u32 client_index;
u32 context;
+ u8 is_l2;
};
/** \brief Dumps all VNIs used in mappings