summaryrefslogtreecommitdiffstats
path: root/src/vnet/tls
diff options
context:
space:
mode:
authorFlorin Coras <fcoras@cisco.com>2019-02-03 15:26:14 -0800
committerDave Barach <openvpp@barachs.net>2019-02-04 22:00:54 +0000
commit288eaab5964b9211350acad8d742fae4789577fe (patch)
treebdc12155958c6fedf4e976791529fc8a6590d70e /src/vnet/tls
parent8d991d923b52a2692370bfa33902d29ff5d2f826 (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/tls')
-rw-r--r--src/vnet/tls/tls.c62
-rw-r--r--src/vnet/tls/tls.h14
2 files changed, 38 insertions, 38 deletions
diff --git a/src/vnet/tls/tls.c b/src/vnet/tls/tls.c
index d51d5dbaa38..3f21e6e3cb2 100644
--- a/src/vnet/tls/tls.c
+++ b/src/vnet/tls/tls.c
@@ -51,40 +51,40 @@ tls_get_available_engine (void)
}
int
-tls_add_vpp_q_rx_evt (stream_session_t * s)
+tls_add_vpp_q_rx_evt (session_t * s)
{
- if (svm_fifo_set_event (s->server_rx_fifo))
- session_send_io_evt_to_thread (s->server_rx_fifo, FIFO_EVENT_APP_RX);
+ if (svm_fifo_set_event (s->rx_fifo))
+ session_send_io_evt_to_thread (s->rx_fifo, FIFO_EVENT_APP_RX);
return 0;
}
int
-tls_add_vpp_q_builtin_rx_evt (stream_session_t * s)
+tls_add_vpp_q_builtin_rx_evt (session_t * s)
{
- 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;
}
int
-tls_add_vpp_q_tx_evt (stream_session_t * s)
+tls_add_vpp_q_tx_evt (session_t * s)
{
- if (svm_fifo_set_event (s->server_tx_fifo))
- session_send_io_evt_to_thread (s->server_tx_fifo, FIFO_EVENT_APP_TX);
+ if (svm_fifo_set_event (s->tx_fifo))
+ session_send_io_evt_to_thread (s->tx_fifo, FIFO_EVENT_APP_TX);
return 0;
}
int
-tls_add_vpp_q_builtin_tx_evt (stream_session_t * s)
+tls_add_vpp_q_builtin_tx_evt (session_t * s)
{
- if (svm_fifo_set_event (s->server_tx_fifo))
+ if (svm_fifo_set_event (s->tx_fifo))
session_send_io_evt_to_thread_custom (s, s->thread_index,
FIFO_EVENT_BUILTIN_TX);
return 0;
}
static inline int
-tls_add_app_q_evt (app_worker_t * app, stream_session_t * app_session)
+tls_add_app_q_evt (app_worker_t * app, session_t * app_session)
{
return app_worker_lock_and_send_event (app, app_session, FIFO_EVENT_APP_RX);
}
@@ -178,7 +178,7 @@ tls_ctx_half_open_index (tls_ctx_t * ctx)
}
void
-tls_notify_app_enqueue (tls_ctx_t * ctx, stream_session_t * app_session)
+tls_notify_app_enqueue (tls_ctx_t * ctx, session_t * app_session)
{
app_worker_t *app;
app = app_worker_get_if_valid (app_session->app_wrk_index);
@@ -189,7 +189,7 @@ tls_notify_app_enqueue (tls_ctx_t * ctx, stream_session_t * app_session)
int
tls_notify_app_accept (tls_ctx_t * ctx)
{
- stream_session_t *app_listener, *app_session;
+ session_t *app_listener, *app_session;
segment_manager_t *sm;
app_worker_t *app_wrk;
application_t *app;
@@ -230,8 +230,8 @@ tls_notify_app_accept (tls_ctx_t * ctx)
int
tls_notify_app_connected (tls_ctx_t * ctx, u8 is_failed)
{
- int (*cb_fn) (u32, u32, stream_session_t *, u8);
- stream_session_t *app_session;
+ int (*cb_fn) (u32, u32, session_t *, u8);
+ session_t *app_session;
segment_manager_t *sm;
app_worker_t *app_wrk;
application_t *app;
@@ -341,13 +341,13 @@ tls_ctx_init_client (tls_ctx_t * ctx)
}
static inline int
-tls_ctx_write (tls_ctx_t * ctx, stream_session_t * app_session)
+tls_ctx_write (tls_ctx_t * ctx, session_t * app_session)
{
return tls_vfts[ctx->tls_ctx_engine].ctx_write (ctx, app_session);
}
static inline int
-tls_ctx_read (tls_ctx_t * ctx, stream_session_t * tls_session)
+tls_ctx_read (tls_ctx_t * ctx, session_t * tls_session)
{
return tls_vfts[ctx->tls_ctx_engine].ctx_read (ctx, tls_session);
}
@@ -359,7 +359,7 @@ tls_ctx_handshake_is_over (tls_ctx_t * ctx)
}
void
-tls_session_reset_callback (stream_session_t * s)
+tls_session_reset_callback (session_t * s)
{
clib_warning ("called...");
}
@@ -378,9 +378,9 @@ tls_del_segment_callback (u32 client_index, u64 segment_handle)
}
void
-tls_session_disconnect_callback (stream_session_t * tls_session)
+tls_session_disconnect_callback (session_t * tls_session)
{
- stream_session_t *app_session;
+ session_t *app_session;
tls_ctx_t *ctx;
app_worker_t *app_wrk;
application_t *app;
@@ -399,9 +399,9 @@ tls_session_disconnect_callback (stream_session_t * tls_session)
}
int
-tls_session_accept_callback (stream_session_t * tls_session)
+tls_session_accept_callback (session_t * tls_session)
{
- stream_session_t *tls_listener, *app_session;
+ session_t *tls_listener, *app_session;
tls_ctx_t *lctx, *ctx;
u32 ctx_handle;
@@ -431,7 +431,7 @@ tls_session_accept_callback (stream_session_t * tls_session)
}
int
-tls_app_tx_callback (stream_session_t * app_session)
+tls_app_tx_callback (session_t * app_session)
{
tls_ctx_t *ctx;
if (PREDICT_FALSE (app_session->session_state == SESSION_STATE_CLOSED))
@@ -442,7 +442,7 @@ tls_app_tx_callback (stream_session_t * app_session)
}
int
-tls_app_rx_callback (stream_session_t * tls_session)
+tls_app_rx_callback (session_t * tls_session)
{
tls_ctx_t *ctx;
@@ -453,9 +453,9 @@ tls_app_rx_callback (stream_session_t * tls_session)
int
tls_session_connected_callback (u32 tls_app_index, u32 ho_ctx_index,
- stream_session_t * tls_session, u8 is_fail)
+ session_t * tls_session, u8 is_fail)
{
- stream_session_t *app_session;
+ session_t *app_session;
tls_ctx_t *ho_ctx, *ctx;
u32 ctx_handle;
@@ -463,7 +463,7 @@ tls_session_connected_callback (u32 tls_app_index, u32 ho_ctx_index,
if (is_fail)
{
- int (*cb_fn) (u32, u32, stream_session_t *, u8), rv = 0;
+ int (*cb_fn) (u32, u32, session_t *, u8), rv = 0;
u32 wrk_index, api_context;
app_worker_t *app_wrk;
application_t *app;
@@ -591,8 +591,8 @@ tls_start_listen (u32 app_listener_index, transport_endpoint_t * tep)
tls_main_t *tm = &tls_main;
session_handle_t tls_handle;
session_endpoint_cfg_t *sep;
- stream_session_t *tls_listener;
- stream_session_t *app_listener;
+ session_t *tls_listener;
+ session_t *app_listener;
tls_engine_type_t engine_type;
application_t *app;
tls_ctx_t *lctx;
@@ -705,7 +705,7 @@ format_tls_connection (u8 * s, va_list * args)
s = format (s, "%-50U", format_tls_ctx, ctx, thread_index);
if (verbose)
{
- stream_session_t *ts;
+ session_t *ts;
ts = session_get_from_handle (ctx->app_session_handle);
s = format (s, "state: %-7u", ts->session_state);
if (verbose > 1)
diff --git a/src/vnet/tls/tls.h b/src/vnet/tls/tls.h
index c4f04673f2e..b9b0e0baa83 100644
--- a/src/vnet/tls/tls.h
+++ b/src/vnet/tls/tls.h
@@ -101,8 +101,8 @@ typedef struct tls_engine_vft_
tls_ctx_t *(*ctx_get_w_thread) (u32 ctx_index, u8 thread_index);
int (*ctx_init_client) (tls_ctx_t * ctx);
int (*ctx_init_server) (tls_ctx_t * ctx);
- int (*ctx_read) (tls_ctx_t * ctx, stream_session_t * tls_session);
- int (*ctx_write) (tls_ctx_t * ctx, stream_session_t * app_session);
+ int (*ctx_read) (tls_ctx_t * ctx, session_t * tls_session);
+ int (*ctx_write) (tls_ctx_t * ctx, session_t * app_session);
u8 (*ctx_handshake_is_over) (tls_ctx_t * ctx);
int (*ctx_start_listen) (tls_ctx_t * ctx);
int (*ctx_stop_listen) (tls_ctx_t * ctx);
@@ -119,13 +119,13 @@ typedef enum tls_engine_type_
tls_main_t *vnet_tls_get_main (void);
void tls_register_engine (const tls_engine_vft_t * vft,
tls_engine_type_t type);
-int tls_add_vpp_q_rx_evt (stream_session_t * s);
-int tls_add_vpp_q_tx_evt (stream_session_t * s);
-int tls_add_vpp_q_builtin_tx_evt (stream_session_t * s);
-int tls_add_vpp_q_builtin_rx_evt (stream_session_t * s);
+int tls_add_vpp_q_rx_evt (session_t * s);
+int tls_add_vpp_q_tx_evt (session_t * s);
+int tls_add_vpp_q_builtin_tx_evt (session_t * s);
+int tls_add_vpp_q_builtin_rx_evt (session_t * s);
int tls_notify_app_accept (tls_ctx_t * ctx);
int tls_notify_app_connected (tls_ctx_t * ctx, u8 is_failed);
-void tls_notify_app_enqueue (tls_ctx_t * ctx, stream_session_t * app_session);
+void tls_notify_app_enqueue (tls_ctx_t * ctx, session_t * app_session);
#endif /* SRC_VNET_TLS_TLS_H_ */
/*
* fd.io coding-style-patch-verification: ON