diff options
author | Florin Coras <fcoras@cisco.com> | 2019-02-03 15:26:14 -0800 |
---|---|---|
committer | Dave Barach <openvpp@barachs.net> | 2019-02-04 22:00:54 +0000 |
commit | 288eaab5964b9211350acad8d742fae4789577fe (patch) | |
tree | bdc12155958c6fedf4e976791529fc8a6590d70e /src/vnet/session-apps/echo_client.c | |
parent | 8d991d923b52a2692370bfa33902d29ff5d2f826 (diff) |
session: cleanup part 1
Rename core data structures. This will break compatibility for out of
tree builtin apps.
- stream_session_t to session_t
- server_rx/tx_fifo to rx/tx_fifo
- stream_session.h to session_types.h
- update copyright
Change-Id: I414097c6e28bcbea866fbf13b8773c7db3f49325
Signed-off-by: Florin Coras <fcoras@cisco.com>
Diffstat (limited to 'src/vnet/session-apps/echo_client.c')
-rw-r--r-- | src/vnet/session-apps/echo_client.c | 28 |
1 files changed, 13 insertions, 15 deletions
diff --git a/src/vnet/session-apps/echo_client.c b/src/vnet/session-apps/echo_client.c index d100aae5c2a..c39f787c093 100644 --- a/src/vnet/session-apps/echo_client.c +++ b/src/vnet/session-apps/echo_client.c @@ -263,7 +263,7 @@ echo_client_node_fn (vlib_main_t * vm, vlib_node_runtime_t * node, } if (PREDICT_FALSE (delete_session == 1)) { - stream_session_t *s; + session_t *s; clib_atomic_fetch_add (&ecm->tx_total, sp->bytes_sent); clib_atomic_fetch_add (&ecm->rx_total, sp->bytes_received); @@ -356,7 +356,7 @@ echo_clients_init (vlib_main_t * vm) static int echo_clients_session_connected_callback (u32 app_index, u32 api_context, - stream_session_t * s, u8 is_fail) + session_t * s, u8 is_fail) { echo_client_main_t *ecm = &echo_client_main; eclient_session_t *session; @@ -393,9 +393,9 @@ echo_clients_session_connected_callback (u32 app_index, u32 api_context, session_index = session - ecm->sessions; session->bytes_to_send = ecm->bytes_to_send; session->bytes_to_receive = ecm->no_return ? 0ULL : ecm->bytes_to_send; - session->data.rx_fifo = s->server_rx_fifo; + session->data.rx_fifo = s->rx_fifo; session->data.rx_fifo->client_session_index = session_index; - session->data.tx_fifo = s->server_tx_fifo; + session->data.tx_fifo = s->tx_fifo; session->data.tx_fifo->client_session_index = session_index; session->data.vpp_evt_q = ecm->vpp_event_queue[thread_index]; session->vpp_session_handle = session_handle (s); @@ -422,7 +422,7 @@ echo_clients_session_connected_callback (u32 app_index, u32 api_context, } static void -echo_clients_session_reset_callback (stream_session_t * s) +echo_clients_session_reset_callback (session_t * s) { echo_client_main_t *ecm = &echo_client_main; vnet_disconnect_args_t _a = { 0 }, *a = &_a; @@ -437,13 +437,13 @@ echo_clients_session_reset_callback (stream_session_t * s) } static int -echo_clients_session_create_callback (stream_session_t * s) +echo_clients_session_create_callback (session_t * s) { return 0; } static void -echo_clients_session_disconnect_callback (stream_session_t * s) +echo_clients_session_disconnect_callback (session_t * s) { echo_client_main_t *ecm = &echo_client_main; vnet_disconnect_args_t _a = { 0 }, *a = &_a; @@ -454,7 +454,7 @@ echo_clients_session_disconnect_callback (stream_session_t * s) } void -echo_clients_session_disconnect (stream_session_t * s) +echo_clients_session_disconnect (session_t * s) { echo_client_main_t *ecm = &echo_client_main; vnet_disconnect_args_t _a = { 0 }, *a = &_a; @@ -464,7 +464,7 @@ echo_clients_session_disconnect (stream_session_t * s) } static int -echo_clients_rx_callback (stream_session_t * s) +echo_clients_rx_callback (session_t * s) { echo_client_main_t *ecm = &echo_client_main; eclient_session_t *sp; @@ -475,15 +475,13 @@ echo_clients_rx_callback (stream_session_t * s) return -1; } - sp = pool_elt_at_index (ecm->sessions, - s->server_rx_fifo->client_session_index); + sp = pool_elt_at_index (ecm->sessions, s->rx_fifo->client_session_index); receive_data_chunk (ecm, sp); - if (svm_fifo_max_dequeue (s->server_rx_fifo)) + if (svm_fifo_max_dequeue (s->rx_fifo)) { - if (svm_fifo_set_event (s->server_rx_fifo)) - session_send_io_evt_to_thread (s->server_rx_fifo, - FIFO_EVENT_BUILTIN_RX); + if (svm_fifo_set_event (s->rx_fifo)) + session_send_io_evt_to_thread (s->rx_fifo, FIFO_EVENT_BUILTIN_RX); } return 0; } |