From 1e95278eb758d55a28a09e5d8d3c89fc3677dc20 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Mon, 25 Mar 2019 13:57:09 +0100 Subject: [PATCH] Try to use default action with parameter --- p4src/static-mapping.p4 | 40 +++++++++++++++++++++++----------------- 1 file changed, 23 insertions(+), 17 deletions(-) diff --git a/p4src/static-mapping.p4 b/p4src/static-mapping.p4 index c348a28..8bea377 100644 --- a/p4src/static-mapping.p4 +++ b/p4src/static-mapping.p4 @@ -228,10 +228,12 @@ control MyIngress(inout headers hdr, controller_debug; icmp6_neighbor_solicitation; icmp6_echo_reply; + controller_debug_table_id; NoAction; } size = ICMP6_TABLE_SIZE; - default_action = NoAction; + default_action = controller_debug_table_id(TABLE_ICMP6); +// default_action = NoAction; } /********************** debugging / general support ***********************************/ @@ -306,10 +308,11 @@ control MyIngress(inout headers hdr, set_egress_port; controller_debug; controller_reply; + controller_debug_table_id; NoAction; } size = ROUTING_TABLE_SIZE; - default_action = NoAction; + default_action = controller_debug_table_id(TABLE_V6_NETWORKS); } table v4_networks { @@ -329,24 +332,27 @@ control MyIngress(inout headers hdr, /********************** APPLYING TABLES ***********************************/ apply { if(hdr.ipv6.isValid()) { - if(!icmp6.apply().hit) { /* icmp6 echo, icmp6 ndp */ - controller_debug_table_id(TABLE_ICMP6); - } + icmp6.apply(); /* icmp6 echo, icmp6 ndp */ + nat64.apply(); /* translating */ + v6_networks.apply(); - if(!nat64.apply().hit) { /* v6 -> v4 */ - controller_debug_table_id(TABLE_NAT64); - } - if(!v6_networks.apply().hit) { - controller_debug_table_id(TABLE_V6_NETWORKS); - } + // if(!nat64.apply().hit) { /* v6 -> v4 */ + // controller_debug_table_id(TABLE_NAT64); + // } + // if(!v6_networks.apply().hit) { + // controller_debug_table_id(TABLE_V6_NETWORKS); + // } } if(hdr.ipv4.isValid()) { - if(!nat46.apply().hit) { /* v4->v6 */ - controller_debug_table_id(TABLE_NAT46); - } - if(!v4_networks.apply().hit) { /* routing, egress */ - controller_debug_table_id(TABLE_V4_NETWORKS); - } + nat46.apply() /* v4->v6 */ + v4_networks.apply(); /* routing, egress */ + + // if(!nat46.apply().hit) { /* v4->v6 */ + // controller_debug_table_id(TABLE_NAT46); + // } + // if(!v4_networks.apply().hit) { /* routing, egress */ + // controller_debug_table_id(TABLE_V4_NETWORKS); + // } } } }