diff options
author | Florin Coras <fcoras@cisco.com> | 2020-04-10 19:52:04 +0000 |
---|---|---|
committer | Florin Coras <fcoras@cisco.com> | 2020-04-10 19:52:04 +0000 |
commit | 256779c85725c75de185f5cba9a4ec0c59b3151c (patch) | |
tree | 2efd3c2efde2b83272b81ec97c39fa5a8def28a4 /src/vnet/udp | |
parent | 92e131468bd9acd5d0fc6504723b8e7f81a3213e (diff) |
udp: remove connected udp transport proto
Type: refactor
To reproduce functionality, use udp in combination with
TRANSPORT_CFG_F_CONNECTED transport flag set in connect and listen
parameters.
Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: Id88470c38326f8168b9646b0de49a674e0f4266f
Diffstat (limited to 'src/vnet/udp')
-rw-r--r-- | src/vnet/udp/udp.c | 60 |
1 files changed, 0 insertions, 60 deletions
diff --git a/src/vnet/udp/udp.c b/src/vnet/udp/udp.c index 9c427a4a982..99fa2aa00d0 100644 --- a/src/vnet/udp/udp.c +++ b/src/vnet/udp/udp.c @@ -463,62 +463,6 @@ static const transport_proto_vft_t udp_proto = { }; /* *INDENT-ON* */ -int -udpc_connection_open (transport_endpoint_cfg_t * rmt) -{ - udp_connection_t *uc; - /* Reproduce the logic of udp_open_connection to find the correct thread */ - u32 thread_index = vlib_num_workers ()? 1 : vlib_get_main ()->thread_index; - u32 uc_index; - uc_index = udp_open_connection (rmt); - if (uc_index == (u32) ~ 0) - return -1; - uc = udp_connection_get (uc_index, thread_index); - uc->flags |= UDP_CONN_F_CONNECTED; - return uc_index; -} - -u32 -udpc_connection_listen (u32 session_index, transport_endpoint_t * lcl) -{ - udp_connection_t *listener; - u32 li_index; - li_index = udp_session_bind (session_index, lcl); - if (li_index == (u32) ~ 0) - return -1; - listener = udp_listener_get (li_index); - listener->flags |= UDP_CONN_F_CONNECTED; - /* Fake udp listener, i.e., make sure session layer adds a udp instead of - * udpc listener to the lookup table */ - ((session_endpoint_cfg_t *) lcl)->transport_proto = TRANSPORT_PROTO_UDP; - return li_index; -} - -/* *INDENT-OFF* */ -static const transport_proto_vft_t udpc_proto = { - .start_listen = udpc_connection_listen, - .stop_listen = udp_session_unbind, - .connect = udpc_connection_open, - .push_header = udp_push_header, - .get_connection = udp_session_get, - .get_listener = udp_session_get_listener, - .get_half_open = udp_session_get_half_open, - .close = udp_session_close, - .cleanup = udp_session_cleanup, - .send_params = udp_session_send_params, - .format_connection = format_udp_session, - .format_half_open = format_udp_half_open_session, - .format_listener = format_udp_listener_session, - .transport_options = { - .name = "udpc", - .short_name = "U", - .tx_type = TRANSPORT_TX_DGRAM, - .service_type = TRANSPORT_SERVICE_VC, - .half_open_has_fifos = 1 - }, -}; -/* *INDENT-ON* */ - static clib_error_t * udp_init (vlib_main_t * vm) { @@ -545,10 +489,6 @@ udp_init (vlib_main_t * vm) FIB_PROTOCOL_IP4, ip4_lookup_node.index); transport_register_protocol (TRANSPORT_PROTO_UDP, &udp_proto, FIB_PROTOCOL_IP6, ip6_lookup_node.index); - transport_register_protocol (TRANSPORT_PROTO_UDPC, &udpc_proto, - FIB_PROTOCOL_IP4, ip4_lookup_node.index); - transport_register_protocol (TRANSPORT_PROTO_UDPC, &udpc_proto, - FIB_PROTOCOL_IP6, ip6_lookup_node.index); /* * Initialize data structures |