Merge branch 'master' of ssh://gerrit.onlab.us:29418/onos-next
diff --git a/cli/src/main/java/org/onlab/onos/cli/net/FlowsListCommand.java b/cli/src/main/java/org/onlab/onos/cli/net/FlowsListCommand.java
index da43255..12f6ee6 100644
--- a/cli/src/main/java/org/onlab/onos/cli/net/FlowsListCommand.java
+++ b/cli/src/main/java/org/onlab/onos/cli/net/FlowsListCommand.java
@@ -1,18 +1,21 @@
 package org.onlab.onos.cli.net;
 
-import com.google.common.collect.Maps;
-import org.apache.karaf.shell.commands.Command;
-import org.onlab.onos.cli.AbstractShellCommand;
-import org.onlab.onos.net.Device;
-import org.onlab.onos.net.device.DeviceService;
-import org.onlab.onos.net.flow.FlowRule;
-import org.onlab.onos.net.flow.FlowRuleService;
+import static com.google.common.collect.Lists.newArrayList;
 
 import java.util.Collections;
 import java.util.List;
 import java.util.Map;
 
-import static com.google.common.collect.Lists.newArrayList;
+import org.apache.karaf.shell.commands.Argument;
+import org.apache.karaf.shell.commands.Command;
+import org.onlab.onos.cli.AbstractShellCommand;
+import org.onlab.onos.net.Device;
+import org.onlab.onos.net.DeviceId;
+import org.onlab.onos.net.device.DeviceService;
+import org.onlab.onos.net.flow.FlowRule;
+import org.onlab.onos.net.flow.FlowRuleService;
+
+import com.google.common.collect.Maps;
 
 /**
  * Lists all currently-known hosts.
@@ -22,14 +25,20 @@
 public class FlowsListCommand extends AbstractShellCommand {
 
     private static final String FMT =
-            "   id=%s, selector=%s, treatment=%s, state=%s";
+            "   id=%s, state=%s, bytes=%s, packets=%s, duration=%s, priority=%s";
+    private static final String TFMT = "      treatment=%s";
+    private static final String SFMT = "      selector=%s";
+
+    @Argument(index = 0, name = "uri", description = "Device ID",
+            required = false, multiValued = false)
+    String uri = null;
 
     @Override
     protected void execute() {
         DeviceService deviceService = get(DeviceService.class);
         FlowRuleService service = get(FlowRuleService.class);
         Map<Device, List<FlowRule>> flows = getSortedFlows(deviceService, service);
-        for (Device d : deviceService.getDevices()) {
+        for (Device d : flows.keySet()) {
             printFlows(d, flows.get(d));
         }
     }
@@ -42,8 +51,10 @@
      */
     protected Map<Device, List<FlowRule>> getSortedFlows(DeviceService deviceService, FlowRuleService service) {
         Map<Device, List<FlowRule>> flows = Maps.newHashMap();
-        List<FlowRule> rules;
-        for (Device d : deviceService.getDevices()) {
+        List<FlowRule> rules = newArrayList();
+        Iterable<Device> devices = uri == null ?  deviceService.getDevices() :
+            Collections.singletonList(deviceService.getDevice(DeviceId.deviceId(uri)));
+        for (Device d : devices) {
             rules = newArrayList(service.getFlowEntries(d.id()));
             Collections.sort(rules, Comparators.FLOW_RULE_COMPARATOR);
             flows.put(d, rules);
@@ -58,8 +69,15 @@
      */
     protected void printFlows(Device d, List<FlowRule> flows) {
         print("Device: " + d.id());
+        if (flows == null | flows.isEmpty()) {
+            print(" %s", "No flows installed.");
+            return;
+        }
         for (FlowRule f : flows) {
-            print(FMT, f.id().value(), f.selector(), f.treatment(), f.state());
+            print(FMT, Long.toHexString(f.id().value()), f.state(), f.bytes(),
+                    f.packets(), f.lifeMillis(), f.priority());
+            print(SFMT, f.selector().criteria());
+            print(TFMT, f.treatment().instructions());
         }
 
     }
diff --git a/cli/src/main/java/org/onlab/onos/cli/net/HostIdCompleter.java b/cli/src/main/java/org/onlab/onos/cli/net/HostIdCompleter.java
index 72c6a41..6da2d82 100644
--- a/cli/src/main/java/org/onlab/onos/cli/net/HostIdCompleter.java
+++ b/cli/src/main/java/org/onlab/onos/cli/net/HostIdCompleter.java
@@ -1,15 +1,15 @@
 package org.onlab.onos.cli.net;
 
+import java.util.Iterator;
+import java.util.List;
+import java.util.SortedSet;
+
 import org.apache.karaf.shell.console.Completer;
 import org.apache.karaf.shell.console.completer.StringsCompleter;
 import org.onlab.onos.cli.AbstractShellCommand;
 import org.onlab.onos.net.Host;
 import org.onlab.onos.net.host.HostService;
 
-import java.util.Iterator;
-import java.util.List;
-import java.util.SortedSet;
-
 public class HostIdCompleter implements Completer {
 
     @Override
diff --git a/cli/src/main/resources/OSGI-INF/blueprint/shell-config.xml b/cli/src/main/resources/OSGI-INF/blueprint/shell-config.xml
index 5284477..6b867b3 100644
--- a/cli/src/main/resources/OSGI-INF/blueprint/shell-config.xml
+++ b/cli/src/main/resources/OSGI-INF/blueprint/shell-config.xml
@@ -72,6 +72,9 @@
 
         <command>
             <action class="org.onlab.onos.cli.net.FlowsListCommand"/>
+            <completers>
+                <ref component-id="deviceIdCompleter"/>
+            </completers>
         </command>
 
         <command>
diff --git a/core/api/src/main/java/org/onlab/onos/net/flow/criteria/Criteria.java b/core/api/src/main/java/org/onlab/onos/net/flow/criteria/Criteria.java
index e27cc4d..758c51c 100644
--- a/core/api/src/main/java/org/onlab/onos/net/flow/criteria/Criteria.java
+++ b/core/api/src/main/java/org/onlab/onos/net/flow/criteria/Criteria.java
@@ -1,5 +1,7 @@
 package org.onlab.onos.net.flow.criteria;
 
+import static com.google.common.base.MoreObjects.toStringHelper;
+
 import org.onlab.onos.net.PortNumber;
 import org.onlab.onos.net.flow.criteria.Criterion.Type;
 import org.onlab.packet.IpPrefix;
@@ -129,6 +131,12 @@
         public PortNumber port() {
             return this.port;
         }
+
+        @Override
+        public String toString() {
+            return toStringHelper(type().toString())
+                    .add("port", port).toString();
+        }
     }
 
 
@@ -149,6 +157,13 @@
         public MacAddress mac() {
             return this.mac;
         }
+
+        @Override
+        public String toString() {
+            return toStringHelper(type().toString())
+                    .add("mac", mac).toString();
+        }
+
     }
 
     public static final class EthTypeCriterion implements Criterion {
@@ -168,6 +183,12 @@
             return ethType;
         }
 
+        @Override
+        public String toString() {
+            return toStringHelper(type().toString())
+                    .add("ethType", Long.toHexString(ethType)).toString();
+        }
+
     }
 
 
@@ -190,6 +211,11 @@
             return this.ip;
         }
 
