CORD-389 Fix for Accton 6712 deployment

Related to this topic:
- Disable the meter collector since right now it is not supported
- Implement extension VLAN ID selector/treatment for OFDPA
    Since it requires two special flow entries to match untagged packets
        0x1ffe/no mask (filtering rule, need to go first)
        0x0000/0x1fff setvid 0x0ffe (assignment rule, need to go second)
- Not able to point /32 IP address to ECMP group. Use /31 instead.

In addition:
- Implement serializer for ExtensionCriterion

Change-Id: I621b3ad14014d7e6945c014cdae4f7cd2939288e
diff --git a/src/main/java/org/onosproject/segmentrouting/RoutingRulePopulator.java b/src/main/java/org/onosproject/segmentrouting/RoutingRulePopulator.java
index 6017e8b..8ca29b0 100644
--- a/src/main/java/org/onosproject/segmentrouting/RoutingRulePopulator.java
+++ b/src/main/java/org/onosproject/segmentrouting/RoutingRulePopulator.java
@@ -230,6 +230,13 @@
     public boolean populateIpRuleForRouter(DeviceId deviceId,
                                            IpPrefix ipPrefix, DeviceId destSw,
                                            Set<DeviceId> nextHops) {
+        // TODO: OFDPA does not support /32 with ECMP group at this moment.
+        //       Use /31 instead
+        IpPrefix effectivePrefix =
+                (ipPrefix.prefixLength() == IpPrefix.MAX_INET_MASK_LENGTH) ?
+                        IpPrefix.valueOf(ipPrefix.getIp4Prefix().address(), 31) :
+                        ipPrefix;
+
         int segmentId;
         try {
             segmentId = config.getSegmentId(destSw);
@@ -239,7 +246,7 @@
         }
 
         TrafficSelector.Builder sbuilder = DefaultTrafficSelector.builder();
-        sbuilder.matchIPDst(ipPrefix);
+        sbuilder.matchIPDst(effectivePrefix);
         sbuilder.matchEthType(Ethernet.TYPE_IPV4);
         TrafficSelector selector = sbuilder.build();
 
@@ -277,7 +284,7 @@
                 .makePermanent()
                 .nextStep(nextId)
                 .withSelector(selector)
-                .withPriority(2000 * ipPrefix.prefixLength())
+                .withPriority(2000 * effectivePrefix.prefixLength())
                 .withFlag(ForwardingObjective.Flag.SPECIFIC);
         if (treatment != null) {
             fwdBuilder.withTreatment(treatment);