Fixes to port map
diff --git a/java_gen/pre-written/src/main/java/org/projectfloodlight/openflow/types/OFPortMap.java b/java_gen/pre-written/src/main/java/org/projectfloodlight/openflow/types/OFPortMap.java
index 0454d39..8ec056e 100644
--- a/java_gen/pre-written/src/main/java/org/projectfloodlight/openflow/types/OFPortMap.java
+++ b/java_gen/pre-written/src/main/java/org/projectfloodlight/openflow/types/OFPortMap.java
@@ -1,14 +1,14 @@
package org.projectfloodlight.openflow.types;
-public class OFPortMap extends Masked<OFPortBitmap> {
+public class OFPortMap extends Masked<OFBitMask128> {
- private OFPortMap(OFPortBitmap mask) {
- super(OFPortBitmap.NONE, mask);
+ private OFPortMap(OFBitMask128 mask) {
+ super(OFBitMask128.NONE, mask);
}
public boolean isOn(OFPort port) {
- return this.mask.isOn(port);
+ return !(this.mask.isOn(port.getPortNumber()));
}
public static OFPortMap ofPorts(OFPort... ports) {
@@ -33,19 +33,19 @@
}
public static class Builder {
- private long raw1, raw2;
+ private long raw1 = -1, raw2 = -1;
public Builder() {
}
public boolean isOn(OFPort port) {
- return OFPortBitmap.isBitOn(raw1, raw2, port.getPortNumber());
+ return !(OFBitMask128.isBitOn(raw1, raw2, port.getPortNumber()));
}
- public Builder set(OFPort port) {
+ public Builder unset(OFPort port) {
int bit = port.getPortNumber();
- if (bit < 0 || bit >= 128)
+ if (bit < 0 || bit >= 127) // MAX PORT IS 127
throw new IndexOutOfBoundsException("Port number is out of bounds");
if (bit < 64) {
raw2 |= ((long)1 << bit);
@@ -55,9 +55,9 @@
return this;
}
- public Builder unset(OFPort port) {
+ public Builder set(OFPort port) {
int bit = port.getPortNumber();
- if (bit < 0 || bit >= 128)
+ if (bit < 0 || bit >= 127)
throw new IndexOutOfBoundsException("Port number is out of bounds");
if (bit < 64) {
raw2 &= ~((long)1 << bit);
@@ -68,7 +68,7 @@
}
public OFPortMap build() {
- return new OFPortMap(OFPortBitmap.of(raw1, raw2));
+ return new OFPortMap(OFBitMask128.of(raw1, raw2));
}
}