+
+ @Override
+ public void descriptionRefreshed(Long switchId,
+ OFDescriptionStatistics descriptionStats) {
+ Node node;
+ try {
+ node = new Node(NodeIDType.OPENFLOW, switchId);
+ } catch (ConstructionException e) {
+ logger.error("{}", e.getMessage());
+ return;
+ }
+
+ Set<Property> properties = new HashSet<Property>(1);
+ Description desc = new Description(
+ descriptionStats.getDatapathDescription());
+ properties.add(desc);
+
+ // Notify all internal and external listeners
+ notifyInventoryShimListener(node, UpdateType.CHANGED, properties);
+ }
+
+ private byte[] deriveMacAddress(long dpid) {
+ byte[] mac = new byte[] { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
+
+ for (short i = 0; i < 6; i++) {
+ mac[5 - i] = (byte) dpid;
+ dpid >>= 8;
+ }
+
+ return mac;
+ }