Improved LinkInfo handling for ONOS
* LinkInfo class is now immutable and uses primitive types
* Removed logic to check STP state of ports. ONOS will not operate in
networks using STP.
* Cleaned up LinkInfo port state update logic to be clearer. We still
maintain the port states in LinkInfo, though they are not used right now.
* Removed the port updates that were sent by the link discovery module.
ONOS does not use these, port updates are sent directly from the switch
manager.
Change-Id: Icd2995de404948fa85b9e6852652bd4389d7cab8
diff --git a/src/main/java/net/onrc/onos/core/linkdiscovery/Link.java b/src/main/java/net/onrc/onos/core/linkdiscovery/Link.java
index 187e8b7..db67cd5 100644
--- a/src/main/java/net/onrc/onos/core/linkdiscovery/Link.java
+++ b/src/main/java/net/onrc/onos/core/linkdiscovery/Link.java
@@ -70,6 +70,14 @@
return dstPort;
}
+ public boolean isSrcPort(NodePortTuple npt) {
+ return npt.getNodeId() == src && npt.getPortId() == srcPort;
+ }
+
+ public boolean isDstPort(NodePortTuple npt) {
+ return npt.getNodeId() == dst && npt.getPortId() == dstPort;
+ }
+
@Override
public int hashCode() {
final int prime = 31;