diff options
Diffstat (limited to 'VNFs/vCGNAPT/pipeline/pipeline_cgnapt_be.c')
-rw-r--r-- | VNFs/vCGNAPT/pipeline/pipeline_cgnapt_be.c | 57 |
1 files changed, 32 insertions, 25 deletions
diff --git a/VNFs/vCGNAPT/pipeline/pipeline_cgnapt_be.c b/VNFs/vCGNAPT/pipeline/pipeline_cgnapt_be.c index a1779aa0..dc8a627c 100644 --- a/VNFs/vCGNAPT/pipeline/pipeline_cgnapt_be.c +++ b/VNFs/vCGNAPT/pipeline/pipeline_cgnapt_be.c @@ -1970,10 +1970,10 @@ static int cgnapt_in_port_ah_mix(struct rte_pipeline *rte_p, /* Gateway Proc Starts */ struct arp_entry_data *ret_arp_data = NULL; - uint32_t src_phy_port = *src_port; - - gw_get_nh_port_ipv4(dest_address, - &dest_if, &nhip); + uint32_t src_phy_port = pkts[pkt_index]->port; + dest_if = prv_to_pub_map[src_phy_port]; + gw_get_route_nh_port_ipv4(dest_address, + &dest_if, &nhip, dest_if); if (dest_if == INVALID_DESTIF) { p_nat->invalid_packets |= @@ -2217,10 +2217,10 @@ static int cgnapt_in_port_ah_mix(struct rte_pipeline *rte_p, struct arp_entry_data *ret_arp_data = NULL; dest_if = INVALID_DESTIF; - uint32_t src_phy_port = *src_port; - - gw_get_nh_port_ipv4(dest_address, - &dest_if, &nhip); + uint32_t src_phy_port = pkts[pkt_index]->port; + dest_if = pub_to_prv_map[src_phy_port]; + gw_get_route_nh_port_ipv4(dest_address, + &dest_if, &nhip, dest_if); if (dest_if == INVALID_DESTIF) { p_nat->invalid_packets |= @@ -3727,9 +3727,10 @@ pkt_work_cgnapt_ipv4_prv( uint32_t nhip = 0; struct arp_entry_data *ret_arp_data = NULL; - uint32_t src_phy_port = *src_port; - - gw_get_nh_port_ipv4(dest_address, &dest_if, &nhip); + uint32_t src_phy_port = pkt->port; + dest_if = prv_to_pub_map[src_phy_port]; + gw_get_route_nh_port_ipv4(dest_address, + &dest_if, &nhip, dest_if); ret_arp_data = get_dest_mac_addr_ipv4(nhip, dest_if, (struct ether_addr *)eth_dest); @@ -4080,9 +4081,11 @@ pkt_work_cgnapt_ipv4_pub( dest_address = entry->data.u.prv_ip; struct arp_entry_data *ret_arp_data = NULL; - uint32_t src_phy_port = *src_port; + uint32_t src_phy_port = pkt->port; - gw_get_nh_port_ipv4(dest_address, &dest_if, &nhip); + dest_if = pub_to_prv_map[src_phy_port]; + gw_get_route_nh_port_ipv4(dest_address, + &dest_if, &nhip, dest_if); ret_arp_data = get_dest_mac_addr_ipv4(nhip, dest_if, (struct ether_addr *)eth_dest); @@ -4529,9 +4532,10 @@ pkt4_work_cgnapt_ipv4_prv( dest_address = rte_bswap32(*dst_addr); struct arp_entry_data *ret_arp_data = NULL; uint64_t start, end; - uint32_t src_phy_port = *src_port; - - gw_get_nh_port_ipv4(dest_address, &dest_if, &nhip); + uint32_t src_phy_port = pkt->port; + dest_if = prv_to_pub_map[src_phy_port]; + gw_get_route_nh_port_ipv4(dest_address, + &dest_if, &nhip, dest_if); ret_arp_data = get_dest_mac_addr_ipv4(nhip, dest_if, (struct ether_addr *)eth_dest); @@ -4899,9 +4903,10 @@ pkt4_work_cgnapt_ipv4_pub( } dest_address = entry->data.u.prv_ip; struct arp_entry_data *ret_arp_data = NULL; - uint32_t src_phy_port = *src_port; - - gw_get_nh_port_ipv4(dest_address, &dest_if, &nhip); + uint32_t src_phy_port = pkt->port; + dest_if = pub_to_prv_map[src_phy_port]; + gw_get_route_nh_port_ipv4(dest_address, + &dest_if, &nhip, dest_if); ret_arp_data = get_dest_mac_addr_ipv4(nhip, dest_if, (struct ether_addr *)eth_dest); @@ -6078,9 +6083,10 @@ pkt_work_cgnapt_ipv6_prv( struct arp_entry_data *ret_arp_data; - uint32_t src_phy_port = *src_port; - - gw_get_nh_port_ipv4(dest_address, &dest_if, &nhip); + uint32_t src_phy_port = pkt->port; + dest_if = prv_to_pub_map[src_phy_port]; + gw_get_route_nh_port_ipv4(dest_address, + &dest_if, &nhip, dest_if); ret_arp_data = get_dest_mac_addr_ipv4(nhip, dest_if, (struct ether_addr *)eth_dest); @@ -6569,9 +6575,10 @@ pkt4_work_cgnapt_ipv6_prv( { struct arp_entry_data *ret_arp_data; - uint32_t src_phy_port = *src_port; - - gw_get_nh_port_ipv4(dest_address, &dest_if, &nhip); + uint32_t src_phy_port = pkt->port; + dest_if = prv_to_pub_map[src_phy_port]; + gw_get_route_nh_port_ipv4(dest_address, + &dest_if, &nhip, dest_if); ret_arp_data = get_dest_mac_addr_ipv4(nhip, dest_if, (struct ether_addr *)eth_dest); |