summaryrefslogtreecommitdiffstats
path: root/vpp-api-test/vat/api_format.c
diff options
context:
space:
mode:
authorAndrej Kozemcak <akozemca@cisco.com>2016-05-02 12:14:33 +0200
committerDave Barach <openvpp@barachs.net>2016-05-05 11:46:10 +0000
commita9edd85e4cb35fd55c515dbfbad37aecd28c1431 (patch)
tree5e3b18b82beea727d9445a19fcbcec7962813ffc /vpp-api-test/vat/api_format.c
parentfdff1e6ed540f2a04792fb64e04b0c7862dc2b8c (diff)
ONE-2: Add new LISP dump API for lisp gpe
API: lisp_gpe_enable_disable_dump Change-Id: I1c8e78f00f9a3f99c1f2f54884af565292e4ccf8 Signed-off-by: Andrej Kozemcak <akozemca@cisco.com>
Diffstat (limited to 'vpp-api-test/vat/api_format.c')
-rw-r--r--vpp-api-test/vat/api_format.c66
1 files changed, 64 insertions, 2 deletions
diff --git a/vpp-api-test/vat/api_format.c b/vpp-api-test/vat/api_format.c
index 548959edb3b..c36e0591b39 100644
--- a/vpp-api-test/vat/api_format.c
+++ b/vpp-api-test/vat/api_format.c
@@ -2113,6 +2113,36 @@ vl_api_lisp_map_resolver_details_t_handler_json (
}
}
+static void
+vl_api_lisp_gpe_enable_disable_status_details_t_handler
+(vl_api_lisp_gpe_enable_disable_status_details_t *mp)
+{
+ vat_main_t *vam = &vat_main;
+
+ fformat(vam->ofp, "%=20s\n",
+ mp->is_en ? "enable" : "disable");
+}
+
+static void
+vl_api_lisp_gpe_enable_disable_status_details_t_handler_json
+(vl_api_lisp_gpe_enable_disable_status_details_t *mp)
+{
+ vat_main_t *vam = &vat_main;
+ vat_json_node_t *node = NULL;
+ u8 *str = NULL;
+
+ str = format(0, "%s", mp->is_en ? "enable" : "disable");
+
+ 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_string_copy(node, "lisp_gpe", str);
+}
+
#define vl_api_vnet_ip4_fib_counters_t_endian vl_noop_handler
#define vl_api_vnet_ip4_fib_counters_t_print vl_noop_handler
#define vl_api_vnet_ip6_fib_counters_t_endian vl_noop_handler
@@ -2379,7 +2409,9 @@ _(LISP_GPE_ADD_DEL_IFACE_REPLY, lisp_gpe_add_del_iface_reply) \
_(LISP_LOCATOR_SET_DETAILS, lisp_locator_set_details) \
_(LISP_LOCAL_EID_TABLE_DETAILS, lisp_local_eid_table_details) \
_(LISP_GPE_TUNNEL_DETAILS, lisp_gpe_tunnel_details) \
-_(LISP_MAP_RESOLVER_DETAILS, lisp_map_resolver_details)
+_(LISP_MAP_RESOLVER_DETAILS, lisp_map_resolver_details) \
+_(LISP_GPE_ENABLE_DISABLE_STATUS_DETAILS, \
+ lisp_gpe_enable_disable_status_details)
/* M: construct, but don't yet send a message */
@@ -10300,6 +10332,35 @@ api_lisp_map_resolver_dump(vat_main_t *vam)
return 0;
}
+static int
+api_lisp_gpe_enable_disable_status_dump(vat_main_t *vam)
+{
+ vl_api_lisp_gpe_enable_disable_status_dump_t *mp;
+ f64 timeout = ~0;
+
+ if (!vam->json_output) {
+ fformat(vam->ofp, "%=20s\n",
+ "lisp gpe");
+ }
+
+ M(LISP_GPE_ENABLE_DISABLE_STATUS_DUMP,
+ lisp_gpe_enable_disable_status_dump);
+ /* send it... */
+ S;
+
+ /* Use a control ping for synchronization */
+ {
+ vl_api_control_ping_t * mp;
+ M(CONTROL_PING, control_ping);
+ S;
+ }
+ /* Wait for a reply... */
+ W;
+
+ /* NOTREACHED */
+ return 0;
+}
+
static int q_or_quit (vat_main_t * vam)
{
longjmp (vam->jump_buf, 1);
@@ -10792,7 +10853,8 @@ _(lisp_gpe_add_del_iface, "up|down") \
_(lisp_locator_set_dump, "") \
_(lisp_local_eid_table_dump, "") \
_(lisp_gpe_tunnel_dump, "") \
-_(lisp_map_resolver_dump, "")
+_(lisp_map_resolver_dump, "") \
+_(lisp_gpe_enable_disable_status_dump, "")
/* List of command functions, CLI names map directly to functions */
#define foreach_cli_function \