java_gen: work in progress commit of java generator
diff --git a/java_gen/pre-written/src/main/java/org/openflow/types/EthType.java b/java_gen/pre-written/src/main/java/org/openflow/types/EthType.java
new file mode 100644
index 0000000..d319e57
--- /dev/null
+++ b/java_gen/pre-written/src/main/java/org/openflow/types/EthType.java
@@ -0,0 +1,5 @@
+package org.openflow.types;
+
+public class EthType {
+
+}
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
new file mode 100644
index 0000000..b4eb8cf
--- /dev/null
+++ b/java_gen/pre-written/src/main/java/org/openflow/types/IPv4.java
@@ -0,0 +1,129 @@
+package org.openflow.types;
+
+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;
+
+/**
+ * Wrapper around an IPv4 address
+ *
+ * @author Andreas Wundsam <andreas.wundsam@bigswitch.com>
+ */
+public class IPv4 implements OFObject {
+ static final int LENGTH = 4;
+ private final int rawValue;
+
+ private IPv4(final int rawValue) {
+ this.rawValue = rawValue;
+ }
+
+ public static IPv4 of(final byte[] address) {
+ if (address.length != LENGTH) {
+ throw new IllegalArgumentException(
+ "Invalid byte array length for IPv4 address: " + address);
+ }
+
+ int raw =
+ (address[0] & 0xFF) << 24 | (address[1] & 0xFF) << 16
+ | (address[2] & 0xFF) << 8 | (address[3] & 0xFF) << 0;
+ return IPv4.of(raw);
+ }
+
+ public static IPv4 of(final int raw) {
+ return new IPv4(raw);
+ }
+
+ public static IPv4 of(final String string) {
+ int start = 0;
+ int shift = 24;
+
+ int raw = 0;
+ while (shift >= 0) {
+ int end = string.indexOf('.', start);
+ if (end == start || !((shift > 0) ^ (end < 0)))
+ throw new IllegalArgumentException("IP Address not well formed: " + string);
+
+ String substr =
+ end > 0 ? string.substring(start, end) : string.substring(start);
+ int val = Integer.parseInt(substr);
+ if (val < 0 || val > 255)
+ throw new IllegalArgumentException("IP Address not well formed: " + string);
+
+ raw |= val << shift;
+
+ shift -= 8;
+ start = end + 1;
+ }
+ return IPv4.of(raw);
+ }
+
+ public int getInt() {
+ return rawValue;
+ }
+
+ volatile byte[] bytesCache = null;
+
+ public byte[] getBytes() {
+ if (bytesCache == null) {
+ synchronized (this) {
+ if (bytesCache == null) {
+ bytesCache =
+ new byte[] { (byte) ((rawValue >>> 24) & 0xFF),
+ (byte) ((rawValue >>> 16) & 0xFF),
+ (byte) ((rawValue >>> 8) & 0xFF),
+ (byte) ((rawValue >>> 0) & 0xFF) };
+ }
+ }
+ }
+ return bytesCache;
+ }
+
+ @Override
+ public int getLength() {
+ return LENGTH;
+ }
+
+ public static IPv4 readFrom(final ChannelBuffer bb) throws OFParseError, OFShortRead {
+ return IPv4.of(bb.readInt());
+ }
+
+ @Override
+ public void writeTo(final ChannelBuffer bb) throws OFParseError, OFShortWrite {
+ bb.writeInt(rawValue);
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder res = new StringBuilder();
+ res.append((rawValue >> 24) & 0xFF).append('.');
+ res.append((rawValue >> 16) & 0xFF).append('.');
+ res.append((rawValue >> 8) & 0xFF).append('.');
+ res.append((rawValue >> 0) & 0xFF);
+ return res.toString();
+ }
+
+ @Override
+ public int hashCode() {
+ final int prime = 31;
+ int result = 1;
+ result = prime * result + rawValue;
+ return result;
+ }
+
+ @Override
+ public boolean equals(final Object obj) {
+ if (this == obj)
+ return true;
+ if (obj == null)
+ return false;
+ if (getClass() != obj.getClass())
+ return false;
+ IPv4 other = (IPv4) obj;
+ if (rawValue != other.rawValue)
+ return false;
+ return true;
+ }
+
+}
diff --git a/java_gen/pre-written/src/main/java/org/openflow/types/IPv4WithMask.java b/java_gen/pre-written/src/main/java/org/openflow/types/IPv4WithMask.java
new file mode 100644
index 0000000..ec777c0
--- /dev/null
+++ b/java_gen/pre-written/src/main/java/org/openflow/types/IPv4WithMask.java
@@ -0,0 +1,5 @@
+package org.openflow.types;
+
+public class IPv4WithMask {
+
+}
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
new file mode 100644
index 0000000..5f51665
--- /dev/null
+++ b/java_gen/pre-written/src/main/java/org/openflow/types/IPv6.java
@@ -0,0 +1,286 @@
+package org.openflow.types;
+
+import java.util.regex.Pattern;
+
+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;
+
+/**
+ * IPv6 address object. Instance controlled, immutable. Internal representation:
+ * two 64 bit longs (not that you'd have to know).
+ *
+ * @author Andreas Wundsam <andreas.wundsam@teleteach.de>
+ */
+public class IPv6 implements OFObject {
+ static final int LENGTH = 16;
+ private final long raw1;
+ private final long raw2;
+
+ private IPv6(final long raw1, final long raw2) {
+ this.raw1 = raw1;
+ this.raw2 = raw2;
+ }
+
+ public static IPv6 of(final byte[] address) {
+ if (address.length != LENGTH) {
+ throw new IllegalArgumentException(
+ "Invalid byte array length for IPv6 address: " + address);
+ }
+
+ long raw1 =
+ (address[0] & 0xFFL) << 56 | (address[1] & 0xFFL) << 48
+ | (address[2] & 0xFFL) << 40 | (address[3] & 0xFFL) << 32
+ | (address[4] & 0xFFL) << 24 | (address[5] & 0xFFL) << 16
+ | (address[6] & 0xFFL) << 8 | (address[7]);
+
+ long raw2 =
+ (address[8] & 0xFFL) << 56 | (address[9] & 0xFFL) << 48
+ | (address[10] & 0xFFL) << 40 | (address[11] & 0xFFL) << 32
+ | (address[12] & 0xFFL) << 24 | (address[13] & 0xFFL) << 16
+ | (address[14] & 0xFFL) << 8 | (address[15]);
+
+ return IPv6.of(raw1, raw2);
+ }
+
+ private static class IPv6Builder {
+ private long raw1, raw2;
+
+ public void setUnsignedShortWord(final int i, final int value) {
+ int shift = 48 - (i % 4) * 16;
+
+ if (value < 0 || value > 0xFFFF)
+ throw new IllegalArgumentException("16 bit word must be in [0, 0xFFFF]");
+
+ if (i >= 0 && i < 4)
+ raw1 = raw1 & ~(0xFFFFL << shift) | (value & 0xFFFFL) << shift;
+ else if (i >= 4 && i < 8)
+ raw2 = raw2 & ~(0xFFFFL << shift) | (value & 0xFFFFL) << shift;
+ else
+ throw new IllegalArgumentException("16 bit word index must be in [0,7]");
+ }
+
+ public IPv6 getIPv6() {
+ return IPv6.of(raw1, raw2);
+ }
+ }
+
+ private final static Pattern colonPattern = Pattern.compile(":");
+
+ public static IPv6 of(final String string) {
+ IPv6Builder builder = new IPv6Builder();
+ String[] parts = colonPattern.split(string, -1);
+
+ int leftWord = 0;
+ int leftIndex = 0;
+
+ boolean hitZeroCompression = false;
+
+ for (leftIndex = 0; leftIndex < parts.length; leftIndex++) {
+ String part = parts[leftIndex];
+ if (part.length() == 0) {
+ // hit empty group of zero compression
+ hitZeroCompression = true;
+ break;
+ }
+ builder.setUnsignedShortWord(leftWord++, Integer.parseInt(part, 16));
+ }
+
+ if (hitZeroCompression) {
+ if (leftIndex == 0) {
+ // if colon is at the start, two columns must be at the start,
+ // move to the second empty group
+ leftIndex = 1;
+ if (parts.length < 2 || parts[1].length() > 0)
+ throw new IllegalArgumentException("Malformed IPv6 address: " + string);
+ }
+
+ int rightWord = 7;
+ int rightIndex;
+ for (rightIndex = parts.length - 1; rightIndex > leftIndex; rightIndex--) {
+ String part = parts[rightIndex];
+ if (part.length() == 0)
+ break;
+ builder.setUnsignedShortWord(rightWord--, Integer.parseInt(part, 16));
+ }
+ if (rightIndex == parts.length - 1) {
+ // if colon is at the end, two columns must be at the end, move
+ // to the second empty group
+ if (rightIndex < 1 || parts[rightIndex - 1].length() > 0)
+ throw new IllegalArgumentException("Malformed IPv6 address: " + string);
+ rightIndex--;
+ }
+ if (leftIndex != rightIndex)
+ throw new IllegalArgumentException("Malformed IPv6 address: " + string);
+ } else {
+ if (leftIndex != 8) {
+ throw new IllegalArgumentException("Malformed IPv6 address: " + string);
+ }
+ }
+ return builder.getIPv6();
+ }
+
+ public static IPv6 of(final long raw1, final long raw2) {
+ return new IPv6(raw1, raw2);
+ }
+
+ volatile byte[] bytesCache = null;
+
+ public byte[] getBytes() {
+ if (bytesCache == null) {
+ synchronized (this) {
+ if (bytesCache == null) {
+ bytesCache =
+ new byte[] { (byte) ((raw1 >> 56) & 0xFF),
+ (byte) ((raw1 >> 48) & 0xFF),
+ (byte) ((raw1 >> 40) & 0xFF),
+ (byte) ((raw1 >> 32) & 0xFF),
+ (byte) ((raw1 >> 24) & 0xFF),
+ (byte) ((raw1 >> 16) & 0xFF),
+ (byte) ((raw1 >> 8) & 0xFF),
+ (byte) ((raw1 >> 0) & 0xFF),
+
+ (byte) ((raw2 >> 56) & 0xFF),
+ (byte) ((raw2 >> 48) & 0xFF),
+ (byte) ((raw2 >> 40) & 0xFF),
+ (byte) ((raw2 >> 32) & 0xFF),
+ (byte) ((raw2 >> 24) & 0xFF),
+ (byte) ((raw2 >> 16) & 0xFF),
+ (byte) ((raw2 >> 8) & 0xFF),
+ (byte) ((raw2 >> 0) & 0xFF) };
+ }
+ }
+ }
+ return bytesCache;
+ }
+
+ @Override
+ public int getLength() {
+ return LENGTH;
+ }
+
+ public static IPv6 readFrom(final ChannelBuffer bb) throws OFParseError, OFShortRead {
+ return IPv6.of(bb.readLong(), bb.readLong());
+ }
+
+ @Override
+ public void writeTo(final ChannelBuffer bb) throws OFParseError, OFShortWrite {
+ bb.writeLong(raw1);
+ bb.writeLong(raw2);
+ }
+
+ @Override
+ public String toString() {
+ return toString(true, false);
+ }
+
+ public int getUnsignedShortWord(final int i) {
+ if (i >= 0 && i < 4)
+ return (int) ((raw1 >>> (48 - i * 16)) & 0xFFFF);
+ else if (i >= 4 && i < 8)
+ return (int) ((raw2 >>> (48 - (i - 4) * 16)) & 0xFFFF);
+ else
+ throw new IllegalArgumentException("16 bit word index must be in [0,7]");
+ }
+
+ /** get the index of the first word where to apply IPv6 zero compression */
+ public int getZeroCompressStart() {
+ int start = Integer.MAX_VALUE;
+ int maxLength = -1;
+
+ int candidateStart = -1;
+
+ for (int i = 0; i < 8; i++) {
+ if (candidateStart >= 0) {
+ // in a zero octect
+ if (getUnsignedShortWord(i) != 0) {
+ // end of this candidate word
+ int candidateLength = i - candidateStart;
+ if (candidateLength >= maxLength) {
+ start = candidateStart;
+ maxLength = candidateLength;
+ }
+ candidateStart = -1;
+ }
+ } else {
+ // not in a zero octect
+ if (getUnsignedShortWord(i) == 0) {
+ candidateStart = i;
+ }
+ }
+ }
+
+ if (candidateStart >= 0) {
+ int candidateLength = 8 - candidateStart;
+ if (candidateLength >= maxLength) {
+ start = candidateStart;
+ maxLength = candidateLength;
+ }
+ }
+
+ return start;
+ }
+
+ public String toString(final boolean zeroCompression, final boolean leadingZeros) {
+ StringBuilder res = new StringBuilder();
+
+ int compressionStart = zeroCompression ? getZeroCompressStart() : Integer.MAX_VALUE;
+ boolean inCompression = false;
+ boolean colonNeeded = false;
+
+ for (int i = 0; i < 8; i++) {
+ int word = getUnsignedShortWord(i);
+
+ if (word == 0) {
+ if (inCompression)
+ continue;
+ else if (i == compressionStart) {
+ res.append(':').append(':');
+ inCompression = true;
+ colonNeeded = false;
+ continue;
+ }
+ } else {
+ inCompression = false;
+ }
+
+ if (colonNeeded) {
+ res.append(':');
+ colonNeeded = false;
+ }
+
+ res.append(leadingZeros ? String.format("%04x", word) : Integer.toString(word,
+ 16));
+ colonNeeded = true;
+ }
+ return res.toString();
+ }
+
+ @Override
+ public int hashCode() {
+ final int prime = 31;
+ int result = 1;
+ result = prime * result + (int) (raw1 ^ (raw1 >>> 32));
+ result = prime * result + (int) (raw2 ^ (raw2 >>> 32));
+ return result;
+ }
+
+ @Override
+ public boolean equals(final Object obj) {
+ if (this == obj)
+ return true;
+ if (obj == null)
+ return false;
+ if (getClass() != obj.getClass())
+ return false;
+ IPv6 other = (IPv6) obj;
+ if (raw1 != other.raw1)
+ return false;
+ if (raw2 != other.raw2)
+ return false;
+ return true;
+ }
+
+}
diff --git a/java_gen/pre-written/src/main/java/org/openflow/types/IPv6WithMask.java b/java_gen/pre-written/src/main/java/org/openflow/types/IPv6WithMask.java
new file mode 100644
index 0000000..0fb3281
--- /dev/null
+++ b/java_gen/pre-written/src/main/java/org/openflow/types/IPv6WithMask.java
@@ -0,0 +1,5 @@
+package org.openflow.types;
+
+public class IPv6WithMask {
+
+}
diff --git a/java_gen/pre-written/src/main/java/org/openflow/types/IpProtocol.java b/java_gen/pre-written/src/main/java/org/openflow/types/IpProtocol.java
new file mode 100644
index 0000000..a295cb2
--- /dev/null
+++ b/java_gen/pre-written/src/main/java/org/openflow/types/IpProtocol.java
@@ -0,0 +1,5 @@
+package org.openflow.types;
+
+public class IpProtocol {
+
+}
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
new file mode 100644
index 0000000..4ce19ab
--- /dev/null
+++ b/java_gen/pre-written/src/main/java/org/openflow/types/MacAddress.java
@@ -0,0 +1,123 @@
+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;
+import org.openflow.util.HexString;
+
+/**
+ * Wrapper around a 6 byte mac address.
+ *
+ * @author Andreas Wundsam <andreas.wundsam@bigswitch.com>
+ */
+
+public class MacAddress implements OFObject {
+ static final int MacAddrLen = 6;
+ private final long rawValue;
+
+ private MacAddress(final long rawValue) {
+ this.rawValue = rawValue;
+ }
+
+ public static MacAddress of(final byte[] address) {
+ long raw =
+ (address[0] & 0xFFL) << 40 | (address[1] & 0xFFL) << 32
+ | (address[2] & 0xFFL) << 24 | (address[3] & 0xFFL) << 16
+ | (address[4] & 0xFFL) << 8 | (address[5] & 0xFFL);
+ return MacAddress.of(raw);
+ }
+
+ public static MacAddress of(final long raw) {
+ return new MacAddress(raw);
+ }
+
+ public static MacAddress of(final String string) {
+ int index = 0;
+ int shift = 40;
+
+ long raw = 0;
+ if (string.length() != 6 * 2 + 5)
+ throw new IllegalArgumentException("Mac address not well formed: " + string);
+
+ while (shift >= 0) {
+ raw |=
+ ((long) (Character.digit(string.charAt(index++), 16) << 4 | Character
+ .digit(string.charAt(index++), 16))) << shift;
+
+ if (shift == 0)
+ break;
+ if (string.charAt(index++) != ':')
+ throw new IllegalArgumentException("Mac address not well formed: " + string);
+ shift -= 8;
+ }
+ return MacAddress.of(raw);
+ }
+
+ volatile byte[] bytesCache = null;
+
+ public byte[] getBytes() {
+ if (bytesCache == null) {
+ synchronized (this) {
+ if (bytesCache == null) {
+ bytesCache =
+ new byte[] { (byte) ((rawValue >> 40) & 0xFF),
+ (byte) ((rawValue >> 32) & 0xFF),
+ (byte) ((rawValue >> 24) & 0xFF),
+ (byte) ((rawValue >> 16) & 0xFF),
+ (byte) ((rawValue >> 8) & 0xFF),
+ (byte) ((rawValue >> 0) & 0xFF) };
+ }
+ }
+ }
+ return bytesCache;
+ }
+
+ @Override
+ public int getLength() {
+ return MacAddrLen;
+ }
+
+ public static MacAddress readFrom(final ChannelBuffer bb) throws OFParseError {
+ long raw = bb.readUnsignedInt() << 16 | bb.readUnsignedShort();
+ return MacAddress.of(raw);
+ }
+
+ @Override
+ public void writeTo(final ChannelBuffer bb) throws OFParseError, OFShortWrite {
+ bb.writeInt((int) (rawValue >> 16));
+ bb.writeShort((int) rawValue & 0xFFFF);
+ }
+
+ @Override
+ public String toString() {
+ return HexString.toHexString(rawValue, 6);
+ }
+
+ @Override
+ public int hashCode() {
+ final int prime = 31;
+ int result = 1;
+ result = prime * result + (int) (rawValue ^ (rawValue >>> 32));
+ return result;
+ }
+
+ @Override
+ public boolean equals(final Object obj) {
+ if (this == obj)
+ return true;
+ if (obj == null)
+ return false;
+ if (getClass() != obj.getClass())
+ return false;
+ MacAddress other = (MacAddress) obj;
+ if (rawValue != other.rawValue)
+ return false;
+ return true;
+ }
+
+ public long getLong() {
+ return rawValue;
+ }
+
+}
diff --git a/java_gen/pre-written/src/main/java/org/openflow/types/MacAddressWithMask.java b/java_gen/pre-written/src/main/java/org/openflow/types/MacAddressWithMask.java
new file mode 100644
index 0000000..ffa5fa7
--- /dev/null
+++ b/java_gen/pre-written/src/main/java/org/openflow/types/MacAddressWithMask.java
@@ -0,0 +1,5 @@
+package org.openflow.types;
+
+public class MacAddressWithMask {
+
+}
diff --git a/java_gen/pre-written/src/main/java/org/openflow/types/Masked.java b/java_gen/pre-written/src/main/java/org/openflow/types/Masked.java
new file mode 100644
index 0000000..98a8e0b
--- /dev/null
+++ b/java_gen/pre-written/src/main/java/org/openflow/types/Masked.java
@@ -0,0 +1,5 @@
+package org.openflow.types;
+
+public class Masked<T> {
+
+}
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
new file mode 100644
index 0000000..d0afb56
--- /dev/null
+++ b/java_gen/pre-written/src/main/java/org/openflow/types/OFBsnInterface.java
@@ -0,0 +1,5 @@
+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
new file mode 100644
index 0000000..47b403b
--- /dev/null
+++ b/java_gen/pre-written/src/main/java/org/openflow/types/OFBucket.java
@@ -0,0 +1,22 @@
+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/OFFlowModCmd.java b/java_gen/pre-written/src/main/java/org/openflow/types/OFFlowModCmd.java
new file mode 100644
index 0000000..6ca2c04
--- /dev/null
+++ b/java_gen/pre-written/src/main/java/org/openflow/types/OFFlowModCmd.java
@@ -0,0 +1,11 @@
+package org.openflow.types;
+
+/**
+ * Version agnostic view of commands to an OFFlowMod
+ *
+ * @author capveg
+ */
+
+public enum OFFlowModCmd {
+ ADD, MODIFY, MODIFY_STRICT, DELETE, DELETE_STRICT
+}
diff --git a/java_gen/pre-written/src/main/java/org/openflow/types/OFHelloElement.java b/java_gen/pre-written/src/main/java/org/openflow/types/OFHelloElement.java
new file mode 100644
index 0000000..288e1b6
--- /dev/null
+++ b/java_gen/pre-written/src/main/java/org/openflow/types/OFHelloElement.java
@@ -0,0 +1,5 @@
+package org.openflow.types;
+
+public interface OFHelloElement {
+
+}
diff --git a/java_gen/pre-written/src/main/java/org/openflow/types/OFMeterBand.java b/java_gen/pre-written/src/main/java/org/openflow/types/OFMeterBand.java
new file mode 100644
index 0000000..d15812b
--- /dev/null
+++ b/java_gen/pre-written/src/main/java/org/openflow/types/OFMeterBand.java
@@ -0,0 +1,5 @@
+package org.openflow.types;
+
+public interface OFMeterBand {
+
+}
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
new file mode 100644
index 0000000..d74906f
--- /dev/null
+++ b/java_gen/pre-written/src/main/java/org/openflow/types/OFPacketQueue.java
@@ -0,0 +1,22 @@
+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/types/OFPhysicalPort.java b/java_gen/pre-written/src/main/java/org/openflow/types/OFPhysicalPort.java
new file mode 100644
index 0000000..0853fea
--- /dev/null
+++ b/java_gen/pre-written/src/main/java/org/openflow/types/OFPhysicalPort.java
@@ -0,0 +1,12 @@
+package org.openflow.types;
+
+/**
+ * A wrapper around the OpenFlow physical port description. The interfaces to
+ * this object are version agnostic.
+ *
+ * @author capveg
+ */
+
+public class OFPhysicalPort {
+
+}
diff --git a/java_gen/pre-written/src/main/java/org/openflow/types/OFPort.java b/java_gen/pre-written/src/main/java/org/openflow/types/OFPort.java
new file mode 100644
index 0000000..4156f1f
--- /dev/null
+++ b/java_gen/pre-written/src/main/java/org/openflow/types/OFPort.java
@@ -0,0 +1,491 @@
+package org.openflow.types;
+
+import org.openflow.annotations.Immutable;
+
+/**
+ * Abstraction of an logical / OpenFlow switch port (ofp_port_no) in OpenFlow.
+ * Immutable. Note: Switch port numbers were changed in OpenFlow 1.1 from uint16
+ * to uint32. This class uses a 32 bit representation internally. Port numbers
+ * are converted from/to uint16 when constructed / getPortNumberasShort is
+ * called. If this port is not representable in OpenFlow 1.0, an
+ * IllegalStateException is raised.
+ *
+ * @author Andreas Wundsam <andreas.wundsam@bigswitch.com>
+ */
+@Immutable
+public class OFPort {
+ // private int constants (OF1.1+) to avoid duplication in the code
+ // should not have to use these outside this class
+ private static final int OFPP_ANY_INT = 0xFFffFFff;
+ private static final int OFPP_LOCAL_INT = 0xFFffFFfe;
+ private static final int OFPP_CONTROLLER_INT = 0xFFffFFfd;
+ private static final int OFPP_ALL_INT = 0xFFffFFfc;
+ private static final int OFPP_FLOOD_INT = 0xFFffFFfb;
+ private static final int OFPP_NORMAL_INT = 0xFFffFFfa;
+ private static final int OFPP_TABLE_INT = 0xFFffFFf9;
+ private static final int OFPP_MAX_INT = 0xFFffFF00;
+ private static final int OFPP_IN_PORT_INT = 0xFFffFFf8;
+
+ // private short constants (OF1.0) to avoid duplication in the code
+ // should not have to use these outside this class
+ private static final short OFPP_ANY_SHORT = (short) 0xFFff;
+ private static final short OFPP_LOCAL_SHORT = (short) 0xFFfe;
+ private static final short OFPP_CONTROLLER_SHORT = (short) 0xFFfd;
+ private static final short OFPP_ALL_SHORT = (short) 0xFFfc;
+ private static final short OFPP_FLOOD_SHORT = (short) 0xFFfb;
+ private static final short OFPP_NORMAL_SHORT = (short) 0xFFfa;
+ private static final short OFPP_TABLE_SHORT = (short) 0xFFf9;
+ private static final short OFPP_IN_PORT_SHORT = (short) 0xFFf8;
+ private static final short OFPP_MAX_SHORT = (short) 0xFF00;
+ private static final int OFPP_MAX_SHORT_UNSIGNED = 0xFF00;
+
+ // ////////////// public constants - use to access well known OpenFlow ports
+
+ /** Maximum number of physical and logical switch ports. */
+ public final static OFPort MAX = new NamedPort(OFPP_MAX_INT, "max");
+
+ /**
+ * Send the packet out the input port. This reserved port must be explicitly
+ * used in order to send back out of the input port.
+ */
+ public final static OFPort IN_PORT = new NamedPort(OFPP_IN_PORT_INT, "in_port");
+
+ /**
+ * Submit the packet to the first flow table NB: This destination port can
+ * only be used in packet-out messages.
+ */
+ public final static OFPort TABLE = new NamedPort(OFPP_TABLE_INT, "table");
+
+ /** Process with normal L2/L3 switching. */
+ public final static OFPort NORMAL = new NamedPort(OFPP_NORMAL_INT, "normal");
+
+ /**
+ * All physical ports in VLAN, except input port and those blocked or link
+ * down
+ */
+ public final static OFPort FLOOD = new NamedPort(OFPP_FLOOD_INT, "flood");
+
+ /** All physical ports except input port */
+ public final static OFPort ALL = new NamedPort(OFPP_ALL_INT, "all");
+
+ /** Send to controller */
+ public final static OFPort CONTROLLER =
+ new NamedPort(OFPP_CONTROLLER_INT, "controller");
+
+ /** local openflow "port" */
+ public final static OFPort LOCAL = new NamedPort(OFPP_LOCAL_INT, "local");
+
+ /**
+ * Wildcard port used only for flow mod (delete) and flow stats requests.
+ * Selects all flows regardless of output port (including flows with no
+ * output port). NOTE: OpenFlow 1.0 calls this 'NONE'
+ */
+ public final static OFPort ANY = new NamedPort(OFPP_ANY_INT, "any");
+
+ /** cache of frequently used ports */
+ private static class PrecachedPort {
+ private final static OFPort p1 = new OFPort(1);
+ private final static OFPort p2 = new OFPort(2);
+ private final static OFPort p3 = new OFPort(3);
+ private final static OFPort p4 = new OFPort(4);
+ private final static OFPort p5 = new OFPort(5);
+ private final static OFPort p6 = new OFPort(6);
+ private final static OFPort p7 = new OFPort(7);
+ private final static OFPort p8 = new OFPort(8);
+ private final static OFPort p9 = new OFPort(9);
+ private final static OFPort p10 = new OFPort(10);
+ private final static OFPort p11 = new OFPort(11);
+ private final static OFPort p12 = new OFPort(12);
+ private final static OFPort p13 = new OFPort(13);
+ private final static OFPort p14 = new OFPort(14);
+ private final static OFPort p15 = new OFPort(15);
+ private final static OFPort p16 = new OFPort(16);
+ private final static OFPort p17 = new OFPort(17);
+ private final static OFPort p18 = new OFPort(18);
+ private final static OFPort p19 = new OFPort(19);
+ private final static OFPort p20 = new OFPort(20);
+ private final static OFPort p21 = new OFPort(21);
+ private final static OFPort p22 = new OFPort(22);
+ private final static OFPort p23 = new OFPort(23);
+ private final static OFPort p24 = new OFPort(24);
+ private final static OFPort p25 = new OFPort(25);
+ private final static OFPort p26 = new OFPort(26);
+ private final static OFPort p27 = new OFPort(27);
+ private final static OFPort p28 = new OFPort(28);
+ private final static OFPort p29 = new OFPort(29);
+ private final static OFPort p31 = new OFPort(31);
+ private final static OFPort p32 = new OFPort(32);
+ private final static OFPort p33 = new OFPort(33);
+ private final static OFPort p34 = new OFPort(34);
+ private final static OFPort p35 = new OFPort(35);
+ private final static OFPort p36 = new OFPort(36);
+ private final static OFPort p37 = new OFPort(37);
+ private final static OFPort p38 = new OFPort(38);
+ private final static OFPort p39 = new OFPort(39);
+ private final static OFPort p40 = new OFPort(40);
+ private final static OFPort p41 = new OFPort(41);
+ private final static OFPort p42 = new OFPort(42);
+ private final static OFPort p43 = new OFPort(43);
+ private final static OFPort p44 = new OFPort(44);
+ private final static OFPort p45 = new OFPort(45);
+ private final static OFPort p46 = new OFPort(46);
+ private final static OFPort p47 = new OFPort(47);
+ private final static OFPort p48 = new OFPort(48);
+ }
+
+ /** raw openflow port number as a signed 32 bit integer */
+ private final int portNumber;
+
+ /** private constructor. use of*-Factory methods instead */
+ private OFPort(final int portNumber) {
+ this.portNumber = portNumber;
+ }
+
+ /**
+ * get an OFPort object corresponding to a raw 32-bit integer port number.
+ * NOTE: The port object may either be newly allocated or cached. Do not
+ * rely on either behavior.
+ *
+ * @param portNumber
+ * @return a corresponding OFPort
+ */
+ public static OFPort ofInt(final int portNumber) {
+ switch (portNumber) {
+ case 1:
+ return PrecachedPort.p1;
+ case 2:
+ return PrecachedPort.p2;
+ case 3:
+ return PrecachedPort.p3;
+ case 4:
+ return PrecachedPort.p4;
+ case 5:
+ return PrecachedPort.p5;
+ case 6:
+ return PrecachedPort.p6;
+ case 7:
+ return PrecachedPort.p7;
+ case 8:
+ return PrecachedPort.p8;
+ case 9:
+ return PrecachedPort.p9;
+ case 10:
+ return PrecachedPort.p10;
+ case 11:
+ return PrecachedPort.p11;
+ case 12:
+ return PrecachedPort.p12;
+ case 13:
+ return PrecachedPort.p13;
+ case 14:
+ return PrecachedPort.p14;
+ case 15:
+ return PrecachedPort.p15;
+ case 16:
+ return PrecachedPort.p16;
+ case 17:
+ return PrecachedPort.p17;
+ case 18:
+ return PrecachedPort.p18;
+ case 19:
+ return PrecachedPort.p19;
+ case 20:
+ return PrecachedPort.p20;
+ case 21:
+ return PrecachedPort.p21;
+ case 22:
+ return PrecachedPort.p22;
+ case 23:
+ return PrecachedPort.p23;
+ case 24:
+ return PrecachedPort.p24;
+ case 25:
+ return PrecachedPort.p25;
+ case 26:
+ return PrecachedPort.p26;
+ case 27:
+ return PrecachedPort.p27;
+ case 28:
+ return PrecachedPort.p28;
+ case 29:
+ return PrecachedPort.p29;
+ case 31:
+ return PrecachedPort.p31;
+ case 32:
+ return PrecachedPort.p32;
+ case 33:
+ return PrecachedPort.p33;
+ case 34:
+ return PrecachedPort.p34;
+ case 35:
+ return PrecachedPort.p35;
+ case 36:
+ return PrecachedPort.p36;
+ case 37:
+ return PrecachedPort.p37;
+ case 38:
+ return PrecachedPort.p38;
+ case 39:
+ return PrecachedPort.p39;
+ case 40:
+ return PrecachedPort.p40;
+ case 41:
+ return PrecachedPort.p41;
+ case 42:
+ return PrecachedPort.p42;
+ case 43:
+ return PrecachedPort.p43;
+ case 44:
+ return PrecachedPort.p44;
+ case 45:
+ return PrecachedPort.p45;
+ case 46:
+ return PrecachedPort.p46;
+ case 47:
+ return PrecachedPort.p47;
+ case 48:
+ return PrecachedPort.p48;
+ case OFPP_MAX_INT:
+ return MAX;
+ case OFPP_IN_PORT_INT:
+ return IN_PORT;
+ case OFPP_TABLE_INT:
+ return TABLE;
+ case OFPP_NORMAL_INT:
+ return NORMAL;
+ case OFPP_FLOOD_INT:
+ return FLOOD;
+ case OFPP_ALL_INT:
+ return ALL;
+ case OFPP_CONTROLLER_INT:
+ return CONTROLLER;
+ case OFPP_LOCAL_INT:
+ return LOCAL;
+ case OFPP_ANY_INT:
+ return ANY;
+ default:
+ // note: This means effectively : portNumber > OFPP_MAX_SHORT
+ // accounting for
+ // signedness of both portNumber and OFPP_MAX_INT(which is
+ // -256).
+ // Any unsigned integer value > OFPP_MAX_INT will be ]-256:0[
+ // when read signed
+ if (portNumber < 0 && portNumber > OFPP_MAX_INT)
+ throw new IllegalArgumentException("Unknown special port number: "
+ + portNumber);
+ return new OFPort(portNumber);
+ }
+ }
+
+ /** convenience function: delegates to ofInt */
+ public static OFPort of(final int portNumber) {
+ return ofInt(portNumber);
+ }
+
+ /**
+ * get an OFPort object corresponding to a raw signed 16-bit integer port
+ * number (OF1.0). Note that the port returned will have the corresponding
+ * 32-bit integer value allocated as its port number. NOTE: The port object
+ * may either be newly allocated or cached. Do not rely on either behavior.
+ *
+ * @param portNumber
+ * @return a corresponding OFPort
+ */
+ public static OFPort ofShort(final short portNumber) {
+ switch (portNumber) {
+ case 1:
+ return PrecachedPort.p1;
+ case 2:
+ return PrecachedPort.p2;
+ case 3:
+ return PrecachedPort.p3;
+ case 4:
+ return PrecachedPort.p4;
+ case 5:
+ return PrecachedPort.p5;
+ case 6:
+ return PrecachedPort.p6;
+ case 7:
+ return PrecachedPort.p7;
+ case 8:
+ return PrecachedPort.p8;
+ case 9:
+ return PrecachedPort.p9;
+ case 10:
+ return PrecachedPort.p10;
+ case 11:
+ return PrecachedPort.p11;
+ case 12:
+ return PrecachedPort.p12;
+ case 13:
+ return PrecachedPort.p13;
+ case 14:
+ return PrecachedPort.p14;
+ case 15:
+ return PrecachedPort.p15;
+ case 16:
+ return PrecachedPort.p16;
+ case 17:
+ return PrecachedPort.p17;
+ case 18:
+ return PrecachedPort.p18;
+ case 19:
+ return PrecachedPort.p19;
+ case 20:
+ return PrecachedPort.p20;
+ case 21:
+ return PrecachedPort.p21;
+ case 22:
+ return PrecachedPort.p22;
+ case 23:
+ return PrecachedPort.p23;
+ case 24:
+ return PrecachedPort.p24;
+ case 25:
+ return PrecachedPort.p25;
+ case 26:
+ return PrecachedPort.p26;
+ case 27:
+ return PrecachedPort.p27;
+ case 28:
+ return PrecachedPort.p28;
+ case 29:
+ return PrecachedPort.p29;
+ case 31:
+ return PrecachedPort.p31;
+ case 32:
+ return PrecachedPort.p32;
+ case 33:
+ return PrecachedPort.p33;
+ case 34:
+ return PrecachedPort.p34;
+ case 35:
+ return PrecachedPort.p35;
+ case 36:
+ return PrecachedPort.p36;
+ case 37:
+ return PrecachedPort.p37;
+ case 38:
+ return PrecachedPort.p38;
+ case 39:
+ return PrecachedPort.p39;
+ case 40:
+ return PrecachedPort.p40;
+ case 41:
+ return PrecachedPort.p41;
+ case 42:
+ return PrecachedPort.p42;
+ case 43:
+ return PrecachedPort.p43;
+ case 44:
+ return PrecachedPort.p44;
+ case 45:
+ return PrecachedPort.p45;
+ case 46:
+ return PrecachedPort.p46;
+ case 47:
+ return PrecachedPort.p47;
+ case 48:
+ return PrecachedPort.p48;
+ case OFPP_MAX_SHORT:
+ return MAX;
+ case OFPP_IN_PORT_SHORT:
+ return IN_PORT;
+ case OFPP_TABLE_SHORT:
+ return TABLE;
+ case OFPP_NORMAL_SHORT:
+ return NORMAL;
+ case OFPP_FLOOD_SHORT:
+ return FLOOD;
+ case OFPP_ALL_SHORT:
+ return ALL;
+ case OFPP_CONTROLLER_SHORT:
+ return CONTROLLER;
+ case OFPP_LOCAL_SHORT:
+ return LOCAL;
+ case OFPP_ANY_SHORT:
+ return ANY;
+ default:
+ // note: This means effectively : portNumber > OFPP_MAX_SHORT
+ // accounting for
+ // signedness of both portNumber and OFPP_MAX_SHORT (which is
+ // -256).
+ // Any unsigned integer value > OFPP_MAX_SHORT will be ]-256:0[
+ // when read signed
+ if (portNumber < 0 && portNumber > OFPP_MAX_SHORT)
+ throw new IllegalArgumentException("Unknown special port number: "
+ + portNumber);
+ return new OFPort(portNumber);
+ }
+ }
+
+ /** return the port number as a int32 */
+ public int getPortNumber() {
+ return portNumber;
+ }
+
+ /**
+ * return the port number as int16. Special ports as defined by the OpenFlow
+ * spec will be converted to their OpenFlow 1.0 equivalent. port numbers >=
+ * FF00 will cause a IllegalArgumentException to be thrown
+ *
+ * @throws IllegalArgumentException
+ * if a regular port number exceeds the maximum value in OF1.0
+ **/
+ public short getShortPortNumber() {
+
+ switch (portNumber) {
+ case OFPP_MAX_INT:
+ return OFPP_MAX_SHORT;
+ case OFPP_IN_PORT_INT:
+ return OFPP_IN_PORT_SHORT;
+ case OFPP_TABLE_INT:
+ return OFPP_TABLE_SHORT;
+ case OFPP_NORMAL_INT:
+ return OFPP_NORMAL_SHORT;
+ case OFPP_FLOOD_INT:
+ return OFPP_FLOOD_SHORT;
+ case OFPP_ALL_INT:
+ return OFPP_ALL_SHORT;
+ case OFPP_CONTROLLER_INT:
+ return OFPP_CONTROLLER_SHORT;
+ case OFPP_LOCAL_INT:
+ return OFPP_LOCAL_SHORT;
+ case OFPP_ANY_INT:
+ return OFPP_ANY_SHORT;
+
+ default:
+ if (portNumber >= OFPP_MAX_SHORT_UNSIGNED || portNumber < 0)
+ throw new IllegalArgumentException("32bit Port number "
+ + U32.f(portNumber)
+ + " cannot be represented as uint16 (OF1.0)");
+
+ return (short) portNumber;
+ }
+ }
+
+ @Override
+ public String toString() {
+ return Long.toString(U32.f(portNumber));
+ }
+
+ /** Extension of OFPort for named ports */
+ static class NamedPort extends OFPort {
+ private final String name;
+
+ NamedPort(final int portNo, final String name) {
+ super(portNo);
+ this.name = name;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ @Override
+ public String toString() {
+ return name;
+ }
+ }
+
+}
diff --git a/java_gen/pre-written/src/main/java/org/openflow/types/U16.java b/java_gen/pre-written/src/main/java/org/openflow/types/U16.java
new file mode 100644
index 0000000..5884adc
--- /dev/null
+++ b/java_gen/pre-written/src/main/java/org/openflow/types/U16.java
@@ -0,0 +1,28 @@
+/**
+ * Copyright (c) 2008 The Board of Trustees of The Leland Stanford Junior
+ * University
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may
+ * not use this file except in compliance with the License. You may obtain
+ * a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ **/
+
+package org.openflow.types;
+
+public class U16 {
+ public static int f(final short i) {
+ return i & 0xffff;
+ }
+
+ public static short t(final int l) {
+ return (short) l;
+ }
+}
diff --git a/java_gen/pre-written/src/main/java/org/openflow/types/U32.java b/java_gen/pre-written/src/main/java/org/openflow/types/U32.java
new file mode 100644
index 0000000..003f35d
--- /dev/null
+++ b/java_gen/pre-written/src/main/java/org/openflow/types/U32.java
@@ -0,0 +1,28 @@
+/**
+ * Copyright (c) 2008 The Board of Trustees of The Leland Stanford Junior
+ * University
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may
+ * not use this file except in compliance with the License. You may obtain
+ * a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ **/
+
+package org.openflow.types;
+
+public class U32 {
+ public static long f(final int i) {
+ return i & 0xffffffffL;
+ }
+
+ public static int t(final long l) {
+ return (int) l;
+ }
+}
diff --git a/java_gen/pre-written/src/main/java/org/openflow/types/U64.java b/java_gen/pre-written/src/main/java/org/openflow/types/U64.java
new file mode 100644
index 0000000..211c3ea
--- /dev/null
+++ b/java_gen/pre-written/src/main/java/org/openflow/types/U64.java
@@ -0,0 +1,57 @@
+/**
+ * Copyright (c) 2008 The Board of Trustees of The Leland Stanford Junior
+ * University
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may
+ * not use this file except in compliance with the License. You may obtain
+ * a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ **/
+
+package org.openflow.types;
+
+import java.math.BigInteger;
+
+public class U64 {
+ private final static BigInteger TWO_POWER_64 = BigInteger.valueOf(Long.MAX_VALUE).add(
+ BigInteger.valueOf(1));
+
+ private final long raw;
+
+ private U64(final long raw) {
+ this.raw = raw;
+ }
+
+ public static U64 of(final long raw) {
+ return new U64(raw);
+ }
+
+ public long getValue() {
+ return raw;
+ }
+
+ public BigInteger getBigInteger() {
+ return raw >= 0 ? BigInteger.valueOf(raw) : TWO_POWER_64.add(BigInteger
+ .valueOf(raw));
+ }
+
+ @Override
+ public String toString() {
+ return getBigInteger().toString();
+ }
+
+ public static BigInteger f(final long i) {
+ return new BigInteger(Long.toBinaryString(i), 2);
+ }
+
+ public static long t(final BigInteger l) {
+ return l.longValue();
+ }
+}
diff --git a/java_gen/pre-written/src/main/java/org/openflow/types/U8.java b/java_gen/pre-written/src/main/java/org/openflow/types/U8.java
new file mode 100644
index 0000000..1cdf0e5
--- /dev/null
+++ b/java_gen/pre-written/src/main/java/org/openflow/types/U8.java
@@ -0,0 +1,34 @@
+/**
+ * Copyright (c) 2008 The Board of Trustees of The Leland Stanford Junior
+ * University
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may
+ * not use this file except in compliance with the License. You may obtain
+ * a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ **/
+
+package org.openflow.types;
+
+public class U8 {
+ byte data;
+
+ public static short f(final byte i) {
+ return (short) (i & 0xff);
+ }
+
+ public static byte t(final short l) {
+ return (byte) l;
+ }
+
+ public byte getValue() {
+ return data;
+ }
+}
diff --git a/java_gen/pre-written/src/main/java/org/openflow/types/VlanPcp.java b/java_gen/pre-written/src/main/java/org/openflow/types/VlanPcp.java
new file mode 100644
index 0000000..bda2dc1
--- /dev/null
+++ b/java_gen/pre-written/src/main/java/org/openflow/types/VlanPcp.java
@@ -0,0 +1,5 @@
+package org.openflow.types;
+
+public class VlanPcp {
+
+}
diff --git a/java_gen/pre-written/src/main/java/org/openflow/types/VlanVid.java b/java_gen/pre-written/src/main/java/org/openflow/types/VlanVid.java
new file mode 100644
index 0000000..0f9eaf7
--- /dev/null
+++ b/java_gen/pre-written/src/main/java/org/openflow/types/VlanVid.java
@@ -0,0 +1,5 @@
+package org.openflow.types;
+
+public class VlanVid {
+
+}
diff --git a/java_gen/pre-written/src/main/java/org/openflow/types/VlanVidWithMask/VlanVidWithMask.java b/java_gen/pre-written/src/main/java/org/openflow/types/VlanVidWithMask/VlanVidWithMask.java
new file mode 100644
index 0000000..610b11c
--- /dev/null
+++ b/java_gen/pre-written/src/main/java/org/openflow/types/VlanVidWithMask/VlanVidWithMask.java
@@ -0,0 +1,5 @@
+package org.openflow.types.VlanVidWithMask;
+
+public class VlanVidWithMask {
+
+}