#ifndef __ACTIONS_P4__ | |
#define __ACTIONS_P4__ | |
#include "headers.p4" | |
action set_egress_port(port) { | |
modify_field(EGR_PORT_FIELD, port); | |
} | |
action _drop() { | |
#ifdef __TOFINO_BUILD__ | |
drop(); | |
#else | |
modify_field(standard_metadata.egress_spec, DROP_PORT); | |
#endif | |
} | |
action send_to_cpu() { | |
#ifdef __TOFINO_BUILD__ | |
modify_field(ig_intr_md_for_tm.copy_to_cpu, 1); | |
#else | |
modify_field(standard_metadata.egress_spec, CPU_PORT); | |
#endif | |
} | |
#endif |