+        @Override
+        public String toString() {
+            return toStringHelper(type().toString())
+                    .add("ip", ip).toString();
+        }
 
     }
 
@@ -211,6 +237,12 @@
             return proto;
         }
 
+        @Override
+        public String toString() {
+            return toStringHelper(type().toString())
+                    .add("protocol", Long.toHexString(proto)).toString();
+        }
+
     }
 
 
@@ -231,6 +263,12 @@
             return vlanPcp;
         }
 
+        @Override
+        public String toString() {
+            return toStringHelper(type().toString())
+                    .add("pcp", Long.toHexString(vlanPcp)).toString();
+        }
+
     }
 
 
@@ -252,6 +290,12 @@
             return vlanId;
         }
 
+        @Override
+        public String toString() {
+            return toStringHelper(type().toString())
+                    .add("id", vlanId).toString();
+        }
+
     }
 
 
diff --git a/core/api/src/main/java/org/onlab/onos/net/flow/instructions/Instructions.java b/core/api/src/main/java/org/onlab/onos/net/flow/instructions/Instructions.java
index ada96a5..1bf5531 100644
--- a/core/api/src/main/java/org/onlab/onos/net/flow/instructions/Instructions.java
+++ b/core/api/src/main/java/org/onlab/onos/net/flow/instructions/Instructions.java
@@ -1,5 +1,6 @@
 package org.onlab.onos.net.flow.instructions;
 
