blob: 9f0665031a6254f80f30ae752bcfb979f28fb83f [file] [log] [blame]
Carmelo Cascone4f011022017-06-05 01:41:02 -04001#include "include/defines.p4"
2#include "include/headers.p4"
3#include "include/parser.p4"
4#include "include/actions.p4"
5#include "include/port_counters.p4"
Carmelo Cascone16de6db2017-08-22 00:27:57 +02006#include "include/packet_io.p4"
Carmelo Cascone4f011022017-06-05 01:41:02 -04007
8table table0 {
9 reads {
Carmelo Cascone16de6db2017-08-22 00:27:57 +020010 IGR_PORT_FIELD : ternary;
11 ethernet.dstAddr : ternary;
12 ethernet.srcAddr : ternary;
Carmelo Cascone4f011022017-06-05 01:41:02 -040013 ethernet.etherType : ternary;
14 }
15 actions {
16 set_egress_port;
17 send_to_cpu;
Carmelo Cascone16de6db2017-08-22 00:27:57 +020018 _drop;
Carmelo Cascone4f011022017-06-05 01:41:02 -040019 }
20 support_timeout: true;
21}
22
23counter table0_counter {
24 type: packets;
25 direct: table0;
26 min_width : 32;
27}
28
29control ingress {
Carmelo Cascone16de6db2017-08-22 00:27:57 +020030 if (not valid(packet_out_hdr)) {
31 apply(table0);
32 }
Carmelo Casconef2ac7202017-09-08 00:57:44 +020033 ingress_pkt_io_control();
Carmelo Cascone4f011022017-06-05 01:41:02 -040034 process_port_counters();
Carmelo Cascone4f011022017-06-05 01:41:02 -040035}