| #include "include/defines.p4" |
| #include "include/headers.p4" |
| #include "include/parser.p4" |
| #include "include/actions.p4" |
| #include "include/port_counters.p4" |
| #include "include/packet_io.p4" |
| |
| table table0 { |
| reads { |
| IGR_PORT_FIELD : ternary; |
| ethernet.dstAddr : ternary; |
| ethernet.srcAddr : ternary; |
| ethernet.etherType : ternary; |
| } |
| actions { |
| set_egress_port; |
| send_to_cpu; |
| _drop; |
| } |
| support_timeout: true; |
| } |
| |
| counter table0_counter { |
| type: packets; |
| direct: table0; |
| min_width : 32; |
| } |
| |
| control ingress { |
| if (not valid(packet_out_hdr)) { |
| apply(table0); |
| } |
| ingress_pkt_io_control(); |
| process_port_counters(); |
| } |