}
}
+uword
+unformat_ip46_address (unformat_input_t * input, va_list * args)
+{
+ ip46_address_t *ip = va_arg (*args, ip46_address_t *);
+
+ if (unformat (input, "%U", unformat_ip4_address, &ip->ip4))
+ ;
+ else if (unformat (input, "%U", unformat_ip6_address, &ip->ip6))
+ ;
+ else
+ return 0;
+ return 1;
+}
+
u8 *
echo_format_crypto_engine (u8 * s, va_list * args)
{
echo_session_t *
echo_session_new (echo_main_t * em)
{
- /* thread safe new prealloced session */
+ /* thread safe new prealloced session
+ * see echo_session_prealloc */
return pool_elt_at_index (em->sessions,
clib_atomic_fetch_add (&em->nxt_available_sidx,
1));
}
int
-echo_send_rpc (echo_main_t * em, void *fp, void *arg, u32 opaque)
+echo_send_rpc (echo_main_t * em, void *fp, echo_rpc_args_t * args)
{
svm_msg_q_msg_t msg;
echo_rpc_msg_t *evt;
}
msg = svm_msg_q_alloc_msg_w_ring (em->rpc_msq_queue, 0);
evt = (echo_rpc_msg_t *) svm_msg_q_msg_data (em->rpc_msq_queue, &msg);
- evt->arg = arg;
- evt->opaque = opaque;
evt->fp = fp;
+ clib_memcpy (&evt->args, args, sizeof (evt->args));
svm_msg_q_add_and_unlock (em->rpc_msq_queue, &msg);
return 0;