blob: 36e6279d8c253676346075d453b0006d2eccb6a7 [file] [log] [blame]
#include <core.p4>
#include <v1model.p4>
#include "include/defines.p4"
#include "include/headers.p4"
#include "include/parsers.p4"
#include "include/port_counters.p4"
#include "include/checksums.p4"
#include "include/actions.p4"
control ingress(inout headers hdr, inout metadata meta, inout standard_metadata_t standard_metadata) {
direct_counter(CounterType.packets) table0_counter;
table table0 {
support_timeout = true;
actions = {
set_egress_port(standard_metadata);
send_to_cpu(standard_metadata);
drop(standard_metadata);
}
key = {
standard_metadata.ingress_port: ternary;
hdr.ethernet.dstAddr : ternary;
hdr.ethernet.srcAddr : ternary;
hdr.ethernet.etherType : ternary;
}
counters = table0_counter;
}
PortCountersControl() port_counters_control;
apply {
table0.apply();
port_counters_control.apply(hdr, meta, standard_metadata);
}
}
control egress(inout headers hdr, inout metadata meta, inout standard_metadata_t standard_metadata) {
apply {
// Nothing to do
}
}
@controller_header("packet_in")
header packet_in_header_t {
bit<9> ingress_port;
bit<32> other1;
}
@controller_header("packet_out")
header packet_out_header_t {
bit<9> egress_port;
bit<32> other2;
}
V1Switch(ParserImpl(), verifyChecksum(), ingress(), egress(), computeChecksum(), DeparserImpl()) main;