summaryrefslogtreecommitdiffstats
path: root/src/vnet/session/session.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.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.c')
-rw-r--r--src/vnet/session/session.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/src/vnet/session/session.c b/src/vnet/session/session.c
index 58ec1c01369..c1d02ab8f09 100644
--- a/src/vnet/session/session.c
+++ b/src/vnet/session/session.c
@@ -1228,7 +1228,7 @@ session_segment_handle (session_t * s)
{
svm_fifo_t *f;
- if (s->session_state == SESSION_STATE_LISTENING)
+ if (!s->rx_fifo)
return SESSION_INVALID_HANDLE;
f = s->rx_fifo;
@@ -1291,6 +1291,20 @@ session_get_transport (session_t * s)
s->connection_index);
}
+void
+session_get_endpoint (session_t * s, ip46_address_t * ip, u16 * port,
+ u8 * is_ip4, u8 is_lcl)
+{
+ if (s->session_state != SESSION_STATE_LISTENING)
+ return transport_get_endpoint (session_get_transport_proto (s),
+ s->connection_index, s->thread_index, ip,
+ port, is_ip4, is_lcl);
+ else
+ return transport_get_listener_endpoint (session_get_transport_proto (s),
+ s->connection_index, ip, port,
+ is_ip4, is_lcl);
+}
+
transport_connection_t *
listen_session_get_transport (session_t * s)
{