blob: 6d26f98f32e2d426ca2bdb10e693ce7a0f064f99 [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(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