aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/hs_apps/sapi/vpp_echo_common.c
diff options
context:
space:
mode:
authorNathan Skrzypczak <nathan.skrzypczak@gmail.com>2019-12-06 14:44:25 +0100
committerDave Wallace <dwallacelf@gmail.com>2019-12-11 16:39:56 +0000
commitf98e59b86d886ad819e98e88b672dbd7c9560edf (patch)
tree1a07b8c124b59735cae04bc156785f6a8cb45603 /src/plugins/hs_apps/sapi/vpp_echo_common.c
parent038c7e662a8673f13ed12310a450ff646e825824 (diff)
hsa: Add option for multiple ips
Type: feature Change-Id: I133f12f9075a09bda0c5c1ed143d03838b33f6da Signed-off-by: Nathan Skrzypczak <nathan.skrzypczak@gmail.com>
Diffstat (limited to 'src/plugins/hs_apps/sapi/vpp_echo_common.c')
-rw-r--r--src/plugins/hs_apps/sapi/vpp_echo_common.c22
1 files changed, 18 insertions, 4 deletions
diff --git a/src/plugins/hs_apps/sapi/vpp_echo_common.c b/src/plugins/hs_apps/sapi/vpp_echo_common.c
index a5bdeb4f27b..e7829f3ab89 100644
--- a/src/plugins/hs_apps/sapi/vpp_echo_common.c
+++ b/src/plugins/hs_apps/sapi/vpp_echo_common.c
@@ -457,6 +457,20 @@ unformat_ip6_address (unformat_input_t * input, va_list * args)
}
}
+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)
{
@@ -517,14 +531,15 @@ echo_session_handle_add_del (echo_main_t * em, u64 handle, u32 sid)
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;
@@ -541,9 +556,8 @@ echo_send_rpc (echo_main_t * em, void *fp, void *arg, u32 opaque)
}
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;