-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy path2591.p4
56 lines (44 loc) · 1.14 KB
/
2591.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
#include <core.p4>
#define V1MODEL_VERSION 20180101
#include <v1model.p4>
struct ingress_metadata_t {
}
header H {
bit<4> a;
}
struct metadata {
}
struct headers {
H h;
}
parser ParserImpl(packet_in packet, out headers hdr, inout metadata meta, inout standard_metadata_t standard_metadata) {
state start {
packet.extract<H>(hdr = hdr.h);
transition select(hdr.h.a) {
4w4 .. 4w7: reject;
4w1 .. 4w4: accept;
default: reject;
}
}
}
control egress(inout headers hdr, inout metadata meta, inout standard_metadata_t standard_metadata) {
apply {
}
}
control ingress(inout headers hdr, inout metadata meta, inout standard_metadata_t standard_metadata) {
apply {
}
}
control DeparserImpl(packet_out packet, in headers hdr) {
apply {
}
}
control verifyChecksum(inout headers hdr, inout metadata meta) {
apply {
}
}
control computeChecksum(inout headers hdr, inout metadata meta) {
apply {
}
}
V1Switch<headers, metadata>(p = ParserImpl(), ig = ingress(), vr = verifyChecksum(), eg = egress(), ck = computeChecksum(), dep = DeparserImpl()) main;