summaryrefslogtreecommitdiffstats
path: root/src/vnet/udp/udp.c
diff options
context:
space:
mode:
authorFlorin Coras <fcoras@cisco.com>2017-07-16 17:12:15 -0700
committerDave Barach <openvpp@barachs.net>2017-07-25 11:17:20 +0000
commit04e5344a358a9ad42d896486d2d226149fd326f4 (patch)
tree74727757d79e1e711f3a8c67016ba2b04eea6c91 /src/vnet/udp/udp.c
parentf8d84901e4f82c54545030a881da9aded659baf9 (diff)
Cleanup/refactor session layer code
Change-Id: Ica99e8cb919fca6b069c37c969d60e8ccc2c6bf9 Signed-off-by: Florin Coras <fcoras@cisco.com>
Diffstat (limited to 'src/vnet/udp/udp.c')
-rw-r--r--src/vnet/udp/udp.c22
1 files changed, 10 insertions, 12 deletions
diff --git a/src/vnet/udp/udp.c b/src/vnet/udp/udp.c
index 57e4a60ea51..ff76a82e4a4 100644
--- a/src/vnet/udp/udp.c
+++ b/src/vnet/udp/udp.c
@@ -25,34 +25,32 @@
udp_uri_main_t udp_uri_main;
u32
-udp_session_bind_ip4 (u32 session_index,
- ip46_address_t * ip, u16 port_number_host_byte_order)
+udp_session_bind_ip4 (u32 session_index, transport_endpoint_t * lcl)
{
udp_uri_main_t *um = vnet_get_udp_main ();
udp_connection_t *listener;
pool_get (um->udp_listeners, listener);
memset (listener, 0, sizeof (udp_connection_t));
- listener->c_lcl_port = clib_host_to_net_u16 (port_number_host_byte_order);
- listener->c_lcl_ip4.as_u32 = ip->ip4.as_u32;
+ listener->c_lcl_port = clib_host_to_net_u16 (lcl->port);
+ listener->c_lcl_ip4.as_u32 = lcl->ip.ip4.as_u32;
listener->c_proto = SESSION_TYPE_IP4_UDP;
- udp_register_dst_port (um->vlib_main, port_number_host_byte_order,
- udp4_uri_input_node.index, 1 /* is_ipv4 */ );
+ udp_register_dst_port (um->vlib_main, lcl->port, udp4_uri_input_node.index,
+ 1 /* is_ipv4 */ );
return 0;
}
u32
-udp_session_bind_ip6 (u32 session_index,
- ip46_address_t * ip, u16 port_number_host_byte_order)
+udp_session_bind_ip6 (u32 session_index, transport_endpoint_t * lcl)
{
udp_uri_main_t *um = vnet_get_udp_main ();
udp_connection_t *listener;
pool_get (um->udp_listeners, listener);
- listener->c_lcl_port = clib_host_to_net_u16 (port_number_host_byte_order);
- clib_memcpy (&listener->c_lcl_ip6, &ip->ip6, sizeof (ip6_address_t));
+ listener->c_lcl_port = clib_host_to_net_u16 (lcl->port);
+ clib_memcpy (&listener->c_lcl_ip6, &lcl->ip.ip6, sizeof (ip6_address_t));
listener->c_proto = SESSION_TYPE_IP6_UDP;
- udp_register_dst_port (um->vlib_main, port_number_host_byte_order,
+ udp_register_dst_port (um->vlib_main, lcl->port,
udp4_uri_input_node.index, 0 /* is_ipv4 */ );
return 0;
}
@@ -251,7 +249,7 @@ udp_send_space_uri (transport_connection_t * t)
}
int
-udp_open_connection (ip46_address_t * addr, u16 port)
+udp_open_connection (transport_endpoint_t * tep)
{
clib_warning ("Not implemented");
return 0;