diff options
author | Florin Coras <fcoras@cisco.com> | 2024-10-03 13:54:05 -0700 |
---|---|---|
committer | Florin Coras <fcoras@cisco.com> | 2024-10-03 13:54:05 -0700 |
commit | 08894464dd694d732f593119d733f30e2163b256 (patch) | |
tree | 39c43f65c9b669b6828dd47a174bdc1a227f2c29 | |
parent | fa5defdc2d7f674b2a9a68030bf2af993c42ad01 (diff) |
session: use proper name for ct transport
Type: refactor
Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: Iebf5155a429c77143df9eb44f504fea28cddaf98
-rw-r--r-- | src/plugins/hs_apps/sapi/vpp_echo_common.c | 4 | ||||
-rw-r--r-- | src/vnet/session/application.c | 6 | ||||
-rw-r--r-- | src/vnet/session/application_local.c | 12 | ||||
-rw-r--r-- | src/vnet/session/session_types.h | 2 | ||||
-rw-r--r-- | src/vnet/session/transport_types.h | 4 |
5 files changed, 15 insertions, 13 deletions
diff --git a/src/plugins/hs_apps/sapi/vpp_echo_common.c b/src/plugins/hs_apps/sapi/vpp_echo_common.c index 5ce04d1b75b..09ba583cf78 100644 --- a/src/plugins/hs_apps/sapi/vpp_echo_common.c +++ b/src/plugins/hs_apps/sapi/vpp_echo_common.c @@ -330,8 +330,8 @@ format_transport_proto (u8 * s, va_list * args) case TRANSPORT_PROTO_UDP: s = format (s, "UDP"); break; - case TRANSPORT_PROTO_NONE: - s = format (s, "NONE"); + case TRANSPORT_PROTO_CT: + s = format (s, "CT"); break; case TRANSPORT_PROTO_TLS: s = format (s, "TLS"); diff --git a/src/vnet/session/application.c b/src/vnet/session/application.c index 7c63ada2774..5c52adb853f 100644 --- a/src/vnet/session/application.c +++ b/src/vnet/session/application.c @@ -175,8 +175,8 @@ app_listener_alloc_and_init (application_t * app, { session_type_t local_st; - local_st = session_type_from_proto_and_ip (TRANSPORT_PROTO_NONE, - sep->is_ip4); + local_st = + session_type_from_proto_and_ip (TRANSPORT_PROTO_CT, sep->is_ip4); ls = listen_session_alloc (0, local_st); ls->app_wrk_index = sep->app_wrk_index; lh = session_handle (ls); @@ -1430,7 +1430,7 @@ vnet_connect (vnet_connect_args_t *a) session_error_t rv; a->sep_ext.original_tp = a->sep_ext.transport_proto; - a->sep_ext.transport_proto = TRANSPORT_PROTO_NONE; + a->sep_ext.transport_proto = TRANSPORT_PROTO_CT; rv = app_worker_connect_session (client_wrk, &a->sep_ext, &a->sh); a->sep_ext.transport_proto = a->sep_ext.original_tp; if (!rv || rv != SESSION_E_LOCAL_CONNECT) diff --git a/src/vnet/session/application_local.c b/src/vnet/session/application_local.c index 3ac2ba4cfbc..afa39f6ded3 100644 --- a/src/vnet/session/application_local.c +++ b/src/vnet/session/application_local.c @@ -710,7 +710,7 @@ ct_accept_one (u32 thread_index, u32 ho_index) sct->c_is_ip4 = cct->c_is_ip4; clib_memcpy (&sct->c_lcl_ip, &cct->c_rmt_ip, sizeof (cct->c_rmt_ip)); sct->client_wrk = cct->client_wrk; - sct->c_proto = TRANSPORT_PROTO_NONE; + sct->c_proto = TRANSPORT_PROTO_CT; sct->client_opaque = cct->client_opaque; sct->actual_tp = cct->actual_tp; @@ -723,8 +723,8 @@ ct_accept_one (u32 thread_index, u32 ho_index) */ ss = session_alloc (thread_index); ll = listen_session_get (ll_index); - ss->session_type = session_type_from_proto_and_ip (TRANSPORT_PROTO_NONE, - sct->c_is_ip4); + ss->session_type = + session_type_from_proto_and_ip (TRANSPORT_PROTO_CT, sct->c_is_ip4); ss->connection_index = sct->c_c_index; ss->listener_handle = listen_session_get_handle (ll); session_set_state (ss, SESSION_STATE_CREATED); @@ -889,7 +889,7 @@ ct_connect (app_worker_t *client_wrk, session_t *ll, ho->client_opaque = sep->opaque; ho->client_wrk = client_wrk->wrk_index; ho->peer_index = ll->session_index; - ho->c_proto = TRANSPORT_PROTO_NONE; + ho->c_proto = TRANSPORT_PROTO_CT; ho->c_flags |= TRANSPORT_CONNECTION_F_NO_LOOKUP; clib_memcpy (&ho->c_rmt_ip, &sep->ip, sizeof (sep->ip)); ho->flags |= CT_CONN_F_CLIENT; @@ -1425,9 +1425,9 @@ ct_session_tx (session_t * s) static clib_error_t * ct_transport_init (vlib_main_t * vm) { - transport_register_protocol (TRANSPORT_PROTO_NONE, &cut_thru_proto, + transport_register_protocol (TRANSPORT_PROTO_CT, &cut_thru_proto, FIB_PROTOCOL_IP4, ~0); - transport_register_protocol (TRANSPORT_PROTO_NONE, &cut_thru_proto, + transport_register_protocol (TRANSPORT_PROTO_CT, &cut_thru_proto, FIB_PROTOCOL_IP6, ~0); return 0; } diff --git a/src/vnet/session/session_types.h b/src/vnet/session/session_types.h index 5e650727d61..683e5378d31 100644 --- a/src/vnet/session/session_types.h +++ b/src/vnet/session/session_types.h @@ -288,7 +288,7 @@ session_get_fib_proto (session_t * s) always_inline u8 session_has_transport (session_t * s) { - return (session_get_transport_proto (s) != TRANSPORT_PROTO_NONE); + return (session_get_transport_proto (s) != TRANSPORT_PROTO_CT); } static inline transport_service_type_t diff --git a/src/vnet/session/transport_types.h b/src/vnet/session/transport_types.h index b3469fa9fdb..c92cb7939ae 100644 --- a/src/vnet/session/transport_types.h +++ b/src/vnet/session/transport_types.h @@ -171,7 +171,7 @@ STATIC_ASSERT (sizeof (transport_connection_t) <= 128, #define foreach_transport_proto \ _ (TCP, "tcp", "T") \ _ (UDP, "udp", "U") \ - _ (NONE, "ct", "C") \ + _ (CT, "ct", "C") \ _ (TLS, "tls", "J") \ _ (QUIC, "quic", "Q") \ _ (DTLS, "dtls", "D") \ @@ -185,6 +185,8 @@ typedef enum _transport_proto #undef _ } transport_proto_t; +#define TRANSPORT_PROTO_NONE TRANSPORT_PROTO_CT + u8 *format_transport_proto (u8 * s, va_list * args); u8 *format_transport_proto_short (u8 * s, va_list * args); u8 *format_transport_flags (u8 *s, va_list *args); |