java_gen: make channel utils version specific
diff --git a/java_gen/java_type.py b/java_gen/java_type.py
index 2d8a547..75bde01 100644
--- a/java_gen/java_type.py
+++ b/java_gen/java_type.py
@@ -44,9 +44,9 @@
         self.size = size            # bytes on the wire; None == variable length or hard to calc
         self.ops = {}
 #        if read_op is None:
-#            read_op = 'ChannelUtils.read%s(bb)' % self.pub_type
+#            read_op = 'ChannelUtilsVer$version.read%s(bb)' % self.pub_type
 #        if write_op is None:
-#            write_op = 'ChannelUtils.write%s(bb, $name)'  % self.pub_type
+#            write_op = 'ChannelUtilsVer$version.write%s(bb, $name)'  % self.pub_type
 #        self._read_op = read_op
 #        self._write_op = write_op
 
@@ -89,11 +89,11 @@
         ver = ANY if version is None else version.int_version
         _read_op = None
         if ver in self.ops:
-            _read_op = self.ops[ver].read or self.ops[ANY].read 
+            _read_op = self.ops[ver].read or self.ops[ANY].read
         elif ANY in self.ops:
             _read_op = self.ops[ANY].read
         if _read_op is None:
-            _read_op = 'ChannelUtils.read%s(bb)' % self.pub_type
+            _read_op = 'ChannelUtilsVer$version.read%s(bb)' % self.pub_type
         if callable(_read_op):
             return _read_op(version)
         else:
@@ -107,7 +107,7 @@
         elif ANY in self.ops:
             _write_op = self.ops[ANY].write
         if _write_op is None:
-            _write_op = 'ChannelUtils.write%s(bb, $name)' % self.pub_type
+            _write_op = 'ChannelUtilsVer$version.write%s(bb, $name)' % self.pub_type
         if callable(_write_op):
             return _write_op(version, name)
         else:
@@ -122,8 +122,6 @@
         return self.pub_type.endswith("[]")
 
 
-hello_elem_list = JType("List<OFHelloElement>") \
-        .op(read='ChannelUtils.readHelloElementList(bb)', write='ChannelUtils.writeHelloElementList(bb)')
 u8 =  JType('byte',  size=1) \
         .op(read='bb.readByte()', write='bb.writeByte($name)')
 u8_list =  JType('List<U8>',  size=1) \
@@ -140,42 +138,42 @@
          .op(version=1, read="OFPort.read2Bytes(bb)", write="$name.write2Bytes(bb)") \
          .op(version=ANY, read="OFPort.read4Bytes(bb)", write="$name.write4Bytes(bb)")
 one_byte_array = JType('byte[]', size=1) \
-        .op(read='ChannelUtils.readBytes(bb, 1)', write='ChannelUtils.writeBytes(bb, $name)')
+        .op(read='ChannelUtilsVer$version.readBytes(bb, 1)', write='ChannelUtilsVer$version.writeBytes(bb, $name)')
 two_byte_array = JType('byte[]', size=2) \
-        .op(read='ChannelUtils.readBytes(bb, 2)', write='ChannelUtils.writeBytes(bb, $name)')
+        .op(read='ChannelUtilsVer$version.readBytes(bb, 2)', write='ChannelUtilsVer$version.writeBytes(bb, $name)')
 three_byte_array = JType('byte[]', size=3) \
-        .op(read='ChannelUtils.readBytes(bb, 3)', write='ChannelUtils.writeBytes(bb, $name)')
+        .op(read='ChannelUtilsVer$version.readBytes(bb, 3)', write='ChannelUtilsVer$version.writeBytes(bb, $name)')
 four_byte_array = JType('byte[]', size=4) \
-        .op(read='ChannelUtils.readBytes(bb, 4)', write='ChannelUtils.writeBytes(bb, $name)')
+        .op(read='ChannelUtilsVer$version.readBytes(bb, 4)', write='ChannelUtilsVer$version.writeBytes(bb, $name)')
 five_byte_array = JType('byte[]', size=5) \
-        .op(read='ChannelUtils.readBytes(bb, 5)', write='ChannelUtils.writeBytes(bb, $name)')
+        .op(read='ChannelUtilsVer$version.readBytes(bb, 5)', write='ChannelUtilsVer$version.writeBytes(bb, $name)')
 six_byte_array = JType('byte[]', size=6) \
-        .op(read='ChannelUtils.readBytes(bb, 6)', write='ChannelUtils.writeBytes(bb, $name)')
+        .op(read='ChannelUtilsVer$version.readBytes(bb, 6)', write='ChannelUtilsVer$version.writeBytes(bb, $name)')
 seven_byte_array = JType('byte[]', size=7) \