+import static com.google.common.base.MoreObjects.toStringHelper;
 import static com.google.common.base.Preconditions.checkNotNull;
 
 import org.onlab.onos.net.PortNumber;
@@ -47,7 +48,7 @@
      */
     public static L2ModificationInstruction modL2Src(MacAddress addr) {
         checkNotNull(addr, "Src l2 address cannot be null");
-        return new ModEtherInstruction(L2SubType.L2_SRC, addr);
+        return new ModEtherInstruction(L2SubType.ETH_SRC, addr);
     }
 
     /**
@@ -57,7 +58,7 @@
      */
     public static L2ModificationInstruction modL2Dst(MacAddress addr) {
         checkNotNull(addr, "Dst l2 address cannot be null");
-        return new L2ModificationInstruction.ModEtherInstruction(L2SubType.L2_DST, addr);
+        return new L2ModificationInstruction.ModEtherInstruction(L2SubType.ETH_DST, addr);
     }
 
     /**
@@ -87,7 +88,7 @@
      */
     public static L3ModificationInstruction modL3Src(IpPrefix addr) {
         checkNotNull(addr, "Src l3 address cannot be null");
-        return new ModIPInstruction(L3SubType.L3_SRC, addr);
+        return new ModIPInstruction(L3SubType.IP_SRC, addr);
     }
 
     /**
@@ -97,7 +98,7 @@
      */
     public static L3ModificationInstruction modL3Dst(IpPrefix addr) {
         checkNotNull(addr, "Dst l3 address cannot be null");
-        return new ModIPInstruction(L3SubType.L3_DST, addr);
+        return new ModIPInstruction(L3SubType.IP_DST, addr);
     }
 
 
@@ -110,6 +111,12 @@
         public Type type() {
             return Type.DROP;
         }
+
+        @Override
+        public String toString() {
+            return toStringHelper(type()).toString();
+
+        }
     }
 
 
@@ -128,6 +135,11 @@
         public Type type() {
             return Type.OUTPUT;
         }
+        @Override
+        public String toString() {
+            return toStringHelper(type().toString())
+                    .add("port", port).toString();
+        }
     }
 
 }
diff --git a/core/api/src/main/java/org/onlab/onos/net/flow/instructions/L2ModificationInstruction.java b/core/api/src/main/java/org/onlab/onos/net/flow/instructions/L2ModificationInstruction.java
index a0ab04c..8c51624 100644
--- a/core/api/src/main/java/org/onlab/onos/net/flow/instructions/L2ModificationInstruction.java
+++ b/core/api/src/main/java/org/onlab/onos/net/flow/instructions/L2ModificationInstruction.java
@@ -1,5 +1,7 @@
 package org.onlab.onos.net.flow.instructions;
 
+import static com.google.common.base.MoreObjects.toStringHelper;
+
 import org.onlab.packet.MacAddress;
 import org.onlab.packet.VlanId;
 
