diff --git a/doc/plan.org b/doc/plan.org index a557f6e..6f51f9c 100644 --- a/doc/plan.org +++ b/doc/plan.org @@ -1398,6 +1398,26 @@ I could work around this by using if(! .. .hit) { my_action(table_id) ^^^^^^ #+END_SRC +**** No conditional execution in actions +#+BEGIN_SRC +../p4src/static-mapping.p4(57): error: MethodCallStatement: Conditional execution in actions is not supported on this target + hdr.icmp.setValid(); + ^^^^^^^^^^^^^^^^^^^ +../p4src/static-mapping.p4(70): error: MethodCallStatement: Conditional execution in actions is not supported on this target + hdr.icmp6.setInvalid(); + ^^^^^^^^^^^^^^^^^^^^^^ +../p4src/static-mapping.p4(73): error: MethodCallStatement: Conditional execution in actions is not supported on this target + hdr.icmp6_na_ns.setInvalid(); + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +../p4src/static-mapping.p4(74): error: MethodCallStatement: Conditional execution in actions is not supported on this target + hdr.icmp6_option_link_layer_addr.setInvalid(); + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +Compilation Error +p4@ubuntu:~/master-thesis/p4app$ + + +#+END_SRC + *** Implementation limitations **** No fragmentation support (yet) **** No session handling (yet) diff --git a/p4src/static-mapping.p4 b/p4src/static-mapping.p4 index 1238306..bf46ec6 100644 --- a/p4src/static-mapping.p4 +++ b/p4src/static-mapping.p4 @@ -48,6 +48,12 @@ control MyIngress(inout headers hdr, /********************** NAT64 / NAT46 ACTIONS ***********************************/ + + action mimic_assign_echo_request() + { + hdr.icmp.type = ICMP_ECHO_REQUEST; + } + /* changes for icmp6 -> icmp - first echo request/reply - later maybe other @@ -58,11 +64,11 @@ control MyIngress(inout headers hdr, hdr.ipv4.protocol = PROTO_ICMP; // overwrite generic same protocol assumption if(hdr.icmp6.type == ICMP6_ECHO_REQUEST) { - hdr.icmp.type = ICMP_ECHO_REQUEST; - } - if(hdr.icmp6.type == ICMP6_ECHO_REPLY) { - hdr.icmp.type = ICMP_ECHO_REPLY; + mimic_assign_echo_request(); } + // if(hdr.icmp6.type == ICMP6_ECHO_REPLY) { + // hdr.icmp.type = ICMP_ECHO_REPLY; + // } /* trigger checksumming */ meta.switch_task = TASK_CHECKSUM_ICMP;