diff options
author | Ole Troan <ot@cisco.com> | 2018-06-14 14:42:14 +0200 |
---|---|---|
committer | Dave Barach <openvpp@barachs.net> | 2018-06-15 12:16:32 +0000 |
commit | e906aacc1089ce86158486ec52d37a8470359ec2 (patch) | |
tree | a0fea12e785a4b1add2ffe6713b0b05b69df384c /src/vat | |
parent | 1ec0ea85c3f57f4638e32a00396057f80d958ec9 (diff) |
STATS: Separate socket for fd exchange.
stats { interval <no> socket-name <name> | default }
Where the default socket is in /run/vpp/stats.sock
Change-Id: Idd501b328c662804d4ccd58034b0ea6b8aa1f89a
Signed-off-by: Ole Troan <ot@cisco.com>
Diffstat (limited to 'src/vat')
-rw-r--r-- | src/vat/api_format.c | 92 |
1 files changed, 2 insertions, 90 deletions
diff --git a/src/vat/api_format.c b/src/vat/api_format.c index b9f08048651..f2d10b78de5 100644 --- a/src/vat/api_format.c +++ b/src/vat/api_format.c @@ -5930,8 +5930,7 @@ _(SESSION_RULE_ADD_DEL_REPLY, session_rule_add_del_reply) \ _(SESSION_RULES_DETAILS, session_rules_details) \ _(IP_CONTAINER_PROXY_ADD_DEL_REPLY, ip_container_proxy_add_del_reply) \ _(OUTPUT_ACL_SET_INTERFACE_REPLY, output_acl_set_interface_reply) \ -_(QOS_RECORD_ENABLE_DISABLE_REPLY, qos_record_enable_disable_reply) \ -_(MAP_STATS_SEGMENT_REPLY, map_stats_segment_reply) +_(QOS_RECORD_ENABLE_DISABLE_REPLY, qos_record_enable_disable_reply) #define foreach_standalone_reply_msg \ _(SW_INTERFACE_EVENT, sw_interface_event) \ @@ -22531,92 +22530,6 @@ api_app_namespace_add_del (vat_main_t * vam) return ret; } -static void vl_api_map_stats_segment_reply_t_handler - (vl_api_map_stats_segment_reply_t * mp) -{ -#if VPP_API_TEST_BUILTIN == 0 - vat_main_t *vam = &vat_main; - ssvm_private_t *ssvmp = &vam->stat_segment; - ssvm_shared_header_t *shared_header; - socket_client_main_t *scm = vam->socket_client_main; - int rv = ntohl (mp->retval); - int my_fd, retval; - clib_error_t *error; - - vam->retval = rv; - - if (rv != 0) - { - vam->result_ready = 1; - return; - } - - /* - * Check the socket for the magic fd - */ - error = vl_sock_api_recv_fd_msg (scm->socket_fd, &my_fd, 5); - if (error) - { - clib_error_report (error); - vam->retval = -99; - vam->result_ready = 1; - return; - } - - memset (ssvmp, 0, sizeof (*ssvmp)); - ssvmp->fd = my_fd; - - /* Note: this closes memfd.fd */ - retval = ssvm_slave_init_memfd (ssvmp); - if (retval) - { - clib_warning ("WARNING: segment map returned %d", retval); - vam->retval = -99; - vam->result_ready = 1; - return; - } - else - errmsg ("stat segment mapped OK..."); - - ASSERT (ssvmp && ssvmp->sh); - - /* Pick up the segment lock from the shared memory header */ - shared_header = ssvmp->sh; - vam->stat_segment_lockp = (clib_spinlock_t *) (shared_header->opaque[0]); - vam->retval = 0; - vam->result_ready = 1; -#endif -} - -static void vl_api_map_stats_segment_reply_t_handler_json - (vl_api_map_stats_segment_reply_t * mp) -{ -#if VPP_API_TEST_BUILTIN == 0 - vat_main_t *vam = &vat_main; - clib_warning ("not implemented"); - vam->retval = -99; - vam->result_ready = 1; -#endif -} - -static int -api_map_stats_segment (vat_main_t * vam) -{ -#if VPP_API_TEST_BUILTIN == 0 - vl_api_map_stats_segment_t *mp; - int ret; - - M (MAP_STATS_SEGMENT, mp); - S (mp); - W (ret); - - return ret; -#else - errmsg ("api unavailable"); - return -99; -#endif -} - static int api_sock_init_shm (vat_main_t * vam) { @@ -24063,8 +23976,7 @@ _(ip_container_proxy_add_del, "[add|del] <address> <sw_if_index>") \ _(output_acl_set_interface, \ "<intfc> | sw_if_index <nn> [ip4-table <nn>] [ip6-table <nn>]\n" \ " [l2-table <nn>] [del]") \ -_(qos_record_enable_disable, "<record-source> <intfc> | sw_if_index <id> [disable]") \ -_(map_stats_segment, "<no-args>") +_(qos_record_enable_disable, "<record-source> <intfc> | sw_if_index <id> [disable]") /* List of command functions, CLI names map directly to functions */ #define foreach_cli_function \ |