Merge into master from pull request #85:
wireshark: fix compatibility with Wireshark 1.10 (https://github.com/floodlight/loxigen/pull/85)
diff --git a/java_gen/java_type.py b/java_gen/java_type.py
index 169b3f0..6de71ba 100644
--- a/java_gen/java_type.py
+++ b/java_gen/java_type.py
@@ -394,6 +394,10 @@
         .op(read='TableId.readByte(bb)',
             write='$name.writeByte(bb)',
             default='TableId.ALL')
+table_id_default_zero = JType("TableId") \
+        .op(read='TableId.readByte(bb)',
+            write='$name.writeByte(bb)',
+            default='TableId.ZERO')
 of_version = JType("OFVersion", 'byte') \
             .op(read='bb.readByte()', write='bb.writeByte($name)')
 
@@ -577,6 +581,8 @@
         return JType("OFInstructionType", 'short') \
             .op(read='bb.readShort()', write='bb.writeShort($name)', pub_type=False)\
             .op(read="OFInstructionTypeSerializerVer$version.readFrom(bb)", write="OFInstructionTypeSerializerVer$version.writeTo(bb, $name)", pub_type=True)
+    elif obj_name in ("of_flow_add", "of_flow_modify", "of_flow_modify_strict", "of_delete_strict") and  field_name == "table_id" and c_type == "uint8_t":
+        return table_id_default_zero
     elif field_name == "table_id" and c_type == "uint8_t":
         return table_id
     elif field_name == "version" and c_type == "uint8_t":
diff --git a/java_gen/pre-written/src/main/java/org/projectfloodlight/openflow/types/TableId.java b/java_gen/pre-written/src/main/java/org/projectfloodlight/openflow/types/TableId.java
index ebb1966..698bc8e 100644
--- a/java_gen/pre-written/src/main/java/org/projectfloodlight/openflow/types/TableId.java
+++ b/java_gen/pre-written/src/main/java/org/projectfloodlight/openflow/types/TableId.java
@@ -14,7 +14,9 @@
     private static final short ALL_VAL = 0x00FF;
     private static final short NONE_VAL = 0x0000;
     public static final TableId NONE = new TableId(NONE_VAL);
+
     public static final TableId ALL = new TableId(ALL_VAL);
+    public static final TableId ZERO = NONE;
 
     private final short id;
 
diff --git a/java_gen/pre-written/src/main/java/org/projectfloodlight/openflow/types/U16.java b/java_gen/pre-written/src/main/java/org/projectfloodlight/openflow/types/U16.java
index c52a74a..2f8bfee 100644
--- a/java_gen/pre-written/src/main/java/org/projectfloodlight/openflow/types/U16.java
+++ b/java_gen/pre-written/src/main/java/org/projectfloodlight/openflow/types/U16.java
@@ -22,6 +22,8 @@
 import org.projectfloodlight.openflow.protocol.OFMessageReader;
 import org.projectfloodlight.openflow.protocol.Writeable;
 
+import com.google.common.primitives.Ints;
+
 public class U16 implements Writeable, OFValueType<U16> {
     private final static short ZERO_VAL = 0;
     public final static U16 ZERO = new U16(ZERO_VAL);
@@ -113,6 +115,6 @@
 
     @Override
     public int compareTo(U16 o) {
-        return Integer.compare(f(raw), f(o.raw));
+        return Ints.compare(f(raw), f(o.raw));
     }
 }
diff --git a/java_gen/pre-written/src/main/java/org/projectfloodlight/openflow/util/ActionUtils.java b/java_gen/pre-written/src/main/java/org/projectfloodlight/openflow/util/ActionUtils.java
new file mode 100644
index 0000000..e0553a9
--- /dev/null
+++ b/java_gen/pre-written/src/main/java/org/projectfloodlight/openflow/util/ActionUtils.java
@@ -0,0 +1,43 @@
+package org.projectfloodlight.openflow.util;
+
+import java.util.List;
+
+import org.projectfloodlight.openflow.protocol.OFFlowMod;
+import org.projectfloodlight.openflow.protocol.OFFlowStatsEntry;
+import org.projectfloodlight.openflow.protocol.OFInstructionType;
+import org.projectfloodlight.openflow.protocol.OFVersion;
+import org.projectfloodlight.openflow.protocol.action.OFAction;
+import org.projectfloodlight.openflow.protocol.instruction.OFInstruction;
+import org.projectfloodlight.openflow.protocol.instruction.OFInstructionApplyActions;
+
+import com.google.common.collect.ImmutableList;
+
+public class ActionUtils {
+    private ActionUtils() {}
+
+    public static List<OFAction> getActions(OFFlowStatsEntry e) {
+        if(e.getVersion() == OFVersion.OF_10) {
+            return e.getActions();
+        } else {
+            for(OFInstruction i: e.getInstructions()) {
+                if(i.getType() == OFInstructionType.APPLY_ACTIONS) {
+                    return ((OFInstructionApplyActions) i).getActions();
+                }
+            }
+            return ImmutableList.of();
+        }
+    }
+
+    public static List<OFAction> getActions(OFFlowMod e) {
+        if(e.getVersion() == OFVersion.OF_10) {
+            return e.getActions();
+        } else {
+            for(OFInstruction i: e.getInstructions()) {
+                if(i.getType() == OFInstructionType.APPLY_ACTIONS) {
+                    return ((OFInstructionApplyActions) i).getActions();
+                }
+            }
+            return ImmutableList.of();
+        }
+    }
+}
diff --git a/java_gen/templates/of_factory_class.java b/java_gen/templates/of_factory_class.java
index 9352541..eef1e04 100644
--- a/java_gen/templates/of_factory_class.java
+++ b/java_gen/templates/of_factory_class.java
@@ -45,10 +45,6 @@
     private final XidGenerator xidGenerator = XidGenerators.global();
     //:: #endif
 
-    public OFVersion getOFVersion() {
-        return OFVersion.OF_${factory.version.of_version};
-    }
-
     //:: for name, clazz in factory.interface.sub_factories.items():
     public ${clazz} ${name}() {
         return ${clazz}Ver${factory.version.of_version}.INSTANCE;
@@ -174,4 +170,7 @@
     }
 //:: #endif
 
+    public OFVersion getVersion() {
+            return OFVersion.${factory.version.constant_version};
+    }
 }
diff --git a/java_gen/templates/of_factory_interface.java b/java_gen/templates/of_factory_interface.java
index c4ec8af..9a77aa7 100644
--- a/java_gen/templates/of_factory_interface.java
+++ b/java_gen/templates/of_factory_interface.java
@@ -58,8 +58,8 @@
     Match matchWildcardAll();
 //:: #endif
 
-    OFVersion getOFVersion();
     OFMessageReader<${factory.base_class}> getReader();
+    OFVersion getVersion();
 //:: if factory.name == 'OFOxms':
 
     public <F extends OFValueType<F>> OFOxm<F> fromValue(F value, MatchField<F> field);