[netpfga] phase in first applied tables/nat64 code

This commit is contained in:
Nico Schottelius 2019-07-24 13:08:02 +02:00
commit ee0d500355
2 changed files with 35 additions and 5 deletions

View file

@ -74,6 +74,7 @@ control RealMain(
inout sume_metadata_t sume_metadata) {
#include "actions_nat64_generic.p4"
#include "actions_egress.p4"
action swap_eth_addresses() {
mac_addr_t temp = hdr.ethernet.dst_addr;
@ -120,6 +121,27 @@ control RealMain(
}
apply {
if(hdr.ipv6.isValid()) {
if(nat64.apply().hit) { /* generic / static nat64 done */
if(hdr.icmp6.isValid()) {
nat64_icmp6_generic();
if(hdr.icmp6.type == ICMP6_ECHO_REPLY) {
hdr.icmp.type = ICMP_ECHO_REPLY;
hdr.icmp.code = 0;
}
if(hdr.icmp6.type == ICMP6_ECHO_REQUEST) {
hdr.icmp.type = ICMP_ECHO_REQUEST;
hdr.icmp.code = 0;
}
}
}
} else if(hdr.arp.isValid()) {
if(v4_arp.apply().hit) {
v4_arp_egress.apply();
}
}
lookup_table.apply();
}
}