// Copyright (c) 2017, Google Inc.
//
// P4_16 specification for a middleblock switch in a Jupiter superblock.
// Status: WORK IN PROGRESS
// Note: This code has not been tested and is expected to contain bugs.

#include "parser.p4"
#include "class_id.p4"
#include "l3_fwd.p4"
#include "packetio.p4"
#include "punt.p4"
#include "vrf.p4"
#include "ipv4_checksum.p4"


control ingress_middleblock(inout parsed_packet_t hdr,
                            inout local_metadata_t local_metadata,
                            inout standard_metadata_t standard_metadata) {
  apply {
    if (hdr.packet_out.isValid()) {
      packetio_ingress.apply(hdr, local_metadata, standard_metadata);
    }
    vrf.apply(hdr, local_metadata, standard_metadata);
    class_id.apply(hdr, local_metadata, standard_metadata);
    l3_fwd.apply(hdr, local_metadata, standard_metadata);
    punt.apply(hdr, local_metadata, standard_metadata);
  }
} // end ingress_middleblock

control egress_middleblock(inout parsed_packet_t hdr,
                     inout local_metadata_t local_metadata,
                     inout standard_metadata_t standard_metadata) {
  apply {
    packetio_egress.apply(hdr, local_metadata, standard_metadata);
  }
} // end egress_middleblock

V1Switch(pkt_parser(), verify_checksum(), ingress_middleblock(),
         egress_middleblock(), compute_checksum(), pkt_deparser()) main;
