aboutsummaryrefslogtreecommitdiffstats
path: root/hicn-plugin/src/faces/app/face_prod.c
diff options
context:
space:
mode:
authorAlberto Compagno <acompagn+fdio@cisco.com>2020-04-22 18:29:52 +0200
committerAlberto Compagno <acompagn+fdio@cisco.com>2020-05-04 11:32:01 +0200
commitc1b56d5861829a23289f42cecd716e681b520cf0 (patch)
tree05a78211549d5581c4f50f6e9647467cbebe548a /hicn-plugin/src/faces/app/face_prod.c
parent0c7f490009e8633e015b5cba48b78cc243254953 (diff)
[HICN-602] Added bidirectional udp tunnels
- Implemented a udp decapsulation node - Added a hash table to identify the incoming udp tunnel when an interest or data packets are received - Added udp punting through udp_register_dst_port Signed-off-by: Alberto Compagno <acompagn+fdio@cisco.com> Change-Id: Iffea4d81c5ea8ce8ccbbfd749113f06a698a2afe
Diffstat (limited to 'hicn-plugin/src/faces/app/face_prod.c')
-rw-r--r--hicn-plugin/src/faces/app/face_prod.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/hicn-plugin/src/faces/app/face_prod.c b/hicn-plugin/src/faces/app/face_prod.c
index c5b9f93dd..645154325 100644
--- a/hicn-plugin/src/faces/app/face_prod.c
+++ b/hicn-plugin/src/faces/app/face_prod.c
@@ -161,12 +161,16 @@ hicn_face_prod_add (fib_prefix_t * prefix, u32 sw_if, u32 * cs_reserved,
{
return HICN_ERROR_APPFACE_PROD_PREFIX_NULL;
}
+
+ u8 isv6 = ip46_address_is_ip4(prod_addr);
+ index_t adj_index = adj_nbr_find(isv6 ? FIB_PROTOCOL_IP6 : FIB_PROTOCOL_IP4, isv6 ? VNET_LINK_IP6 : VNET_LINK_IP4, prod_addr, sw_if);
+
/*
* Check if a producer face is already existing for the same prefix
* and sw_if
*/
face = hicn_face_get (&(prefix->fp_addr), sw_if,
- &hicn_face_hashtb);
+ &hicn_face_hashtb, adj_index);
if (face != NULL)
{
@@ -208,6 +212,8 @@ hicn_face_prod_add (fib_prefix_t * prefix, u32 sw_if, u32 * cs_reserved,
&local_app_ip4, 31, 0 /* is_del */ );
local_app_ip = to_ip46 ( /* isv6 */ 0, local_app_ip4.as_u8);
remote_app_ip = to_ip46 ( /* isv6 */ 0, remote_app_ip4.as_u8);
+
+ vnet_build_rewrite_for_sw_interface(vnm, sw_if, VNET_LINK_IP4, &remote_app_ip4);
}
else
{
@@ -279,7 +285,8 @@ hicn_face_prod_add (fib_prefix_t * prefix, u32 sw_if, u32 * cs_reserved,
hicn_app_state_create (sw_if, prefix);
}
- face = hicn_face_get(&local_app_ip, sw_if, &hicn_face_hashtb);//HICN_FACE_FLAGS_APPFACE_PROD);
+ adj_index = adj_nbr_find(isv6 ? FIB_PROTOCOL_IP6 : FIB_PROTOCOL_IP4, isv6 ? VNET_LINK_IP6 : VNET_LINK_IP4, prod_addr, sw_if);
+ face = hicn_face_get(&local_app_ip, sw_if, &hicn_face_hashtb, adj_index);//HICN_FACE_FLAGS_APPFACE_PROD);
*faceid = hicn_dpoi_get_index (face);