@@ -15,12 +17,12 @@
         /**
          * Ether src modification.
          */
-        L2_SRC,
+        ETH_SRC,
 
         /**
          * Ether dst modification.
          */
-        L2_DST,
+        ETH_DST,
 
         /**
          * VLAN id modification.
@@ -66,6 +68,13 @@
             return this.mac;
         }
 
+        @Override
+        public String toString() {
+            return toStringHelper(subtype().toString())
+                    .add("mac", mac).toString();
+        }
+
+
     }
 
     /**
@@ -88,6 +97,12 @@
             return this.vlanId;
         }
 
+        @Override
+        public String toString() {
+            return toStringHelper(subtype().toString())
+                    .add("id", vlanId).toString();
+        }
+
     }
 
     /**
@@ -110,6 +125,12 @@
             return this.vlanPcp;
         }
 
+        @Override
+        public String toString() {
+            return toStringHelper(subtype().toString())
+                    .add("pcp", Long.toHexString(vlanPcp)).toString();
+        }
+
     }
 
 
diff --git a/core/api/src/main/java/org/onlab/onos/net/flow/instructions/L3ModificationInstruction.java b/core/api/src/main/java/org/onlab/onos/net/flow/instructions/L3ModificationInstruction.java
index aa47634..ae82cd9 100644
--- a/core/api/src/main/java/org/onlab/onos/net/flow/instructions/L3ModificationInstruction.java
+++ b/core/api/src/main/java/org/onlab/onos/net/flow/instructions/L3ModificationInstruction.java
@@ -1,5 +1,7 @@
 package org.onlab.onos.net.flow.instructions;
 
+import static com.google.common.base.MoreObjects.toStringHelper;
+
 import org.onlab.packet.IpPrefix;
 
 /**
@@ -14,12 +16,12 @@
         /**
          * Ether src modification.
          */
-        L3_SRC,
+        IP_SRC,
 
         /**
          * Ether dst modification.
          */
-        L3_DST
+        IP_DST
 
         //TODO: remaining types
     }
@@ -58,5 +60,11 @@
             return this.ip;
         }
 
+        @Override
+        public String toString() {
+            return toStringHelper(subtype().toString())
+                    .add("ip", ip).toString();
+        }
+
     }
 }
