--- /dev/null
+/*
+ * Copyright (c) 2019 Ericsson India Global Services Pvt Ltd. and others. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+
+package org.opendaylight.openflowplugin.applications.frm;
+
+import com.google.common.util.concurrent.ListenableFuture;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNode;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.onf.bundle.service.rev170124.AddBundleMessagesOutput;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.onf.rev170124.BundleId;
+import org.opendaylight.yangtools.yang.binding.DataObject;
+import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
+import org.opendaylight.yangtools.yang.common.RpcResult;
+
+public interface BundleMessagesCommiter<D extends DataObject> {
+
+ /**
+ * Method removes DataObject which is identified by InstanceIdentifier from
+ * device.
+ *
+ * @param identifier
+ * - the whole path to DataObject
+ * @param del
+ * - DataObject for removing
+ * @param nodeIdent
+ * Node InstanceIdentifier
+ */
+ void remove(InstanceIdentifier<D> identifier, D del, InstanceIdentifier<FlowCapableNode> nodeIdent,
+ BundleId bundleId);
+
+ /**
+ * Method updates the original DataObject to the update DataObject in device.ForwardingRulesManager.java.
+ * Both are identified by same InstanceIdentifier.
+ *
+ * @param identifier
+ * - the whole path to DataObject
+ * @param original
+ * - original DataObject (for update)
+ * @param update
+ * - changed DataObject (contain updates)
+ * @param nodeIdent
+ * Node InstanceIdentifier
+ */
+ void update(InstanceIdentifier<D> identifier, D original, D update,
+ InstanceIdentifier<FlowCapableNode> nodeIdent, BundleId bundleId);
+
+ /**
+ * Method adds the DataObject which is identified by InstanceIdentifier to
+ * device.
+ *
+ * @param identifier
+ * - the whole path to new DataObject
+ * @param add
+ * - new DataObject
+ * @param nodeIdent
+ * Node InstanceIdentifier
+ * @return A future associated with RPC task. {@code null} is set to the future
+ * if this method does not invoke RPC.
+ */
+ ListenableFuture<RpcResult<AddBundleMessagesOutput>> add(InstanceIdentifier<D> identifier, D add,
+ InstanceIdentifier<FlowCapableNode> nodeIdent, BundleId bundleId);
+
+}
*/
ForwardingRulesCommiter<TableFeatures> getTableFeaturesCommiter();
+ /**
+ * Return BundleFlowListener instance.
+ *
+ * @return BundleFlowListener
+ */
+ BundleMessagesCommiter<Flow> getBundleFlowListener();
+
+ /**
+ * Return BundleGroupListener instance.
+ *
+ * @return BundleGroupListener
+ */
+ BundleMessagesCommiter<Group> getBundleGroupListener();
+
/**
* Check if reconciliation is disabled by user.
*
import java.util.List;
import java.util.Optional;
import java.util.concurrent.ExecutionException;
-import java.util.concurrent.Future;
import org.opendaylight.infrautils.utils.concurrent.LoggingFutures;
import org.opendaylight.mdsal.binding.api.ReadTransaction;
import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
+import org.opendaylight.openflowplugin.applications.frm.BundleMessagesCommiter;
import org.opendaylight.openflowplugin.applications.frm.ForwardingRulesManager;
import org.opendaylight.openflowplugin.applications.frm.NodeConfigurator;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Uri;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-public class BundleFlowForwarder {
+public class BundleFlowForwarder implements BundleMessagesCommiter<Flow> {
private static final Logger LOG = LoggerFactory.getLogger(BundleFlowForwarder.class);
private static final BundleFlags BUNDLE_FLAGS = new BundleFlags(true, true);
});
}
- public Future<? extends RpcResult<?>> add(final InstanceIdentifier<Flow> identifier, final Flow flow,
+ @Override
+ public ListenableFuture<RpcResult<AddBundleMessagesOutput>> add(final InstanceIdentifier<Flow> identifier,
+ final Flow flow,
final InstanceIdentifier<FlowCapableNode> nodeIdent, final BundleId bundleId) {
final NodeId nodeId = getNodeIdFromNodeIdentifier(nodeIdent);
return nodeConfigurator.enqueueJob(nodeId.getValue(), () -> {
import java.util.ArrayList;
import java.util.List;
import org.opendaylight.infrautils.utils.concurrent.LoggingFutures;
+import org.opendaylight.openflowplugin.applications.frm.BundleMessagesCommiter;
import org.opendaylight.openflowplugin.applications.frm.ForwardingRulesManager;
import org.opendaylight.openflowplugin.applications.frm.NodeConfigurator;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNode;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-public class BundleGroupForwarder {
+public class BundleGroupForwarder implements BundleMessagesCommiter<Group> {
private static final Logger LOG = LoggerFactory.getLogger(BundleGroupForwarder.class);
private static final BundleFlags BUNDLE_FLAGS = new BundleFlags(true, true);
});
}
- public ListenableFuture<? extends RpcResult<?>> add(final InstanceIdentifier<Group> identifier, final Group group,
- final InstanceIdentifier<FlowCapableNode> nodeIdent, final BundleId bundleId) {
+ @Override
+ public ListenableFuture<RpcResult<AddBundleMessagesOutput>> add(final InstanceIdentifier<Group> identifier,
+ final Group group, final InstanceIdentifier<FlowCapableNode> nodeIdent, final BundleId bundleId) {
final NodeId nodeId = getNodeIdFromNodeIdentifier(nodeIdent);
final Long groupId = group.getGroupId().getValue();
return nodeConfigurator.enqueueJob(nodeId.getValue(), () -> {
private static final String GROUP_EXISTS_IN_DEVICE_ERROR = "GROUPEXISTS";
private ListenerRegistration<FlowForwarder> listenerRegistration;
- private final BundleFlowForwarder bundleFlowForwarder;
public FlowForwarder(final ForwardingRulesManager manager, final DataBroker db) {
super(manager, db);
- bundleFlowForwarder = new BundleFlowForwarder(manager);
}
@Override
if (tableIdValidationPrecondition(tableKey, removeDataObj)) {
BundleId bundleId = getActiveBundle(nodeIdent, provider);
if (bundleId != null) {
- bundleFlowForwarder.remove(identifier, removeDataObj, nodeIdent, bundleId);
+ provider.getBundleFlowListener().remove(identifier, removeDataObj, nodeIdent, bundleId);
} else {
final RemoveFlowInputBuilder builder = new RemoveFlowInputBuilder(removeDataObj);
builder.setFlowRef(new FlowRef(identifier));
if (tableIdValidationPrecondition(tableKey, update)) {
BundleId bundleId = getActiveBundle(nodeIdent, provider);
if (bundleId != null) {
- bundleFlowForwarder.update(identifier, original, update, nodeIdent, bundleId);
+ provider.getBundleFlowListener().update(identifier, original, update, nodeIdent, bundleId);
} else {
final NodeId nodeId = getNodeIdFromNodeIdentifier(nodeIdent);
nodeConfigurator.enqueueJob(nodeId.getValue(), () -> {
if (tableIdValidationPrecondition(tableKey, addDataObj)) {
BundleId bundleId = getActiveBundle(nodeIdent, provider);
if (bundleId != null) {
- return bundleFlowForwarder.add(identifier, addDataObj, nodeIdent, bundleId);
+ return provider.getBundleFlowListener().add(identifier, addDataObj, nodeIdent, bundleId);
} else {
final NodeId nodeId = getNodeIdFromNodeIdentifier(nodeIdent);
nodeConfigurator.enqueueJob(nodeId.getValue(), () -> {
import org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.groups.GroupKey;
import org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.groups.StaleGroup;
import org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.groups.StaleGroupKey;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeId;
import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeRef;
import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node;
import org.opendaylight.yang.gen.v1.urn.opendaylight.meter.types.rev130918.MeterId;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.onf.bundle.service.rev170124.add.bundle.messages.input.MessagesBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.onf.bundle.service.rev170124.add.bundle.messages.input.messages.Message;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.onf.bundle.service.rev170124.add.bundle.messages.input.messages.MessageBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.onf.bundle.service.rev170124.bundle.inner.message.grouping.bundle.inner.message.BundleAddFlowCaseBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.onf.bundle.service.rev170124.bundle.inner.message.grouping.bundle.inner.message.BundleAddGroupCaseBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.onf.bundle.service.rev170124.bundle.inner.message.grouping.bundle.inner.message.BundleRemoveFlowCaseBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.onf.bundle.service.rev170124.bundle.inner.message.grouping.bundle.inner.message.BundleRemoveGroupCaseBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.onf.bundle.service.rev170124.bundle.inner.message.grouping.bundle.inner.message.bundle.add.flow._case.AddFlowCaseDataBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.onf.bundle.service.rev170124.bundle.inner.message.grouping.bundle.inner.message.bundle.add.group._case.AddGroupCaseDataBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.onf.bundle.service.rev170124.bundle.inner.message.grouping.bundle.inner.message.bundle.remove.flow._case.RemoveFlowCaseDataBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.onf.bundle.service.rev170124.bundle.inner.message.grouping.bundle.inner.message.bundle.remove.group._case.RemoveGroupCaseDataBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.onf.rev170124.BundleControlType;
.setBundleId(bundleIdValue).setFlags(BUNDLE_FLAGS)
.setType(BundleControlType.ONFBCTCOMMITREQUEST).build();
- final AddBundleMessagesInput addBundleMessagesInput = new AddBundleMessagesInputBuilder()
+ final AddBundleMessagesInput deleteAllFlowGroupsInput = new AddBundleMessagesInputBuilder()
.setNode(nodeRef).setBundleId(bundleIdValue).setFlags(BUNDLE_FLAGS)
- .setMessages(createMessages(nodeRef, flowNode)).build();
+ .setMessages(createMessages(nodeRef)).build();
+ LOG.debug("Closing openflow bundle for device {}", dpnId);
/* Close previously opened bundle on the openflow switch if any */
ListenableFuture<RpcResult<ControlBundleOutput>> closeBundle
= salBundleService.controlBundle(closeBundleInput);
MoreExecutors.directExecutor());
/* Push groups and flows via bundle add messages */
- ListenableFuture<RpcResult<AddBundleMessagesOutput>> addBundleMessagesFuture
+ ListenableFuture<RpcResult<AddBundleMessagesOutput>> deleteAllFlowGroupsFuture
= Futures.transformAsync(openBundle, rpcResult -> {
if (rpcResult.isSuccessful()) {
- return salBundleService.addBundleMessages(addBundleMessagesInput);
+ return salBundleService.addBundleMessages(deleteAllFlowGroupsInput);
}
return Futures.immediateFuture(null);
}, MoreExecutors.directExecutor());
- /* Commit the bundle on the openflow switch */
- ListenableFuture<RpcResult<ControlBundleOutput>> commitBundleFuture
- = Futures.transformAsync(addBundleMessagesFuture, rpcResult -> {
+ /* Push flows and groups via bundle add messages */
+ Optional<FlowCapableNode> finalFlowNode = flowNode;
+ ListenableFuture<List<RpcResult<AddBundleMessagesOutput>>> addbundlesFuture
+ = Futures.transformAsync(deleteAllFlowGroupsFuture, rpcResult -> {
if (rpcResult.isSuccessful()) {
- return salBundleService.controlBundle(commitBundleInput);
+ LOG.debug("Adding delete all flow/group message is successful for device {}", dpnId);
+ return Futures.allAsList(addBundleMessages(finalFlowNode.get(), bundleIdValue,
+ nodeIdentity));
}
return Futures.immediateFuture(null);
}, MoreExecutors.directExecutor());
+ /* Commit the bundle on the openflow switch */
+ ListenableFuture<RpcResult<ControlBundleOutput>> commitBundleFuture
+ = Futures.transformAsync(addbundlesFuture, rpcResult ->
+ salBundleService.controlBundle(commitBundleInput), MoreExecutors.directExecutor());
+
/* Bundles not supported for meters */
List<Meter> meters = flowNode.get().getMeter() != null ? flowNode.get().getMeter()
: Collections.emptyList();
}
return Futures.immediateFuture(null);
}, MoreExecutors.directExecutor());
-
try {
- if (commitBundleFuture.get().isSuccessful()) {
+ RpcResult<ControlBundleOutput> bundleFuture = commitBundleFuture.get();
+ if (bundleFuture != null && bundleFuture.isSuccessful()) {
LOG.debug("Completing bundle based reconciliation for device ID:{}", dpnId);
OF_EVENT_LOG.debug("Bundle Reconciliation Finish, Node: {}", dpnId);
return true;
return false;
}
} catch (InterruptedException | ExecutionException e) {
- LOG.error("Error while doing bundle based reconciliation for device ID:{}", nodeIdentity);
+ LOG.error("Error while doing bundle based reconciliation for device ID:{}", dpnId);
return false;
}
}
return nodeIdent.child(StaleMeter.class, new StaleMeterKey(new MeterId(staleMeter.getMeterId())));
}
+ private List<ListenableFuture<RpcResult<AddBundleMessagesOutput>>> addBundleMessages(final FlowCapableNode flowNode,
+ final BundleId bundleIdValue,
+ final InstanceIdentifier<FlowCapableNode> nodeIdentity) {
+ List<ListenableFuture<RpcResult<AddBundleMessagesOutput>>> futureList = new ArrayList<>();
+ for (Group group : flowNode.nonnullGroup()) {
+ final KeyedInstanceIdentifier<Group, GroupKey> groupIdent = nodeIdentity.child(Group.class, group.key());
+ futureList.add(provider.getBundleGroupListener().add(groupIdent, group, nodeIdentity, bundleIdValue));
+ }
+
+ for (Table table : flowNode.nonnullTable()) {
+ final KeyedInstanceIdentifier<Table, TableKey> tableIdent = nodeIdentity.child(Table.class, table.key());
+ for (Flow flow : table.nonnullFlow()) {
+ final KeyedInstanceIdentifier<Flow, FlowKey> flowIdent = tableIdent.child(Flow.class, flow.key());
+ futureList.add(provider.getBundleFlowListener().add(flowIdent, flow, nodeIdentity, bundleIdValue));
+ }
+ }
+ OF_EVENT_LOG.debug("Flow/Group count is {}", futureList.size());
+ return futureList;
+ }
+
private void handleStaleEntityDeletionResultFuture(FluentFuture<?> submitFuture) {
submitFuture.addCallback(new FutureCallback<Object>() {
@Override
return groupBuilder.build();
}
- private Messages createMessages(final NodeRef nodeRef, final Optional<FlowCapableNode> flowNode) {
+ private Messages createMessages(final NodeRef nodeRef) {
final List<Message> messages = new ArrayList<>();
messages.add(new MessageBuilder().setNode(nodeRef)
.setBundleInnerMessage(new BundleRemoveFlowCaseBuilder()
.setBundleInnerMessage(new BundleRemoveGroupCaseBuilder()
.setRemoveGroupCaseData(new RemoveGroupCaseDataBuilder(getDeleteAllGroup()).build()).build())
.build());
-
- NodeId nodeId = nodeRef.getValue().firstKeyOf(Node.class).getId();
- if (flowNode.get().getGroup() != null) {
- for (Group gr : flowNode.get().getGroup()) {
- provider.getDevicesGroupRegistry().storeGroup(nodeId,gr.getGroupId().getValue());
- messages.add(new MessageBuilder().setNode(nodeRef).setBundleInnerMessage(new BundleAddGroupCaseBuilder()
- .setAddGroupCaseData(new AddGroupCaseDataBuilder(gr).build()).build()).build());
- }
- }
-
- if (flowNode.get().getTable() != null) {
- for (Table table : flowNode.get().getTable()) {
- for (Flow flow : table.getFlow()) {
- messages.add(
- new MessageBuilder().setNode(nodeRef)
- .setBundleInnerMessage(new BundleAddFlowCaseBuilder()
- .setAddFlowCaseData(new AddFlowCaseDataBuilder(flow).build()).build())
- .build());
- }
- }
- }
-
- LOG.debug("The size of the flows and group messages created in createMessage() {}", messages.size());
return new MessagesBuilder().setMessage(messages).build();
}
}
import org.opendaylight.mdsal.singleton.common.api.ClusterSingletonServiceProvider;
import org.opendaylight.openflowplugin.api.openflow.configuration.ConfigurationService;
import org.opendaylight.openflowplugin.api.openflow.mastership.MastershipChangeServiceManager;
+import org.opendaylight.openflowplugin.applications.frm.BundleMessagesCommiter;
import org.opendaylight.openflowplugin.applications.frm.FlowNodeReconciliation;
import org.opendaylight.openflowplugin.applications.frm.ForwardingRulesCommiter;
import org.opendaylight.openflowplugin.applications.frm.ForwardingRulesManager;
private ForwardingRulesCommiter<Group> groupListener;
private ForwardingRulesCommiter<Meter> meterListener;
private ForwardingRulesCommiter<TableFeatures> tableListener;
+ private BundleMessagesCommiter<Flow> bundleFlowListener;
+ private BundleMessagesCommiter<Group> bundleGroupListener;
private FlowNodeReconciliation nodeListener;
private NotificationRegistration reconciliationNotificationRegistration;
private FlowNodeConnectorInventoryTranslatorImpl flowNodeConnectorInventoryTranslatorImpl;
new FrmReconciliationServiceImpl(this));
flowNodeConnectorInventoryTranslatorImpl = new FlowNodeConnectorInventoryTranslatorImpl(dataService);
+ this.bundleFlowListener = new BundleFlowForwarder(this);
+ this.bundleGroupListener = new BundleGroupForwarder(this);
this.flowListener = new FlowForwarder(this, dataService);
this.groupListener = new GroupForwarder(this, dataService);
this.meterListener = new MeterForwarder(this, dataService);
return tableListener;
}
+ @Override
+ public BundleMessagesCommiter<Flow> getBundleFlowListener() {
+ return bundleFlowListener;
+ }
+
+ @Override
+ public BundleMessagesCommiter<Group> getBundleGroupListener() {
+ return bundleGroupListener;
+ }
+
@Override
public ArbitratorReconcileService getArbitratorReconciliationManager() {
return arbitratorReconciliationManager;
private static final Logger LOG = LoggerFactory.getLogger(GroupForwarder.class);
private ListenerRegistration<GroupForwarder> listenerRegistration;
- private final BundleGroupForwarder bundleGroupForwarder;
public GroupForwarder(final ForwardingRulesManager manager, final DataBroker db) {
super(manager, db);
- this.bundleGroupForwarder = new BundleGroupForwarder(manager);
}
@SuppressWarnings("IllegalCatch")
final InstanceIdentifier<FlowCapableNode> nodeIdent) {
BundleId bundleId = getActiveBundle(nodeIdent, provider);
if (bundleId != null) {
- bundleGroupForwarder.remove(identifier, removeDataObj, nodeIdent, bundleId);
+ provider.getBundleGroupListener().remove(identifier, removeDataObj, nodeIdent, bundleId);
} else {
final Group group = removeDataObj;
final RemoveGroupInputBuilder builder = new RemoveGroupInputBuilder(group);
final InstanceIdentifier<FlowCapableNode> nodeIdent) {
BundleId bundleId = getActiveBundle(nodeIdent, provider);
if (bundleId != null) {
- bundleGroupForwarder.update(identifier, original, update, nodeIdent, bundleId);
+ provider.getBundleGroupListener().update(identifier, original, update, nodeIdent, bundleId);
} else {
final NodeId nodeId = getNodeIdFromNodeIdentifier(nodeIdent);
nodeConfigurator.enqueueJob(nodeId.getValue(), () -> {
final InstanceIdentifier<FlowCapableNode> nodeIdent) {
BundleId bundleId = getActiveBundle(nodeIdent, provider);
if (bundleId != null) {
- return bundleGroupForwarder.add(identifier, addDataObj, nodeIdent, bundleId);
+ return provider.getBundleGroupListener().add(identifier, addDataObj, nodeIdent, bundleId);
} else {
final NodeId nodeId = getNodeIdFromNodeIdentifier(nodeIdent);
return nodeConfigurator
package org.opendaylight.openflowjava.protocol.api.connection;
import com.google.common.annotations.Beta;
+import java.math.BigInteger;
import java.net.InetSocketAddress;
import java.util.concurrent.Future;
import org.opendaylight.openflowjava.protocol.api.extensibility.AlienMessageListener;
*/
@Beta
void setPacketInFiltering(boolean enabled);
+
+ /**
+ * Set datapathId for the dpn.
+ * @param datapathId of the dpn
+ */
+ void setDatapathId(BigInteger datapathId);
}
import io.netty.channel.ChannelInboundHandlerAdapter;
import io.netty.util.concurrent.Future;
import io.netty.util.concurrent.GenericFutureListener;
+import java.math.BigInteger;
import java.net.InetSocketAddress;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicBoolean;
* Method immediately response on Echo message.
*
* @param message incoming Echo message from device
+ * @param datapathId the dpnId of the node
*/
- void onEchoRequest(final EchoRequestMessage message) {
+ void onEchoRequest(final EchoRequestMessage message, BigInteger datapathId) {
+ LOG.debug("echo request received: {} for the DPN {}", message.getXid(), datapathId);
final EchoReplyInput reply = new EchoReplyInputBuilder().setData(message.getData())
.setVersion(message.getVersion()).setXid(message.getXid()).build();
parent.getChannel().writeAndFlush(makeMessageListenerWrapper(reply));
import com.google.common.base.Preconditions;
import io.netty.channel.Channel;
+import java.math.BigInteger;
import java.net.InetSocketAddress;
import org.opendaylight.openflowjava.protocol.api.connection.ConnectionReadyListener;
import org.opendaylight.openflowjava.protocol.api.connection.OutboundQueueHandler;
private AlienMessageListener alienMessageListener;
private AbstractOutboundQueueManager<?, ?> outputManager;
private OFVersionDetector versionDetector;
+ private BigInteger datapathId;
private final boolean useBarrier;
@Override
public void consumeDeviceMessage(final DataObject message) {
- LOG.debug("ConsumeIntern msg on {}", channel);
+ LOG.debug("ConsumeIntern msg {} for dpn {} on {}", message.implementedInterface().getSimpleName(),
+ datapathId, channel);
+ LOG.trace("ConsumeIntern msg {}", message);
if (disconnectOccured) {
return;
}
// OpenFlow messages
} else if (message instanceof EchoRequestMessage) {
if (outputManager != null) {
- outputManager.onEchoRequest((EchoRequestMessage) message);
+ outputManager.onEchoRequest((EchoRequestMessage) message, datapathId);
} else {
messageListener.onEchoRequestMessage((EchoRequestMessage) message);
}
versionDetector.setFilterPacketIns(enabled);
LOG.debug("PacketIn filtering {}abled", enabled ? "en" : "dis");
}
+
+ @Override
+ public void setDatapathId(final BigInteger datapathId) {
+ this.datapathId = datapathId;
+ }
}
LOG.trace("features are back");
if (rpcFeatures.isSuccessful()) {
GetFeaturesOutput featureOutput = rpcFeatures.getResult();
+ connectionAdapter.setDatapathId(featureOutput.getDatapathId());
if (!deviceConnectionRateLimiter.tryAquire()) {
LOG.warn("Openflowplugin hit the device connection rate limit threshold. Denying"
+ " the connection from device {}", featureOutput.getDatapathId());