unsigned PortNumber
PortNumber class update
- internal representation now uses int
- toString() now converts the value as unsigned integer
- renamed value() to shortValue()
- added value() method returning port number as unsigned long
- added constructor from String
- JSON serialization now uses the new value(), so that special handling for
unsigned integer is not required
Update classes using PortNumber
- Replaced value() calls with new value(), when the return value was
converted to long immediately.
- toString() result may change if the object contained PortNumber.
- e.g., FlowEntryAction, FlowEntry, SwitchPort, ...
Change-Id: I0b1f8aa92208e165b6113c8dd6954076c0513167
diff --git a/src/main/java/net/onrc/onos/core/flowprogrammer/FlowPusher.java b/src/main/java/net/onrc/onos/core/flowprogrammer/FlowPusher.java
index 1a7cae8..2c64ec1 100644
--- a/src/main/java/net/onrc/onos/core/flowprogrammer/FlowPusher.java
+++ b/src/main/java/net/onrc/onos/core/flowprogrammer/FlowPusher.java
@@ -667,7 +667,7 @@
// Match the Incoming Port
PortNumber matchInPort = flowEntryMatch.inPort();
if (matchInPort != null) {
- match.setInputPort(matchInPort.value());
+ match.setInputPort(matchInPort.shortValue());
match.setWildcards(match.getWildcards() & ~OFMatch.OFPFW_IN_PORT);
}
@@ -792,10 +792,10 @@
ActionEnqueue actionEnqueue = action.actionEnqueue();
if (actionOutput != null) {
- actionOutputPort.portNumber = actionOutput.port().value();
+ actionOutputPort.portNumber = actionOutput.port().shortValue();
// XXX: The max length is hard-coded for now
OFActionOutput ofa = new OFActionOutput(actionOutput.port()
- .value(), (short) 0xffff);
+ .shortValue(), (short) 0xffff);
openFlowActions.add(ofa);
}
@@ -862,7 +862,7 @@
if (actionEnqueue != null) {
OFActionEnqueue ofa =
- new OFActionEnqueue(actionEnqueue.port().value(), actionEnqueue.queueId());
+ new OFActionEnqueue(actionEnqueue.port().shortValue(), actionEnqueue.queueId());
openFlowActions.add(ofa);
}
}