Also expose ingrees port to controller

This commit is contained in:
Nico Schottelius 2019-03-04 18:10:24 +01:00
parent f9925ce4c2
commit 1dd9542168
1 changed files with 3 additions and 0 deletions

View File

@ -28,11 +28,13 @@ control MyIngress(inout headers hdr,
action controller_debug() {
meta.task = TASK_DEBUG;
meta.ingress_port = standard_metadata.ingress_port;
clone3(CloneType.I2E, 100, meta);
}
action controller_reply(task_t task) {
meta.task = task;
meta.ingress_port = standard_metadata.ingress_port;
clone3(CloneType.I2E, 100, meta);
}
@ -206,6 +208,7 @@ control MyEgress(inout headers hdr,
hdr.cpu.setValid();
hdr.cpu.task = meta.task;
hdr.cpu.ethertype = hdr.ethernet.ethertype;
hdr.cpu.ingress_port = (bit<16>)meta.ingress_port;
hdr.ethernet.ethertype = TYPE_CPU;
}