diff --git a/core/api/src/main/java/org/onlab/onos/store/Timestamp.java b/core/api/src/main/java/org/onlab/onos/store/Timestamp.java
new file mode 100644
index 0000000..b9d3648
--- /dev/null
+++ b/core/api/src/main/java/org/onlab/onos/store/Timestamp.java
@@ -0,0 +1,8 @@
+package org.onlab.onos.store;
+
+/**
+ * Opaque version structure.
+ */
+public interface Timestamp extends Comparable<Timestamp> {
+
+}
diff --git a/core/net/src/main/java/org/onlab/onos/net/flow/impl/FlowRuleManager.java b/core/net/src/main/java/org/onlab/onos/net/flow/impl/FlowRuleManager.java
index 8513a2e..4babb50 100644
--- a/core/net/src/main/java/org/onlab/onos/net/flow/impl/FlowRuleManager.java
+++ b/core/net/src/main/java/org/onlab/onos/net/flow/impl/FlowRuleManager.java
@@ -252,7 +252,6 @@
                 }
             }
             for (FlowRule rule : storedRules) {
-                log.info("missing rule is {}", rule);
                 // there are rules in the store that aren't on the switch
                 flowMissing(rule);
 
diff --git a/core/store/src/main/java/org/onlab/onos/store/impl/OnosTimestamp.java b/core/store/src/main/java/org/onlab/onos/store/impl/OnosTimestamp.java
new file mode 100644
index 0000000..f994e02
--- /dev/null
+++ b/core/store/src/main/java/org/onlab/onos/store/impl/OnosTimestamp.java
@@ -0,0 +1,105 @@
+package org.onlab.onos.store.impl;
+
+import static com.google.common.base.Preconditions.checkNotNull;
+import static com.google.common.base.Preconditions.checkArgument;
+
+import java.util.Objects;
+
+import org.onlab.onos.net.ElementId;
+import org.onlab.onos.store.Timestamp;
+
+import com.google.common.base.MoreObjects;
+import com.google.common.collect.ComparisonChain;
+
+// If it is store specific, implement serializable interfaces?
+/**
+ * Default implementation of Timestamp.
+ */
+public final class OnosTimestamp implements Timestamp {
+
+    private final ElementId id;
+    private final int termNumber;
+    private final int sequenceNumber;
+
+    /**
+     * Default version tuple.
+     *
+     * @param id identifier of the element
+     * @param termNumber the mastership termNumber
+     * @param sequenceNumber  the sequenceNumber number within the termNumber
+     */
+    public OnosTimestamp(ElementId id, int termNumber, int sequenceNumber) {
+        this.id = checkNotNull(id);
+        this.termNumber = termNumber;
+        this.sequenceNumber = sequenceNumber;
+    }
+
+    @Override
+    public int compareTo(Timestamp o) {
+        checkArgument(o instanceof OnosTimestamp, "Must be OnosTimestamp", o);
+        OnosTimestamp that = (OnosTimestamp) o;
+        checkArgument(this.id.equals(that.id),
+                "Cannot compare version for different element this:%s, that:%s",
+                    this, that);
+
+        return ComparisonChain.start()
+                .compare(this.termNumber, that.termNumber)
+                .compare(this.sequenceNumber, that.sequenceNumber)
+                .result();
+    }
+
+    @Override
+    public int hashCode() {
+        return Objects.hash(id, termNumber, sequenceNumber);
+    }
+
+    @Override
+    public boolean equals(Object obj) {
+        if (this == obj) {
+            return true;
+        }
+        if (!(obj instanceof OnosTimestamp)) {
+            return false;
+        }
+        OnosTimestamp that = (OnosTimestamp) obj;
+        return Objects.equals(this.id, that.id) &&
+                Objects.equals(this.termNumber, that.termNumber) &&
+                Objects.equals(this.sequenceNumber, that.sequenceNumber);
+    }
+
+    @Override
+    public String toString() {
+        return MoreObjects.toStringHelper(getClass())
+                    .add("id", id)
+                    .add("termNumber", termNumber)
+                    .add("sequenceNumber", sequenceNumber)
+                    .toString();
+    }
+
+    /**
+     * Returns the element.
+     *
+     * @return element identifier
+     */
+    public ElementId id() {
+        return id;
+    }
+
+    /**
+     * Returns the termNumber.
+     *
+     * @return termNumber
+     */
+    public int termNumber() {
+        return termNumber;
+    }
+
+    /**
+     * Returns the sequenceNumber number.
+     *
+     * @return sequenceNumber
+     */
+    public int sequenceNumber() {
+        return sequenceNumber;
+    }
+}
diff --git a/core/store/src/main/java/org/onlab/onos/store/impl/StoreManager.java b/core/store/src/main/java/org/onlab/onos/store/impl/StoreManager.java
index abd8ade..c22d915 100644
--- a/core/store/src/main/java/org/onlab/onos/store/impl/StoreManager.java
+++ b/core/store/src/main/java/org/onlab/onos/store/impl/StoreManager.java
@@ -4,7 +4,9 @@
 import com.hazelcast.config.FileSystemXmlConfig;
 import com.hazelcast.core.Hazelcast;
 import com.hazelcast.core.HazelcastInstance;
+
 import de.javakaffee.kryoserializers.URISerializer;
+
 import org.apache.felix.scr.annotations.Activate;
 import org.apache.felix.scr.annotations.Component;
 import org.apache.felix.scr.annotations.Deactivate;
@@ -26,6 +28,7 @@
 import org.onlab.onos.store.serializers.DeviceIdSerializer;
 import org.onlab.onos.store.serializers.IpPrefixSerializer;
 import org.onlab.onos.store.serializers.NodeIdSerializer;
+import org.onlab.onos.store.serializers.OnosTimestampSerializer;
 import org.onlab.onos.store.serializers.PortNumberSerializer;
 import org.onlab.onos.store.serializers.ProviderIdSerializer;
 import org.onlab.packet.IpPrefix;
@@ -90,6 +93,7 @@
                 .register(DeviceId.class, new DeviceIdSerializer())
                 .register(PortNumber.class, new PortNumberSerializer())
                 .register(DefaultPort.class, new DefaultPortSerializer())
+                .register(OnosTimestamp.class, new OnosTimestampSerializer())
                 .build()
                 .populate(10);
     }
