java_gen/prewritten: add 'ZERO/NONE' values to OFValueTypes
diff --git a/java_gen/pre-written/src/main/java/org/projectfloodlight/openflow/types/OFPort.java b/java_gen/pre-written/src/main/java/org/projectfloodlight/openflow/types/OFPort.java
index d65d0aa..db7bd5f 100644
--- a/java_gen/pre-written/src/main/java/org/projectfloodlight/openflow/types/OFPort.java
+++ b/java_gen/pre-written/src/main/java/org/projectfloodlight/openflow/types/OFPort.java
@@ -17,9 +17,10 @@
@Immutable
public class OFPort implements OFValueType<OFPort> {
static final int LENGTH = 4;
-
+
// 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_NONE_INT = 0x0;
private static final int OFPP_ANY_INT = 0xFFffFFff;
private static final int OFPP_LOCAL_INT = 0xFFffFFfe;
private static final int OFPP_CONTROLLER_INT = 0xFFffFFfd;
@@ -86,9 +87,12 @@
*/
public final static OFPort ANY = new NamedPort(OFPP_ANY_INT, "any");
+ /** port number 0, read of the wire, e.g, if not set */
+ public final static OFPort NONE = new NamedPort(OFPP_NONE_INT, "none");
+
public static final OFPort NO_MASK = OFPort.of(0xFFFFFFFF);
public static final OFPort FULL_MASK = OFPort.of(0x0);
-
+
/** cache of frequently used ports */
private static class PrecachedPort {
private final static OFPort p1 = new OFPort(1);
@@ -158,6 +162,8 @@
*/
public static OFPort ofInt(final int portNumber) {
switch (portNumber) {
+ case 0:
+ return NONE;
case 1:
return PrecachedPort.p1;
case 2:
@@ -300,6 +306,8 @@
*/
public static OFPort ofShort(final short portNumber) {
switch (portNumber) {
+ case 0:
+ return NONE;
case 1:
return PrecachedPort.p1;
case 2:
@@ -499,7 +507,7 @@
public int getLength() {
return LENGTH;
}
-
+
@Override
public boolean equals(Object obj) {
if (!(obj instanceof OFPort))