#ifndef __PACKET_IO__ | |
#define __PACKET_IO__ | |
#include "headers.p4" | |
#include "parser.p4" | |
action _process_packet_out() { | |
modify_field(EGR_PORT_FIELD, packet_out_hdr.egress_port); | |
remove_header(packet_out_hdr); | |
} | |
table process_packet_out_table { | |
actions { | |
_process_packet_out; | |
} | |
default_action: _process_packet_out(); | |
} | |
control ingress_pkt_io_control { | |
if (valid(packet_out_hdr)) { | |
apply(process_packet_out_table); | |
} | |
} | |
#endif |