X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=vpp-api-test%2Fvat%2Fapi_format.c;h=50153fe3202e156ecbe787f7444fb8d444869851;hb=00bbf276be22fa0458366d4dd3f4daf4e55d13e7;hp=b6f09021d5b9bed99ffdea1d7f3cd87049c86d16;hpb=433688dbdcaa550f7cdb6314742fb46c0c95d5d8;p=vpp.git 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 ") \ _(cop_interface_enable_disable, " | sw_if_index [disable]") \ _(cop_whitelist_enable_disable, " | sw_if_index \n" \ "fib-id [ip4][ip6][default]") \ -_(get_node_graph, " ") +_(get_node_graph, " ") \ +_(sw_interface_clear_stats," | sw_if_index ") /* List of command functions, CLI names map directly to functions */ #define foreach_cli_function \