add more supporting types
diff --git a/.gitignore b/.gitignore
index 9712e8f..c0b10be 100644
--- a/.gitignore
+++ b/.gitignore
@@ -11,3 +11,4 @@
.*.swo
*.cache
openflowj-loxi
+/bin
diff --git a/java_gen/pre-written/src/main/java/org/projectfloodlight/openflow/types/ClassId.java b/java_gen/pre-written/src/main/java/org/projectfloodlight/openflow/types/ClassId.java
new file mode 100644
index 0000000..418ec9f
--- /dev/null
+++ b/java_gen/pre-written/src/main/java/org/projectfloodlight/openflow/types/ClassId.java
@@ -0,0 +1,61 @@
+package org.projectfloodlight.openflow.types;
+
+import org.projectfloodlight.openflow.annotations.Immutable;
+
+@Immutable
+public class ClassId implements OFValueType<ClassId> {
+ static final int LENGTH = 4;
+ private final int rawValue;
+
+ public static final ClassId NO_ClassId = ClassId.of(0xFFFFFFFF);
+ public static final ClassId FULL_MASK = ClassId.of(0x00000000);
+
+ private ClassId(final int rawValue) {
+ this.rawValue = rawValue;
+ }
+
+ public static ClassId of(final int raw) {
+ return new ClassId(raw);
+ }
+
+ public int getInt() {
+ return rawValue;
+ }
+
+ @Override
+ public int getLength() {
+ return LENGTH;
+ }
+
+ @Override
+ public int hashCode() {
+ final int prime = 31;
+ int result = 1;
+ result = prime * result + rawValue;
+ return result;
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj)
+ return true;
+ if (obj == null)
+ return false;
+ if (getClass() != obj.getClass())
+ return false;
+ ClassId other = (ClassId) obj;
+ if (rawValue != other.rawValue)
+ return false;
+ return true;
+ }
+
+ @Override
+ public String toString() {
+ return Integer.toString(rawValue);
+ }
+
+ @Override
+ public ClassId applyMask(ClassId mask) {
+ return ClassId.of(this.rawValue & mask.rawValue);
+ }
+}
diff --git a/java_gen/pre-written/src/main/java/org/projectfloodlight/openflow/types/L2MulticastId.java b/java_gen/pre-written/src/main/java/org/projectfloodlight/openflow/types/L2MulticastId.java
new file mode 100644
index 0000000..ff69aed
--- /dev/null
+++ b/java_gen/pre-written/src/main/java/org/projectfloodlight/openflow/types/L2MulticastId.java
@@ -0,0 +1,61 @@
+package org.projectfloodlight.openflow.types;
+
+import org.projectfloodlight.openflow.annotations.Immutable;
+
+@Immutable
+public class L2MulticastId implements OFValueType<L2MulticastId> {
+ static final int LENGTH = 4;
+ private final int rawValue;
+
+ public static final L2MulticastId NO_ClassId = L2MulticastId.of(0xFFFFFFFF);
+ public static final L2MulticastId FULL_MASK = L2MulticastId.of(0x00000000);
+
+ private L2MulticastId(final int rawValue) {
+ this.rawValue = rawValue;
+ }
+
+ public static L2MulticastId of(final int raw) {
+ return new L2MulticastId(raw);
+ }
+
+ public int getInt() {
+ return rawValue;
+ }
+
+ @Override
+ public int getLength() {
+ return LENGTH;
+ }
+
+ @Override
+ public int hashCode() {
+ final int prime = 31;
+ int result = 1;
+ result = prime * result + rawValue;
+ return result;
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj)
+ return true;
+ if (obj == null)
+ return false;
+ if (getClass() != obj.getClass())
+ return false;
+ L2MulticastId other = (L2MulticastId) obj;
+ if (rawValue != other.rawValue)
+ return false;
+ return true;
+ }
+
+ @Override
+ public String toString() {
+ return Integer.toString(rawValue);
+ }
+
+ @Override
+ public L2MulticastId applyMask(L2MulticastId mask) {
+ return L2MulticastId.of(this.rawValue & mask.rawValue);
+ }
+}
diff --git a/java_gen/pre-written/src/main/java/org/projectfloodlight/openflow/types/LagId.java b/java_gen/pre-written/src/main/java/org/projectfloodlight/openflow/types/LagId.java
new file mode 100644
index 0000000..76c7011
--- /dev/null
+++ b/java_gen/pre-written/src/main/java/org/projectfloodlight/openflow/types/LagId.java
@@ -0,0 +1,70 @@
+package org.projectfloodlight.openflow.types;
+
+import org.jboss.netty.buffer.ChannelBuffer;
+import org.projectfloodlight.openflow.annotations.Immutable;
+
+@Immutable
+public class LagId implements OFValueType<LagId> {
+ static final int LENGTH = 4;
+ private final int rawValue;
+
+ public static final LagId NO_ClassId = LagId.of(0xFFFFFFFF);
+ public static final LagId FULL_MASK = LagId.of(0x00000000);
+
+ private LagId(final int rawValue) {
+ this.rawValue = rawValue;
+ }
+
+ public static LagId of(final int raw) {
+ return new LagId(raw);
+ }
+
+ public int getInt() {
+ return rawValue;
+ }
+
+ @Override
+ public int getLength() {
+ return LENGTH;
+ }
+
+ @Override
+ public int hashCode() {
+ final int prime = 31;
+ int result = 1;
+ result = prime * result + rawValue;
+ return result;
+ }
+
+ @Override
+ public String toString() {
+ return Integer.toString(rawValue);
+ }
+
+ @Override
+ public boolean equals(final Object obj) {
+ if (this == obj)
+ return true;
+ if (obj == null)
+ return false;
+ if (getClass() != obj.getClass())
+ return false;
+ LagId other = (LagId) obj;
+ if (rawValue != other.rawValue)
+ return false;
+ return true;
+ }
+
+ @Override
+ public LagId applyMask(LagId mask) {
+ return LagId.of(this.rawValue & mask.rawValue);
+ }
+
+ public void write4Bytes(ChannelBuffer c) {
+ c.writeInt(rawValue);
+ }
+
+ public static LagId read4Bytes(ChannelBuffer c) {
+ return LagId.of(c.readInt());
+ }
+}
diff --git a/java_gen/pre-written/src/main/java/org/projectfloodlight/openflow/types/PortType.java b/java_gen/pre-written/src/main/java/org/projectfloodlight/openflow/types/PortType.java
new file mode 100644
index 0000000..245c321
--- /dev/null
+++ b/java_gen/pre-written/src/main/java/org/projectfloodlight/openflow/types/PortType.java
@@ -0,0 +1,59 @@
+package org.projectfloodlight.openflow.types;
+
+import org.jboss.netty.buffer.ChannelBuffer;
+import org.projectfloodlight.openflow.exceptions.OFParseError;
+import org.projectfloodlight.openflow.annotations.Immutable;
+
+@Immutable
+public enum PortType implements OFValueType<PortType> {
+ PHYSICA((byte)0),
+ LAG((byte)1);
+
+ private final byte type;
+ static final int LENGTH = 1;
+
+ public static final PortType NO_MASK = PortType.of((byte)0xFF);
+ public static final PortType FULL_MASK = PortType.of((byte)0x00);
+
+ private PortType(byte type) {
+ this.type = type;
+ }
+
+ public static PortType of(byte type) {
+ switch (type) {
+ case 0:
+ return PHYSICA;
+ case 1:
+ return LAG;
+ default:
+ throw new IllegalArgumentException("Illegal Port Type: " + type);
+ }
+ }
+
+ @Override
+ public int getLength() {
+ return LENGTH;
+ }
+
+ @Override
+ public String toString() {
+ return Integer.toHexString(type);
+ }
+
+ @Override
+ public PortType applyMask(PortType mask) {
+ return PortType.of((byte)(this.type & mask.type));
+ }
+
+ public void writeByte(ChannelBuffer c) {
+ c.writeByte(this.type);
+ }
+
+ public static PortType readByte(ChannelBuffer c) throws OFParseError {
+ return PortType.of((byte)(c.readUnsignedByte()));
+ }
+
+ public byte getPortType() {
+ return type;
+ }
+}
diff --git a/java_gen/pre-written/src/main/java/org/projectfloodlight/openflow/types/Priority.java b/java_gen/pre-written/src/main/java/org/projectfloodlight/openflow/types/Priority.java
new file mode 100644
index 0000000..5f86cea
--- /dev/null
+++ b/java_gen/pre-written/src/main/java/org/projectfloodlight/openflow/types/Priority.java
@@ -0,0 +1,61 @@
+package org.projectfloodlight.openflow.types;
+
+import org.projectfloodlight.openflow.annotations.Immutable;
+
+@Immutable
+public class Priority implements OFValueType<Priority> {
+ static final int LENGTH = 4;
+ private final int rawValue;
+
+ public static final Priority NO_ClassId = Priority.of(0xFFFFFFFF);
+ public static final Priority FULL_MASK = Priority.of(0x00000000);
+
+ private Priority(final int rawValue) {
+ this.rawValue = rawValue;
+ }
+
+ public static Priority of(final int raw) {
+ return new Priority(raw);
+ }
+
+ public int getInt() {
+ return rawValue;
+ }
+
+ @Override
+ public int getLength() {
+ return LENGTH;
+ }
+
+ @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;
+ Priority other = (Priority) obj;
+ if (rawValue != other.rawValue)
+ return false;
+ return true;
+ }
+
+ @Override
+ public String toString() {
+ return Integer.toString(rawValue);
+ }
+
+ @Override
+ public Priority applyMask(Priority mask) {
+ return Priority.of(this.rawValue & mask.rawValue);
+ }
+}
diff --git a/java_gen/pre-written/src/main/java/org/projectfloodlight/openflow/types/VRF.java b/java_gen/pre-written/src/main/java/org/projectfloodlight/openflow/types/VRF.java
new file mode 100644
index 0000000..641f40a
--- /dev/null
+++ b/java_gen/pre-written/src/main/java/org/projectfloodlight/openflow/types/VRF.java
@@ -0,0 +1,70 @@
+package org.projectfloodlight.openflow.types;
+
+import org.jboss.netty.buffer.ChannelBuffer;
+import org.projectfloodlight.openflow.annotations.Immutable;
+
+@Immutable
+public class VRF implements OFValueType<VRF> {
+ static final int LENGTH = 4;
+ private final int rawValue;
+
+ public static final VRF NO_MASK = VRF.of(0xFFFFFFFF);
+ public static final VRF FULL_MASK = VRF.of(0x00000000);
+
+ private VRF(final int rawValue) {
+ this.rawValue = rawValue;
+ }
+
+ public static VRF of(final int raw) {
+ return new VRF(raw);
+ }
+
+ public int getInt() {
+ return rawValue;
+ }
+
+ @Override
+ public int getLength() {
+ return LENGTH;
+ }
+
+ @Override
+ public int hashCode() {
+ final int prime = 31;
+ int result = 1;
+ result = prime * result + rawValue;
+ return result;
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj)
+ return true;
+ if (obj == null)
+ return false;
+ if (getClass() != obj.getClass())
+ return false;
+ VRF other = (VRF) obj;
+ if (rawValue != other.rawValue)
+ return false;
+ return true;
+ }
+
+ @Override
+ public String toString() {
+ return Integer.toString(rawValue);
+ }
+
+ public void write4Bytes(ChannelBuffer c) {
+ c.writeInt(rawValue);
+ }
+
+ public static VRF read4Bytes(ChannelBuffer c) {
+ return VRF.of(c.readInt());
+ }
+
+ @Override
+ public VRF applyMask(VRF mask) {
+ return VRF.of(this.rawValue & mask.rawValue);
+ }
+}