session: use teps in accept/connect notifications
[vpp.git] / src / plugins / quic / quic.c
index a2aa17a..5ff962d 100644 (file)
@@ -1620,6 +1620,39 @@ quic_app_rx_callback (session_t * udp_session)
   return 0;
 }
 
+always_inline void
+quic_common_get_transport_endpoint (quic_ctx_t * ctx,
+                                   transport_endpoint_t * tep, u8 is_lcl)
+{
+  session_t *udp_session;
+  QUIC_DBG (2, "Called quic_get_transport_endpoint");
+  if (ctx->c_quic_ctx_id.is_stream)
+    tep->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, tep, is_lcl);
+    }
+}
+
+static void
+quic_get_transport_listener_endpoint (u32 listener_index,
+                                     transport_endpoint_t * tep, u8 is_lcl)
+{
+  quic_ctx_t *ctx;
+  ctx = quic_ctx_get (listener_index);
+  quic_common_get_transport_endpoint (ctx, tep, is_lcl);
+}
+
+static void
+quic_get_transport_endpoint (u32 ctx_index, u32 thread_index,
+                            transport_endpoint_t * tep, u8 is_lcl)
+{
+  quic_ctx_t *ctx;
+  ctx = quic_ctx_get_w_thread (ctx_index, thread_index);
+  quic_common_get_transport_endpoint (ctx, tep, is_lcl);
+}
 
 /*****************************************************************************
  * END TRANSPORT PROTO FUNCTIONS
@@ -1650,6 +1683,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* */