blob: 09e4740dc5da971122bc4439b9e36caf951ab7ce [file] [log] [blame]
Yi Tseng21629932017-06-06 11:17:43 -07001#include <core.p4>
2#include <v1model.p4>
3
4struct dummy_t {
5 bit<8> dummyField;
6}
7
8struct metadata {
9 dummy_t dummy_metadata;
10}
11
12struct headers {
13}
14
15parser ParserImpl(packet_in packet, out headers hdr, inout metadata meta, inout standard_metadata_t standard_metadata) {
16 state start {
17 transition accept;
18 }
19}
20
21control ingress(inout headers hdr, inout metadata meta, inout standard_metadata_t standard_metadata) {
22 action dummy_action() {
23 meta.dummy_metadata.dummyField = 8w1;
24 }
25 table table0 {
26 actions = {
27 dummy_action;
28 }
29 key = {
30 meta.dummy_metadata.dummyField: exact;
31 }
32 }
33 apply {
34 table0.apply();
35 }
36}
37
38control egress(inout headers hdr, inout metadata meta, inout standard_metadata_t standard_metadata) {
39 apply {
40 // Nothing to do
41 }
42}
43
44control DeparserImpl(packet_out packet, in headers hdr) {
45 apply {
46 // Nothing to do
47 }
48}
49
50control verifyChecksum(in headers hdr, inout metadata meta) {
51 apply {
52 // Nothing to do
53 }
54}
55
56control computeChecksum(inout headers hdr, inout metadata meta) {
57 apply {
58 // Nothing to do
59 }
60}
61
62V1Switch(ParserImpl(), verifyChecksum(), ingress(), egress(), computeChecksum(), DeparserImpl()) main;