-        .op(read='ChannelUtils.readBytes(bb, 7)', write='ChannelUtils.writeBytes(bb, $name)')
-actions_list = JType('List<OFAction>', size='ChannelUtils.calcListSize($name)') \
-        .op(read='ChannelUtils.readActionsList(bb, $length)', write='ChannelUtils.writeActionsList(bb, $name);')
-instructions_list = JType('List<OFInstruction>', size='ChannelUtils.calcListSize($name)') \
-        .op(read='ChannelUtils.readInstructionsList(bb, $length)', \
-            write='ChannelUtils.writeList(bb, $name)')
-buckets_list = JType('List<OFBucket>', size='ChannelUtils.calcListSize($name)') \
-        .op(read='ChannelUtils.readBucketList(bb, $length)', \
-            write='ChannelUtils.writeList(bb, $name)')
-port_desc_list = JType('List<OFPhysicalPort>', size='ChannelUtils.calcListSize($name)') \
-        .op(read='ChannelUtils.readPhysicalPortList(bb, $length)', \
-            write='ChannelUtils.writeList(bb, $name)')
+        .op(read='ChannelUtilsVer$version.readBytes(bb, 7)', write='ChannelUtilsVer$version.writeBytes(bb, $name)')
+actions_list = JType('List<OFAction>', size='ChannelUtilsVer$version.calcListSize($name)') \
+        .op(read='ChannelUtilsVer$version.readActionsList(bb, $length)', write='ChannelUtilsVer$version.writeActionsList(bb, $name);')
+instructions_list = JType('List<OFInstruction>', size='ChannelUtilsVer$version.calcListSize($name)') \
+        .op(read='ChannelUtilsVer$version.readInstructionsList(bb, $length)', \
+            write='ChannelUtilsVer$version.writeList(bb, $name)')
+buckets_list = JType('List<OFBucket>', size='ChannelUtilsVer$version.calcListSize($name)') \
+        .op(read='ChannelUtilsVer$version.readBucketList(bb, $length)', \
+            write='ChannelUtilsVer$version.writeList(bb, $name)')
+port_desc_list = JType('List<OFPhysicalPort>', size='ChannelUtilsVer$version.calcListSize($name)') \
+        .op(read='ChannelUtilsVer$version.readPhysicalPortList(bb, $length)', \
+            write='ChannelUtilsVer$version.writePhysicalPortList(bb, $name)')
 port_desc = JType('OFPortDesc', size='$name.getLength()') \
         .op(read='null; // TODO OFPortDescVer$version.READER.read(bb)', \
             write='$name.writeTo(bb)')
-packet_queue_list = JType('List<OFPacketQueue>', size='ChannelUtils.calcListSize($name)') \
-        .op(read='ChannelUtils.readPacketQueueList(bb, $length)', \
-            write='ChannelUtils.writeList(bb, $name)')
+packet_queue_list = JType('List<OFPacketQueue>', size='ChannelUtilsVer$version.calcListSize($name)') \
+        .op(read='ChannelUtilsVer$version.readPacketQueueList(bb, $length)', \
+            write='ChannelUtilsVer$version.writeList(bb, $name)')
 octets = JType('byte[]', size="$length") \
