commit | 9dfb5129b244e83b6ee84deb5e5c562d8705f992 | [log] [tgz] |
---|---|---|
author | Laszlo Papp <laszlo.papp@hubersuhner.com> | Fri Jan 12 21:10:13 2018 +0000 |
committer | Laszlo Papp <laszlo.papp@hubersuhner.com> | Fri Jan 12 21:11:14 2018 +0000 |
tree | 7e7f37356f6c6e7e65e50e8e322409ba3320401d | |
parent | 7cf6037b2ce68dcd8291283e767d041501872fb3 [diff] |
Use port stats prop from OF 1.4 Change-Id: I8b4bb7dc7f0f77014e67c81f5e73e2afb50664ef
diff --git a/providers/openflow/device/src/main/java/org/onosproject/provider/of/device/impl/OpenFlowDeviceProvider.java b/providers/openflow/device/src/main/java/org/onosproject/provider/of/device/impl/OpenFlowDeviceProvider.java index 4f58bb1..ba691fd 100644 --- a/providers/openflow/device/src/main/java/org/onosproject/provider/of/device/impl/OpenFlowDeviceProvider.java +++ b/providers/openflow/device/src/main/java/org/onosproject/provider/of/device/impl/OpenFlowDeviceProvider.java
@@ -523,10 +523,12 @@ continue; } DefaultAnnotations.Builder annotations = DefaultAnnotations.builder(); - Optional<OFPortStatsPropOptical> optical = entry.getProperties().stream() + boolean propSupported = entry.getVersion().getWireVersion() >= OFVersion.OF_14.getWireVersion(); + Optional<OFPortStatsPropOptical> optical = propSupported ? + entry.getProperties().stream() .filter(OFPortStatsPropOptical.class::isInstance) .map(OFPortStatsPropOptical.class::cast) - .findAny(); + .findAny() : Optional.empty(); if (optical.isPresent()) { long flags = optical.get().getFlags();