diff options
author | Alberto Compagno <acompagn+fdio@cisco.com> | 2020-04-22 18:29:52 +0200 |
---|---|---|
committer | Alberto Compagno <acompagn+fdio@cisco.com> | 2020-05-04 11:32:01 +0200 |
commit | c1b56d5861829a23289f42cecd716e681b520cf0 (patch) | |
tree | 05a78211549d5581c4f50f6e9647467cbebe548a /hicn-plugin/src/faces/dpo_face.h | |
parent | 0c7f490009e8633e015b5cba48b78cc243254953 (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/dpo_face.h')
-rw-r--r-- | hicn-plugin/src/faces/dpo_face.h | 32 |
1 files changed, 15 insertions, 17 deletions
diff --git a/hicn-plugin/src/faces/dpo_face.h b/hicn-plugin/src/faces/dpo_face.h index 736c5c926..3bb99ecdb 100644 --- a/hicn-plugin/src/faces/dpo_face.h +++ b/hicn-plugin/src/faces/dpo_face.h @@ -135,7 +135,7 @@ always_inline void hicn_dpo_iface_ip4_add_and_lock (hicn_face_id_t * index, u8 * hicnb_flags, const ip4_address_t * nat_addr, - u32 sw_if, u32 node_index) + u32 sw_if, u32 adj_index, u32 node_index) { /*All (complete) faces are indexed by remote addess as well */ @@ -144,29 +144,27 @@ hicn_dpo_iface_ip4_add_and_lock (hicn_face_id_t * index, /* if the face exists, it adds a lock */ hicn_face_t *face = - hicn_face_get (&ip_address, sw_if, &hicn_face_hashtb); + hicn_face_get (&ip_address, sw_if, &hicn_face_hashtb, adj_index); if (face == NULL) { hicn_face_id_t idx; - hicn_iface_add (&ip_address, sw_if, &idx, DPO_PROTO_IP4); + hicn_iface_add (&ip_address, sw_if, &idx, DPO_PROTO_IP4, adj_index); face = hicn_dpoi_get_from_idx(idx); - if (nat_addr->as_u32 == 0) - { + face->dpo.dpoi_type = DPO_FIRST; + face->dpo.dpoi_proto = DPO_PROTO_IP4; + face->dpo.dpoi_index = adj_index; + face->dpo.dpoi_next_node = node_index; + + /* if (nat_addr->as_u32 == 0) */ + /* { */ adj_nbr_walk(face->sw_if, FIB_PROTOCOL_IP4, hicn4_iface_adj_walk_cb, face); - } - else - { - face->dpo.dpoi_type = DPO_FIRST; - face->dpo.dpoi_proto = DPO_PROTO_IP4; - face->dpo.dpoi_index = ~0; - face->dpo.dpoi_next_node = node_index; - } + /* } */ *hicnb_flags = HICN_BUFFER_FLAGS_DEFAULT; @@ -226,23 +224,23 @@ always_inline void hicn_dpo_iface_ip6_add_and_lock (hicn_face_id_t * index, u8 * hicnb_flags, const ip6_address_t * nat_addr, - u32 sw_if, u32 node_index) + u32 sw_if, u32 adj_index, u32 node_index) { /*All (complete) faces are indexed by remote addess as well */ /* if the face exists, it adds a lock */ hicn_face_t *face = - hicn_face_get ((ip46_address_t *)nat_addr, sw_if, &hicn_face_hashtb); + hicn_face_get ((ip46_address_t *)nat_addr, sw_if, &hicn_face_hashtb, adj_index); if (face == NULL) { hicn_face_id_t idx; - hicn_iface_add ((ip46_address_t *) nat_addr, sw_if, &idx, DPO_PROTO_IP6); + hicn_iface_add ((ip46_address_t *) nat_addr, sw_if, &idx, DPO_PROTO_IP6, adj_index); face = hicn_dpoi_get_from_idx(idx); face->dpo.dpoi_type = DPO_FIRST; face->dpo.dpoi_proto = DPO_PROTO_IP6; - face->dpo.dpoi_index = ~0; + face->dpo.dpoi_index = adj_index; face->dpo.dpoi_next_node = node_index; //if (ip46_address_is_zero((ip46_address_t *)nat_addr)) |