diff --git a/core/store/src/main/java/org/onlab/onos/store/serializers/DefaultPortSerializer.java b/core/store/src/main/java/org/onlab/onos/store/serializers/DefaultPortSerializer.java
index 836adea..8455e80 100644
--- a/core/store/src/main/java/org/onlab/onos/store/serializers/DefaultPortSerializer.java
+++ b/core/store/src/main/java/org/onlab/onos/store/serializers/DefaultPortSerializer.java
@@ -9,7 +9,6 @@
 import com.esotericsoftware.kryo.io.Input;
 import com.esotericsoftware.kryo.io.Output;
 
-// TODO move to util, etc.
 /**
  * Kryo Serializer for {@link DefaultPort}.
  */
diff --git a/core/store/src/main/java/org/onlab/onos/store/serializers/DeviceIdSerializer.java b/core/store/src/main/java/org/onlab/onos/store/serializers/DeviceIdSerializer.java
index 709dce0..c63b676 100644
--- a/core/store/src/main/java/org/onlab/onos/store/serializers/DeviceIdSerializer.java
+++ b/core/store/src/main/java/org/onlab/onos/store/serializers/DeviceIdSerializer.java
@@ -9,7 +9,6 @@
 import com.esotericsoftware.kryo.io.Input;
 import com.esotericsoftware.kryo.io.Output;
 
-//TODO move to util, etc.
 /**
 * Kryo Serializer for {@link DeviceId}.
 */
diff --git a/core/store/src/main/java/org/onlab/onos/store/serializers/IpPrefixSerializer.java b/core/store/src/main/java/org/onlab/onos/store/serializers/IpPrefixSerializer.java
index 8ac6679..2dbec57 100644
--- a/core/store/src/main/java/org/onlab/onos/store/serializers/IpPrefixSerializer.java
+++ b/core/store/src/main/java/org/onlab/onos/store/serializers/IpPrefixSerializer.java
@@ -7,7 +7,6 @@
 import com.esotericsoftware.kryo.io.Input;
 import com.esotericsoftware.kryo.io.Output;
 
-// TODO move to util, etc.
 /**
  * Kryo Serializer for {@link IpPrefix}.
  */
