Add P4 info to java constant tool
Change-Id: I73a451404e8b657845bfc9b6a37abd824a10910e
diff --git a/pipelines/fabric/src/main/java/org/onosproject/pipelines/fabric/FabricConstants.java b/pipelines/fabric/src/main/java/org/onosproject/pipelines/fabric/FabricConstants.java
index 5bb6a5d..4bb1d92 100644
--- a/pipelines/fabric/src/main/java/org/onosproject/pipelines/fabric/FabricConstants.java
+++ b/pipelines/fabric/src/main/java/org/onosproject/pipelines/fabric/FabricConstants.java
@@ -32,192 +32,160 @@
private FabricConstants() {
}
- public static final String DOT = ".";
- // Header IDs
- public static final String HDR = "hdr";
- public static final String STANDARD_METADATA = "standard_metadata";
- public static final String MPLS = "mpls";
- public static final String FABRIC_METADATA = "fabric_metadata";
- public static final String IPV4 = "ipv4";
- public static final String IPV6 = "ipv6";
- public static final String ETHERNET = "ethernet";
- public static final String VLAN_TAG = "vlan_tag";
- public static final String ICMP = "icmp";
-
// Header field IDs
- public static final PiMatchFieldId HF_FABRIC_METADATA_L4_SRC_PORT_ID =
- buildPiMatchField(FABRIC_METADATA, "l4_src_port", false);
- public static final PiMatchFieldId HF_IPV4_SRC_ADDR_ID =
- buildPiMatchField(IPV4, "src_addr", true);
- public static final PiMatchFieldId HF_VLAN_TAG_VLAN_ID_ID =
- buildPiMatchField(VLAN_TAG, "vlan_id", true);
- public static final PiMatchFieldId HF_MPLS_LABEL_ID =
- buildPiMatchField(MPLS, "label", true);
- public static final PiMatchFieldId HF_IPV6_DST_ADDR_ID =
- buildPiMatchField(IPV6, "dst_addr", true);
- public static final PiMatchFieldId HF_ETHERNET_SRC_ADDR_ID =
- buildPiMatchField(ETHERNET, "src_addr", true);
- public static final PiMatchFieldId HF_ICMP_ICMP_TYPE_ID =
- buildPiMatchField(ICMP, "icmp_type", true);
- public static final PiMatchFieldId HF_STANDARD_METADATA_EGRESS_PORT_ID =
- buildPiMatchField(STANDARD_METADATA, "egress_port", false);
- public static final PiMatchFieldId HF_FABRIC_METADATA_NEXT_ID_ID =
- buildPiMatchField(FABRIC_METADATA, "next_id", false);
- public static final PiMatchFieldId HF_FABRIC_METADATA_L4_DST_PORT_ID =
- buildPiMatchField(FABRIC_METADATA, "l4_dst_port", false);
- public static final PiMatchFieldId HF_STANDARD_METADATA_INGRESS_PORT_ID =
- buildPiMatchField(STANDARD_METADATA, "ingress_port", false);
- public static final PiMatchFieldId HF_FABRIC_METADATA_ORIGINAL_ETHER_TYPE_ID =
- buildPiMatchField(FABRIC_METADATA, "original_ether_type", false);
- public static final PiMatchFieldId HF_IPV4_DST_ADDR_ID =
- buildPiMatchField(IPV4, "dst_addr", true);
- public static final PiMatchFieldId HF_VLAN_TAG_IS_VALID_ID =
- buildPiMatchField(VLAN_TAG, "is_valid", true);
- public static final PiMatchFieldId HF_FABRIC_METADATA_IP_PROTO_ID =
- buildPiMatchField(FABRIC_METADATA, "ip_proto", false);
- public static final PiMatchFieldId HF_ETHERNET_DST_ADDR_ID =
- buildPiMatchField(ETHERNET, "dst_addr", true);
- public static final PiMatchFieldId HF_ICMP_ICMP_CODE_ID =
- buildPiMatchField(ICMP, "icmp_code", true);
-
- private static PiMatchFieldId buildPiMatchField(String header, String field, boolean withHdrPrefix) {
- if (withHdrPrefix) {
- return PiMatchFieldId.of(HDR + DOT + header + DOT + field);
- } else {
- return PiMatchFieldId.of(header + DOT + field);
- }
- }
-
+ public static final PiMatchFieldId FABRIC_METADATA_L4_SRC_PORT =
+ PiMatchFieldId.of("fabric_metadata.l4_src_port");
+ public static final PiMatchFieldId HDR_IPV4_SRC_ADDR =
+ PiMatchFieldId.of("hdr.ipv4.src_addr");
+ public static final PiMatchFieldId HDR_VLAN_TAG_VLAN_ID =
+ PiMatchFieldId.of("hdr.vlan_tag.vlan_id");
+ public static final PiMatchFieldId HDR_MPLS_LABEL =
+ PiMatchFieldId.of("hdr.mpls.label");
+ public static final PiMatchFieldId HDR_IPV6_DST_ADDR =
+ PiMatchFieldId.of("hdr.ipv6.dst_addr");
+ public static final PiMatchFieldId HDR_ETHERNET_SRC_ADDR =
+ PiMatchFieldId.of("hdr.ethernet.src_addr");
+ public static final PiMatchFieldId HDR_ICMP_ICMP_TYPE =
+ PiMatchFieldId.of("hdr.icmp.icmp_type");
+ public static final PiMatchFieldId STANDARD_METADATA_EGRESS_PORT =
+ PiMatchFieldId.of("standard_metadata.egress_port");
+ public static final PiMatchFieldId FABRIC_METADATA_NEXT_ID =
+ PiMatchFieldId.of("fabric_metadata.next_id");
+ public static final PiMatchFieldId FABRIC_METADATA_L4_DST_PORT =
+ PiMatchFieldId.of("fabric_metadata.l4_dst_port");
+ public static final PiMatchFieldId STANDARD_METADATA_INGRESS_PORT =
+ PiMatchFieldId.of("standard_metadata.ingress_port");
+ public static final PiMatchFieldId FABRIC_METADATA_ORIGINAL_ETHER_TYPE =
+ PiMatchFieldId.of("fabric_metadata.original_ether_type");
+ public static final PiMatchFieldId HDR_IPV4_DST_ADDR =
+ PiMatchFieldId.of("hdr.ipv4.dst_addr");
+ public static final PiMatchFieldId HDR_VLAN_TAG_IS_VALID =
+ PiMatchFieldId.of("hdr.vlan_tag.is_valid");
+ public static final PiMatchFieldId FABRIC_METADATA_IP_PROTO =
+ PiMatchFieldId.of("fabric_metadata.ip_proto");
+ public static final PiMatchFieldId HDR_ETHERNET_DST_ADDR =
+ PiMatchFieldId.of("hdr.ethernet.dst_addr");
+ public static final PiMatchFieldId HDR_ICMP_ICMP_CODE =
+ PiMatchFieldId.of("hdr.icmp.icmp_code");
// Table IDs
- public static final PiTableId TBL_ACL_ID =
+ public static final PiTableId FABRIC_INGRESS_FORWARDING_ACL =
PiTableId.of("FabricIngress.forwarding.acl");
- public static final PiTableId TBL_HASHED_ID =
+ public static final PiTableId FABRIC_INGRESS_NEXT_HASHED =
PiTableId.of("FabricIngress.next.hashed");
- public static final PiTableId TBL_EGRESS_VLAN_ID =
+ public static final PiTableId FABRIC_EGRESS_EGRESS_NEXT_EGRESS_VLAN =
PiTableId.of("FabricEgress.egress_next.egress_vlan");
- public static final PiTableId TBL_MPLS_ID =
+ public static final PiTableId FABRIC_INGRESS_FORWARDING_MPLS =
PiTableId.of("FabricIngress.forwarding.mpls");
- public static final PiTableId TBL_MULTICAST_ID =
+ public static final PiTableId FABRIC_INGRESS_NEXT_MULTICAST =
PiTableId.of("FabricIngress.next.multicast");
- public static final PiTableId TBL_MULTICAST_V4_ID =
+ public static final PiTableId FABRIC_INGRESS_FORWARDING_MULTICAST_V4 =
PiTableId.of("FabricIngress.forwarding.multicast_v4");
- public static final PiTableId TBL_MULTICAST_V6_ID =
+ public static final PiTableId FABRIC_INGRESS_FORWARDING_MULTICAST_V6 =
PiTableId.of("FabricIngress.forwarding.multicast_v6");
- public static final PiTableId TBL_UNICAST_V4_ID =
+ public static final PiTableId FABRIC_INGRESS_FORWARDING_UNICAST_V4 =
PiTableId.of("FabricIngress.forwarding.unicast_v4");
- public static final PiTableId TBL_FWD_CLASSIFIER_ID =
+ public static final PiTableId FABRIC_INGRESS_FILTERING_FWD_CLASSIFIER =
PiTableId.of("FabricIngress.filtering.fwd_classifier");
- public static final PiTableId TBL_BRIDGING_ID =
+ public static final PiTableId FABRIC_INGRESS_FORWARDING_BRIDGING =
PiTableId.of("FabricIngress.forwarding.bridging");
- public static final PiTableId TBL_SIMPLE_ID =
+ public static final PiTableId FABRIC_INGRESS_NEXT_SIMPLE =
PiTableId.of("FabricIngress.next.simple");
- public static final PiTableId TBL_INGRESS_PORT_VLAN_ID =
+ public static final PiTableId FABRIC_INGRESS_FILTERING_INGRESS_PORT_VLAN =
PiTableId.of("FabricIngress.filtering.ingress_port_vlan");
- public static final PiTableId TBL_UNICAST_V6_ID =
+ public static final PiTableId FABRIC_INGRESS_FORWARDING_UNICAST_V6 =
PiTableId.of("FabricIngress.forwarding.unicast_v6");
- public static final PiTableId TBL_VLAN_META_ID =
+ public static final PiTableId FABRIC_INGRESS_NEXT_VLAN_META =
PiTableId.of("FabricIngress.next.vlan_meta");
-
// Indirect Counter IDs
- public static final PiCounterId CNT_EGRESS_PORT_COUNTER_ID =
+ public static final PiCounterId FABRIC_INGRESS_PORT_COUNTERS_CONTROL_EGRESS_PORT_COUNTER =
PiCounterId.of("FabricIngress.port_counters_control.egress_port_counter");
- public static final PiCounterId CNT_INGRESS_PORT_COUNTER_ID =
+ public static final PiCounterId FABRIC_INGRESS_PORT_COUNTERS_CONTROL_INGRESS_PORT_COUNTER =
PiCounterId.of("FabricIngress.port_counters_control.ingress_port_counter");
-
// Direct Counter IDs
- public static final PiCounterId CNT_ACL_COUNTER_ID =
+ public static final PiCounterId FABRIC_INGRESS_FORWARDING_ACL_COUNTER =
PiCounterId.of("FabricIngress.forwarding.acl_counter");
- public static final PiCounterId CNT_MULTICAST_COUNTER_ID =
+ public static final PiCounterId FABRIC_INGRESS_NEXT_MULTICAST_COUNTER =
PiCounterId.of("FabricIngress.next.multicast_counter");
- public static final PiCounterId CNT_VLAN_META_COUNTER_ID =
+ public static final PiCounterId FABRIC_INGRESS_NEXT_VLAN_META_COUNTER =
PiCounterId.of("FabricIngress.next.vlan_meta_counter");
- public static final PiCounterId CNT_FWD_CLASSIFIER_COUNTER_ID =
+ public static final PiCounterId FABRIC_INGRESS_FILTERING_FWD_CLASSIFIER_COUNTER =
PiCounterId.of("FabricIngress.filtering.fwd_classifier_counter");
- public static final PiCounterId CNT_BRIDGING_COUNTER_ID =
+ public static final PiCounterId FABRIC_INGRESS_FORWARDING_BRIDGING_COUNTER =
PiCounterId.of("FabricIngress.forwarding.bridging_counter");
- public static final PiCounterId CNT_MULTICAST_V6_COUNTER_ID =
+ public static final PiCounterId FABRIC_INGRESS_FORWARDING_MULTICAST_V6_COUNTER =
PiCounterId.of("FabricIngress.forwarding.multicast_v6_counter");
- public static final PiCounterId CNT_MULTICAST_V4_COUNTER_ID =
+ public static final PiCounterId FABRIC_INGRESS_FORWARDING_MULTICAST_V4_COUNTER =
PiCounterId.of("FabricIngress.forwarding.multicast_v4_counter");
- public static final PiCounterId CNT_UNICAST_V6_COUNTER_ID =
+ public static final PiCounterId FABRIC_INGRESS_FORWARDING_UNICAST_V6_COUNTER =
PiCounterId.of("FabricIngress.forwarding.unicast_v6_counter");
- public static final PiCounterId CNT_UNICAST_V4_COUNTER_ID =
+ public static final PiCounterId FABRIC_INGRESS_FORWARDING_UNICAST_V4_COUNTER =
PiCounterId.of("FabricIngress.forwarding.unicast_v4_counter");
- public static final PiCounterId CNT_SIMPLE_COUNTER_ID =
+ public static final PiCounterId FABRIC_INGRESS_NEXT_SIMPLE_COUNTER =
PiCounterId.of("FabricIngress.next.simple_counter");
- public static final PiCounterId CNT_INGRESS_PORT_VLAN_COUNTER_ID =
+ public static final PiCounterId FABRIC_INGRESS_FILTERING_INGRESS_PORT_VLAN_COUNTER =
PiCounterId.of("FabricIngress.filtering.ingress_port_vlan_counter");
- public static final PiCounterId CNT_MPLS_COUNTER_ID =
+ public static final PiCounterId FABRIC_INGRESS_FORWARDING_MPLS_COUNTER =
PiCounterId.of("FabricIngress.forwarding.mpls_counter");
- public static final PiCounterId CNT_HASHED_COUNTER_ID =
+ public static final PiCounterId FABRIC_INGRESS_NEXT_HASHED_COUNTER =
PiCounterId.of("FabricIngress.next.hashed_counter");
-
// Action IDs
- public static final PiActionId ACT_FABRICINGRESS_FILTERING_DROP_ID =
+ public static final PiActionId FABRIC_INGRESS_FILTERING_DROP =
PiActionId.of("FabricIngress.filtering.drop");
- public static final PiActionId ACT_FABRICINGRESS_NEXT_SET_VLAN_ID =
+ public static final PiActionId FABRIC_INGRESS_NEXT_SET_VLAN =
PiActionId.of("FabricIngress.next.set_vlan");
- public static final PiActionId ACT_FABRICINGRESS_FORWARDING_POP_MPLS_AND_NEXT_ID =
+ public static final PiActionId FABRIC_INGRESS_FORWARDING_POP_MPLS_AND_NEXT =
PiActionId.of("FabricIngress.forwarding.pop_mpls_and_next");
- public static final PiActionId ACT_FABRICEGRESS_EGRESS_NEXT_POP_VLAN_ID =
+ public static final PiActionId FABRIC_EGRESS_EGRESS_NEXT_POP_VLAN =
PiActionId.of("FabricEgress.egress_next.pop_vlan");
- public static final PiActionId ACT_FABRICINGRESS_FILTERING_SET_FORWARDING_TYPE_ID =
+ public static final PiActionId FABRIC_INGRESS_FILTERING_SET_FORWARDING_TYPE =
PiActionId.of("FabricIngress.filtering.set_forwarding_type");
- public static final PiActionId ACT_NOP_ID = PiActionId.of("nop");
- public static final PiActionId ACT_FABRICINGRESS_FILTERING_SET_VLAN_ID =
+ public static final PiActionId NOP = PiActionId.of("nop");
+ public static final PiActionId FABRIC_INGRESS_FILTERING_SET_VLAN =
PiActionId.of("FabricIngress.filtering.set_vlan");
- public static final PiActionId ACT_FABRICINGRESS_NEXT_MPLS_ROUTING_V6_ID =
+ public static final PiActionId FABRIC_INGRESS_NEXT_MPLS_ROUTING_V6 =
PiActionId.of("FabricIngress.next.mpls_routing_v6");
- public static final PiActionId ACT_FABRICEGRESS_PKT_IO_EGRESS_POP_VLAN_ID =
+ public static final PiActionId FABRIC_EGRESS_PKT_IO_EGRESS_POP_VLAN =
PiActionId.of("FabricEgress.pkt_io_egress.pop_vlan");
- public static final PiActionId ACT_FABRICINGRESS_NEXT_L3_ROUTING_VLAN_ID =
+ public static final PiActionId FABRIC_INGRESS_NEXT_L3_ROUTING_VLAN =
PiActionId.of("FabricIngress.next.l3_routing_vlan");
- public static final PiActionId ACT_NOACTION_ID = PiActionId.of("NoAction");
- public static final PiActionId ACT_FABRICINGRESS_NEXT_SET_MCAST_GROUP_ID =
+ public static final PiActionId NO_ACTION = PiActionId.of("NoAction");
+ public static final PiActionId FABRIC_INGRESS_NEXT_SET_MCAST_GROUP =
PiActionId.of("FabricIngress.next.set_mcast_group");
- public static final PiActionId ACT_FABRICINGRESS_FORWARDING_DUPLICATE_TO_CONTROLLER_ID =
+ public static final PiActionId FABRIC_INGRESS_FORWARDING_DUPLICATE_TO_CONTROLLER =
PiActionId.of("FabricIngress.forwarding.duplicate_to_controller");
- public static final PiActionId ACT_FABRICINGRESS_NEXT_L3_ROUTING_ID =
+ public static final PiActionId FABRIC_INGRESS_NEXT_L3_ROUTING =
PiActionId.of("FabricIngress.next.l3_routing");
- public static final PiActionId ACT_FABRICINGRESS_NEXT_MPLS_ROUTING_V4_ID =
+ public static final PiActionId FABRIC_INGRESS_NEXT_MPLS_ROUTING_V4 =
PiActionId.of("FabricIngress.next.mpls_routing_v4");
- public static final PiActionId ACT_FABRICINGRESS_NEXT_SET_VLAN_OUTPUT_ID =
+ public static final PiActionId FABRIC_INGRESS_NEXT_SET_VLAN_OUTPUT =
PiActionId.of("FabricIngress.next.set_vlan_output");
- public static final PiActionId ACT_FABRICINGRESS_FORWARDING_SET_NEXT_ID_ID =
+ public static final PiActionId FABRIC_INGRESS_FORWARDING_SET_NEXT_ID =
PiActionId.of("FabricIngress.forwarding.set_next_id");
- public static final PiActionId ACT_FABRICINGRESS_FILTERING_PUSH_INTERNAL_VLAN_ID =
+ public static final PiActionId FABRIC_INGRESS_FILTERING_PUSH_INTERNAL_VLAN =
PiActionId.of("FabricIngress.filtering.push_internal_vlan");
- public static final PiActionId ACT_FABRICINGRESS_FORWARDING_DROP_ID =
+ public static final PiActionId FABRIC_INGRESS_FORWARDING_DROP =
PiActionId.of("FabricIngress.forwarding.drop");
- public static final PiActionId ACT_FABRICINGRESS_NEXT_OUTPUT_ID =
+ public static final PiActionId FABRIC_INGRESS_NEXT_OUTPUT =
PiActionId.of("FabricIngress.next.output");
-
// Action Param IDs
- public static final PiActionParamId ACT_PRM_DMAC_ID =
- PiActionParamId.of("dmac");
- public static final PiActionParamId ACT_PRM_PORT_NUM_ID =
+ public static final PiActionParamId DMAC = PiActionParamId.of("dmac");
+ public static final PiActionParamId PORT_NUM =
PiActionParamId.of("port_num");
- public static final PiActionParamId ACT_PRM_LABEL_ID =
- PiActionParamId.of("label");
- public static final PiActionParamId ACT_PRM_SMAC_ID =
- PiActionParamId.of("smac");
- public static final PiActionParamId ACT_PRM_GID_ID =
- PiActionParamId.of("gid");
- public static final PiActionParamId ACT_PRM_NEW_VLAN_ID_ID =
+ public static final PiActionParamId LABEL = PiActionParamId.of("label");
+ public static final PiActionParamId SMAC = PiActionParamId.of("smac");
+ public static final PiActionParamId GID = PiActionParamId.of("gid");
+ public static final PiActionParamId NEW_VLAN_ID =
PiActionParamId.of("new_vlan_id");
- public static final PiActionParamId ACT_PRM_FWD_TYPE_ID =
+ public static final PiActionParamId FWD_TYPE =
PiActionParamId.of("fwd_type");
- public static final PiActionParamId ACT_PRM_NEXT_ID_ID =
- PiActionParamId.of("next_id");
-
+ public static final PiActionParamId NEXT_ID = PiActionParamId.of("next_id");
// Action Profile IDs
- public static final PiActionProfileId ACT_PRF_FABRICINGRESS_NEXT_ECMP_SELECTOR_ID =
+ public static final PiActionProfileId FABRIC_INGRESS_NEXT_ECMP_SELECTOR =
PiActionProfileId.of("FabricIngress.next.ecmp_selector");
-
// Packet Metadata IDs
- public static final PiControlMetadataId CTRL_META_INGRESS_PORT_ID =
+ public static final PiControlMetadataId INGRESS_PORT =
PiControlMetadataId.of("ingress_port");
- public static final PiControlMetadataId CTRL_META_EGRESS_PORT_ID =
+ public static final PiControlMetadataId EGRESS_PORT =
PiControlMetadataId.of("egress_port");
public static final int PORT_BITWIDTH = 9;
-}
+}
\ No newline at end of file
diff --git a/pipelines/fabric/src/main/java/org/onosproject/pipelines/fabric/FabricInterpreter.java b/pipelines/fabric/src/main/java/org/onosproject/pipelines/fabric/FabricInterpreter.java
index fb85ff3..2c698a5 100644
--- a/pipelines/fabric/src/main/java/org/onosproject/pipelines/fabric/FabricInterpreter.java
+++ b/pipelines/fabric/src/main/java/org/onosproject/pipelines/fabric/FabricInterpreter.java
@@ -63,75 +63,79 @@
private static final ImmutableBiMap<Integer, PiTableId> TABLE_ID_MAP =
ImmutableBiMap.<Integer, PiTableId>builder()
// Filtering
- .put(0, FabricConstants.TBL_INGRESS_PORT_VLAN_ID)
- .put(1, FabricConstants.TBL_FWD_CLASSIFIER_ID)
+ .put(0, FabricConstants.FABRIC_INGRESS_FILTERING_INGRESS_PORT_VLAN)
+ .put(1, FabricConstants.FABRIC_INGRESS_FILTERING_FWD_CLASSIFIER)
// Forwarding
- .put(2, FabricConstants.TBL_MPLS_ID)
- .put(3, FabricConstants.TBL_UNICAST_V4_ID)
- .put(4, FabricConstants.TBL_UNICAST_V6_ID)
- .put(5, FabricConstants.TBL_MULTICAST_V4_ID)
- .put(6, FabricConstants.TBL_MULTICAST_V6_ID)
- .put(7, FabricConstants.TBL_BRIDGING_ID)
- .put(8, FabricConstants.TBL_ACL_ID)
+ .put(2, FabricConstants.FABRIC_INGRESS_FORWARDING_MPLS)
+ .put(3, FabricConstants.FABRIC_INGRESS_FORWARDING_UNICAST_V4)
+ .put(4, FabricConstants.FABRIC_INGRESS_FORWARDING_UNICAST_V6)
+ .put(5, FabricConstants.FABRIC_INGRESS_FORWARDING_MULTICAST_V4)
+ .put(6, FabricConstants.FABRIC_INGRESS_FORWARDING_MULTICAST_V6)
+ .put(7, FabricConstants.FABRIC_INGRESS_FORWARDING_BRIDGING)
+ .put(8, FabricConstants.FABRIC_INGRESS_FORWARDING_ACL)
// Next
- .put(9, FabricConstants.TBL_SIMPLE_ID)
- .put(10, FabricConstants.TBL_HASHED_ID)
- .put(11, FabricConstants.TBL_MULTICAST_ID)
+ .put(9, FabricConstants.FABRIC_INGRESS_NEXT_VLAN_META)
+ .put(10, FabricConstants.FABRIC_INGRESS_NEXT_SIMPLE)
+ .put(11, FabricConstants.FABRIC_INGRESS_NEXT_HASHED)
+ .put(12, FabricConstants.FABRIC_INGRESS_NEXT_MULTICAST)
+ .put(13, FabricConstants.FABRIC_EGRESS_EGRESS_NEXT_EGRESS_VLAN)
.build();
- private static final Set<PiTableId> FILTERING_CTRL_TBLS = ImmutableSet.of(FabricConstants.TBL_INGRESS_PORT_VLAN_ID,
- FabricConstants.TBL_FWD_CLASSIFIER_ID);
- private static final Set<PiTableId> FORWARDING_CTRL_TBLS = ImmutableSet.of(FabricConstants.TBL_MPLS_ID,
- FabricConstants.TBL_UNICAST_V4_ID,
- FabricConstants.TBL_UNICAST_V6_ID,
- FabricConstants.TBL_MULTICAST_V4_ID,
- FabricConstants.TBL_MULTICAST_V6_ID,
- FabricConstants.TBL_BRIDGING_ID,
- FabricConstants.TBL_ACL_ID);
- private static final Set<PiTableId> NEXT_CTRL_TBLS = ImmutableSet.of(FabricConstants.TBL_SIMPLE_ID,
- FabricConstants.TBL_HASHED_ID,
- FabricConstants.TBL_MULTICAST_ID,
- FabricConstants.TBL_VLAN_META_ID);
-
- private static final Set<PiTableId> E_NEXT_CTRL_TBLS = ImmutableSet.of(FabricConstants.TBL_EGRESS_VLAN_ID);
+ private static final Set<PiTableId> FILTERING_CTRL_TBLS =
+ ImmutableSet.of(FabricConstants.FABRIC_INGRESS_FILTERING_INGRESS_PORT_VLAN,
+ FabricConstants.FABRIC_INGRESS_FILTERING_FWD_CLASSIFIER);
+ private static final Set<PiTableId> FORWARDING_CTRL_TBLS =
+ ImmutableSet.of(FabricConstants.FABRIC_INGRESS_FORWARDING_MPLS,
+ FabricConstants.FABRIC_INGRESS_FORWARDING_UNICAST_V4,
+ FabricConstants.FABRIC_INGRESS_FORWARDING_UNICAST_V6,
+ FabricConstants.FABRIC_INGRESS_FORWARDING_MULTICAST_V4,
+ FabricConstants.FABRIC_INGRESS_FORWARDING_MULTICAST_V6,
+ FabricConstants.FABRIC_INGRESS_FORWARDING_BRIDGING,
+ FabricConstants.FABRIC_INGRESS_FORWARDING_ACL);
+ private static final Set<PiTableId> NEXT_CTRL_TBLS =
+ ImmutableSet.of(FabricConstants.FABRIC_INGRESS_NEXT_SIMPLE,
+ FabricConstants.FABRIC_INGRESS_NEXT_HASHED,
+ FabricConstants.FABRIC_INGRESS_NEXT_MULTICAST);
+ private static final Set<PiTableId> E_NEXT_CTRL_TBLS =
+ ImmutableSet.of(FabricConstants.FABRIC_EGRESS_EGRESS_NEXT_EGRESS_VLAN);
private static final ImmutableMap<Criterion.Type, PiMatchFieldId> CRITERION_MAP =
ImmutableMap.<Criterion.Type, PiMatchFieldId>builder()
- .put(Criterion.Type.IN_PORT, FabricConstants.HF_STANDARD_METADATA_INGRESS_PORT_ID)
- .put(Criterion.Type.ETH_DST, FabricConstants.HF_ETHERNET_DST_ADDR_ID)
- .put(Criterion.Type.ETH_SRC, FabricConstants.HF_ETHERNET_SRC_ADDR_ID)
- .put(Criterion.Type.ETH_TYPE, FabricConstants.HF_FABRIC_METADATA_ORIGINAL_ETHER_TYPE_ID)
- .put(Criterion.Type.MPLS_LABEL, FabricConstants.HF_MPLS_LABEL_ID)
- .put(Criterion.Type.VLAN_VID, FabricConstants.HF_VLAN_TAG_VLAN_ID_ID)
- .put(Criterion.Type.IPV4_DST, FabricConstants.HF_IPV4_DST_ADDR_ID)
- .put(Criterion.Type.IPV4_SRC, FabricConstants.HF_IPV4_SRC_ADDR_ID)
- .put(Criterion.Type.IPV6_DST, FabricConstants.HF_IPV6_DST_ADDR_ID)
- .put(Criterion.Type.TCP_SRC, FabricConstants.HF_FABRIC_METADATA_L4_SRC_PORT_ID)
- .put(Criterion.Type.TCP_DST, FabricConstants.HF_FABRIC_METADATA_L4_DST_PORT_ID)
- .put(Criterion.Type.UDP_SRC, FabricConstants.HF_FABRIC_METADATA_L4_SRC_PORT_ID)
- .put(Criterion.Type.UDP_DST, FabricConstants.HF_FABRIC_METADATA_L4_DST_PORT_ID)
- .put(Criterion.Type.IP_PROTO, FabricConstants.HF_FABRIC_METADATA_IP_PROTO_ID)
- .put(Criterion.Type.ICMPV6_TYPE, FabricConstants.HF_ICMP_ICMP_TYPE_ID)
- .put(Criterion.Type.ICMPV6_CODE, FabricConstants.HF_ICMP_ICMP_CODE_ID)
+ .put(Criterion.Type.IN_PORT, FabricConstants.STANDARD_METADATA_INGRESS_PORT)
+ .put(Criterion.Type.ETH_DST, FabricConstants.HDR_ETHERNET_DST_ADDR)
+ .put(Criterion.Type.ETH_SRC, FabricConstants.HDR_ETHERNET_SRC_ADDR)
+ .put(Criterion.Type.ETH_TYPE, FabricConstants.FABRIC_METADATA_ORIGINAL_ETHER_TYPE)
+ .put(Criterion.Type.MPLS_LABEL, FabricConstants.HDR_MPLS_LABEL)
+ .put(Criterion.Type.VLAN_VID, FabricConstants.HDR_VLAN_TAG_VLAN_ID)
+ .put(Criterion.Type.IPV4_DST, FabricConstants.HDR_IPV4_DST_ADDR)
+ .put(Criterion.Type.IPV4_SRC, FabricConstants.HDR_IPV4_SRC_ADDR)
+ .put(Criterion.Type.IPV6_DST, FabricConstants.HDR_IPV6_DST_ADDR)
+ .put(Criterion.Type.TCP_SRC, FabricConstants.FABRIC_METADATA_L4_SRC_PORT)
+ .put(Criterion.Type.TCP_DST, FabricConstants.FABRIC_METADATA_L4_DST_PORT)
+ .put(Criterion.Type.UDP_SRC, FabricConstants.FABRIC_METADATA_L4_SRC_PORT)
+ .put(Criterion.Type.UDP_DST, FabricConstants.FABRIC_METADATA_L4_DST_PORT)
+ .put(Criterion.Type.IP_PROTO, FabricConstants.FABRIC_METADATA_IP_PROTO)
+ .put(Criterion.Type.ICMPV6_TYPE, FabricConstants.HDR_ICMP_ICMP_TYPE)
+ .put(Criterion.Type.ICMPV6_CODE, FabricConstants.HDR_ICMP_ICMP_CODE)
.build();
private static final ImmutableMap<PiMatchFieldId, Criterion.Type> INVERSE_CRITERION_MAP =
ImmutableMap.<PiMatchFieldId, Criterion.Type>builder()
- .put(FabricConstants.HF_STANDARD_METADATA_INGRESS_PORT_ID, Criterion.Type.IN_PORT)
- .put(FabricConstants.HF_ETHERNET_DST_ADDR_ID, Criterion.Type.ETH_DST)
- .put(FabricConstants.HF_ETHERNET_SRC_ADDR_ID, Criterion.Type.ETH_SRC)
- .put(FabricConstants.HF_FABRIC_METADATA_ORIGINAL_ETHER_TYPE_ID, Criterion.Type.ETH_TYPE)
- .put(FabricConstants.HF_MPLS_LABEL_ID, Criterion.Type.MPLS_LABEL)
- .put(FabricConstants.HF_VLAN_TAG_VLAN_ID_ID, Criterion.Type.VLAN_VID)
- .put(FabricConstants.HF_IPV4_DST_ADDR_ID, Criterion.Type.IPV4_DST)
- .put(FabricConstants.HF_IPV4_SRC_ADDR_ID, Criterion.Type.IPV4_SRC)
- .put(FabricConstants.HF_IPV6_DST_ADDR_ID, Criterion.Type.IPV6_DST)
+ .put(FabricConstants.STANDARD_METADATA_INGRESS_PORT, Criterion.Type.IN_PORT)
+ .put(FabricConstants.HDR_ETHERNET_DST_ADDR, Criterion.Type.ETH_DST)
+ .put(FabricConstants.HDR_ETHERNET_SRC_ADDR, Criterion.Type.ETH_SRC)
+ .put(FabricConstants.FABRIC_METADATA_ORIGINAL_ETHER_TYPE, Criterion.Type.ETH_TYPE)
+ .put(FabricConstants.HDR_MPLS_LABEL, Criterion.Type.MPLS_LABEL)
+ .put(FabricConstants.HDR_VLAN_TAG_VLAN_ID, Criterion.Type.VLAN_VID)
+ .put(FabricConstants.HDR_IPV4_DST_ADDR, Criterion.Type.IPV4_DST)
+ .put(FabricConstants.HDR_IPV4_SRC_ADDR, Criterion.Type.IPV4_SRC)
+ .put(FabricConstants.HDR_IPV6_DST_ADDR, Criterion.Type.IPV6_DST)
// FIXME: might be incorrect if we inverse the map....
- .put(FabricConstants.HF_FABRIC_METADATA_L4_SRC_PORT_ID, Criterion.Type.UDP_SRC)
- .put(FabricConstants.HF_FABRIC_METADATA_L4_DST_PORT_ID, Criterion.Type.UDP_DST)
- .put(FabricConstants.HF_FABRIC_METADATA_IP_PROTO_ID, Criterion.Type.IP_PROTO)
- .put(FabricConstants.HF_ICMP_ICMP_TYPE_ID, Criterion.Type.ICMPV6_TYPE)
- .put(FabricConstants.HF_ICMP_ICMP_CODE_ID, Criterion.Type.ICMPV6_CODE)
+ .put(FabricConstants.FABRIC_METADATA_L4_SRC_PORT, Criterion.Type.UDP_SRC)
+ .put(FabricConstants.FABRIC_METADATA_L4_DST_PORT, Criterion.Type.UDP_DST)
+ .put(FabricConstants.FABRIC_METADATA_IP_PROTO, Criterion.Type.IP_PROTO)
+ .put(FabricConstants.HDR_ICMP_ICMP_TYPE, Criterion.Type.ICMPV6_TYPE)
+ .put(FabricConstants.HDR_ICMP_ICMP_CODE, Criterion.Type.ICMPV6_CODE)
.build();
@Override
@@ -185,7 +189,7 @@
private PiControlMetadata createPacketMetadata(long portNumber) throws PiInterpreterException {
try {
return PiControlMetadata.builder()
- .withId(FabricConstants.CTRL_META_EGRESS_PORT_ID)
+ .withId(FabricConstants.EGRESS_PORT)
.withValue(copyFrom(portNumber).fit(FabricConstants.PORT_BITWIDTH))
.build();
} catch (ImmutableByteSequence.ByteSequenceTrimException e) {
@@ -247,7 +251,7 @@
// Returns the ingress port packet metadata.
Optional<PiControlMetadata> packetMetadata = packetIn.metadatas()
- .stream().filter(m -> m.id().equals(FabricConstants.CTRL_META_INGRESS_PORT_ID))
+ .stream().filter(m -> m.id().equals(FabricConstants.INGRESS_PORT))
.findFirst();
if (packetMetadata.isPresent()) {
@@ -259,7 +263,7 @@
} else {
throw new PiInterpreterException(format(
"Missing metadata '%s' in packet-in received from '%s': %s",
- FabricConstants.CTRL_META_INGRESS_PORT_ID, deviceId, packetIn));
+ FabricConstants.INGRESS_PORT, deviceId, packetIn));
}
}
}
diff --git a/pipelines/fabric/src/main/java/org/onosproject/pipelines/fabric/FabricPortStatisticsDiscovery.java b/pipelines/fabric/src/main/java/org/onosproject/pipelines/fabric/FabricPortStatisticsDiscovery.java
index a9e3f3b..ab44040 100644
--- a/pipelines/fabric/src/main/java/org/onosproject/pipelines/fabric/FabricPortStatisticsDiscovery.java
+++ b/pipelines/fabric/src/main/java/org/onosproject/pipelines/fabric/FabricPortStatisticsDiscovery.java
@@ -32,7 +32,7 @@
*/
@Override
public PiCounterId ingressCounterId() {
- return FabricConstants.CNT_INGRESS_PORT_COUNTER_ID;
+ return FabricConstants.FABRIC_INGRESS_PORT_COUNTERS_CONTROL_INGRESS_PORT_COUNTER;
}
/**
@@ -42,6 +42,6 @@
*/
@Override
public PiCounterId egressCounterId() {
- return FabricConstants.CNT_EGRESS_PORT_COUNTER_ID;
+ return FabricConstants.FABRIC_INGRESS_PORT_COUNTERS_CONTROL_EGRESS_PORT_COUNTER;
}
}
diff --git a/pipelines/fabric/src/main/java/org/onosproject/pipelines/fabric/FabricTreatmentInterpreter.java b/pipelines/fabric/src/main/java/org/onosproject/pipelines/fabric/FabricTreatmentInterpreter.java
index 3be56bb..2c41985 100644
--- a/pipelines/fabric/src/main/java/org/onosproject/pipelines/fabric/FabricTreatmentInterpreter.java
+++ b/pipelines/fabric/src/main/java/org/onosproject/pipelines/fabric/FabricTreatmentInterpreter.java
@@ -51,11 +51,11 @@
private static final Logger log = getLogger(FabricTreatmentInterpreter.class);
private static final String INVALID_TREATMENT = "Invalid treatment for %s block: %s";
private static final PiAction NOP = PiAction.builder()
- .withId(FabricConstants.ACT_NOP_ID)
+ .withId(FabricConstants.NOP)
.build();
private static final PiAction POP_VLAN = PiAction.builder()
- .withId(FabricConstants.ACT_FABRICEGRESS_EGRESS_NEXT_POP_VLAN_ID)
+ .withId(FabricConstants.FABRIC_EGRESS_EGRESS_NEXT_POP_VLAN)
.build();
// Hide default constructor
@@ -103,14 +103,14 @@
}
VlanId vlanId = setVlanInst.vlanId();
- PiActionParam param = new PiActionParam(FabricConstants.ACT_PRM_NEW_VLAN_ID_ID,
+ PiActionParam param = new PiActionParam(FabricConstants.NEW_VLAN_ID,
ImmutableByteSequence.copyFrom(vlanId.toShort()));
PiActionId actionId;
if (pushVlanInst != null) {
// push_internal_vlan
- actionId = FabricConstants.ACT_FABRICINGRESS_FILTERING_PUSH_INTERNAL_VLAN_ID;
+ actionId = FabricConstants.FABRIC_INGRESS_FILTERING_PUSH_INTERNAL_VLAN;
} else {
- actionId = FabricConstants.ACT_FABRICINGRESS_FILTERING_SET_VLAN_ID;
+ actionId = FabricConstants.FABRIC_INGRESS_FILTERING_SET_VLAN;
}
// set_vlan
@@ -155,7 +155,7 @@
}
return PiAction.builder()
- .withId(FabricConstants.ACT_FABRICINGRESS_FORWARDING_DUPLICATE_TO_CONTROLLER_ID)
+ .withId(FabricConstants.FABRIC_INGRESS_FORWARDING_DUPLICATE_TO_CONTROLLER)
.build();
}
@@ -219,11 +219,10 @@
// set_vlan
VlanId vlanId = modVlanIdInst.vlanId();
PiActionParam newVlanParam =
- new PiActionParam(FabricConstants.ACT_PRM_NEW_VLAN_ID_ID,
+ new PiActionParam(FabricConstants.NEW_VLAN_ID,
ImmutableByteSequence.copyFrom(vlanId.toShort()));
- // set_vlan_output
return PiAction.builder()
- .withId(FabricConstants.ACT_FABRICINGRESS_NEXT_SET_VLAN_ID)
+ .withId(FabricConstants.FABRIC_INGRESS_NEXT_SET_VLAN)
.withParameter(newVlanParam)
.build();
} else {
@@ -232,23 +231,23 @@
}
short portNum = (short) outInst.port().toLong();
- PiActionParam portNumParam = new PiActionParam(FabricConstants.ACT_PRM_PORT_NUM_ID,
+ PiActionParam portNumParam = new PiActionParam(FabricConstants.PORT_NUM,
ImmutableByteSequence.copyFrom(portNum));
if (modEthDstInst == null && modEthSrcInst == null) {
if (modVlanIdInst != null) {
VlanId vlanId = modVlanIdInst.vlanId();
PiActionParam vlanParam =
- new PiActionParam(FabricConstants.ACT_PRM_NEW_VLAN_ID_ID,
+ new PiActionParam(FabricConstants.NEW_VLAN_ID,
ImmutableByteSequence.copyFrom(vlanId.toShort()));
// set_vlan_output
return PiAction.builder()
- .withId(FabricConstants.ACT_FABRICINGRESS_NEXT_SET_VLAN_OUTPUT_ID)
+ .withId(FabricConstants.FABRIC_INGRESS_NEXT_SET_VLAN_OUTPUT)
.withParameters(ImmutableList.of(portNumParam, vlanParam))
.build();
} else {
// output
return PiAction.builder()
- .withId(FabricConstants.ACT_FABRICINGRESS_NEXT_OUTPUT_ID)
+ .withId(FabricConstants.FABRIC_INGRESS_NEXT_OUTPUT)
.withParameter(portNumParam)
.build();
}
@@ -257,9 +256,9 @@
if (modEthDstInst != null && modEthSrcInst != null) {
MacAddress srcMac = modEthSrcInst.mac();
MacAddress dstMac = modEthDstInst.mac();
- PiActionParam srcMacParam = new PiActionParam(FabricConstants.ACT_PRM_SMAC_ID,
+ PiActionParam srcMacParam = new PiActionParam(FabricConstants.SMAC,
ImmutableByteSequence.copyFrom(srcMac.toBytes()));
- PiActionParam dstMacParam = new PiActionParam(FabricConstants.ACT_PRM_DMAC_ID,
+ PiActionParam dstMacParam = new PiActionParam(FabricConstants.DMAC,
ImmutableByteSequence.copyFrom(dstMac.toBytes()));
if (modMplsInst != null) {
@@ -268,10 +267,10 @@
try {
ImmutableByteSequence mplsValue =
ImmutableByteSequence.copyFrom(mplsLabel.toInt()).fit(20);
- PiActionParam mplsParam = new PiActionParam(FabricConstants.ACT_PRM_LABEL_ID, mplsValue);
+ PiActionParam mplsParam = new PiActionParam(FabricConstants.LABEL, mplsValue);
return PiAction.builder()
// FIXME: fins a way to determine v4 or v6
- .withId(FabricConstants.ACT_FABRICINGRESS_NEXT_MPLS_ROUTING_V4_ID)
+ .withId(FabricConstants.FABRIC_INGRESS_NEXT_MPLS_ROUTING_V4)
.withParameters(ImmutableList.of(portNumParam,
srcMacParam,
dstMacParam,
@@ -287,17 +286,17 @@
if (modVlanIdInst != null) {
VlanId vlanId = modVlanIdInst.vlanId();
PiActionParam vlanParam =
- new PiActionParam(FabricConstants.ACT_PRM_NEW_VLAN_ID_ID,
+ new PiActionParam(FabricConstants.NEW_VLAN_ID,
ImmutableByteSequence.copyFrom(vlanId.toShort()));
// L3 routing and set VLAN
return PiAction.builder()
- .withId(FabricConstants.ACT_FABRICINGRESS_NEXT_L3_ROUTING_VLAN_ID)
+ .withId(FabricConstants.FABRIC_INGRESS_NEXT_L3_ROUTING_VLAN)
.withParameters(ImmutableList.of(srcMacParam, dstMacParam, portNumParam, vlanParam))
.build();
} else {
// L3 routing
return PiAction.builder()
- .withId(FabricConstants.ACT_FABRICINGRESS_NEXT_L3_ROUTING_ID)
+ .withId(FabricConstants.FABRIC_INGRESS_NEXT_L3_ROUTING)
.withParameters(ImmutableList.of(portNumParam,
srcMacParam,
dstMacParam))
diff --git a/pipelines/fabric/src/main/java/org/onosproject/pipelines/fabric/pipeliner/FabricFilteringPipeliner.java b/pipelines/fabric/src/main/java/org/onosproject/pipelines/fabric/pipeliner/FabricFilteringPipeliner.java
index d46d354..a8515e5 100644
--- a/pipelines/fabric/src/main/java/org/onosproject/pipelines/fabric/pipeliner/FabricFilteringPipeliner.java
+++ b/pipelines/fabric/src/main/java/org/onosproject/pipelines/fabric/pipeliner/FabricFilteringPipeliner.java
@@ -58,10 +58,10 @@
private static final byte FWD_IPV6_UNICAST = 4;
private static final byte FWD_IPV6_MULTICAST = 5;
private static final PiCriterion VLAN_VALID = PiCriterion.builder()
- .matchExact(FabricConstants.HF_VLAN_TAG_IS_VALID_ID, new byte[]{1})
+ .matchExact(FabricConstants.HDR_VLAN_TAG_IS_VALID, new byte[]{1})
.build();
private static final PiCriterion VLAN_INVALID = PiCriterion.builder()
- .matchExact(FabricConstants.HF_VLAN_TAG_IS_VALID_ID, new byte[]{0})
+ .matchExact(FabricConstants.HDR_VLAN_TAG_IS_VALID, new byte[]{0})
.build();
protected DeviceId deviceId;
@@ -147,7 +147,7 @@
.withSelector(selector.build())
.withTreatment(treatment)
.withPriority(filterObjective.priority())
- .forTable(FabricConstants.TBL_INGRESS_PORT_VLAN_ID)
+ .forTable(FabricConstants.FABRIC_INGRESS_FILTERING_INGRESS_PORT_VLAN)
.forDevice(deviceId)
.makePermanent()
.build();
@@ -225,15 +225,15 @@
.withPriority(filterObjective.priority())
.forDevice(deviceId)
.makePermanent()
- .forTable(FabricConstants.TBL_FWD_CLASSIFIER_ID)
+ .forTable(FabricConstants.FABRIC_INGRESS_FILTERING_FWD_CLASSIFIER)
.build();
}
private TrafficTreatment createFwdClassifierTreatment(byte fwdType) {
- PiActionParam param = new PiActionParam(FabricConstants.ACT_PRM_FWD_TYPE_ID,
+ PiActionParam param = new PiActionParam(FabricConstants.FWD_TYPE,
ImmutableByteSequence.copyFrom(fwdType));
PiAction action = PiAction.builder()
- .withId(FabricConstants.ACT_FABRICINGRESS_FILTERING_SET_FORWARDING_TYPE_ID)
+ .withId(FabricConstants.FABRIC_INGRESS_FILTERING_SET_FORWARDING_TYPE)
.withParameter(param)
.build();
return DefaultTrafficTreatment.builder()
diff --git a/pipelines/fabric/src/main/java/org/onosproject/pipelines/fabric/pipeliner/FabricForwardingPipeliner.java b/pipelines/fabric/src/main/java/org/onosproject/pipelines/fabric/pipeliner/FabricForwardingPipeliner.java
index 6f87e79..785870e 100644
--- a/pipelines/fabric/src/main/java/org/onosproject/pipelines/fabric/pipeliner/FabricForwardingPipeliner.java
+++ b/pipelines/fabric/src/main/java/org/onosproject/pipelines/fabric/pipeliner/FabricForwardingPipeliner.java
@@ -84,7 +84,7 @@
FlowRule flowRule = DefaultFlowRule.builder()
.withSelector(fwd.selector())
.withTreatment(fwd.treatment())
- .forTable(FabricConstants.TBL_ACL_ID)
+ .forTable(FabricConstants.FABRIC_INGRESS_FORWARDING_ACL)
.withPriority(fwd.priority())
.forDevice(deviceId)
.makePermanent()
@@ -188,7 +188,7 @@
.withPriority(fwd.priority())
.makePermanent()
.forDevice(deviceId)
- .forTable(FabricConstants.TBL_BRIDGING_ID)
+ .forTable(FabricConstants.FABRIC_INGRESS_FORWARDING_BRIDGING)
.build();
resultBuilder.addFlowRule(flowRule);
@@ -215,7 +215,7 @@
.withPriority(fwd.priority())
.makePermanent()
.forDevice(deviceId)
- .forTable(FabricConstants.TBL_BRIDGING_ID)
+ .forTable(FabricConstants.FABRIC_INGRESS_FORWARDING_BRIDGING)
.build();
resultBuilder.addFlowRule(flowRule);
@@ -238,7 +238,7 @@
.withPriority(fwd.priority())
.makePermanent()
.forDevice(deviceId)
- .forTable(FabricConstants.TBL_UNICAST_V4_ID)
+ .forTable(FabricConstants.FABRIC_INGRESS_FORWARDING_UNICAST_V4)
.build();
resultBuilder.addFlowRule(flowRule);
@@ -251,10 +251,10 @@
treatment = fwd.treatment();
if (fwd.nextId() != null) {
- PiActionParam nextIdParam = new PiActionParam(FabricConstants.ACT_PRM_NEXT_ID_ID,
+ PiActionParam nextIdParam = new PiActionParam(FabricConstants.NEXT_ID,
ImmutableByteSequence.copyFrom(fwd.nextId().byteValue()));
PiAction nextIdAction = PiAction.builder()
- .withId(FabricConstants.ACT_FABRICINGRESS_FORWARDING_POP_MPLS_AND_NEXT_ID)
+ .withId(FabricConstants.FABRIC_INGRESS_FORWARDING_POP_MPLS_AND_NEXT)
.withParameter(nextIdParam)
.build();
treatment = DefaultTrafficTreatment.builder()
@@ -273,7 +273,7 @@
.withPriority(fwd.priority())
.makePermanent()
.forDevice(deviceId)
- .forTable(FabricConstants.TBL_MPLS_ID)
+ .forTable(FabricConstants.FABRIC_INGRESS_FORWARDING_MPLS)
.build();
resultBuilder.addFlowRule(flowRule);
@@ -287,10 +287,10 @@
* @return treatment with set_next_id action; empty treatment if next id is null
*/
private static TrafficTreatment buildSetNextIdTreatment(Integer nextId) {
- PiActionParam nextIdParam = new PiActionParam(FabricConstants.ACT_PRM_NEXT_ID_ID,
+ PiActionParam nextIdParam = new PiActionParam(FabricConstants.NEXT_ID,
ImmutableByteSequence.copyFrom(nextId.byteValue()));
PiAction nextIdAction = PiAction.builder()
- .withId(FabricConstants.ACT_FABRICINGRESS_FORWARDING_SET_NEXT_ID_ID)
+ .withId(FabricConstants.FABRIC_INGRESS_FORWARDING_SET_NEXT_ID)
.withParameter(nextIdParam)
.build();
diff --git a/pipelines/fabric/src/main/java/org/onosproject/pipelines/fabric/pipeliner/FabricNextPipeliner.java b/pipelines/fabric/src/main/java/org/onosproject/pipelines/fabric/pipeliner/FabricNextPipeliner.java
index 12602b4..3b66b1b 100644
--- a/pipelines/fabric/src/main/java/org/onosproject/pipelines/fabric/pipeliner/FabricNextPipeliner.java
+++ b/pipelines/fabric/src/main/java/org/onosproject/pipelines/fabric/pipeliner/FabricNextPipeliner.java
@@ -42,18 +42,12 @@
import org.onosproject.net.group.GroupDescription;
import org.onosproject.net.pi.runtime.PiActionGroupId;
import org.onosproject.net.pi.runtime.PiGroupKey;
+import org.onosproject.pipelines.fabric.FabricConstants;
import org.slf4j.Logger;
import java.util.List;
import java.util.stream.Collectors;
-import static org.onosproject.pipelines.fabric.FabricConstants.ACT_PRF_FABRICINGRESS_NEXT_ECMP_SELECTOR_ID;
-import static org.onosproject.pipelines.fabric.FabricConstants.HF_FABRIC_METADATA_NEXT_ID_ID;
-import static org.onosproject.pipelines.fabric.FabricConstants.HF_STANDARD_METADATA_EGRESS_PORT_ID;
-import static org.onosproject.pipelines.fabric.FabricConstants.TBL_EGRESS_VLAN_ID;
-import static org.onosproject.pipelines.fabric.FabricConstants.TBL_HASHED_ID;
-import static org.onosproject.pipelines.fabric.FabricConstants.TBL_SIMPLE_ID;
-import static org.onosproject.pipelines.fabric.FabricConstants.TBL_VLAN_META_ID;
import static org.slf4j.LoggerFactory.getLogger;
/**
@@ -116,7 +110,7 @@
resultBuilder.addFlowRule(DefaultFlowRule.builder()
.withSelector(selector)
.withTreatment(treatment)
- .forTable(TBL_VLAN_META_ID)
+ .forTable(FabricConstants.FABRIC_INGRESS_NEXT_VLAN_META)
.makePermanent()
.withPriority(next.priority())
.forDevice(deviceId)
@@ -146,7 +140,7 @@
resultBuilder.addFlowRule(DefaultFlowRule.builder()
.withSelector(selector)
.withTreatment(treatment)
- .forTable(TBL_SIMPLE_ID)
+ .forTable(FabricConstants.FABRIC_INGRESS_NEXT_SIMPLE)
.makePermanent()
.withPriority(next.priority())
.forDevice(deviceId)
@@ -184,7 +178,7 @@
VlanId vlanId = vlanIdCriterion.vlanId();
PiCriterion egressVlanTableMatch = PiCriterion.builder()
- .matchExact(HF_STANDARD_METADATA_EGRESS_PORT_ID,
+ .matchExact(FabricConstants.STANDARD_METADATA_EGRESS_PORT,
(short) port.toLong())
.build();
// Add VLAN pop rule to egress pipeline table
@@ -198,7 +192,7 @@
resultBuilder.addFlowRule(DefaultFlowRule.builder()
.withSelector(selector)
.withTreatment(treatment)
- .forTable(TBL_EGRESS_VLAN_ID)
+ .forTable(FabricConstants.FABRIC_EGRESS_EGRESS_NEXT_EGRESS_VLAN)
.makePermanent()
.withPriority(next.priority())
.forDevice(deviceId)
@@ -256,8 +250,8 @@
}
GroupBuckets buckets = new GroupBuckets(bucketList);
- PiGroupKey groupKey = new PiGroupKey(TBL_HASHED_ID,
- ACT_PRF_FABRICINGRESS_NEXT_ECMP_SELECTOR_ID,
+ PiGroupKey groupKey = new PiGroupKey(FabricConstants.FABRIC_INGRESS_NEXT_HASHED,
+ FabricConstants.FABRIC_INGRESS_NEXT_ECMP_SELECTOR,
groupId);
resultBuilder.addGroup(new DefaultGroupDescription(deviceId,
@@ -282,7 +276,7 @@
resultBuilder.addFlowRule(DefaultFlowRule.builder()
.withSelector(selector)
.withTreatment(treatment)
- .forTable(TBL_HASHED_ID)
+ .forTable(FabricConstants.FABRIC_INGRESS_NEXT_HASHED)
.makePermanent()
.withPriority(next.priority())
.forDevice(deviceId)
@@ -292,7 +286,7 @@
private TrafficSelector buildNextIdSelector(int nextId) {
PiCriterion nextIdCriterion = PiCriterion.builder()
- .matchExact(HF_FABRIC_METADATA_NEXT_ID_ID, nextId)
+ .matchExact(FabricConstants.FABRIC_METADATA_NEXT_ID, nextId)
.build();
return DefaultTrafficSelector.builder()
.matchPi(nextIdCriterion)