#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(EGR_PORT_FIELD, DROP_PORT); | |
#endif | |
} | |
action send_to_cpu() { | |
modify_field(EGR_PORT_FIELD, CPU_PORT); | |
add_header(packet_in_hdr); | |
modify_field(packet_in_hdr.ingress_port, IGR_PORT_FIELD); | |
} | |
#endif |