|
| 1 | +/* |
| 2 | +Copyright 2016 VMware, Inc. |
| 3 | +
|
| 4 | +Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | +you may not use this file except in compliance with the License. |
| 6 | +You may obtain a copy of the License at |
| 7 | +
|
| 8 | + http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | +
|
| 10 | +Unless required by applicable law or agreed to in writing, software |
| 11 | +distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | +See the License for the specific language governing permissions and |
| 14 | +limitations under the License. |
| 15 | +*/ |
| 16 | + |
| 17 | +#include <core.p4> |
| 18 | +#include <v1model.p4> |
| 19 | + |
| 20 | +struct H { }; |
| 21 | +struct M { }; |
| 22 | + |
| 23 | +parser ParserI(packet_in pk, out H hdr, inout M meta, inout standard_metadata_t smeta) { |
| 24 | + state start { transition accept; } |
| 25 | +} |
| 26 | + |
| 27 | +control Aux(inout M meta) { |
| 28 | + action a() {} |
| 29 | + apply { |
| 30 | + a(); |
| 31 | + } |
| 32 | +} |
| 33 | + |
| 34 | +control IngressI(inout H hdr, inout M meta, inout standard_metadata_t smeta) { |
| 35 | + Aux() aux; |
| 36 | + apply { |
| 37 | + aux.apply(meta); |
| 38 | + } |
| 39 | +} |
| 40 | + |
| 41 | +control EgressI(inout H hdr, inout M meta, inout standard_metadata_t smeta) { |
| 42 | + apply { } |
| 43 | +} |
| 44 | + |
| 45 | +control DeparserI(packet_out pk, in H hdr) { |
| 46 | + apply { } |
| 47 | +} |
| 48 | + |
| 49 | +control VerifyChecksumI(in H hdr, inout M meta) { |
| 50 | + apply { } |
| 51 | +} |
| 52 | + |
| 53 | +control ComputeChecksumI(inout H hdr, inout M meta) { |
| 54 | + apply { } |
| 55 | +} |
| 56 | + |
| 57 | + |
| 58 | +V1Switch(ParserI(), VerifyChecksumI(), IngressI(), EgressI(), |
| 59 | + ComputeChecksumI(), DeparserI()) main; |
0 commit comments