#include <vpp/api/vpe_all_api_h.h>
#undef vl_printfun
#include <vlibapi/api_helper_macros.h>
+
#define foreach_vpe_api_msg \
_(CONTROL_PING, control_ping) \
_(CLI, cli) \
#define QUOTE_(x) #x
#define QUOTE(x) QUOTE_(x)
+
typedef enum
{
RESOLVE_IP4_ADD_DEL_ROUTE = 1,
vl_api_cli_t_handler (vl_api_cli_t * mp)
{
vl_api_cli_reply_t *rp;
- unix_shared_memory_queue_t *q;
+ vl_api_registration_t *reg;
vlib_main_t *vm = vlib_get_main ();
api_main_t *am = &api_main;
unformat_input_t input;
u8 *shmem_vec = 0;
void *oldheap;
- q = vl_api_client_index_to_input_queue (mp->client_index);
- if (!q)
- return;
+ reg = vl_api_client_index_to_registration (mp->client_index);
+ if (!reg)
+ return;;
rp = vl_msg_api_alloc (sizeof (*rp));
rp->_vl_msg_id = ntohs (VL_API_CLI_REPLY);
rp->reply_in_shmem = (uword) shmem_vec;
- vl_msg_api_send_shmem (q, (u8 *) & rp);
+ vl_api_send_msg (reg, (u8 *) rp);
}
static void
vlib_main_t *vm = vlib_get_main ();
void *oldheap;
vl_api_get_node_graph_reply_t *rmp;
+ static vlib_node_t ***node_dups;
+ static vlib_main_t **stat_vms;
pthread_mutex_lock (&am->vlib_rp->mutex);
oldheap = svm_push_data_heap (am->vlib_rp);
vec_validate (vector, 16384);
vec_reset_length (vector);
- /* $$$$ FIXME */
- vector = vlib_node_serialize (&vm->node_main, vector,
- (u32) ~ 0 /* all threads */ ,
- 1 /* include nexts */ ,
+ vlib_node_get_nodes (vm, 0 /* main threads */ ,
+ 0 /* include stats */ ,
+ 1 /* barrier sync */ ,
+ &node_dups, &stat_vms);
+ vector = vlib_node_serialize (vm, node_dups, vector, 1 /* include nexts */ ,
1 /* include stats */ );
svm_pop_heap (oldheap);
{ \
vpe_client_registration_t *reg; \
vpe_api_main_t * vam = &vpe_api_main; \
- unix_shared_memory_queue_t * q; \
+ svm_queue_t * q; \
\
/* One registration only... */ \
pool_foreach(reg, vam->nn##_registrations, \
VLIB_API_INIT_FUNCTION (vpe_api_hookup);
-static clib_error_t *
+clib_error_t *
vpe_api_init (vlib_main_t * vm)
{
vpe_api_main_t *am = &vpe_api_main;
#undef _
vl_set_memory_region_name ("/vpe-api");
- vl_enable_disable_memory_api (vm, 1 /* enable it */ );
+ vl_mem_api_enable_disable (vm, 1 /* enable it */ );
return 0;
}
-VLIB_INIT_FUNCTION (vpe_api_init);
-
-
static clib_error_t *
api_segment_config (vlib_main_t * vm, unformat_input_t * input)
{