summaryrefslogtreecommitdiffstats
path: root/vpp-api-test/vat/api_format.c
diff options
context:
space:
mode:
authorMatus Fabian <matfabia@cisco.com>2016-12-02 06:00:53 -0800
committerDamjan Marion <dmarion.lists@gmail.com>2016-12-02 16:59:03 +0000
commitf468e23da6c1d40900124aa1f37fdb45189a21a5 (patch)
tree0487a291955e3bedbb463cfae961782b2dd688bc /vpp-api-test/vat/api_format.c
parent8b2247d24749a13e1b1e395c64fb358ef5bd0aa8 (diff)
api: L2 XConnect API (VPP-438)
Change-Id: I0a86184391723675488a5eb517c375f67940f5b5 Signed-off-by: Matus Fabian <matfabia@cisco.com>
Diffstat (limited to 'vpp-api-test/vat/api_format.c')
-rw-r--r--vpp-api-test/vat/api_format.c59
1 files changed, 57 insertions, 2 deletions
diff --git a/vpp-api-test/vat/api_format.c b/vpp-api-test/vat/api_format.c
index 0bbed5c49c7..e93c89bf076 100644
--- a/vpp-api-test/vat/api_format.c
+++ b/vpp-api-test/vat/api_format.c
@@ -3786,7 +3786,8 @@ _(PUNT_REPLY, punt_reply) \
_(IP_FIB_DETAILS, ip_fib_details) \
_(IP6_FIB_DETAILS, ip6_fib_details) \
_(FEATURE_ENABLE_DISABLE_REPLY, feature_enable_disable_reply) \
-_(SW_INTERFACE_TAG_ADD_DEL_REPLY, sw_interface_tag_add_del_reply)
+_(SW_INTERFACE_TAG_ADD_DEL_REPLY, sw_interface_tag_add_del_reply) \
+_(L2_XCONNECT_DETAILS, l2_xconnect_details)
/* M: construct, but don't yet send a message */
@@ -16304,6 +16305,59 @@ api_sw_interface_tag_add_del (vat_main_t * vam)
W;
}
+static void vl_api_l2_xconnect_details_t_handler
+ (vl_api_l2_xconnect_details_t * mp)
+{
+ vat_main_t *vam = &vat_main;
+
+ fformat (vam->ofp, "%15d%15d\n",
+ ntohl (mp->rx_sw_if_index), ntohl (mp->tx_sw_if_index));
+}
+
+static void vl_api_l2_xconnect_details_t_handler_json
+ (vl_api_l2_xconnect_details_t * mp)
+{
+ vat_main_t *vam = &vat_main;
+ vat_json_node_t *node = NULL;
+
+ if (VAT_JSON_ARRAY != vam->json_tree.type)
+ {
+ ASSERT (VAT_JSON_NONE == vam->json_tree.type);
+ vat_json_init_array (&vam->json_tree);
+ }
+ node = vat_json_array_add (&vam->json_tree);
+
+ vat_json_init_object (node);
+ vat_json_object_add_uint (node, "rx_sw_if_index",
+ ntohl (mp->rx_sw_if_index));
+ vat_json_object_add_uint (node, "tx_sw_if_index",
+ ntohl (mp->tx_sw_if_index));
+}
+
+static int
+api_l2_xconnect_dump (vat_main_t * vam)
+{
+ vl_api_l2_xconnect_dump_t *mp;
+ f64 timeout;
+
+ if (!vam->json_output)
+ {
+ fformat (vam->ofp, "%15s%15s\n", "rx_sw_if_index", "tx_sw_if_index");
+ }
+
+ M (L2_XCONNECT_DUMP, l2_xconnect_dump);
+
+ S;
+
+ /* Use a control ping for synchronization */
+ {
+ vl_api_control_ping_t *mp;
+ M (CONTROL_PING, control_ping);
+ S;
+ }
+ W;
+}
+
static int
q_or_quit (vat_main_t * vam)
{
@@ -16976,7 +17030,8 @@ _(ip6_fib_dump, "") \
_(feature_enable_disable, "arc_name <arc_name> " \
"feature_name <feature_name> <intfc> | sw_if_index <nn> [disable]") \
_(sw_interface_tag_add_del, "<intfc> | sw_if_index <nn> tag <text>" \
-"[disable]")
+"[disable]") \
+_(l2_xconnect_dump, "")
/* List of command functions, CLI names map directly to functions */
#define foreach_cli_function \