-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
-}
-