/** * Do NOT modify manually. * This code is autogenerated using /src/main/gen_p4.go using the template in perf_query_p4_template.txt. * Any changes you wish to make should be made to perf_query_p4_template.txt. */ #include #include // This program processes packets composed of an Ethernet and // an IPv4 header, performing forwarding based on the // destination IP address typedef bit<48> EthernetAddress; typedef bit<32> IPv4Address; // standard Ethernet header header Ethernet_h { EthernetAddress dstAddr; EthernetAddress srcAddr; bit<16> etherType; } // IPv4 header without options header Ipv4_h { bit<4> version; bit<4> ihl; bit<8> diffserv; bit<16> totalLen; bit<16> identification; bit<3> flags; bit<13> fragOffset; bit<8> ttl; bit<8> protocol; bit<16> hdrChecksum; IPv4Address srcAddr; IPv4Address dstAddr; } // Parser section // List of all recognized headers struct Headers { Ethernet_h ethernet; Ipv4_h ip; } struct Metadata { } parser P(packet_in b, out Headers p, inout Metadata meta, inout standard_metadata_t standard_meta) { state start { transition accept; } } // match-action pipeline section control Ing(inout Headers headers, inout Metadata meta, inout standard_metadata_t standard_meta) { apply {} } control Eg(inout Headers hdrs, inout Metadata meta, inout standard_metadata_t standard_meta) { action update(in bool p, inout bit<64> val) { bit<32> _sub = val[31:0]; _sub = p ? _sub : 32w1; val[31:0] = _sub; } apply { bit<64> res = 0; update(true, res); } } // deparser section control DP(packet_out b, in Headers p) { apply {} } // Fillers control Verify(in Headers hdrs, inout Metadata meta) { apply {} } control Compute(inout Headers hdr, inout Metadata meta) { apply {} } // Instantiate the top-level V1 Model package. V1Switch(P(), Verify(), Ing(), Eg(), Compute(), DP()) main;