From 65bd5e48243633aef2dafd42bd9476d6b211c990 Mon Sep 17 00:00:00 2001 From: Rob Adams <rob.adams@bigswitch.com> Date: Fri, 17 Feb 2012 19:43:30 -0800 Subject: [PATCH] Basic pinging working with new Device manager --- .../internal/DeviceManagerImpl.java | 46 ++++++++++--------- 1 file changed, 25 insertions(+), 21 deletions(-) diff --git a/src/main/java/net/floodlightcontroller/devicemanager/internal/DeviceManagerImpl.java b/src/main/java/net/floodlightcontroller/devicemanager/internal/DeviceManagerImpl.java index 215efee51..f55f506c6 100755 --- a/src/main/java/net/floodlightcontroller/devicemanager/internal/DeviceManagerImpl.java +++ b/src/main/java/net/floodlightcontroller/devicemanager/internal/DeviceManagerImpl.java @@ -326,29 +326,33 @@ public class DeviceManagerImpl implements IDeviceManager, IOFMessageListener, // Find the device matching the destination from the entity // classes of the source. Entity dstEntity = getDestEntityFromPacket(eth); - Device dstDevice = findDeviceByEntity(dstEntity); - if (dstDevice == null) { - // This can only happen if we have attachment point - // key fields since attachment point information isn't - // available for destination devices. - /* - ArrayList<Device> candidates = new ArrayList<Device>(); - for (IEntityClass clazz : srcDevice.getEntityClasses()) { - Device c = findDeviceInClassByEntity(clazz, dstEntity); - if (c != null) - candidates.add(c); - } - if (candidates.size() == 1) { - dstDevice = candidates.get(0); - } else if (candidates.size() > 1) { - // ambiguous device. A higher-order component will need - // to deal with it by assigning priority - // XXX - TODO + if (dstEntity != null) { + Device dstDevice = findDeviceByEntity(dstEntity); + + if (dstDevice == null) { + // This can only happen if we have attachment point + // key fields since attachment point information isn't + // available for destination devices. + /* + ArrayList<Device> candidates = new ArrayList<Device>(); + for (IEntityClass clazz : srcDevice.getEntityClasses()) { + Device c = findDeviceInClassByEntity(clazz, dstEntity); + if (c != null) + candidates.add(c); + } + if (candidates.size() == 1) { + dstDevice = candidates.get(0); + } else if (candidates.size() > 1) { + // ambiguous device. A higher-order component will + // need to deal with it by assigning priority + // XXX - TODO + } + */ + } - */ + if (dstDevice != null) + fcStore.put(cntx, CONTEXT_DST_DEVICE, dstDevice); } - if (dstDevice != null) - fcStore.put(cntx, CONTEXT_DST_DEVICE, dstDevice); return Command.CONTINUE; -- GitLab