java_loxi: big refactoring and clean-up
diff --git a/java_gen/pre-written/src/main/java/org/openflow/protocol/OFAbstractMessage.java b/java_gen/pre-written/src/main/java/org/openflow/protocol/OFAbstractMessage.java
deleted file mode 100644
index bc2218f..0000000
--- a/java_gen/pre-written/src/main/java/org/openflow/protocol/OFAbstractMessage.java
+++ /dev/null
@@ -1,83 +0,0 @@
-/* Copyright 2013, Big Switch Networks, Inc.
- *
- * LoxiGen is licensed under the Eclipse Public License, version 1.0 (EPL), with
- * the following special exception:
- *
- * LOXI Exception
- *
- * As a special exception to the terms of the EPL, you may distribute libraries
- * generated by LoxiGen (LoxiGen Libraries) under the terms of your choice, provided
- * that copyright and licensing notices generated by LoxiGen are not altered or removed
- * from the LoxiGen Libraries and the notice provided below is (i) included in
- * the LoxiGen Libraries, if distributed in source code form and (ii) included in any
- * documentation for the LoxiGen Libraries, if distributed in binary form.
- *
- * Notice: "Copyright 2013, Big Switch Networks, Inc. This library was generated by the LoxiGen Compiler."
- *
- * You may not use this file except in compliance with the EPL or LOXI Exception. You may obtain
- * a copy of the EPL at:
- *
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * EPL for the specific language governing permissions and limitations
- * under the EPL.
- */
-package org.openflow.protocol;
-
-/**
- * The base interface for all OpenFlow message objects
- */
-
-import org.openflow.types.OFType;
-
-abstract public class OFAbstractMessage implements OFObject {
- private final OFVersion version;
- private final OFType type;
- private int xid;
-
- public static int MINIMUM_SIZE = 8;
-
- public OFAbstractMessage(final OFVersion version, final OFType type) {
- this.version = version;
- this.type = type;
- }
-
- /**
- * Return the wire format version of this message, e.g., 0x01
- */
- OFVersion getVersion() {
- return version;
- }
-
- /**
- * @return the transction ID for this message
- */
- int getXid() {
- return xid;
- }
-
- /**
- * @param newXid
- * Set this transaction ID for this message
- */
- void setXid(final int xid) {
- this.xid = xid;
- }
-
- /**
- * The type that is returned here is agnostic to the underlying wire format
- *
- * @return the type of OpenFlow message.
- */
- OFType getType() {
- return type;
- }
-
- @Override
- public int getLength() {
- return MINIMUM_SIZE;
- }
-}
diff --git a/java_gen/pre-written/src/main/java/org/openflow/protocol/OFBsnVportQInQT.java b/java_gen/pre-written/src/main/java/org/openflow/protocol/OFBsnVportQInQT.java
new file mode 100644
index 0000000..c5b884e
--- /dev/null
+++ b/java_gen/pre-written/src/main/java/org/openflow/protocol/OFBsnVportQInQT.java
@@ -0,0 +1,5 @@
+package org.openflow.protocol;
+
+public class OFBsnVportQInQT {
+
+}
diff --git a/java_gen/pre-written/src/main/java/org/openflow/protocol/OFMatchBmap.java b/java_gen/pre-written/src/main/java/org/openflow/protocol/OFMatchBmap.java
new file mode 100644
index 0000000..6e4dc5b
--- /dev/null
+++ b/java_gen/pre-written/src/main/java/org/openflow/protocol/OFMatchBmap.java
@@ -0,0 +1,5 @@
+package org.openflow.protocol;
+
+public class OFMatchBmap {
+
+}
diff --git a/java_gen/pre-written/src/main/java/org/openflow/protocol/OFMessage.java b/java_gen/pre-written/src/main/java/org/openflow/protocol/OFMessage.java
index 4f31741..c1e4456 100644
--- a/java_gen/pre-written/src/main/java/org/openflow/protocol/OFMessage.java
+++ b/java_gen/pre-written/src/main/java/org/openflow/protocol/OFMessage.java
@@ -1,13 +1,13 @@
package org.openflow.protocol;
-import org.openflow.types.OFType;
-
public interface OFMessage {
int getXid();
- boolean isXidSet();
-
OFType getType();
OFVersion getVersion();
+
+ interface Builder {
+
+ }
}
diff --git a/java_gen/pre-written/src/main/java/org/openflow/protocol/OFMessageReader.java b/java_gen/pre-written/src/main/java/org/openflow/protocol/OFMessageReader.java
index 24c3314..3f34d9b 100644
--- a/java_gen/pre-written/src/main/java/org/openflow/protocol/OFMessageReader.java
+++ b/java_gen/pre-written/src/main/java/org/openflow/protocol/OFMessageReader.java
@@ -3,6 +3,6 @@
import org.jboss.netty.buffer.ChannelBuffer;
import org.openflow.exceptions.OFParseError;
-public interface OFMessageReader<T extends OFMessage> {
+public interface OFMessageReader<T> {
T readFrom(ChannelBuffer bb) throws OFParseError;
}
diff --git a/java_gen/pre-written/src/main/java/org/openflow/protocol/OFMessageWriter.java b/java_gen/pre-written/src/main/java/org/openflow/protocol/OFMessageWriter.java
new file mode 100644
index 0000000..84e5507
--- /dev/null
+++ b/java_gen/pre-written/src/main/java/org/openflow/protocol/OFMessageWriter.java
@@ -0,0 +1,8 @@
+package org.openflow.protocol;
+
+import org.jboss.netty.buffer.ChannelBuffer;
+import org.openflow.exceptions.OFParseError;
+
+public interface OFMessageWriter<T> {
+ public int write(ChannelBuffer bb, T message) throws OFParseError;
+}
diff --git a/java_gen/pre-written/src/main/java/org/openflow/protocol/OFObject.java b/java_gen/pre-written/src/main/java/org/openflow/protocol/OFObject.java
index 21a4607..4a7557f 100644
--- a/java_gen/pre-written/src/main/java/org/openflow/protocol/OFObject.java
+++ b/java_gen/pre-written/src/main/java/org/openflow/protocol/OFObject.java
@@ -1,5 +1,7 @@
package org.openflow.protocol;
+import org.jboss.netty.buffer.ChannelBuffer;
+
/**
* Base interface of all OpenFlow objects (e.g., messages, actions, stats, etc.)
*
@@ -10,26 +12,8 @@
* malformed packets, for example, for negative testing.
*/
-import org.jboss.netty.buffer.ChannelBuffer;
-import org.openflow.exceptions.OFParseError;
-import org.openflow.exceptions.OFShortWrite;
public interface OFObject {
- /**
- * Return a number equal or greater than zero (and currently in OF less than
- * 65536)
- *
- * @return the number of bytes this object will represent on the wire
- */
- public int getLength();
-
- /**
- * Automatically calculate any lengths and write an openflow object into the
- * byte buffer.
- *
- * @param bb
- * A valid byte buffer with sufficient capacity to hold this
- * object/
- */
- public void writeTo(ChannelBuffer bb) throws OFParseError, OFShortWrite;
+ void writeTo(ChannelBuffer bb);
+ int getLength();
}
diff --git a/java_gen/pre-written/src/main/java/org/openflow/protocol/OFTableFeature.java b/java_gen/pre-written/src/main/java/org/openflow/protocol/OFTableFeature.java
new file mode 100644
index 0000000..114f638
--- /dev/null
+++ b/java_gen/pre-written/src/main/java/org/openflow/protocol/OFTableFeature.java
@@ -0,0 +1,5 @@
+package org.openflow.protocol;
+
+public class OFTableFeature {
+ // FIXME implement
+}
diff --git a/java_gen/pre-written/src/main/java/org/openflow/protocol/OFVersion.java b/java_gen/pre-written/src/main/java/org/openflow/protocol/OFVersion.java
index afc0393..7241647 100644
--- a/java_gen/pre-written/src/main/java/org/openflow/protocol/OFVersion.java
+++ b/java_gen/pre-written/src/main/java/org/openflow/protocol/OFVersion.java
@@ -3,7 +3,7 @@
public enum OFVersion {
OF_10(1), OF_11(2), OF_12(3), OF_13(4);
- private final int wireVersion;
+ public final int wireVersion;
OFVersion(final int wireVersion) {
this.wireVersion = wireVersion;
diff --git a/java_gen/pre-written/src/main/java/org/openflow/protocol/Wildcards.java b/java_gen/pre-written/src/main/java/org/openflow/protocol/Wildcards.java
new file mode 100644
index 0000000..25b2c21
--- /dev/null
+++ b/java_gen/pre-written/src/main/java/org/openflow/protocol/Wildcards.java
@@ -0,0 +1,5 @@
+package org.openflow.protocol;
+
+public class Wildcards {
+
+}
diff --git a/java_gen/pre-written/src/main/java/org/openflow/protocol/XidGenerator.java b/java_gen/pre-written/src/main/java/org/openflow/protocol/XidGenerator.java
new file mode 100644
index 0000000..0819ac2
--- /dev/null
+++ b/java_gen/pre-written/src/main/java/org/openflow/protocol/XidGenerator.java
@@ -0,0 +1,5 @@
+package org.openflow.protocol;
+
+public interface XidGenerator {
+ int nextXid();
+}
diff --git a/java_gen/pre-written/src/main/java/org/openflow/protocol/actions/OFAction.java b/java_gen/pre-written/src/main/java/org/openflow/protocol/actions/OFAction.java
deleted file mode 100644
index f01f8fe..0000000
--- a/java_gen/pre-written/src/main/java/org/openflow/protocol/actions/OFAction.java
+++ /dev/null
@@ -1,7 +0,0 @@
-package org.openflow.protocol.actions;
-
-import org.openflow.protocol.OFObject;
-
-public interface OFAction extends OFObject {
-
-}
diff --git a/java_gen/pre-written/src/main/java/org/openflow/protocol/instructions/OFInstruction.java b/java_gen/pre-written/src/main/java/org/openflow/protocol/instructions/OFInstruction.java
deleted file mode 100644
index 8af305c..0000000
--- a/java_gen/pre-written/src/main/java/org/openflow/protocol/instructions/OFInstruction.java
+++ /dev/null
@@ -1,7 +0,0 @@
-package org.openflow.protocol.instructions;
-
-import org.openflow.protocol.OFObject;
-
-public interface OFInstruction extends OFObject {
-
-}
diff --git a/java_gen/pre-written/src/main/java/org/openflow/protocol/match/MatchBuilderVer10.java b/java_gen/pre-written/src/main/java/org/openflow/protocol/match/MatchBuilderVer10.java
index 19ced8f..f00e1b4 100644
--- a/java_gen/pre-written/src/main/java/org/openflow/protocol/match/MatchBuilderVer10.java
+++ b/java_gen/pre-written/src/main/java/org/openflow/protocol/match/MatchBuilderVer10.java
@@ -1,8 +1,6 @@
package org.openflow.protocol.match;
import org.jboss.netty.buffer.ChannelBuffer;
-import org.openflow.exceptions.OFParseError;
-import org.openflow.exceptions.OFShortWrite;
import org.openflow.protocol.types.IpDscp;
import org.openflow.types.EthType;
import org.openflow.types.IPv4;
@@ -157,7 +155,7 @@
}
@Override
- public void writeTo(final ChannelBuffer bb) throws OFParseError, OFShortWrite {
+ public void writeTo(final ChannelBuffer bb) {
// TODO Auto-generated method stub
}
diff --git a/java_gen/pre-written/src/main/java/org/openflow/types/IPv4.java b/java_gen/pre-written/src/main/java/org/openflow/types/IPv4.java
index b4eb8cf..aab6dc2 100644
--- a/java_gen/pre-written/src/main/java/org/openflow/types/IPv4.java
+++ b/java_gen/pre-written/src/main/java/org/openflow/types/IPv4.java
@@ -3,7 +3,6 @@
import org.jboss.netty.buffer.ChannelBuffer;
import org.openflow.exceptions.OFParseError;
import org.openflow.exceptions.OFShortRead;
-import org.openflow.exceptions.OFShortWrite;
import org.openflow.protocol.OFObject;
/**
@@ -90,7 +89,7 @@
}
@Override
- public void writeTo(final ChannelBuffer bb) throws OFParseError, OFShortWrite {
+ public void writeTo(final ChannelBuffer bb) {
bb.writeInt(rawValue);
}
diff --git a/java_gen/pre-written/src/main/java/org/openflow/types/IPv6.java b/java_gen/pre-written/src/main/java/org/openflow/types/IPv6.java
index 5f51665..f499eac 100644
--- a/java_gen/pre-written/src/main/java/org/openflow/types/IPv6.java
+++ b/java_gen/pre-written/src/main/java/org/openflow/types/IPv6.java
@@ -5,7 +5,6 @@
import org.jboss.netty.buffer.ChannelBuffer;
import org.openflow.exceptions.OFParseError;
import org.openflow.exceptions.OFShortRead;
-import org.openflow.exceptions.OFShortWrite;
import org.openflow.protocol.OFObject;
/**
@@ -166,7 +165,7 @@
}
@Override
- public void writeTo(final ChannelBuffer bb) throws OFParseError, OFShortWrite {
+ public void writeTo(final ChannelBuffer bb) {
bb.writeLong(raw1);
bb.writeLong(raw2);
}
diff --git a/java_gen/pre-written/src/main/java/org/openflow/types/MacAddress.java b/java_gen/pre-written/src/main/java/org/openflow/types/MacAddress.java
index 4ce19ab..8806bb3 100644
--- a/java_gen/pre-written/src/main/java/org/openflow/types/MacAddress.java
+++ b/java_gen/pre-written/src/main/java/org/openflow/types/MacAddress.java
@@ -2,7 +2,6 @@
import org.jboss.netty.buffer.ChannelBuffer;
import org.openflow.exceptions.OFParseError;
-import org.openflow.exceptions.OFShortWrite;
import org.openflow.protocol.OFObject;
import org.openflow.util.HexString;
@@ -84,7 +83,7 @@
}
@Override
- public void writeTo(final ChannelBuffer bb) throws OFParseError, OFShortWrite {
+ public void writeTo(final ChannelBuffer bb) {
bb.writeInt((int) (rawValue >> 16));
bb.writeShort((int) rawValue & 0xFFFF);
}
diff --git a/java_gen/pre-written/src/main/java/org/openflow/types/OFBsnInterface.java b/java_gen/pre-written/src/main/java/org/openflow/types/OFBsnInterface.java
deleted file mode 100644
index d0afb56..0000000
--- a/java_gen/pre-written/src/main/java/org/openflow/types/OFBsnInterface.java
+++ /dev/null
@@ -1,5 +0,0 @@
-package org.openflow.types;
-
-public interface OFBsnInterface {
-
-}
diff --git a/java_gen/pre-written/src/main/java/org/openflow/types/OFBucket.java b/java_gen/pre-written/src/main/java/org/openflow/types/OFBucket.java
deleted file mode 100644
index 47b403b..0000000
--- a/java_gen/pre-written/src/main/java/org/openflow/types/OFBucket.java
+++ /dev/null
@@ -1,22 +0,0 @@
-package org.openflow.types;
-
-import org.jboss.netty.buffer.ChannelBuffer;
-import org.openflow.exceptions.OFParseError;
-import org.openflow.exceptions.OFShortWrite;
-import org.openflow.protocol.OFObject;
-
-public class OFBucket implements OFObject {
-
- @Override
- public int getLength() {
- // TODO Auto-generated method stub
- return 0;
- }
-
- @Override
- public void writeTo(final ChannelBuffer bb) throws OFParseError, OFShortWrite {
- // TODO Auto-generated method stub
-
- }
-
-}
diff --git a/java_gen/pre-written/src/main/java/org/openflow/types/OFPacketQueue.java b/java_gen/pre-written/src/main/java/org/openflow/types/OFPacketQueue.java
deleted file mode 100644
index d74906f..0000000
--- a/java_gen/pre-written/src/main/java/org/openflow/types/OFPacketQueue.java
+++ /dev/null
@@ -1,22 +0,0 @@
-package org.openflow.types;
-
-import org.jboss.netty.buffer.ChannelBuffer;
-import org.openflow.exceptions.OFParseError;
-import org.openflow.exceptions.OFShortWrite;
-import org.openflow.protocol.OFObject;
-
-public class OFPacketQueue implements OFObject {
-
- @Override
- public int getLength() {
- // TODO Auto-generated method stub
- return 0;
- }
-
- @Override
- public void writeTo(final ChannelBuffer bb) throws OFParseError, OFShortWrite {
- // 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/util/ChannelUtils.java
index e8eeebd..dab6ff2 100644
--- a/java_gen/pre-written/src/main/java/org/openflow/util/ChannelUtils.java
+++ b/java_gen/pre-written/src/main/java/org/openflow/util/ChannelUtils.java
@@ -3,17 +3,32 @@
import java.util.List;
import org.jboss.netty.buffer.ChannelBuffer;
-import org.openflow.protocol.actions.OFAction;
-import org.openflow.protocol.instructions.OFInstruction;
+import org.openflow.protocol.OFBsnInterface;
+import org.openflow.protocol.OFBsnVportQInQ;
+import org.openflow.protocol.OFBsnVportQInQT;
+import org.openflow.protocol.OFBucket;
+import org.openflow.protocol.OFFlowStatsEntry;
+import org.openflow.protocol.OFGroupDescStatsEntry;
+import org.openflow.protocol.OFGroupStatsEntry;
+import org.openflow.protocol.OFHelloElem;
+import org.openflow.protocol.OFMeterFeatures;
+import org.openflow.protocol.OFMeterStats;
+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.action.OFAction;
+import org.openflow.protocol.instruction.OFInstruction;
import org.openflow.protocol.match.Match;
-import org.openflow.types.OFBsnInterface;
-import org.openflow.types.OFBucket;
import org.openflow.types.OFFlowModCmd;
import org.openflow.types.OFHelloElement;
import org.openflow.types.OFMeterBand;
-import org.openflow.types.OFPacketQueue;
import org.openflow.types.OFPhysicalPort;
+import com.google.common.base.Charsets;
+
/**
* Collection of helper functions for reading and writing into ChannelBuffers
*
@@ -90,4 +105,212 @@
return null;
}
+ public static void writeOFMatch(ChannelBuffer bb, Match match) {
+ // TODO Auto-generated method stub
+
+ }
+
+ public static void writeList(ChannelBuffer bb, List<?> ports) {
+ // TODO Auto-generated method stub
+
+ }
+
+ public static void writeOFFlowModCmd(ChannelBuffer bb, OFFlowModCmd command) {
+ // TODO Auto-generated method stub
+
+ }
+
+ public static String readFixedLengthString(ChannelBuffer bb, int length) {
+ byte[] dst = new byte[length];
+ bb.readBytes(dst, 0, length);
+ return new String(dst, Charsets.US_ASCII);
+ }
+
+ public static void writeFixedLengthString(ChannelBuffer bb, String string, int length) {
+ int l = string.length();
+ if(l > length) {
+ throw new IllegalArgumentException("Error writing string: length="+l+" > max Length="+length);
+ }
+ bb.writeBytes(string.getBytes(Charsets.US_ASCII));
+ if(l < length) {
+ bb.writeZero(length - l);
+ }
+ }
+
+ public static void writeBsnInterfaceList(ChannelBuffer bb, List<OFBsnInterface> interfaces) {
+ // TODO Auto-generated method stub
+
+ }
+
+ public static void writeTableFeatureList(ChannelBuffer bb,
+ List<OFTableFeature> entries) {
+ // TODO Auto-generated method stub
+
+ }
+
+ public static void writeBsnInterface(ChannelBuffer bb,
+ List<OFBsnInterface> interfaces) {
+ // TODO Auto-generated method stub
+
+ }
+
+ public static void writeFlowStatsEntry(ChannelBuffer bb,
+ List<OFFlowStatsEntry> entries) {
+ // TODO Auto-generated method stub
+
+ }
+
+ public static List<OFFlowStatsEntry> readFlowStatsEntry(ChannelBuffer bb) {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public static void writeTableStatsEntryList(ChannelBuffer bb,
+ List<OFTableStatsEntry> entries) {
+ // TODO Auto-generated method stub
+
+ }
+
+ public static List<OFTableStatsEntry> readTableStatsEntryList(
+ ChannelBuffer bb) {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public static List<OFFlowStatsEntry> readFlowStatsEntryList(ChannelBuffer bb) {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public static void writeFlowStatsEntryList(ChannelBuffer bb,
+ List<OFFlowStatsEntry> entries) {
+ // TODO Auto-generated method stub
+
+ }
+
+ public static void writeGroupDescStatsEntryList(ChannelBuffer bb,
+ List<OFGroupDescStatsEntry> entries) {
+ // TODO Auto-generated method stub
+
+ }
+
+ public static List<OFGroupDescStatsEntry> readGroupDescStatsEntryList(
+ ChannelBuffer bb) {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public static void writeOFBsnVportQInQT(ChannelBuffer bb,
+ OFBsnVportQInQT vport) {
+ // TODO Auto-generated method stub
+
+ }
+
+ public static void writeMeterBandList(ChannelBuffer bb,
+ List<OFMeterBand> entries) {
+ // TODO Auto-generated method stub
+
+ }
+
+ public static int writeActionsList(ChannelBuffer bb, List<OFAction> actions) {
+ // TODO Auto-generated method stub
+ return 0;
+ }
+
+ public static OFBsnVportQInQ readOFBsnVportQInQ(ChannelBuffer bb) {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public static void writePortStatsEntryList(ChannelBuffer bb,
+ List<OFPortStatsEntry> entries) {
+ // TODO Auto-generated method stub
+
+ }
+
+ public static void write(ChannelBuffer bb, OFPhysicalPort desc) {
+ // TODO Auto-generated method stub
+
+ }
+
+ public static List<OFPortStatsEntry> readPortStatsEntryList(ChannelBuffer bb) {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public static void writeOFBsnVportQInQ(ChannelBuffer bb,
+ OFBsnVportQInQ vport) {
+ // TODO Auto-generated method stub
+
+ }
+
+ public static List<OFHelloElem> readHelloElemList(ChannelBuffer bb) {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public static void writeHelloElemList(ChannelBuffer bb,
+ List<OFHelloElem> elements) {
+ // TODO Auto-generated method stub
+
+ }
+
+ public static List<OFGroupStatsEntry> readGroupStatsEntryList(
+ ChannelBuffer bb) {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public static void writeGroupStatsEntryList(ChannelBuffer bb,
+ List<OFGroupStatsEntry> entries) {
+ // TODO Auto-generated method stub
+
+ }
+
+ public static List<OFQueueStatsEntry> readQueueStatsEntryList(
+ ChannelBuffer bb) {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public static void writeQueueStatsEntryList(ChannelBuffer bb,
+ List<OFQueueStatsEntry> entries) {
+ // TODO Auto-generated method stub
+
+ }
+
+ public static OFMeterFeatures readOFMeterFeatures(ChannelBuffer bb) {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public static void writeOFMeterFeatures(ChannelBuffer bb,
+ OFMeterFeatures features) {
+ // TODO Auto-generated method stub
+
+ }
+
+ public static List<OFMeterStats> readMeterStatsList(ChannelBuffer bb) {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public static void writeMeterStatsList(ChannelBuffer bb,
+ List<OFMeterStats> entries) {
+ // TODO Auto-generated method stub
+
+ }
+
+ public static List<OFTableFeatures> readTableFeaturesList(ChannelBuffer bb) {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public static void writeTableFeaturesList(ChannelBuffer bb,
+ List<OFTableFeatures> entries) {
+ // TODO Auto-generated method stub
+
+ }
+
+
}
diff --git a/java_gen/pre-written/src/main/java/org/openflow/util/LengthCountingPseudoChannelBuffer.java b/java_gen/pre-written/src/main/java/org/openflow/util/LengthCountingPseudoChannelBuffer.java
new file mode 100644
index 0000000..bd0adce
--- /dev/null
+++ b/java_gen/pre-written/src/main/java/org/openflow/util/LengthCountingPseudoChannelBuffer.java
@@ -0,0 +1,673 @@
+package org.openflow.util;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.nio.ByteBuffer;
+import java.nio.ByteOrder;
+import java.nio.channels.GatheringByteChannel;
+import java.nio.channels.ScatteringByteChannel;
+import java.nio.charset.Charset;
+
+import org.jboss.netty.buffer.ChannelBuffer;
+import org.jboss.netty.buffer.ChannelBufferFactory;
+import org.jboss.netty.buffer.ChannelBufferIndexFinder;
+
+public class LengthCountingPseudoChannelBuffer implements ChannelBuffer {
+
+ int writerIndex = 0;
+ private int markedWriterIndex;
+
+ @Override
+ public ChannelBufferFactory factory() {
+ return null;
+ }
+
+ @Override
+ public int capacity() {
+ return Integer.MAX_VALUE;
+ }
+
+ @Override
+ public ByteOrder order() {
+ return ByteOrder.BIG_ENDIAN;
+ }
+
+ @Override
+ public boolean isDirect() {
+ return true;
+ }
+
+ @Override
+ public int readerIndex() {
+ return 0;
+ }
+
+ @Override
+ public void readerIndex(int readerIndex) {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public int writerIndex() {
+ return writerIndex;
+ }
+
+ @Override
+ public void writerIndex(int writerIndex) {
+ this.writerIndex = writerIndex;
+ }
+
+ @Override
+ public void setIndex(int readerIndex, int writerIndex) {
+ if(readerIndex != 0)
+ throw new UnsupportedOperationException();
+ this.writerIndex = writerIndex;
+ }
+
+ @Override
+ public int readableBytes() {
+ return writerIndex;
+ }
+
+ @Override
+ public int writableBytes() {
+ return Integer.MAX_VALUE - writerIndex;
+ }
+
+ @Override
+ public boolean readable() {
+ return writerIndex > 0;
+ }
+
+ @Override
+ public boolean writable() {
+ return writerIndex < Integer.MAX_VALUE;
+ }
+
+ @Override
+ public void clear() {
+ writerIndex = 0;
+
+ }
+
+ @Override
+ public void markReaderIndex() {
+ }
+
+ @Override
+ public void resetReaderIndex() {
+ }
+
+ @Override
+ public void markWriterIndex() {
+ markedWriterIndex = writerIndex;
+ }
+
+ @Override
+ public void resetWriterIndex() {
+ writerIndex = markedWriterIndex;
+ }
+
+ @Override
+ public void discardReadBytes() {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public void ensureWritableBytes(int writableBytes) {
+ if(!((Integer.MAX_VALUE - writableBytes) > writerIndex))
+ throw new IllegalStateException();
+ }
+
+ @Override
+ public byte getByte(int index) {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public short getUnsignedByte(int index) {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public short getShort(int index) {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public int getUnsignedShort(int index) {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public int getMedium(int index) {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public int getUnsignedMedium(int index) {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public int getInt(int index) {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public long getUnsignedInt(int index) {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public long getLong(int index) {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public char getChar(int index) {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public float getFloat(int index) {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public double getDouble(int index) {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public void getBytes(int index, ChannelBuffer dst) {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public void getBytes(int index, ChannelBuffer dst, int length) {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public void getBytes(int index, ChannelBuffer dst, int dstIndex, int length) {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public void getBytes(int index, byte[] dst) {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public void getBytes(int index, byte[] dst, int dstIndex, int length) {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public void getBytes(int index, ByteBuffer dst) {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public void getBytes(int index, OutputStream out, int length)
+ throws IOException {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public int getBytes(int index, GatheringByteChannel out, int length)
+ throws IOException {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public void setByte(int index, int value) {
+ }
+
+ @Override
+ public void setShort(int index, int value) {
+ }
+
+ @Override
+ public void setMedium(int index, int value) {
+ }
+
+ @Override
+ public void setInt(int index, int value) {
+ }
+
+ @Override
+ public void setLong(int index, long value) {
+ }
+
+ @Override
+ public void setChar(int index, int value) {
+ }
+
+ @Override
+ public void setFloat(int index, float value) {
+ }
+
+ @Override
+ public void setDouble(int index, double value) {
+ }
+
+ @Override
+ public void setBytes(int index, ChannelBuffer src) {
+ }
+
+ @Override
+ public void setBytes(int index, ChannelBuffer src, int length) {
+ }
+
+ @Override
+ public void setBytes(int index, ChannelBuffer src, int srcIndex, int length) {
+ }
+
+ @Override
+ public void setBytes(int index, byte[] src) {
+ }
+
+ @Override
+ public void setBytes(int index, byte[] src, int srcIndex, int length) {
+ }
+
+ @Override
+ public void setBytes(int index, ByteBuffer src) {
+
+ }
+
+ @Override
+ public int setBytes(int index, InputStream in, int length)
+ throws IOException {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public int setBytes(int index, ScatteringByteChannel in, int length)
+ throws IOException {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public void setZero(int index, int length) {
+ }
+
+ @Override
+ public byte readByte() {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public short readUnsignedByte() {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public short readShort() {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public int readUnsignedShort() {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public int readMedium() {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public int readUnsignedMedium() {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public int readInt() {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public long readUnsignedInt() {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public long readLong() {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public char readChar() {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public float readFloat() {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public double readDouble() {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public ChannelBuffer readBytes(int length) {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ @Deprecated
+ public ChannelBuffer readBytes(ChannelBufferIndexFinder indexFinder) {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public ChannelBuffer readSlice(int length) {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ @Deprecated
+ public
+ ChannelBuffer readSlice(ChannelBufferIndexFinder indexFinder) {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public void readBytes(ChannelBuffer dst) {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public void readBytes(ChannelBuffer dst, int length) {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public void readBytes(ChannelBuffer dst, int dstIndex, int length) {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public void readBytes(byte[] dst) {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public void readBytes(byte[] dst, int dstIndex, int length) {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public void readBytes(ByteBuffer dst) {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public void readBytes(OutputStream out, int length) throws IOException {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public int readBytes(GatheringByteChannel out, int length)
+ throws IOException {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public void skipBytes(int length) {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ @Deprecated
+ public int skipBytes(ChannelBufferIndexFinder indexFinder) {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public void writeByte(int value) {
+ writerIndex++;
+ }
+
+ @Override
+ public void writeShort(int value) {
+ writerIndex += 2;
+}
+
+@Override
+public void writeMedium(int value) {
+ writerIndex += 3;
+}
+
+@Override
+public void writeInt(int value) {
+ writerIndex += 4;
+}
+
+@Override
+public void writeLong(long value) {
+ writerIndex += 8;
+}
+
+
+ @Override
+ public void writeChar(int value) {
+ writeShort(value);
+ }
+
+ @Override
+ public void writeFloat(float value) {
+ writeInt(Float.floatToIntBits(value));
+ }
+
+ @Override
+ public void writeDouble(double value) {
+ writeLong(Double.doubleToLongBits(value));
+
+ }
+
+ @Override
+ public void writeBytes(ChannelBuffer src) {
+ writerIndex += src.readableBytes();
+
+ }
+
+ @Override
+ public void writeBytes(ChannelBuffer src, int length) {
+ writerIndex += src.readableBytes();
+
+ }
+
+ @Override
+ public void writeBytes(ChannelBuffer src, int srcIndex, int length) {
+ writerIndex += length;
+ }
+
+ @Override
+ public void writeBytes(byte[] src) {
+ writerIndex += src.length;
+
+ }
+
+ @Override
+ public void writeBytes(byte[] src, int srcIndex, int length) {
+ writerIndex += length;
+ }
+
+ @Override
+ public void writeBytes(ByteBuffer src) {
+ writerIndex += src.remaining();
+
+ }
+
+ @Override
+ public int writeBytes(InputStream in, int length) throws IOException {
+ writerIndex += length;
+ return length;
+ }
+
+ @Override
+ public int writeBytes(ScatteringByteChannel in, int length)
+ throws IOException {
+ writerIndex += length;
+ return length;
+ }
+
+ @Override
+ public void writeZero(int length) {
+ writerIndex += length;
+
+ }
+
+ @Override
+ public int indexOf(int fromIndex, int toIndex, byte value) {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public int indexOf(int fromIndex, int toIndex,
+ ChannelBufferIndexFinder indexFinder) {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public int bytesBefore(byte value) {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public int bytesBefore(ChannelBufferIndexFinder indexFinder) {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public int bytesBefore(int length, byte value) {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public int bytesBefore(int length, ChannelBufferIndexFinder indexFinder) {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public int bytesBefore(int index, int length, byte value) {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public int bytesBefore(int index, int length,
+ ChannelBufferIndexFinder indexFinder) {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public ChannelBuffer copy() {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public ChannelBuffer copy(int index, int length) {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public ChannelBuffer slice() {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public ChannelBuffer slice(int index, int length) {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public ChannelBuffer duplicate() {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public ByteBuffer toByteBuffer() {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public ByteBuffer toByteBuffer(int index, int length) {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public ByteBuffer[] toByteBuffers() {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public ByteBuffer[] toByteBuffers(int index, int length) {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public boolean hasArray() {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public byte[] array() {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public int arrayOffset() {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public String toString(Charset charset) {
+ return "LengthCountingPseudoChannelBuffer(length="+writerIndex+")";
+ }
+
+ @Override
+ public String toString(int index, int length, Charset charset) {
+ return toString();
+ }
+
+ @Override
+ @Deprecated
+ public String toString(String charsetName) {
+ return toString();
+ }
+
+ @Override
+ @Deprecated
+ public String toString(String charsetName,
+ ChannelBufferIndexFinder terminatorFinder) {
+ return toString();
+ }
+
+ @Override
+ @Deprecated
+ public String toString(int index, int length, String charsetName) {
+ return toString();
+ }
+
+ @Override
+ @Deprecated
+ public
+ String toString(int index, int length, String charsetName,
+ ChannelBufferIndexFinder terminatorFinder) {
+ return toString();
+ }
+
+ @Override
+ public int compareTo(ChannelBuffer buffer) {
+ throw new UnsupportedOperationException();
+
+ }
+
+}