-
Notifications
You must be signed in to change notification settings - Fork 455
/
Copy pathissue5094-a-bmv2.p4
62 lines (52 loc) · 1.04 KB
/
issue5094-a-bmv2.p4
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#include <core.p4>
#define V1MODEL_VERSION 20180101
#include <v1model.p4>
header hdr {
int<32> a;
bit<8> b;
int<64> c;
}
struct Headers {
hdr h;
}
struct Meta {
}
parser p(packet_in b, out Headers h, inout Meta m, inout standard_metadata_t sm) {
state start {
b.extract(h.h);
transition accept;
}
}
control vrfy(inout Headers h, inout Meta m) {
apply {
}
}
control update(inout Headers h, inout Meta m) {
apply {
}
}
control egress(inout Headers h, inout Meta m, inout standard_metadata_t sm) {
apply {
}
}
control deparser(packet_out b, in Headers h) {
apply {
b.emit(h.h);
}
}
control ingress(inout Headers h, inout Meta m, inout standard_metadata_t sm) {
action shift() {
h.h.c = (int<64>)(h.h.a >> "aaaa");
sm.egress_spec = 0;
}
table t {
actions = {
shift;
}
const default_action = shift;
}
apply {
t.apply();
}
}
V1Switch(p(), vrfy(), ingress(), egress(), update(), deparser()) main;