From b87b7b72f6976ef461b92f7be6ce2f7576a81e64 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Wed, 27 Mar 2019 20:12:56 +0100 Subject: [PATCH] Action definition order matters... --- p4src/static-mapping.p4 | 32 +++++++++++++++++--------------- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/p4src/static-mapping.p4 b/p4src/static-mapping.p4 index 36670d2..d0bfae8 100644 --- a/p4src/static-mapping.p4 +++ b/p4src/static-mapping.p4 @@ -48,21 +48,6 @@ control MyIngress(inout headers hdr, /********************** NAT64 / NAT46 ACTIONS ***********************************/ - /* if replacing actions */ - action nat64_icmp6_echo_request(ipv6_addr_t v6_src, ipv4_addr_t v4_dst, ipv6_addr_t nat64_prefix) { - nat64_static(v6_src, v4_dst, nat64_prefix); - nat64_icmp6_generic(); - - hdr.icmp.type = ICMP_ECHO_REQUEST; - } - - action nat64_icmp6_echo_reply(ipv6_addr_t v6_src, ipv4_addr_t v4_dst, ipv6_addr_t nat64_prefix) { - nat64_static(v6_src, v4_dst, nat64_prefix); - nat64_icmp6_generic(); - - hdr.icmp.type = ICMP_ECHO_REPLY; - } - /* changes for icmp6 -> icmp */ action nat64_icmp6_generic() @@ -113,6 +98,23 @@ control MyIngress(inout headers hdr, hdr.ipv6.setInvalid(); } + /* if replacing actions */ + action nat64_icmp6_echo_request(ipv6_addr_t v6_src, ipv4_addr_t v4_dst, ipv6_addr_t nat64_prefix) { + nat64_static(v6_src, v4_dst, nat64_prefix); + nat64_icmp6_generic(); + + hdr.icmp.type = ICMP_ECHO_REQUEST; + } + + action nat64_icmp6_echo_reply(ipv6_addr_t v6_src, ipv4_addr_t v4_dst, ipv6_addr_t nat64_prefix) { + nat64_static(v6_src, v4_dst, nat64_prefix); + nat64_icmp6_generic(); + + hdr.icmp.type = ICMP_ECHO_REPLY; + } + + + /* NAT46: protocol unspecific changes */ action nat46_generic(ipv6_addr_t src, ipv6_addr_t dst) { hdr.ipv6.setValid();