From bb5d22dafb394c6a619894bb803f770266f223f0 Mon Sep 17 00:00:00 2001 From: Khers Date: Mon, 10 Dec 2018 13:22:14 +0330 Subject: New api in order to get max entries of connection table is added. Change-Id: I2f81ec95de55ad2355f82550451ad825c228e5cd Signed-off-by: Khers --- src/plugins/acl/acl_test.c | 36 +++++++++++++++++++++++++++++++++--- 1 file changed, 33 insertions(+), 3 deletions(-) (limited to 'src/plugins/acl/acl_test.c') diff --git a/src/plugins/acl/acl_test.c b/src/plugins/acl/acl_test.c index ef98f79351f..19a6f915381 100644 --- a/src/plugins/acl/acl_test.c +++ b/src/plugins/acl/acl_test.c @@ -175,7 +175,14 @@ static void vl_api_acl_interface_etype_whitelist_details_t_handler vam->result_ready = 1; } - +static void vl_api_acl_plugin_get_conn_table_max_entries_reply_t_handler + (vl_api_acl_plugin_get_conn_table_max_entries_reply_t * mp) + { + vat_main_t * vam = acl_test_main.vat_main; + clib_warning("\nConn table max entries: %d", + __bswap_64(mp->conn_table_max_entries) ); + vam->result_ready = 1; + } static inline u8 * vl_api_acl_rule_t_pretty_format (u8 *out, vl_api_acl_rule_t * a) @@ -302,7 +309,8 @@ _(MACIP_ACL_DETAILS, macip_acl_details) \ _(MACIP_ACL_INTERFACE_ADD_DEL_REPLY, macip_acl_interface_add_del_reply) \ _(MACIP_ACL_INTERFACE_GET_REPLY, macip_acl_interface_get_reply) \ _(ACL_PLUGIN_CONTROL_PING_REPLY, acl_plugin_control_ping_reply) \ -_(ACL_PLUGIN_GET_VERSION_REPLY, acl_plugin_get_version_reply) +_(ACL_PLUGIN_GET_VERSION_REPLY, acl_plugin_get_version_reply) \ +_(ACL_PLUGIN_GET_CONN_TABLE_MAX_ENTRIES_REPLY,acl_plugin_get_conn_table_max_entries_reply) static int api_acl_plugin_get_version (vat_main_t * vam) { @@ -545,6 +553,27 @@ static int api_acl_add_replace (vat_main_t * vam) return ret; } +static int api_acl_plugin_get_conn_table_max_entries (vat_main_t * vam) +{ + acl_test_main_t * sm = &acl_test_main; + vl_api_acl_plugin_get_conn_table_max_entries_t * mp; + u32 msg_size = sizeof(*mp); + int ret; + + vam->result_ready = 0; + mp = vl_msg_api_alloc_as_if_client(msg_size); + memset (mp, 0, msg_size); + mp->_vl_msg_id = ntohs (VL_API_ACL_PLUGIN_GET_CONN_TABLE_MAX_ENTRIES + sm->msg_id_base); + mp->client_index = vam->my_client_index; + + /* send it... */ + S(mp); + + /* Wait for a reply... */ + W (ret); + return ret; +} + /* * Read the series of ACL entries from file in the following format: @@ -1455,7 +1484,8 @@ _(macip_acl_add_replace, " [ [count < _(macip_acl_del, "")\ _(macip_acl_dump, "[]") \ _(macip_acl_interface_add_del, " | sw_if_index [add|del] acl ") \ -_(macip_acl_interface_get, "") +_(macip_acl_interface_get, "") \ +_(acl_plugin_get_conn_table_max_entries, "") static -- cgit 1.2.3-korg