Add table_id info to the NAT* tables

This commit is contained in:
Nico Schottelius 2019-03-25 14:16:14 +01:00
parent b0cd39d82c
commit 764245a914
1 changed files with 6 additions and 4 deletions

View File

@ -33,7 +33,7 @@ control MyIngress(inout headers hdr,
} }
action controller_debug_table_id(table_t table_id) { action controller_debug_table_id(table_t table_id) {
hdr.cpu.table_id = table_id; meta.table_id = table_id;
controller_reply(TASK_DEBUG); controller_reply(TASK_DEBUG);
} }
@ -129,10 +129,11 @@ control MyIngress(inout headers hdr,
actions = { actions = {
controller_debug; controller_debug;
nat64_static; nat64_static;
controller_debug_table_id;
NoAction; NoAction;
} }
size = NAT64_TABLE_SIZE; size = NAT64_TABLE_SIZE;
default_action = controller_debug; default_action = controller_debug_table_id(TABLE_NAT64);
} }
table nat46 { table nat46 {
@ -143,10 +144,11 @@ control MyIngress(inout headers hdr,
actions = { actions = {
controller_debug; controller_debug;
nat46_static; nat46_static;
controller_debug_table_id;
NoAction; NoAction;
} }
size = NAT64_TABLE_SIZE; size = NAT64_TABLE_SIZE;
default_action = controller_debug; default_action = controller_debug_table_id(TABLE_NAT46);
} }
@ -371,7 +373,7 @@ control MyEgress(inout headers hdr,
hdr.cpu.task = meta.task; hdr.cpu.task = meta.task;
hdr.cpu.ethertype = hdr.ethernet.ethertype; hdr.cpu.ethertype = hdr.ethernet.ethertype;
hdr.cpu.ingress_port = (bit<16>) meta.ingress_port; hdr.cpu.ingress_port = (bit<16>) meta.ingress_port;
hdr.cpu.table_id = meta.table_id;
hdr.ethernet.ethertype = TYPE_CPU; hdr.ethernet.ethertype = TYPE_CPU;
} }