summaryrefslogtreecommitdiffstats
path: root/src/plugins
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/quic/quic.c36
1 files changed, 36 insertions, 0 deletions
diff --git a/src/plugins/quic/quic.c b/src/plugins/quic/quic.c
index a2aa17a3ca8..c066b0d955e 100644
--- a/src/plugins/quic/quic.c
+++ b/src/plugins/quic/quic.c
@@ -1620,6 +1620,40 @@ quic_app_rx_callback (session_t * udp_session)
return 0;
}
+always_inline void
+quic_common_get_transport_endpoint (quic_ctx_t * ctx, ip46_address_t * ip,
+ u16 * port, u8 * is_ip4, u8 is_lcl)
+{
+ session_t *udp_session;
+ QUIC_DBG (2, "Called quic_get_transport_endpoint");
+ if (ctx->c_quic_ctx_id.is_stream)
+ *is_ip4 = 255; /* well this is ugly */
+ else
+ {
+ udp_session =
+ session_get_from_handle (ctx->c_quic_ctx_id.udp_session_handle);
+ session_get_endpoint (udp_session, ip, port, is_ip4, is_lcl);
+ }
+}
+
+static void
+quic_get_transport_listener_endpoint (u32 listener_index, ip46_address_t * ip,
+ u16 * port, u8 * is_ip4, u8 is_lcl)
+{
+ quic_ctx_t *ctx;
+ ctx = quic_ctx_get (listener_index);
+ quic_common_get_transport_endpoint (ctx, ip, port, is_ip4, is_lcl);
+}
+
+static void
+quic_get_transport_endpoint (u32 ctx_index, u32 thread_index,
+ ip46_address_t * ip, u16 * port, u8 * is_ip4,
+ u8 is_lcl)
+{
+ quic_ctx_t *ctx;
+ ctx = quic_ctx_get_w_thread (ctx_index, thread_index);
+ quic_common_get_transport_endpoint (ctx, ip, port, is_ip4, is_lcl);
+}
/*****************************************************************************
* END TRANSPORT PROTO FUNCTIONS
@@ -1650,6 +1684,8 @@ const static transport_proto_vft_t quic_proto = {
.format_connection = format_quic_connection,
.format_half_open = format_quic_half_open,
.format_listener = format_quic_listener,
+ .get_transport_endpoint = quic_get_transport_endpoint,
+ .get_transport_listener_endpoint = quic_get_transport_listener_endpoint,
};
/* *INDENT-ON* */