diff --git a/core/store/src/main/java/org/onlab/onos/store/serializers/OnosTimestampSerializer.java b/core/store/src/main/java/org/onlab/onos/store/serializers/OnosTimestampSerializer.java
new file mode 100644
index 0000000..812bc9d
--- /dev/null
+++ b/core/store/src/main/java/org/onlab/onos/store/serializers/OnosTimestampSerializer.java
@@ -0,0 +1,37 @@
+package org.onlab.onos.store.serializers;
+
+import org.onlab.onos.net.ElementId;
+import org.onlab.onos.store.impl.OnosTimestamp;
+
+import com.esotericsoftware.kryo.Kryo;
+import com.esotericsoftware.kryo.Serializer;
+import com.esotericsoftware.kryo.io.Input;
+import com.esotericsoftware.kryo.io.Output;
+
+/**
+ * Kryo Serializer for {@link OnosTimestamp}.
+ */
+public class OnosTimestampSerializer extends Serializer<OnosTimestamp> {
+
+    /**
+     * Default constructor.
+     */
+    public OnosTimestampSerializer() {
+        // non-null, immutable
+        super(false, true);
+    }
+    @Override
+    public void write(Kryo kryo, Output output, OnosTimestamp object) {
+        kryo.writeClassAndObject(output, object.id());
+        output.writeInt(object.termNumber());
+        output.writeInt(object.sequenceNumber());
+    }
+
+    @Override
+    public OnosTimestamp read(Kryo kryo, Input input, Class<OnosTimestamp> type) {
+        ElementId id = (ElementId) kryo.readClassAndObject(input);
+        final int term = input.readInt();
+        final int sequence = input.readInt();
+        return new OnosTimestamp(id, term, sequence);
+    }
+}
diff --git a/core/store/src/main/java/org/onlab/onos/store/serializers/PortNumberSerializer.java b/core/store/src/main/java/org/onlab/onos/store/serializers/PortNumberSerializer.java
index e89c379..02805bb 100644
--- a/core/store/src/main/java/org/onlab/onos/store/serializers/PortNumberSerializer.java
+++ b/core/store/src/main/java/org/onlab/onos/store/serializers/PortNumberSerializer.java
@@ -7,7 +7,6 @@
 import com.esotericsoftware.kryo.io.Input;
 import com.esotericsoftware.kryo.io.Output;
 
-// TODO move to util, etc.
 /**
  * Serializer for {@link PortNumber}.
  */
diff --git a/core/store/src/main/java/org/onlab/onos/store/serializers/ProviderIdSerializer.java b/core/store/src/main/java/org/onlab/onos/store/serializers/ProviderIdSerializer.java
index 3abb784..1a1c6f6 100644
--- a/core/store/src/main/java/org/onlab/onos/store/serializers/ProviderIdSerializer.java
+++ b/core/store/src/main/java/org/onlab/onos/store/serializers/ProviderIdSerializer.java
@@ -7,7 +7,6 @@
 import com.esotericsoftware.kryo.io.Input;
 import com.esotericsoftware.kryo.io.Output;
 
-//TODO move to util, etc.
 /**
  * Serializer for {@link ProviderId}.
  */
diff --git a/providers/openflow/flow/src/main/java/org/onlab/onos/provider/of/flow/impl/FlowModBuilder.java b/providers/openflow/flow/src/main/java/org/onlab/onos/provider/of/flow/impl/FlowModBuilder.java
index 8faf5ab..2822f02 100644
--- a/providers/openflow/flow/src/main/java/org/onlab/onos/provider/of/flow/impl/FlowModBuilder.java
+++ b/providers/openflow/flow/src/main/java/org/onlab/onos/provider/of/flow/impl/FlowModBuilder.java
@@ -133,10 +133,10 @@
         L3ModificationInstruction l3m = (L3ModificationInstruction) i;
         ModIPInstruction ip;
         switch (l3m.subtype()) {
-        case L3_DST:
+        case IP_DST:
             ip = (ModIPInstruction) i;
             return factory.actions().setNwDst(IPv4Address.of(ip.ip().toInt()));
-        case L3_SRC:
+        case IP_SRC:
             ip = (ModIPInstruction) i;
             return factory.actions().setNwSrc(IPv4Address.of(ip.ip().toInt()));
         default:
@@ -150,10 +150,10 @@
         L2ModificationInstruction l2m = (L2ModificationInstruction) i;
         ModEtherInstruction eth;
         switch (l2m.subtype()) {
-        case L2_DST:
+        case ETH_DST:
             eth = (ModEtherInstruction) l2m;
             return factory.actions().setDlDst(MacAddress.of(eth.mac().toLong()));
-        case L2_SRC:
+        case ETH_SRC:
             eth = (ModEtherInstruction) l2m;
             return factory.actions().setDlSrc(MacAddress.of(eth.mac().toLong()));
         case VLAN_ID: