#include #include struct Meta {} header H { bit<8> src; bit<8> dst; bit<16> type; bit<16> cksm; } struct Hdr { H h; } control DeparserI(packet_out packet, in Hdr hdr) { apply {} } parser parserI( packet_in pkt, out Hdr hdr, inout Meta meta, inout standard_metadata_t stdmeta) { state start { transition accept; } } control cIngress( inout Hdr hdr, inout Meta meta, inout standard_metadata_t stdmeta) { Checksum16() ck; action act1() { hdr.h.cksm = ck.get(hdr.h); } apply { hdr.h.cksm = 0; act1(); } } control cEgress( inout Hdr hdr, inout Meta meta, inout standard_metadata_t stdmeta) { apply {} } control vc(in Hdr hdr, inout Meta meta) { apply {} } control uc(inout Hdr hdr, inout Meta meta) { apply {} } V1Switch(parserI(), vc(), cIngress(), cEgress(), uc(), DeparserI()) main;