blob: 1e6d425031961259905280be5cc6ad082f22b3fb [file] [log] [blame]
#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() {
modify_field(EGR_PORT_FIELD, CPU_PORT);
add_header(packet_in_hdr);
modify_field(packet_in_hdr.ingress_port, IGR_PORT_FIELD);
}
#endif