master-thesis/p4src/actions_controller.p4

32 lines
739 B
Plaintext
Raw Normal View History

2019-07-10 07:10:59 +00:00
#ifndef NICO_CONTROLLER
#define NICO_CONTROLLER
2019-07-10 07:07:17 +00:00
/********************** GENERAL ACTIONS ***********************************/
2019-07-10 20:28:37 +00:00
#ifndef _SUME_SWITCH_P4_
action controller_reply(task_t task) {
meta.task = task;
2019-07-11 09:01:33 +00:00
meta.ingress_port = standard_metadata.ingress_port;
2019-07-10 20:28:37 +00:00
clone3(CloneType.I2E, 100, meta);
}
2019-07-10 07:07:17 +00:00
2019-07-10 20:28:37 +00:00
#else
#include "action_egress.p4"
2019-07-10 07:07:17 +00:00
2019-07-10 20:28:37 +00:00
action controller_reply(task_t task) {
meta.task = task;
2019-07-11 09:01:33 +00:00
meta.ingress_port = sume_metadata.src_port;
2019-07-10 20:28:37 +00:00
set_egress_port(4); /* port1 = 1, port2 = 2, port3=4 */
}
#endif /* _SUME_SWITCH_P4_ */
action controller_debug_table_id(table_t table_id) {
meta.table_id = table_id;
controller_reply(TASK_DEBUG);
}
action controller_debug() {
controller_reply(TASK_DEBUG);
}
2019-07-10 07:07:17 +00:00
#endif