Action definition order matters...

This commit is contained in:
Nico Schottelius 2019-03-27 20:12:56 +01:00
parent f52522fe0c
commit b87b7b72f6

View file

@ -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();