aboutsummaryrefslogtreecommitdiffstats
path: root/src/vnet/tls
diff options
context:
space:
mode:
authorYu Ping <ping.yu@intel.com>2019-05-07 02:24:30 +0800
committerPing Yu <ping.yu@intel.com>2019-05-07 02:09:58 +0000
commit0b81915af417ca568aa3c8d976e0ecfd3fdffe39 (patch)
tree424f10dbce9ab8b2ddfb17f595c2f970f965380c /src/vnet/tls
parent3e9b7a219df7ba52db719af5216a44b31f21f770 (diff)
add TLS endpoint function
a bit like QUIC, and the added function can get the endpoint info in TLS, so that the VCL layer can get those info correctly Change-Id: Ied7aa3077087c1814499364dfa7654a088ad9910 Signed-off-by: Yu Ping <ping.yu@intel.com>
Diffstat (limited to 'src/vnet/tls')
-rw-r--r--src/vnet/tls/tls.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/vnet/tls/tls.c b/src/vnet/tls/tls.c
index 4d042d6bc85..520ac7b7dda 100644
--- a/src/vnet/tls/tls.c
+++ b/src/vnet/tls/tls.c
@@ -731,6 +731,30 @@ format_tls_half_open (u8 * s, va_list * args)
return s;
}
+static void
+tls_transport_endpoint_get (u32 ctx_handle, u32 thread_index,
+ transport_endpoint_t * tep, u8 is_lcl)
+{
+ tls_ctx_t *ctx = tls_ctx_get_w_thread (ctx_handle, thread_index);
+ session_t *tcp_session;
+
+ tcp_session = session_get_from_handle (ctx->tls_session_handle);
+ session_get_endpoint (tcp_session, tep, is_lcl);
+}
+
+static void
+tls_transport_listener_endpoint_get (u32 ctx_handle,
+ transport_endpoint_t * tep, u8 is_lcl)
+{
+ session_t *tls_listener;
+ app_listener_t *al;
+ tls_ctx_t *ctx = tls_listener_ctx_get (ctx_handle);
+
+ al = app_listener_get_w_handle (ctx->tls_session_handle);
+ tls_listener = app_listener_get_session (al);
+ session_get_endpoint (tls_listener, tep, is_lcl);
+}
+
/* *INDENT-OFF* */
const static transport_proto_vft_t tls_proto = {
.connect = tls_connect,
@@ -745,6 +769,8 @@ const static transport_proto_vft_t tls_proto = {
.format_connection = format_tls_connection,
.format_half_open = format_tls_half_open,
.format_listener = format_tls_listener,
+ .get_transport_endpoint = tls_transport_endpoint_get,
+ .get_transport_listener_endpoint = tls_transport_listener_endpoint_get,
};
/* *INDENT-ON* */