Refactor fabric.p4 and pipeliner
- Rename constants, some control blocks may share same action
- Remove unused match keys from ACL table
- Better style for constant file
- Ignore unsupported match from objective
Change-Id: I6472426d2a2607581c6fa7479ad40d7090a7d660
diff --git a/pipelines/fabric/src/main/resources/include/parser.p4 b/pipelines/fabric/src/main/resources/include/parser.p4
index c5653dc..b5eadbc 100644
--- a/pipelines/fabric/src/main/resources/include/parser.p4
+++ b/pipelines/fabric/src/main/resources/include/parser.p4
@@ -75,8 +75,10 @@
state parse_mpls {
packet.extract(hdr.mpls);
- //There is only one MPLS label for this fabric.
- transition select(packet.lookahead<ipv4_t>().version) {
+ // There is only one MPLS label for this fabric.
+ // Assume header after MPLS header is IP/IPv6
+ // Lookup first 4 bits for version
+ transition select(packet.lookahead<bit<4>>()) {
//The packet should be either IPv4 or IPv6.
IP_VERSION_4: parse_ipv4;
IP_VERSION_6: parse_ipv6;