import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+import org.opendaylight.controller.sal.connection.IPluginOutConnectionService;
import org.opendaylight.controller.sal.core.ConstructionException;
import org.opendaylight.controller.sal.core.ContainerFlow;
import org.opendaylight.controller.sal.core.IContainerListener;
private ConcurrentMap<String, List<ContainerFlow>> container2FlowSpecs = new ConcurrentHashMap<String, List<ContainerFlow>>();
// Track local data packet listener
private List<IDataPacketListen> iDataPacketListen = new CopyOnWriteArrayList<IDataPacketListen>();
+ private IPluginOutConnectionService connectionOutService;
void setIDataPacketListen(IDataPacketListen s) {
if (this.iDataPacketListen != null) {
}
}
+ void setIPluginOutConnectionService(IPluginOutConnectionService s) {
+ connectionOutService = s;
+ }
+
+ void unsetIPluginOutConnectionService(IPluginOutConnectionService s) {
+ if (connectionOutService == s) {
+ connectionOutService = null;
+ }
+ }
+
/**
* Function called by the dependency manager when all the required
* dependencies are satisfied
new Object[] { sw, msg, this.pluginOutDataPacketServices });
return;
}
+
+ Long ofSwitchID = Long.valueOf(sw.getId());
+ try {
+ Node n = new Node(Node.NodeIDType.OPENFLOW, ofSwitchID);
+ if (!connectionOutService.isLocal(n)) {
+ logger.debug("Connection service refused DataPacketMuxDemux receive {} {}", sw, msg);
+ return;
+ }
+ }
+ catch (Exception e) {
+ return;
+ }
+
if (msg instanceof OFPacketIn) {
OFPacketIn ofPacket = (OFPacketIn) msg;
- Long ofSwitchID = Long.valueOf(sw.getId());
Short ofPortID = Short.valueOf(ofPacket.getInPort());
try {
return;
}
+ if (!connectionOutService.isLocal(outPort.getNode())) {
+ logger.debug("data packets will not be sent to {} in a non-master controller", outPort.toString());
+ return;
+ }
+
+
if (!outPort.getType().equals(
NodeConnector.NodeConnectorIDType.OPENFLOW)) {
// The output Port is not of type OpenFlow