-        .op(read='ChannelUtils.readBytes(bb, $length)', \
+        .op(read='ChannelUtilsVer$version.readBytes(bb, $length)', \
             write='bb.writeBytes($name)')
 of_match = JType('Match', size="$name.getLength()") \
-        .op(read='ChannelUtils.readOFMatch(bb)', \
-            write='ChannelUtils.writeOFMatch(bb, $name)')
+        .op(read='ChannelUtilsVer$version.readOFMatch(bb)', \
+            write='ChannelUtilsVer$version.writeOFMatch(bb, $name)')
 flow_mod_cmd = JType('OFFlowModCommand', 'short', size="$name.getLength()") \
         .op(version=1, read="bb.readShort()", write="bb.writeShort($name)") \
         .op(version=ANY, read="bb.readByte()", write="bb.writeByte($name)")
@@ -183,17 +181,17 @@
         .op(read="MacAddress.read6Bytes(bb)", \
             write="$name.write6Bytes(bb)")
 port_name = JType('String', size=16) \
-        .op(read='ChannelUtils.readFixedLengthString(bb, 16)', \
-            write='ChannelUtils.writeFixedLengthString(bb, $name, 16)')
+        .op(read='ChannelUtilsVer$version.readFixedLengthString(bb, 16)', \
+            write='ChannelUtilsVer$version.writeFixedLengthString(bb, $name, 16)')
 desc_str = JType('String', size=256) \
-        .op(read='ChannelUtils.readFixedLengthString(bb, 256)', \
-            write='ChannelUtils.writeFixedLengthString(bb, $name, 256)')
+        .op(read='ChannelUtilsVer$version.readFixedLengthString(bb, 256)', \
+            write='ChannelUtilsVer$version.writeFixedLengthString(bb, $name, 256)')
 serial_num = JType('String', size=32) \
-        .op(read='ChannelUtils.readFixedLengthString(bb, 32)', \
-            write='ChannelUtils.writeFixedLengthString(bb, $name, 32)')
+        .op(read='ChannelUtilsVer$version.readFixedLengthString(bb, 32)', \
+            write='ChannelUtilsVer$version.writeFixedLengthString(bb, $name, 32)')
 table_name = JType('String', size=32) \
-        .op(read='ChannelUtils.readFixedLengthString(bb, 32)', \
-            write='ChannelUtils.writeFixedLengthString(bb, $name, 32)')
+        .op(read='ChannelUtilsVer$version.readFixedLengthString(bb, 32)', \
+            write='ChannelUtilsVer$version.writeFixedLengthString(bb, $name, 32)')
 ipv4 = JType("IPv4") \
         .op(read="IPv4.read4Bytes(bb)", \
             write="$name.write4Bytes(bb)")
@@ -263,8 +261,8 @@
     base_name = m.group(1)
     java_base_name = name_c_to_caps_camel(base_name)
     return JType("List<OF%s>" % java_base_name) \
-        .op(read='ChannelUtils.read%sList(bb)' % java_base_name, \
-            write='ChannelUtils.write%sList(bb, $name)' % java_base_name)
+        .op(read='ChannelUtilsVer$version.read%sList(bb, $length)' % java_base_name, \
+            write='ChannelUtilsVer$version.write%sList(bb, $name)' % java_base_name)
 
 def convert_to_jtype(obj_name, field_name, c_type):
     """ Convert from a C type ("uint_32") to a java type ("U32")
diff --git a/java_gen/pre-written/src/main/java/org/openflow/util/ChannelUtils.java b/java_gen/pre-written/src/main/java/org/openflow/protocol/ver10/ChannelUtilsVer10.java
similarity index 84%
copy from java_gen/pre-written/src/main/java/org/openflow/util/ChannelUtils.java
copy to java_gen/pre-written/src/main/java/org/openflow/protocol/ver10/ChannelUtilsVer10.java
index afd03ad..67c914d 100644
--- a/java_gen/pre-written/src/main/java/org/openflow/util/ChannelUtils.java
+++ b/java_gen/pre-written/src/main/java/org/openflow/protocol/ver10/ChannelUtilsVer10.java
@@ -1,4 +1,4 @@
-package org.openflow.util;
+package org.openflow.protocol.ver10;
 
 import java.util.List;
 
@@ -13,16 +13,19 @@
 import org.openflow.protocol.OFHelloElem;
 import org.openflow.protocol.OFMeterFeatures;
 import org.openflow.protocol.OFMeterStats;
+import org.openflow.protocol.OFObject;
 import org.openflow.protocol.OFPacketQueue;
 import org.openflow.protocol.OFPortStatsEntry;
 import org.openflow.protocol.OFQueueStatsEntry;
 import org.openflow.protocol.OFTableFeature;
 import org.openflow.protocol.OFTableFeatures;
 import org.openflow.protocol.OFTableStatsEntry;
+import org.openflow.protocol.Wildcards;
 import org.openflow.protocol.action.OFAction;
 import org.openflow.protocol.instruction.OFInstruction;
 import org.openflow.protocol.match.Match;
 import org.openflow.protocol.meterband.OFMeterBand;
+import org.openflow.protocol.oxm.OFOxm;
 import org.openflow.types.OFFlowModCmd;
 import org.openflow.types.OFHelloElement;
 import org.openflow.types.OFPhysicalPort;
@@ -35,7 +38,7 @@
  * @author capveg
  */
 
-public class ChannelUtils {
+public class ChannelUtilsVer10 {
 
     static public byte[] readBytes(final ChannelBuffer bb, final int length) {
         byte byteArray[] = new byte[length];
@@ -77,7 +80,7 @@
     }
 
     public static List<OFBsnInterface> readBsnInterfaceList(
-            final ChannelBuffer bb) {
+            final ChannelBuffer bb, int length) {
         // TODO Auto-generated method stub
         return null;
     }
@@ -100,12 +103,12 @@
     }
 
     public static List<OFBucket> readBucketList(final ChannelBuffer bb,
-            final int i) {
+            final int length) {
         // TODO Auto-generated method stub
         return null;
     }
 
-    public static List<OFMeterBand> readMeterBandList(final ChannelBuffer bb) {
+    public static List<OFMeterBand> readMeterBandList(final ChannelBuffer bb, int length) {
         // TODO Auto-generated method stub
         return null;
     }
@@ -115,9 +118,10 @@
 
     }
 
-    public static void writeList(ChannelBuffer bb, List<?> ports) {
-        // TODO Auto-generated method stub
-
+    public static void writeList(ChannelBuffer bb, List<? extends OFObject> objects) {
+        for(OFObject o : objects) {
+            o.writeTo(bb);
+        }
     }
 
     public static void writeOFFlowModCmd(ChannelBuffer bb, OFFlowModCmd command) {
@@ -180,12 +184,12 @@
     }
 
     public static List<OFTableStatsEntry> readTableStatsEntryList(
-            ChannelBuffer bb) {
+            ChannelBuffer bb, int length) {
         // TODO Auto-generated method stub
         return null;
     }
 
-    public static List<OFFlowStatsEntry> readFlowStatsEntryList(ChannelBuffer bb) {
+    public static List<OFFlowStatsEntry> readFlowStatsEntryList(ChannelBuffer bb, int length) {
         // TODO Auto-generated method stub
         return null;
     }
@@ -203,7 +207,7 @@
     }
 
     public static List<OFGroupDescStatsEntry> readGroupDescStatsEntryList(
-            ChannelBuffer bb) {
+            ChannelBuffer bb, int length) {
         // TODO Auto-generated method stub
         return null;
     }
@@ -241,7 +245,7 @@
 
     }
 
-    public static List<OFPortStatsEntry> readPortStatsEntryList(ChannelBuffer bb) {
+    public static List<OFPortStatsEntry> readPortStatsEntryList(ChannelBuffer bb, int length) {
         // TODO Auto-generated method stub
         return null;
     }
@@ -252,7 +256,7 @@
 
     }
 
-    public static List<OFHelloElem> readHelloElemList(ChannelBuffer bb) {
+    public static List<OFHelloElem> readHelloElemList(ChannelBuffer bb, int length) {
         // TODO Auto-generated method stub
         return null;
     }
@@ -276,7 +280,7 @@
     }
 
     public static List<OFQueueStatsEntry> readQueueStatsEntryList(
-            ChannelBuffer bb) {
+            ChannelBuffer bb, int length) {
         // TODO Auto-generated method stub
         return null;
     }
@@ -298,7 +302,7 @@
 
     }
 
-    public static List<OFMeterStats> readMeterStatsList(ChannelBuffer bb) {
+    public static List<OFMeterStats> readMeterStatsList(ChannelBuffer bb, int length) {
         // TODO Auto-generated method stub
         return null;
     }
@@ -309,7 +313,7 @@
 
     }
 
-    public static List<OFTableFeatures> readTableFeaturesList(ChannelBuffer bb) {
+    public static List<OFTableFeatures> readTableFeaturesList(ChannelBuffer bb, int length) {
         // TODO Auto-generated method stub
         return null;
     }
@@ -320,4 +324,39 @@
 
     }
 
+    public static OFOxm readOFOxm(ChannelBuffer bb) {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    public static void writeOFOxm(ChannelBuffer bb, OFOxm field) {
+        // TODO Auto-generated method stub
+
+    }
+
+    public static void writeOxmList(ChannelBuffer bb, List<OFOxm> oxmList) {
+        for(OFOxm o: oxmList) {
+            o.writeTo(bb);
+        }
+    }
+
+    public static List<OFOxm> readOxmList(ChannelBuffer bb, int length) {
+        return null;
+    }
+
+    public static Wildcards readWildcards(ChannelBuffer bb) {
+        return Wildcards.of(bb.readInt());
+    }
+
+    public static void writeWildcards(ChannelBuffer bb, Wildcards wildcards) {
+        // TODO Auto-generated method stub
+
+    }
+
+    public static void writePhysicalPortList(ChannelBuffer bb,
+            List<OFPhysicalPort> ports) {
+        // TODO Auto-generated method stub
+
+    }
+
 }
diff --git a/java_gen/pre-written/src/main/java/org/openflow/util/ChannelUtils.java b/java_gen/pre-written/src/main/java/org/openflow/protocol/ver11/ChannelUtilsVer11.java
similarity index 83%
copy from java_gen/pre-written/src/main/java/org/openflow/util/ChannelUtils.java
copy to java_gen/pre-written/src/main/java/org/openflow/protocol/ver11/ChannelUtilsVer11.java
index afd03ad..1a0df58 100644
--- a/java_gen/pre-written/src/main/java/org/openflow/util/ChannelUtils.java
+++ b/java_gen/pre-written/src/main/java/org/openflow/protocol/ver11/ChannelUtilsVer11.java
@@ -1,4 +1,4 @@
-package org.openflow.util;
+package org.openflow.protocol.ver11;
 
 import java.util.List;
 
@@ -13,16 +13,19 @@
 import org.openflow.protocol.OFHelloElem;
 import org.openflow.protocol.OFMeterFeatures;
 import org.openflow.protocol.OFMeterStats;
+import org.openflow.protocol.OFObject;
 import org.openflow.protocol.OFPacketQueue;
 import org.openflow.protocol.OFPortStatsEntry;
 import org.openflow.protocol.OFQueueStatsEntry;
 import org.openflow.protocol.OFTableFeature;
 import org.openflow.protocol.OFTableFeatures;
 import org.openflow.protocol.OFTableStatsEntry;
+import org.openflow.protocol.Wildcards;
 import org.openflow.protocol.action.OFAction;
 import org.openflow.protocol.instruction.OFInstruction;
 import org.openflow.protocol.match.Match;
 import org.openflow.protocol.meterband.OFMeterBand;
+import org.openflow.protocol.oxm.OFOxm;
 import org.openflow.types.OFFlowModCmd;
 import org.openflow.types.OFHelloElement;
 import org.openflow.types.OFPhysicalPort;
@@ -35,7 +38,7 @@
  * @author capveg
  */
 
-public class ChannelUtils {
+public class ChannelUtilsVer11 {
 
     static public byte[] readBytes(final ChannelBuffer bb, final int length) {
         byte byteArray[] = new byte[length];
@@ -77,7 +80,7 @@
     }
 
     public static List<OFBsnInterface> readBsnInterfaceList(
-            final ChannelBuffer bb) {
+            final ChannelBuffer bb, int length) {
         // TODO Auto-generated method stub
         return null;
     }
@@ -100,12 +103,12 @@
     }
 
     public static List<OFBucket> readBucketList(final ChannelBuffer bb,
-            final int i) {
+            final int length) {
         // TODO Auto-generated method stub
         return null;
     }
 
-    public static List<OFMeterBand> readMeterBandList(final ChannelBuffer bb) {
+    public static List<OFMeterBand> readMeterBandList(final ChannelBuffer bb, int length) {
         // TODO Auto-generated method stub
         return null;
     }
@@ -115,9 +118,10 @@
 
     }
 
-    public static void writeList(ChannelBuffer bb, List<?> ports) {
-        // TODO Auto-generated method stub
-
+    public static void writeList(ChannelBuffer bb, List<? extends OFObject> objects) {
+        for(OFObject o : objects) {
+            o.writeTo(bb);
+        }
     }
 
     public static void writeOFFlowModCmd(ChannelBuffer bb, OFFlowModCmd command) {
@@ -180,12 +184,12 @@
     }
 
     public static List<OFTableStatsEntry> readTableStatsEntryList(
-            ChannelBuffer bb) {
+            ChannelBuffer bb, int length) {
         // TODO Auto-generated method stub
         return null;
     }
 
-    public static List<OFFlowStatsEntry> readFlowStatsEntryList(ChannelBuffer bb) {
+    public static List<OFFlowStatsEntry> readFlowStatsEntryList(ChannelBuffer bb, int length) {
         // TODO Auto-generated method stub
         return null;
     }
@@ -203,7 +207,7 @@
     }
 
     public static List<OFGroupDescStatsEntry> readGroupDescStatsEntryList(
-            ChannelBuffer bb) {
+            ChannelBuffer bb, int length) {
         // TODO Auto-generated method stub
         return null;
     }
@@ -241,7 +245,7 @@
 
     }
 
-    public static List<OFPortStatsEntry> readPortStatsEntryList(ChannelBuffer bb) {
+    public static List<OFPortStatsEntry> readPortStatsEntryList(ChannelBuffer bb, int length) {
         // TODO Auto-generated method stub
         return null;
     }
@@ -252,7 +256,7 @@
 
     }
 
-    public static List<OFHelloElem> readHelloElemList(ChannelBuffer bb) {
+    public static List<OFHelloElem> readHelloElemList(ChannelBuffer bb, int length) {
         // TODO Auto-generated method stub
         return null;
     }
@@ -264,7 +268,7 @@
     }
 
     public static List<OFGroupStatsEntry> readGroupStatsEntryList(
-            ChannelBuffer bb) {
+            ChannelBuffer bb, int length) {
         // TODO Auto-generated method stub
         return null;
     }
@@ -276,7 +280,7 @@
     }
 
     public static List<OFQueueStatsEntry> readQueueStatsEntryList(
-            ChannelBuffer bb) {
+            ChannelBuffer bb, int length) {
         // TODO Auto-generated method stub
         return null;
     }
@@ -298,7 +302,7 @@
 
     }
 
-    public static List<OFMeterStats> readMeterStatsList(ChannelBuffer bb) {
+    public static List<OFMeterStats> readMeterStatsList(ChannelBuffer bb, int length) {
         // TODO Auto-generated method stub
         return null;
     }
@@ -309,7 +313,7 @@
 
     }
 
-    public static List<OFTableFeatures> readTableFeaturesList(ChannelBuffer bb) {
+    public static List<OFTableFeatures> readTableFeaturesList(ChannelBuffer bb, int length) {
         // TODO Auto-generated method stub
         return null;
     }
@@ -320,4 +324,40 @@
 
     }
 
+    public static OFOxm readOFOxm(ChannelBuffer bb) {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    public static void writeOFOxm(ChannelBuffer bb, OFOxm field) {
+        // TODO Auto-generated method stub
+
+    }
+
+    public static void writeOxmList(ChannelBuffer bb, List<OFOxm> oxmList) {
+        for(OFOxm o: oxmList) {
+            o.writeTo(bb);
+        }
+    }
+
+    public static List<OFOxm> readOxmList(ChannelBuffer bb, int length) {
+        return null;
+    }
+
+    public static void writePhysicalPortList(ChannelBuffer bb,
+            List<OFPhysicalPort> ports) {
+        // TODO Auto-generated method stub
+
+    }
+
+    public static Wildcards readWildcards(ChannelBuffer bb) {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    public static void writeWildcards(ChannelBuffer bb, Wildcards wildcards) {
+        // TODO Auto-generated method stub
+
+    }
+
 }
diff --git a/java_gen/pre-written/src/main/java/org/openflow/util/ChannelUtils.java b/java_gen/pre-written/src/main/java/org/openflow/protocol/ver12/ChannelUtilsVer12.java
similarity index 86%
rename from java_gen/pre-written/src/main/java/org/openflow/util/ChannelUtils.java
rename to java_gen/pre-written/src/main/java/org/openflow/protocol/ver12/ChannelUtilsVer12.java
index afd03ad..a66fb70 100644
--- a/java_gen/pre-written/src/main/java/org/openflow/util/ChannelUtils.java
+++ b/java_gen/pre-written/src/main/java/org/openflow/protocol/ver12/ChannelUtilsVer12.java
@@ -1,4 +1,4 @@
-package org.openflow.util;
+package org.openflow.protocol.ver12;
 
 import java.util.List;
 
@@ -13,6 +13,7 @@
 import org.openflow.protocol.OFHelloElem;
 import org.openflow.protocol.OFMeterFeatures;
 import org.openflow.protocol.OFMeterStats;
+import org.openflow.protocol.OFObject;
 import org.openflow.protocol.OFPacketQueue;
 import org.openflow.protocol.OFPortStatsEntry;
 import org.openflow.protocol.OFQueueStatsEntry;
@@ -23,6 +24,7 @@
 import org.openflow.protocol.instruction.OFInstruction;
 import org.openflow.protocol.match.Match;
 import org.openflow.protocol.meterband.OFMeterBand;
+import org.openflow.protocol.oxm.OFOxm;
 import org.openflow.types.OFFlowModCmd;
 import org.openflow.types.OFHelloElement;
 import org.openflow.types.OFPhysicalPort;
@@ -35,7 +37,7 @@
  * @author capveg
  */
 
-public class ChannelUtils {
+public class ChannelUtilsVer12 {
 
     static public byte[] readBytes(final ChannelBuffer bb, final int length) {
         byte byteArray[] = new byte[length];
@@ -77,7 +79,7 @@
     }
 
     public static List<OFBsnInterface> readBsnInterfaceList(
-            final ChannelBuffer bb) {
+            final ChannelBuffer bb, int length) {
         // TODO Auto-generated method stub
         return null;
     }
@@ -100,12 +102,12 @@
     }
 
     public static List<OFBucket> readBucketList(final ChannelBuffer bb,
-            final int i) {
+            final int length) {
         // TODO Auto-generated method stub
         return null;
     }
 
-    public static List<OFMeterBand> readMeterBandList(final ChannelBuffer bb) {
+    public static List<OFMeterBand> readMeterBandList(final ChannelBuffer bb, int length) {
         // TODO Auto-generated method stub
         return null;
     }
@@ -115,9 +117,10 @@
 
     }
 
-    public static void writeList(ChannelBuffer bb, List<?> ports) {
-        // TODO Auto-generated method stub
-
+    public static void writeList(ChannelBuffer bb, List<? extends OFObject> objects) {
+        for(OFObject o : objects) {
+            o.writeTo(bb);
+        }
     }
 
     public static void writeOFFlowModCmd(ChannelBuffer bb, OFFlowModCmd command) {
@@ -180,12 +183,12 @@
     }
 
     public static List<OFTableStatsEntry> readTableStatsEntryList(
-            ChannelBuffer bb) {
+            ChannelBuffer bb, int length) {
         // TODO Auto-generated method stub
         return null;
     }
 
-    public static List<OFFlowStatsEntry> readFlowStatsEntryList(ChannelBuffer bb) {
+    public static List<OFFlowStatsEntry> readFlowStatsEntryList(ChannelBuffer bb, int length) {
         // TODO Auto-generated method stub
         return null;
     }
@@ -203,7 +206,7 @@
     }
 
     public static List<OFGroupDescStatsEntry> readGroupDescStatsEntryList(
-            ChannelBuffer bb) {
+            ChannelBuffer bb, int length) {
         // TODO Auto-generated method stub
         return null;
     }
@@ -241,7 +244,7 @@
 
     }
 
-    public static List<OFPortStatsEntry> readPortStatsEntryList(ChannelBuffer bb) {
+    public static List<OFPortStatsEntry> readPortStatsEntryList(ChannelBuffer bb, int length) {
         // TODO Auto-generated method stub
         return null;
     }
@@ -252,7 +255,7 @@
 
     }
 
-    public static List<OFHelloElem> readHelloElemList(ChannelBuffer bb) {
+    public static List<OFHelloElem> readHelloElemList(ChannelBuffer bb, int length) {
         // TODO Auto-generated method stub
         return null;
     }
@@ -264,7 +267,7 @@
     }
 
     public static List<OFGroupStatsEntry> readGroupStatsEntryList(
-            ChannelBuffer bb) {
+            ChannelBuffer bb, int length) {
         // TODO Auto-generated method stub
         return null;
     }
@@ -276,7 +279,7 @@
     }
 
     public static List<OFQueueStatsEntry> readQueueStatsEntryList(
-            ChannelBuffer bb) {
+            ChannelBuffer bb, int length) {
         // TODO Auto-generated method stub
         return null;
     }
@@ -298,7 +301,7 @@
 
     }
 
-    public static List<OFMeterStats> readMeterStatsList(ChannelBuffer bb) {
+    public static List<OFMeterStats> readMeterStatsList(ChannelBuffer bb, int length) {
         // TODO Auto-generated method stub
         return null;
     }
@@ -309,7 +312,7 @@
 
     }
 
-    public static List<OFTableFeatures> readTableFeaturesList(ChannelBuffer bb) {
+    public static List<OFTableFeatures> readTableFeaturesList(ChannelBuffer bb, int length) {
         // TODO Auto-generated method stub
         return null;
     }
@@ -320,4 +323,30 @@
 
     }
 
+    public static OFOxm readOFOxm(ChannelBuffer bb) {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    public static void writeOFOxm(ChannelBuffer bb, OFOxm field) {
+        // TODO Auto-generated method stub
+
+    }
+
+    public static void writeOxmList(ChannelBuffer bb, List<OFOxm> oxmList) {
+        for(OFOxm o: oxmList) {
+            o.writeTo(bb);
+        }
+    }
+
+    public static List<OFOxm> readOxmList(ChannelBuffer bb, int length) {
+        return null;
+    }
+
+    public static void writePhysicalPortList(ChannelBuffer bb,
+            List<OFPhysicalPort> ports) {
+        // TODO Auto-generated method stub
+
+    }
+
 }
diff --git a/java_gen/pre-written/src/main/java/org/openflow/util/ChannelUtils.java b/java_gen/pre-written/src/main/java/org/openflow/protocol/ver13/ChannelUtilsVer13.java
similarity index 85%
copy from java_gen/pre-written/src/main/java/org/openflow/util/ChannelUtils.java
copy to java_gen/pre-written/src/main/java/org/openflow/protocol/ver13/ChannelUtilsVer13.java
index afd03ad..73b240e 100644
--- a/java_gen/pre-written/src/main/java/org/openflow/util/ChannelUtils.java
+++ b/java_gen/pre-written/src/main/java/org/openflow/protocol/ver13/ChannelUtilsVer13.java
@@ -1,8 +1,9 @@
-package org.openflow.util;
+package org.openflow.protocol.ver13;
 
 import java.util.List;
 
 import org.jboss.netty.buffer.ChannelBuffer;
+import org.openflow.exceptions.OFParseError;
 import org.openflow.protocol.OFBsnInterface;
 import org.openflow.protocol.OFBsnVportQInQ;
 import org.openflow.protocol.OFBsnVportQInQT;
@@ -13,6 +14,7 @@
 import org.openflow.protocol.OFHelloElem;
 import org.openflow.protocol.OFMeterFeatures;
 import org.openflow.protocol.OFMeterStats;
+import org.openflow.protocol.OFObject;
 import org.openflow.protocol.OFPacketQueue;
 import org.openflow.protocol.OFPortStatsEntry;
 import org.openflow.protocol.OFQueueStatsEntry;
@@ -23,6 +25,7 @@
 import org.openflow.protocol.instruction.OFInstruction;
 import org.openflow.protocol.match.Match;
 import org.openflow.protocol.meterband.OFMeterBand;
+import org.openflow.protocol.oxm.OFOxm;
 import org.openflow.types.OFFlowModCmd;
 import org.openflow.types.OFHelloElement;
 import org.openflow.types.OFPhysicalPort;
@@ -35,7 +38,7 @@
  * @author capveg
  */
 
-public class ChannelUtils {
+public class ChannelUtilsVer13 {
 
     static public byte[] readBytes(final ChannelBuffer bb, final int length) {
         byte byteArray[] = new byte[length];
@@ -60,9 +63,8 @@
         return null;
     }
 
-    public static Match readOFMatch(final ChannelBuffer bb) {
-        // TODO Auto-generated method stub
-        return null;
+    public static Match readOFMatch(final ChannelBuffer bb) throws OFParseError {
+        return OFMatchV3Ver13.READER.readFrom(bb);
     }
 
     public static OFFlowModCmd readOFFlowModCmd(final ChannelBuffer bb) {
@@ -77,7 +79,7 @@
     }
 
     public static List<OFBsnInterface> readBsnInterfaceList(
-            final ChannelBuffer bb) {
+            final ChannelBuffer bb, int length) {
         // TODO Auto-generated method stub
         return null;
     }
@@ -100,24 +102,24 @@
     }
 
     public static List<OFBucket> readBucketList(final ChannelBuffer bb,
-            final int i) {
+            final int length) {
         // TODO Auto-generated method stub
         return null;
     }
 
-    public static List<OFMeterBand> readMeterBandList(final ChannelBuffer bb) {
+    public static List<OFMeterBand> readMeterBandList(final ChannelBuffer bb, int length) {
         // TODO Auto-generated method stub
         return null;
     }
 
     public static void writeOFMatch(ChannelBuffer bb, Match match) {
-        // TODO Auto-generated method stub
-
+        match.writeTo(bb);
     }
 
-    public static void writeList(ChannelBuffer bb, List<?> ports) {
-        // TODO Auto-generated method stub
-
+    public static void writeList(ChannelBuffer bb, List<? extends OFObject> objects) {
+        for(OFObject o : objects) {
+            o.writeTo(bb);
+        }
     }
 
     public static void writeOFFlowModCmd(ChannelBuffer bb, OFFlowModCmd command) {
@@ -180,12 +182,12 @@
     }
 
     public static List<OFTableStatsEntry> readTableStatsEntryList(
-            ChannelBuffer bb) {
+            ChannelBuffer bb, int length) {
         // TODO Auto-generated method stub
         return null;
     }
 
-    public static List<OFFlowStatsEntry> readFlowStatsEntryList(ChannelBuffer bb) {
+    public static List<OFFlowStatsEntry> readFlowStatsEntryList(ChannelBuffer bb, int length) {
         // TODO Auto-generated method stub
         return null;
     }
@@ -203,7 +205,7 @@
     }
 
     public static List<OFGroupDescStatsEntry> readGroupDescStatsEntryList(
-            ChannelBuffer bb) {
+            ChannelBuffer bb, int length) {
         // TODO Auto-generated method stub
         return null;
     }
@@ -241,7 +243,7 @@
 
     }
 
-    public static List<OFPortStatsEntry> readPortStatsEntryList(ChannelBuffer bb) {
+    public static List<OFPortStatsEntry> readPortStatsEntryList(ChannelBuffer bb, int length) {
         // TODO Auto-generated method stub
         return null;
     }
@@ -252,7 +254,7 @@
 
     }
 
-    public static List<OFHelloElem> readHelloElemList(ChannelBuffer bb) {
+    public static List<OFHelloElem> readHelloElemList(ChannelBuffer bb, int length) {
         // TODO Auto-generated method stub
         return null;
     }
@@ -264,7 +266,7 @@
     }
 
     public static List<OFGroupStatsEntry> readGroupStatsEntryList(
-            ChannelBuffer bb) {
+            ChannelBuffer bb, int length) {
         // TODO Auto-generated method stub
         return null;
     }
@@ -276,7 +278,7 @@
     }
 
     public static List<OFQueueStatsEntry> readQueueStatsEntryList(
-            ChannelBuffer bb) {
+            ChannelBuffer bb, int length) {
         // TODO Auto-generated method stub
         return null;
     }
@@ -298,7 +300,7 @@
 
     }
 
-    public static List<OFMeterStats> readMeterStatsList(ChannelBuffer bb) {
+    public static List<OFMeterStats> readMeterStatsList(ChannelBuffer bb, int length) {
         // TODO Auto-generated method stub
         return null;
     }
@@ -309,7 +311,7 @@
 
     }
 
-    public static List<OFTableFeatures> readTableFeaturesList(ChannelBuffer bb) {
+    public static List<OFTableFeatures> readTableFeaturesList(ChannelBuffer bb, int length) {
         // TODO Auto-generated method stub
         return null;
     }
@@ -320,4 +322,30 @@
 
     }
 
+    public static OFOxm readOFOxm(ChannelBuffer bb) {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    public static void writeOFOxm(ChannelBuffer bb, OFOxm field) {
+        // TODO Auto-generated method stub
+
+    }
+
+    public static void writeOxmList(ChannelBuffer bb, List<OFOxm> oxmList) {
+        for(OFOxm o: oxmList) {
+            o.writeTo(bb);
+        }
+    }
+
+    public static List<OFOxm> readOxmList(ChannelBuffer bb, int length) {
+        return null;
+    }
+
+    public static void writePhysicalPortList(ChannelBuffer bb,
+            List<OFPhysicalPort> entries) {
+        // TODO Auto-generated method stub
+
+    }
+
 }