aboutsummaryrefslogtreecommitdiffstats
path: root/framework/src/onos/providers/openflow/device/src/main/java/org
diff options
context:
space:
mode:
authorAshlee Young <ashlee@wildernessvoice.com>2015-12-06 07:15:03 -0800
committerAshlee Young <ashlee@wildernessvoice.com>2015-12-08 10:55:21 -0800
commit76dc892491948adae5e5e62cf94448967e8d865b (patch)
tree7a33ef05cc583946db21edad627060f280a53549 /framework/src/onos/providers/openflow/device/src/main/java/org
parentd333c63fdec8b064184b0a26f8d777f267577fde (diff)
Fixes bad POM file with ONOS commit 8c68536972f63069c263635c9d9f4f31d7f3e9a2
Change-Id: I7adb5a2d3738d53dbc41db7577768b0e7ced5450 Signed-off-by: Ashlee Young <ashlee@wildernessvoice.com>
Diffstat (limited to 'framework/src/onos/providers/openflow/device/src/main/java/org')
-rw-r--r--framework/src/onos/providers/openflow/device/src/main/java/org/onosproject/provider/of/device/impl/OpenFlowDeviceProvider.java21
1 files changed, 12 insertions, 9 deletions
diff --git a/framework/src/onos/providers/openflow/device/src/main/java/org/onosproject/provider/of/device/impl/OpenFlowDeviceProvider.java b/framework/src/onos/providers/openflow/device/src/main/java/org/onosproject/provider/of/device/impl/OpenFlowDeviceProvider.java
index a7e334f4..4ceb425c 100644
--- a/framework/src/onos/providers/openflow/device/src/main/java/org/onosproject/provider/of/device/impl/OpenFlowDeviceProvider.java
+++ b/framework/src/onos/providers/openflow/device/src/main/java/org/onosproject/provider/of/device/impl/OpenFlowDeviceProvider.java
@@ -516,7 +516,7 @@ public class OpenFlowDeviceProvider extends AbstractProvider implements DevicePr
PortNumber portNo = PortNumber.portNumber(port.getPortNo().getPortNumber());
boolean enabled = !port.getState().contains(OFPortState.LINK_DOWN)
&& !port.getConfig().contains(OFPortConfig.PORT_DOWN);
- SparseAnnotations annotations = makePortNameAnnotation(port.getName());
+ SparseAnnotations annotations = makePortAnnotation(port.getName(), port.getHwAddr().toString());
OFExpPortDescPropOpticalTransport firstProp = port.getProperties().get(0);
OFPortOpticalTransportSignalType sigType = firstProp.getPortSignalType();
@@ -560,16 +560,19 @@ public class OpenFlowDeviceProvider extends AbstractProvider implements DevicePr
/**
* Creates an annotation for the port name if one is available.
*
- * @param port description of the port
+ * @param portName the port name
+ * @param portMac the port mac
* @return annotation containing the port name if one is found,
* null otherwise
*/
- private SparseAnnotations makePortNameAnnotation(String port) {
+ private SparseAnnotations makePortAnnotation(String portName, String portMac) {
SparseAnnotations annotations = null;
- String portName = Strings.emptyToNull(port);
+ String pName = Strings.emptyToNull(portName);
+ String pMac = Strings.emptyToNull(portMac);
if (portName != null) {
annotations = DefaultAnnotations.builder()
- .set(AnnotationKeys.PORT_NAME, portName).build();
+ .set(AnnotationKeys.PORT_NAME, pName)
+ .set(AnnotationKeys.PORT_MAC, pMac).build();
}
return annotations;
}
@@ -586,7 +589,7 @@ public class OpenFlowDeviceProvider extends AbstractProvider implements DevicePr
!port.getState().contains(OFPortState.LINK_DOWN) &&
!port.getConfig().contains(OFPortConfig.PORT_DOWN);
Port.Type type = port.getCurr().contains(OFPortFeatures.PF_FIBER) ? FIBER : COPPER;
- SparseAnnotations annotations = makePortNameAnnotation(port.getName());
+ SparseAnnotations annotations = makePortAnnotation(port.getName(), port.getHwAddr().toString());
return new DefaultPortDescription(portNo, enabled, type,
portSpeed(port), annotations);
}
@@ -607,7 +610,7 @@ public class OpenFlowDeviceProvider extends AbstractProvider implements DevicePr
boolean enabled = !port.getState().contains(OFPortState.LINK_DOWN)
&& !port.getConfig().contains(OFPortConfig.PORT_DOWN);
- SparseAnnotations annotations = makePortNameAnnotation(port.getName());
+ SparseAnnotations annotations = makePortAnnotation(port.getName(), port.getHwAddr().toString());
if (port.getVersion() == OFVersion.OF_13
&& ptype == PortDescPropertyType.OPTICAL_TRANSPORT) {
@@ -649,7 +652,7 @@ public class OpenFlowDeviceProvider extends AbstractProvider implements DevicePr
// FIXME when Calient OF agent reports port status
boolean enabled = true;
- SparseAnnotations annotations = makePortNameAnnotation(port.getName());
+ SparseAnnotations annotations = makePortAnnotation(port.getName(), port.getHwAddr().toString());
// S160 data sheet
// Wavelength range: 1260 - 1630 nm, grid is irrelevant for this type of switch
@@ -664,7 +667,7 @@ public class OpenFlowDeviceProvider extends AbstractProvider implements DevicePr
} else {
PortNumber portNo = PortNumber.portNumber(port.getPortNo().getPortNumber());
Port.Type type = port.getCurr().contains(OFPortFeatures.PF_FIBER) ? FIBER : COPPER;
- SparseAnnotations annotations = makePortNameAnnotation(port.getName());
+ SparseAnnotations annotations = makePortAnnotation(port.getName(), port.getHwAddr().toString());
return new DefaultPortDescription(portNo, false, type,
portSpeed(port), annotations);
}