aboutsummaryrefslogtreecommitdiffstats
path: root/src/vnet/session/session_api.c
diff options
context:
space:
mode:
authorAloys Augustin <aloaugus@cisco.com>2019-04-08 17:54:39 +0200
committerFlorin Coras <florin.coras@gmail.com>2019-04-24 17:54:38 +0000
commitcdb7170ab44affe51c574eb2218744fff1bdd369 (patch)
tree56b852f5a203f96126df528198324baaead9317e /src/vnet/session/session_api.c
parent689f5b5425ea0f179f7c5400e79440927b10198c (diff)
Add get_endpoint in transport vft
This allows QUIC & TLS specific logic to be implemented, and meaningfull IP/port to be returned when connection is overridden. Change-Id: Id79c59fe4d7b16d36f0e96ad3e281c4026b5fe65 Signed-off-by: Aloys Augustin <aloaugus@cisco.com>
Diffstat (limited to 'src/vnet/session/session_api.c')
-rwxr-xr-xsrc/vnet/session/session_api.c17
1 files changed, 7 insertions, 10 deletions
diff --git a/src/vnet/session/session_api.c b/src/vnet/session/session_api.c
index 8e37d428982..d0af0fac279 100755
--- a/src/vnet/session/session_api.c
+++ b/src/vnet/session/session_api.c
@@ -174,7 +174,6 @@ mq_send_session_accepted_cb (session_t * s)
app_worker_t *app_wrk = app_worker_get (s->app_wrk_index);
svm_msg_q_msg_t _msg, *msg = &_msg;
svm_msg_q_t *vpp_queue, *app_mq;
- transport_connection_t *tc;
session_t *listener;
session_accepted_msg_t *mp;
session_event_t *evt;
@@ -212,11 +211,9 @@ mq_send_session_accepted_cb (session_t * s)
vpp_queue = session_main_get_vpp_event_queue (s->thread_index);
mp->vpp_event_queue_address = pointer_to_uword (vpp_queue);
mp->handle = session_handle (s);
- tc = transport_get_connection (session_get_transport_proto (s),
- s->connection_index, s->thread_index);
- mp->port = tc->rmt_port;
- mp->is_ip4 = tc->is_ip4;
- clib_memcpy_fast (&mp->ip, &tc->rmt_ip, sizeof (tc->rmt_ip));
+
+ session_get_endpoint (s, (ip46_address_t *) mp->ip, &mp->port,
+ &mp->is_ip4, 0 /* is_lcl */ );
}
else
{
@@ -350,9 +347,10 @@ mq_send_session_connected_cb (u32 app_wrk_index, u32 api_context,
vpp_mq = session_main_get_vpp_event_queue (s->thread_index);
mp->handle = session_handle (s);
mp->vpp_event_queue_address = pointer_to_uword (vpp_mq);
- clib_memcpy_fast (mp->lcl_ip, &tc->lcl_ip, sizeof (tc->lcl_ip));
- mp->is_ip4 = tc->is_ip4;
- mp->lcl_port = tc->lcl_port;
+
+ session_get_endpoint (s, (ip46_address_t *) mp->lcl_ip, &mp->lcl_port,
+ &mp->is_ip4, 1 /* is_lcl */ );
+
mp->server_rx_fifo = pointer_to_uword (s->rx_fifo);
mp->server_tx_fifo = pointer_to_uword (s->tx_fifo);
mp->segment_handle = session_segment_handle (s);
@@ -397,7 +395,6 @@ mq_send_session_bound_cb (u32 app_wrk_index, u32 api_context,
session_event_t *evt;
app_listener_t *al;
session_t *ls = 0;
-
app_wrk = app_worker_get (app_wrk_index);
app_mq = app_wrk->event_queue;
if (!app_mq)