summaryrefslogtreecommitdiffstats
path: root/src/vnet
diff options
context:
space:
mode:
authorNathan Skrzypczak <nathan.skrzypczak@gmail.com>2019-03-19 13:57:31 +0100
committerFlorin Coras <florin.coras@gmail.com>2019-03-29 15:57:30 +0000
commit60f3e6547aa75a31fad1f78bea11c950cc30d63c (patch)
tree4df1f649f10272c5f276754d6b0dbecaaa08784a /src/vnet
parentdb4cae5d438e5114a19df38acbb9e1dd6c99fe3f (diff)
Integrate first QUIC protocol implementation
Currently supports on single stream exposed through standard internal APIs Based on libquicly & picotls by h2o Change-Id: I7bc1ec0e399d1fb02bfd1da91aa7410076d08d14 Signed-off-by: Nathan Skrzypczak <nathan.skrzypczak@gmail.com>
Diffstat (limited to 'src/vnet')
-rw-r--r--src/vnet/CMakeLists.txt6
-rw-r--r--src/vnet/session/application.h4
-rw-r--r--src/vnet/session/session.c11
-rw-r--r--src/vnet/session/session.h2
-rw-r--r--src/vnet/session/transport.c10
-rw-r--r--src/vnet/session/transport_types.h1
6 files changed, 31 insertions, 3 deletions
diff --git a/src/vnet/CMakeLists.txt b/src/vnet/CMakeLists.txt
index 8e56ac35c71..c96da2a6c57 100644
--- a/src/vnet/CMakeLists.txt
+++ b/src/vnet/CMakeLists.txt
@@ -1588,6 +1588,12 @@ if(VPP_BUILD_SESSION_ECHO_APPS)
DEPENDS api_headers
NO_INSTALL
)
+ add_vpp_executable(quic_echo
+ SOURCES ../tests/vnet/session/quic_echo.c
+ LINK_LIBRARIES vlibmemoryclient svm vppinfra pthread m rt
+ DEPENDS api_headers
+ NO_INSTALL
+ )
add_vpp_executable(udp_echo
SOURCES ../tests/vnet/session/udp_echo.c
LINK_LIBRARIES vlibmemoryclient svm vppinfra pthread m rt
diff --git a/src/vnet/session/application.h b/src/vnet/session/application.h
index 3e1590ecb9f..3d601cecfc9 100644
--- a/src/vnet/session/application.h
+++ b/src/vnet/session/application.h
@@ -109,7 +109,7 @@ typedef struct application_
app_listener_t *listeners;
/*
- * TLS Specific
+ * TLS & QUIC Specific
*/
/** Certificate to be used for listen sessions */
@@ -121,6 +121,8 @@ typedef struct application_
/** Preferred tls engine */
u8 tls_engine;
+ u64 *quicly_ctx;
+
} application_t;
typedef struct app_main_
diff --git a/src/vnet/session/session.c b/src/vnet/session/session.c
index e51b138968e..7769f1faace 100644
--- a/src/vnet/session/session.c
+++ b/src/vnet/session/session.c
@@ -106,11 +106,18 @@ session_send_ctrl_evt_to_thread (session_t * s, session_evt_type_t evt_type)
}
void
+session_send_rpc_evt_to_thread_force (u32 thread_index, void *fp,
+ void *rpc_args)
+{
+ session_send_evt_to_thread (fp, rpc_args, thread_index,
+ SESSION_CTRL_EVT_RPC);
+}
+
+void
session_send_rpc_evt_to_thread (u32 thread_index, void *fp, void *rpc_args)
{
if (thread_index != vlib_get_thread_index ())
- session_send_evt_to_thread (fp, rpc_args, thread_index,
- SESSION_CTRL_EVT_RPC);
+ session_send_rpc_evt_to_thread_force (thread_index, fp, rpc_args);
else
{
void (*fnp) (void *) = fp;
diff --git a/src/vnet/session/session.h b/src/vnet/session/session.h
index 518fc62c97d..a3b84a6c8ef 100644
--- a/src/vnet/session/session.h
+++ b/src/vnet/session/session.h
@@ -335,6 +335,8 @@ int session_send_io_evt_to_thread_custom (void *data, u32 thread_index,
session_evt_type_t evt_type);
void session_send_rpc_evt_to_thread (u32 thread_index, void *fp,
void *rpc_args);
+void session_send_rpc_evt_to_thread_force (u32 thread_index, void *fp,
+ void *rpc_args);
transport_connection_t *session_get_transport (session_t * s);
diff --git a/src/vnet/session/transport.c b/src/vnet/session/transport.c
index e453ee01879..abab0865674 100644
--- a/src/vnet/session/transport.c
+++ b/src/vnet/session/transport.c
@@ -69,6 +69,9 @@ format_transport_proto (u8 * s, va_list * args)
case TRANSPORT_PROTO_UDPC:
s = format (s, "UDPC");
break;
+ case TRANSPORT_PROTO_QUIC:
+ s = format (s, "QUIC");
+ break;
}
return s;
}
@@ -91,6 +94,9 @@ format_transport_proto_short (u8 * s, va_list * args)
case TRANSPORT_PROTO_UDPC:
s = format (s, "U");
break;
+ case TRANSPORT_PROTO_QUIC:
+ s = format (s, "Q");
+ break;
}
return s;
}
@@ -175,6 +181,10 @@ unformat_transport_proto (unformat_input_t * input, va_list * args)
*proto = TRANSPORT_PROTO_TLS;
else if (unformat (input, "TLS"))
*proto = TRANSPORT_PROTO_TLS;
+ else if (unformat (input, "quic"))
+ *proto = TRANSPORT_PROTO_QUIC;
+ else if (unformat (input, "QUIC"))
+ *proto = TRANSPORT_PROTO_QUIC;
else
return 0;
return 1;
diff --git a/src/vnet/session/transport_types.h b/src/vnet/session/transport_types.h
index d309c581db8..e262ddad583 100644
--- a/src/vnet/session/transport_types.h
+++ b/src/vnet/session/transport_types.h
@@ -130,6 +130,7 @@ typedef enum _transport_proto
TRANSPORT_PROTO_NONE,
TRANSPORT_PROTO_TLS,
TRANSPORT_PROTO_UDPC,
+ TRANSPORT_PROTO_QUIC,
TRANSPORT_N_PROTO
} transport_proto_t;