- mp = vl_msg_api_alloc (sizeof (*mp));
- memset (mp, 0, sizeof (*mp));
- mp->_vl_msg_id = ntohs (VL_API_GET_FIRST_MSG_ID);
- mp->client_index = am->my_client_index;
- strncpy ((char *) mp->name, plugin_name, sizeof (mp->name) - 1);
+ /* Not using shm client */
+ if (!am->my_registration)
+ {
+ mp = vl_socket_client_msg_alloc (sizeof (*mp));
+ clib_memset (mp, 0, sizeof (*mp));
+ mp->_vl_msg_id = ntohs (VL_API_GET_FIRST_MSG_ID);
+ mp->client_index = am->my_client_index;
+ strncpy ((char *) mp->name, plugin_name, sizeof (mp->name) - 1);
+
+ if (vl_socket_client_write () <= 0)
+ goto sock_err;
+ if (vl_socket_client_read (1))
+ goto sock_err;
+
+ if (mm->first_msg_id_reply_ready == 1)
+ {
+ rv = mm->first_msg_id_reply;
+ goto result;
+ }