diff options
author | Filip Tehlar <ftehlar@cisco.com> | 2023-10-26 12:51:09 +0200 |
---|---|---|
committer | Florin Coras <florin.coras@gmail.com> | 2023-10-31 15:27:55 +0000 |
commit | 4a8fde0e51a94191efecedb431d6b9a524a23b29 (patch) | |
tree | b07c9b5efadb16b4d4fa3e4a1066eb0a559a327e /src/plugins/hs_apps/hs_test.h | |
parent | 2d7988d719d1f3cab9ac4a0762786c4b07443671 (diff) |
hsa: use common app session interface in echo tests
Type: test
Change-Id: Ib320cfb5e20f12614c013a92ac15490f8ca3a7ce
Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
Diffstat (limited to 'src/plugins/hs_apps/hs_test.h')
-rw-r--r-- | src/plugins/hs_apps/hs_test.h | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/plugins/hs_apps/hs_test.h b/src/plugins/hs_apps/hs_test.h index 71f417824d5..167c7957229 100644 --- a/src/plugins/hs_apps/hs_test.h +++ b/src/plugins/hs_apps/hs_test.h @@ -18,6 +18,7 @@ #define __included_hs_test_t__ #include <vnet/session/application_interface.h> +#include <vnet/session/session.h> #define HS_TEST_CFG_CTRL_MAGIC 0xfeedface #define HS_TEST_CFG_TXBUF_SIZE_DEF 8192 @@ -190,4 +191,22 @@ hs_make_data_port (u16 p) return clib_host_to_net_u16 (p + 1); } +static inline void +hs_test_app_session_init_ (app_session_t *as, session_t *s) +{ + as->rx_fifo = s->rx_fifo; + as->tx_fifo = s->tx_fifo; + as->vpp_evt_q = session_main_get_vpp_event_queue (s->thread_index); + if (session_get_transport_proto (s) == TRANSPORT_PROTO_UDP) + { + transport_connection_t *tc; + tc = session_get_transport (s); + clib_memcpy_fast (&as->transport, tc, sizeof (as->transport)); + as->is_dgram = 1; + } +} + +#define hs_test_app_session_init(_as, _s) \ + hs_test_app_session_init_ ((app_session_t *) (_as), (_s)) + #endif /* __included_hs_test_t__ */ |