aboutsummaryrefslogtreecommitdiffstats
path: root/vpp-api-test
diff options
context:
space:
mode:
authorPavel Kotucek <pkotucek@cisco.com>2016-03-03 13:27:11 +0100
committerGerrit Code Review <gerrit@fd.io>2016-03-07 14:07:22 +0000
commit00bbf276be22fa0458366d4dd3f4daf4e55d13e7 (patch)
tree4c2afba9a866d6200362a26df8a5789471b340a0 /vpp-api-test
parent433688dbdcaa550f7cdb6314742fb46c0c95d5d8 (diff)
Add sw_interface_clear_stats API call
Change-Id: I0731357744ddcb890efaebd81aac5370449a90e3 Signed-off-by: Pavel Kotucek <pkotucek@cisco.com>
Diffstat (limited to 'vpp-api-test')
-rw-r--r--vpp-api-test/vat/api_format.c44
1 files changed, 40 insertions, 4 deletions
diff --git a/vpp-api-test/vat/api_format.c b/vpp-api-test/vat/api_format.c
index b6f09021d5b..50153fe3202 100644
--- a/vpp-api-test/vat/api_format.c
+++ b/vpp-api-test/vat/api_format.c
@@ -620,7 +620,7 @@ static void vl_api_sw_interface_set_flags_t_handler_json
/* JSON output not supported */
}
-static void vl_api_cli_reply_t_handler
+static void vl_api_cli_reply_t_handler
(vl_api_cli_reply_t * mp)
{
vat_main_t * vam = &vat_main;
@@ -1896,7 +1896,8 @@ _(map_add_del_rule_reply) \
_(want_interface_events_reply) \
_(want_stats_reply) \
_(cop_interface_enable_disable_reply) \
-_(cop_whitelist_enable_disable_reply)
+_(cop_whitelist_enable_disable_reply) \
+_(sw_interface_clear_stats_reply)
#define _(n) \
static void vl_api_##n##_t_handler \
@@ -2049,7 +2050,8 @@ _(WANT_STATS_REPLY, want_stats_reply) \
_(GET_FIRST_MSG_ID_REPLY, get_first_msg_id_reply) \
_(COP_INTERFACE_ENABLE_DISABLE_REPLY, cop_interface_enable_disable_reply) \
_(COP_WHITELIST_ENABLE_DISABLE_REPLY, cop_whitelist_enable_disable_reply) \
-_(GET_NODE_GRAPH_REPLY, get_node_graph_reply)
+_(GET_NODE_GRAPH_REPLY, get_node_graph_reply) \
+_(SW_INTERFACE_CLEAR_STATS_REPLY, sw_interface_clear_stats_reply)
/* M: construct, but don't yet send a message */
@@ -2670,6 +2672,39 @@ static int api_sw_interface_set_flags (vat_main_t * vam)
W;
}
+static int api_sw_interface_clear_stats (vat_main_t * vam)
+{
+ unformat_input_t * i = vam->input;
+ vl_api_sw_interface_clear_stats_t *mp;
+ f64 timeout;
+ u32 sw_if_index;
+ u8 sw_if_index_set = 0;
+
+ /* Parse args required to build the message */
+ while (unformat_check_input (i) != UNFORMAT_END_OF_INPUT) {
+ if (unformat (i, "%U", unformat_sw_if_index, vam, &sw_if_index))
+ sw_if_index_set = 1;
+ else if (unformat (i, "sw_if_index %d", &sw_if_index))
+ sw_if_index_set = 1;
+ else
+ break;
+ }
+
+ /* Construct the API message */
+ M(SW_INTERFACE_CLEAR_STATS, sw_interface_clear_stats);
+
+ if (sw_if_index_set == 1)
+ mp->sw_if_index = ntohl (sw_if_index);
+ else
+ mp->sw_if_index = ~0;
+
+ /* send it... */
+ S;
+
+ /* Wait for a reply, return the good/bad news... */
+ W;
+}
+
static int api_sw_interface_add_del_address (vat_main_t * vam)
{
unformat_input_t * i = vam->input;
@@ -9064,7 +9099,8 @@ _(get_first_msg_id, "client <name>") \
_(cop_interface_enable_disable, "<intfc> | sw_if_index <nn> [disable]") \
_(cop_whitelist_enable_disable, "<intfc> | sw_if_index <nn>\n" \
"fib-id <nn> [ip4][ip6][default]") \
-_(get_node_graph, " ")
+_(get_node_graph, " ") \
+_(sw_interface_clear_stats,"<intfc> | sw_if_index <nn>")
/* List of command functions, CLI names map directly to functions */
#define foreach_cli_function \