add ifdef for controller actions

This commit is contained in:
Nico Schottelius 2019-07-23 15:50:31 +02:00
commit 93c98323f4
2 changed files with 62 additions and 5 deletions

View file

@ -2,6 +2,12 @@
#include <sume_switch.p4>
#include "headers.p4"
/********************************************************************************
* Features
*/
// #define ENABLE_CONTROLLER 1
/********************************************************************************
* Header
*/
@ -101,7 +107,11 @@ control TopPipe(inout headers hdr,
action do_nothing() {
EthAddr_t temp = hdr.ethernet.dst_addr;
}
}
#ifdef ENABLE_CONTROLLER
#include "actions_controller.p4"
#endif
table lookup_table {
key = {
@ -109,7 +119,10 @@ control TopPipe(inout headers hdr,
}
actions = {
swap_eth_addresses;
#ifdef ENABLE_CONTROLLER
controller_debug;
#endif
swap_eth_addresses;
do_nothing;
send_to_port1;
send_to_all_ports;
@ -150,7 +163,6 @@ control TopDeparser(packet_out packet,
#include "deparser.p4"
}
/********************************************************************************