<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
- <version>2.3.6</version>
+ <version>${bundle.plugin.version}</version>
<extensions>true</extensions>
<configuration>
<instructions>
<packaging>maven-archetype</packaging>\r
\r
<name>odl-model-project</name>\r
+ <scm>\r
+ <connection>scm:git:ssh://git.opendaylight.org:29418/controller.git</connection>\r
+ <developerConnection>scm:git:ssh://git.opendaylight.org:29418/controller.git</developerConnection>\r
+ <url>https://wiki.opendaylight.org/view/OpenDaylight_Controller:Main</url>\r
+ </scm>\r
\r
<build>\r
<extensions>\r
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>\r
<nexusproxy>http://nexus.opendaylight.org/content</nexusproxy>\r
<yang.version>0.5.8-SNAPSHOT</yang.version>\r
- <maven.bundle.version>2.4.0</maven.bundle.version>\r
+ <bundle.plugin.version>2.3.7</bundle.plugin.version>\r
</properties>\r
+ <scm>\r
+ <connection>scm:git:ssh://git.opendaylight.org:29418/controller.git</connection>\r
+ <developerConnection>scm:git:ssh://git.opendaylight.org:29418/controller.git</developerConnection>\r
+ <url>https://wiki.opendaylight.org/view/OpenDaylight_Controller:Main</url>\r
+ </scm>\r
\r
<build>\r
<plugins>\r
<plugin>\r
<groupId>org.apache.felix</groupId>\r
<artifactId>maven-bundle-plugin</artifactId>\r
- <version>${maven.bundle.version}</version>\r
+ <version>${bundle.plugin.version}</version>\r
<extensions>true</extensions>\r
<configuration>\r
<instructions>\r
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
- <version>2.3.6</version>
+ <version>${bundle.plugin.version}</version>
<extensions>true</extensions>
<configuration>
<instructions>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
- <version>2.3.6</version>
+ <version>${bundle.plugin.version}</version>
<extensions>true</extensions>
<configuration>
<instructions>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
- <version>2.3.6</version>
+ <version>${bundle.plugin.version}</version>
<extensions>true</extensions>
<configuration>
<instructions>
rpcManager.invokeRemotely(recipientGenerator.generateRecipients(), command,
rpcManager.getDefaultRpcOptions(isSync));
} else {
- log.errorf("Didn't invoke RPC because primaryOwner (%s) didn't match this node (%s)", primaryOwner,
+ log.tracef("Didn't invoke RPC because primaryOwner (%s) didn't match this node (%s)", primaryOwner,
rpcManager.getAddress());
- log.errorf("Hashcode is (%s) for Key (%s) .. it could be inconsistent in the cluster!",
+ log.tracef("Hashcode is (%s) for Key (%s)",
command.getKey().hashCode(), command.getKey());
}
return returnValue;
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
- <version>2.3.6</version>
+ <version>${bundle.plugin.version}</version>
<extensions>true</extensions>
<configuration>
<instructions>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
- <version>2.3.6</version>
+ <version>${bundle.plugin.version}</version>
<extensions>true</extensions>
<configuration>
<instructions>
<plugin>\r
<groupId>org.apache.felix</groupId>\r
<artifactId>maven-bundle-plugin</artifactId>\r
- <version>2.3.6</version>\r
+ <version>${bundle.plugin.version}</version>\r
<extensions>true</extensions>\r
<configuration>\r
<instructions>\r
<commons.lang.version>3.1</commons.lang.version>
<jacoco.version>0.5.3.201107060350</jacoco.version>
<enforcer.version>1.3.1</enforcer.version>
+ <bundle.plugin.version>2.3.7</bundle.plugin.version>
</properties>
<pluginRepositories>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
- <version>2.3.6</version>
+ <version>${bundle.plugin.version}</version>
<extensions>true</extensions>
<configuration>
<instructions>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
- <version>2.3.6</version>
+ <version>${bundle.plugin.version}</version>
<extensions>true</extensions>
<configuration>
<instructions>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
- <version>2.3.6</version>
+ <version>${bundle.plugin.version}</version>
<extensions>true</extensions>
<configuration>
<instructions>
import java.util.Set;
import org.opendaylight.controller.sal.connection.ConnectionConstants;
+import org.opendaylight.controller.sal.connection.ConnectionLocality;
import org.opendaylight.controller.sal.core.Node;
import org.opendaylight.controller.sal.utils.Status;
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
- <version>2.3.6</version>
+ <version>${bundle.plugin.version}</version>
<extensions>true</extensions>
<configuration>
<instructions>
import org.opendaylight.controller.clustering.services.ICacheUpdateAware;
import org.opendaylight.controller.clustering.services.IClusterGlobalServices;
import org.opendaylight.controller.clustering.services.ICoordinatorChangeAware;
-import org.opendaylight.controller.connectionmanager.ConnectionLocality;
import org.opendaylight.controller.connectionmanager.ConnectionMgmtScheme;
import org.opendaylight.controller.connectionmanager.IConnectionManager;
import org.opendaylight.controller.connectionmanager.scheme.AbstractScheme;
import org.opendaylight.controller.connectionmanager.scheme.SchemeFactory;
import org.opendaylight.controller.sal.connection.ConnectionConstants;
+import org.opendaylight.controller.sal.connection.ConnectionLocality;
import org.opendaylight.controller.sal.connection.IConnectionListener;
import org.opendaylight.controller.sal.connection.IConnectionService;
import org.opendaylight.controller.sal.core.Node;
import org.opendaylight.controller.clustering.services.CacheExistException;
import org.opendaylight.controller.clustering.services.IClusterGlobalServices;
import org.opendaylight.controller.clustering.services.IClusterServices;
-import org.opendaylight.controller.connectionmanager.ConnectionLocality;
import org.opendaylight.controller.connectionmanager.ConnectionMgmtScheme;
+import org.opendaylight.controller.sal.connection.ConnectionLocality;
import org.opendaylight.controller.sal.core.Node;
import org.opendaylight.controller.sal.utils.Status;
import org.opendaylight.controller.sal.utils.StatusCode;
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
- <version>2.3.6</version>
+ <version>${bundle.plugin.version}</version>
<extensions>true</extensions>
<configuration>
<instructions>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
- <version>2.3.6</version>
+ <version>${bundle.plugin.version}</version>
<extensions>true</extensions>
<configuration>
<instructions>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
- <version>2.3.6</version>
+ <version>${bundle.plugin.version}</version>
<extensions>true</extensions>
<configuration>
<instructions>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
- <version>2.3.6</version>
+ <version>${bundle.plugin.version}</version>
<extensions>true</extensions>
<configuration>
<instructions>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
- <version>2.3.6</version>
+ <version>${bundle.plugin.version}</version>
<extensions>true</extensions>
<configuration>
<instructions>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
- <version>2.3.6</version>
+ <version>${bundle.plugin.version}</version>
<extensions>true</extensions>
<configuration>
<instructions>
org.opendaylight.controller.sal.match,
org.opendaylight.controller.sal.utils,
org.opendaylight.controller.sal.packet,
+ org.opendaylight.controller.sal.connection,
org.opendaylight.controller.forwardingrulesmanager,
org.opendaylight.controller.connectionmanager,
javax.xml.bind.annotation,
<artifactId>sal</artifactId>
<version>0.5.0-SNAPSHOT</version>
</dependency>
+ <dependency>
+ <groupId>org.opendaylight.controller</groupId>
+ <artifactId>sal.connection</artifactId>
+ <version>0.1.0-SNAPSHOT</version>
+ </dependency>
<dependency>
<groupId>org.opendaylight.controller</groupId>
<artifactId>forwardingrulesmanager</artifactId>
@Override
public boolean cancel(boolean mayInterruptIfRunning) {
+ if (this.waitingLatch.getCount() != 0L) {
+ this.retStatus = new Status(StatusCode.GONE);
+ this.waitingLatch.countDown();
+ logger.trace("Cancelled the workOrder");
+ return true;
+ }
return false;
}
// Return the known status
return retStatus;
} else {
- logger.error("Timing out, the workStatus for order {} has not come back in time!", this.order);
+ logger.error("Timing out, the workStatus for order {} has not come back in time!, it's hashcode is {}",
+ this.order, this.order.hashCode());
return new Status(StatusCode.TIMEOUT);
}
}
import java.util.concurrent.ExecutionException;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
-import java.util.concurrent.Future;
import java.util.concurrent.LinkedBlockingQueue;
import org.eclipse.osgi.framework.console.CommandInterpreter;
import org.opendaylight.controller.clustering.services.IClusterContainerServices;
import org.opendaylight.controller.clustering.services.IClusterServices;
import org.opendaylight.controller.configuration.IConfigurationContainerAware;
-import org.opendaylight.controller.connectionmanager.ConnectionLocality;
+import org.opendaylight.controller.sal.connection.ConnectionLocality;
import org.opendaylight.controller.connectionmanager.IConnectionManager;
import org.opendaylight.controller.forwardingrulesmanager.FlowConfig;
import org.opendaylight.controller.forwardingrulesmanager.FlowEntry;
return true;
}
+ private ConcurrentMap.Entry<Integer, FlowConfig> getStaticFlowEntry(String name, Node node) {
+ for (ConcurrentMap.Entry<Integer, FlowConfig> flowEntry : staticFlows.entrySet()) {
+ FlowConfig flowConfig = flowEntry.getValue();
+ if (flowConfig.isByNameAndNodeIdEqual(name, node)) {
+ return flowEntry;
+ }
+ }
+ return null;
+ }
+
private void updateLocalDatabase(FlowEntryInstall entry, boolean add) {
// Update the software view
updateSwViewes(entry, add);
* If requested, a copy of each original flow entry will be stored in the
* inactive list so that it can be re-applied when needed (This is typically
* the case when running in the default container and controller moved to
- * container mode)
+ * container mode) NOTE WELL: The routine as long as does a bulk change will
+ * operate only on the entries for nodes locally attached so to avoid
+ * redundant operations initiated by multiple nodes
*
* @param preserveFlowEntries
* if true, a copy of each original entry is stored in the
// Now remove the entries
for (FlowEntryInstall flowEntryHw : toRemove) {
- Status status = this.removeEntryInternal(flowEntryHw, false);
- if (!status.isSuccess()) {
- log.warn("Failed to remove entry: {}. The failure is: {}", flowEntryHw, status.getDescription());
+ Node n = flowEntryHw.getNode();
+ if (n != null && connectionManager.getLocalityStatus(n) == ConnectionLocality.LOCAL) {
+ Status status = this.removeEntryInternal(flowEntryHw, false);
+ if (!status.isSuccess()) {
+ log.warn("Failed to remove entry: {}. The failure is: {}", flowEntryHw, status.getDescription());
+ }
+ } else {
+ log.debug("Not removing entry {} because not connected locally, the remote guy will do it's job",
+ flowEntryHw);
}
}
}
@Override
public FlowConfig getStaticFlow(String name, Node node) {
- for (ConcurrentMap.Entry<Integer, FlowConfig> entry : staticFlows.entrySet()) {
- if (entry.getValue().isByNameAndNodeIdEqual(name, node)) {
- return entry.getValue();
- }
+ ConcurrentMap.Entry<Integer, FlowConfig> entry = getStaticFlowEntry(name, node);
+ if(entry != null) {
+ return entry.getValue();
}
return null;
}
uninstallAllFlowEntries(false);
// Shutdown executor
this.executor.shutdownNow();
+ // Now walk all the workMonitor and wake up the one sleeping because
+ // destruction is happening
+ for (FlowEntryDistributionOrder fe : workMonitor.keySet()) {
+ FlowEntryDistributionOrderFutureTask task = workMonitor.get(fe);
+ task.cancel(true);
+ }
}
public void setFlowProgrammerService(IFlowProgrammerService service) {
}
}
+ public void _frmProcessErrorEvent(CommandInterpreter ci) throws UnknownHostException {
+ Node node = null;
+ long reqId = 0L;
+ String nodeId = ci.nextArgument();
+ if (nodeId == null) {
+ ci.print("Node id not specified");
+ return;
+ }
+ String requestId = ci.nextArgument();
+ if (requestId == null) {
+ ci.print("Request id not specified");
+ return;
+ }
+ try {
+ node = NodeCreator.createOFNode(Long.valueOf(nodeId));
+ } catch (NumberFormatException e) {
+ ci.print("Node id not a number");
+ return;
+ }
+ try {
+ reqId = Long.parseLong(requestId);
+ } catch (NumberFormatException e) {
+ ci.print("Request id not a number");
+ return;
+ }
+ // null for error object is good enough for now
+ ErrorReportedEvent event = new ErrorReportedEvent(reqId, node, null);
+ this.processErrorEvent(event);
+ }
+
@Override
public void flowRemoved(Node node, Flow flow) {
log.trace("Received flow removed notification on {} for {}", node, flow);
if (target != null) {
// This was a flow install, update database
this.updateLocalDatabase(target, false);
+ // also update the config
+ if(FlowConfig.STATICFLOWGROUP.equals(target.getGroupName())) {
+ ConcurrentMap.Entry<Integer, FlowConfig> staticFlowEntry = getStaticFlowEntry(target.getFlowName(),target.getNode());
+ // staticFlowEntry should never be null.
+ // the null check is just an extra defensive check.
+ if(staticFlowEntry != null) {
+ staticFlows.remove(staticFlowEntry.getKey());
+ }
+ }
}
// Notify listeners
<plugin>\r
<groupId>org.apache.felix</groupId>\r
<artifactId>maven-bundle-plugin</artifactId>\r
- <version>2.3.6</version>\r
+ <version>${bundle.plugin.version}</version>\r
<extensions>true</extensions>\r
<configuration>\r
<instructions>\r
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
- <version>2.3.6</version>
+ <version>${bundle.plugin.version}</version>
<extensions>true</extensions>
<configuration>
<instructions>
<plugin>\r
<groupId>org.apache.felix</groupId>\r
<artifactId>maven-bundle-plugin</artifactId>\r
- <version>2.3.6</version>\r
+ <version>${bundle.plugin.version}</version>\r
<extensions>true</extensions>\r
<configuration>\r
<instructions>\r
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
- <version>2.3.6</version>
+ <version>${bundle.plugin.version}</version>
<extensions>true</extensions>
<configuration>
<instructions>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
- <version>2.3.6</version>
+ <version>${bundle.plugin.version}</version>
<extensions>true</extensions>
<configuration>
<instructions>
<groupId>org.opendaylight.controller.model</groupId>
<version>1.0-SNAPSHOT</version>
</parent>
+ <scm>
+ <connection>scm:git:ssh://git.opendaylight.org:29418/controller.git</connection>
+ <developerConnection>scm:git:ssh://git.opendaylight.org:29418/controller.git</developerConnection>
+ <url>https://wiki.opendaylight.org/view/OpenDaylight_Controller:MD-SAL</url>
+ </scm>
<modelVersion>4.0.0</modelVersion>
<artifactId>model-flow-service</artifactId>
</dependency>
</dependencies>
<packaging>bundle</packaging>
-</project>
\ No newline at end of file
+</project>
<properties>
<yang.version>0.5.7-SNAPSHOT</yang.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
- <maven.bundle.version>2.4.0</maven.bundle.version>
+ <bundle.plugin.version>2.3.7</bundle.plugin.version>
</properties>
<modules>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
- <version>${maven.bundle.version}</version>
+ <version>${bundle.plugin.version}</version>
<extensions>true</extensions>
<configuration>
<instructions>
<slf4j.version>1.7.2</slf4j.version>
<nexusproxy>http://nexus.opendaylight.org/content</nexusproxy>
<yang.version>0.5.8-SNAPSHOT</yang.version>
- <maven.bundle.version>2.4.0</maven.bundle.version>
+ <bundle.plugin.version>2.3.7</bundle.plugin.version>
<releaseplugin.version>2.3.2</releaseplugin.version>
<guava.version>14.0.1</guava.version>
<osgi.core.version>5.0.0</osgi.core.version>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
- <version>${maven.bundle.version}</version>
+ <version>${bundle.plugin.version}</version>
<extensions>true</extensions>
<configuration>
<instructions>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
+ <version>${bundle.plugin.version}</version>
<extensions>true</extensions>
<configuration>
<instructions>
<version>1.0-SNAPSHOT</version>
</parent>
<artifactId>sal-compability</artifactId>
+ <scm>
+ <connection>scm:git:ssh://git.opendaylight.org:29418/controller.git</connection>
+ <developerConnection>scm:git:ssh://git.opendaylight.org:29418/controller.git</developerConnection>
+ <url>https://wiki.opendaylight.org/view/OpenDaylight_Controller:MD-SAL</url>
+ </scm>
<dependencies>
<dependency>
import static org.opendaylight.controller.sal.match.MatchType.TP_SRC;
import java.net.InetAddress;
+import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
List<Action> actions = source.getAction();
if (actions != null) {
- for (Action sourceAction : actions) {
- Set<org.opendaylight.controller.sal.action.Action> targetActions = actionFrom(sourceAction);
- for (org.opendaylight.controller.sal.action.Action targetAction : targetActions) {
- target.addAction(targetAction);
- }
- }
+ target.setActions(actionFrom(actions));
}
target.setId(source.getCookie().longValue());
return target;
}
- public static Set<org.opendaylight.controller.sal.action.Action> actionFrom(Action source) {
- org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev130819.action.Action sourceAction = source
- .getAction();
- Set<org.opendaylight.controller.sal.action.Action> targetAction = new HashSet<>();
- if (sourceAction instanceof ControllerAction) {
- targetAction.add(new Controller());
- } else if (sourceAction instanceof OutputAction) {
-
- List<Uri> nodeConnectors = ((OutputAction) sourceAction).getOutputNodeConnector();
- for (Uri uri : nodeConnectors) {
- targetAction.add(new Output(fromNodeConnectorRef(uri)));
- }
- } else if (sourceAction instanceof PopMplsAction) {
- // TODO: define maping
- } else if (sourceAction instanceof PushMplsAction) {
- // TODO: define maping
- } else if (sourceAction instanceof PushPbbAction) {
- // TODO: define maping
- } else if (sourceAction instanceof PushVlanAction) {
- // TODO: define maping
- // PushVlanAction vlanAction = (PushVlanAction) sourceAction;
- // targetAction.add(new PushVlan(vlanAction., pcp, cfi, vlanId);
- } else if (sourceAction instanceof SetMplsTtlAction) {
- // TODO: define maping
- // targetAction = //no action to map
- } else if (sourceAction instanceof SetNwTtlAction) {
- // TODO: define maping
- } else if (sourceAction instanceof SetQueueAction) {
- // TODO: define maping
- // targetAction = //no action to map
- } else if (sourceAction instanceof DropAction) {
- targetAction.add(new Drop());
- } else if (sourceAction instanceof FloodAction) {
- targetAction.add(new Flood());
- } else if (sourceAction instanceof FloodAllAction) {
- targetAction.add(new FloodAll());
- } else if (sourceAction instanceof HwPathAction) {
- targetAction.add(new HwPath());
- } else if (sourceAction instanceof LoopbackAction) {
- targetAction.add(new Loopback());
- } else if (sourceAction instanceof PopVlanAction) {
- targetAction.add(new PopVlan());
- } else if (sourceAction instanceof PushVlanAction) {
- PushVlanAction pushVlanAction = (PushVlanAction) sourceAction;
- PushVlan pushVlan = pushVlanFrom(pushVlanAction);
- if (pushVlan != null) {
- targetAction.add(pushVlan);
- }
- } else if (sourceAction instanceof SetDlDstAction) {
- MacAddress addressL2Dest = ((SetDlDstAction) sourceAction).getAddress();
- if (addressL2Dest != null) {
- String addressValue = addressL2Dest.getValue();
- if (addressValue != null) {
- targetAction.add(new SetDlDst(addressValue.getBytes()));
+ public static List<org.opendaylight.controller.sal.action.Action> actionFrom(List<Action> actions) {
+ List<org.opendaylight.controller.sal.action.Action> targetAction = new ArrayList<>();
+ for (Action action : actions) {
+ org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev130819.action.Action sourceAction = action
+ .getAction();
+
+ if (sourceAction instanceof ControllerAction) {
+ targetAction.add(new Controller());
+ } else if (sourceAction instanceof OutputAction) {
+
+ List<Uri> nodeConnectors = ((OutputAction) sourceAction).getOutputNodeConnector();
+ if (nodeConnectors != null) {
+ for (Uri uri : nodeConnectors) {
+ targetAction.add(new Output(fromNodeConnectorRef(uri)));
+ }
}
- }
- } else if (sourceAction instanceof SetDlSrcAction) {
- MacAddress addressL2Src = ((SetDlSrcAction) sourceAction).getAddress();
- if (addressL2Src != null) {
- String addressValue = addressL2Src.getValue();
- if (addressValue != null) {
- targetAction.add(new SetDlSrc(addressValue.getBytes()));
+ } else if (sourceAction instanceof PopMplsAction) {
+ // TODO: define maping
+ } else if (sourceAction instanceof PushMplsAction) {
+ // TODO: define maping
+ } else if (sourceAction instanceof PushPbbAction) {
+ // TODO: define maping
+ } else if (sourceAction instanceof SetMplsTtlAction) {
+ // TODO: define maping
+ // targetAction = //no action to map
+ } else if (sourceAction instanceof SetNwTtlAction) {
+ // TODO: define maping
+ } else if (sourceAction instanceof SetQueueAction) {
+ // TODO: define maping
+ // targetAction = //no action to map
+ } else if (sourceAction instanceof DropAction) {
+ targetAction.add(new Drop());
+ } else if (sourceAction instanceof FloodAction) {
+ targetAction.add(new Flood());
+ } else if (sourceAction instanceof FloodAllAction) {
+ targetAction.add(new FloodAll());
+ } else if (sourceAction instanceof HwPathAction) {
+ targetAction.add(new HwPath());
+ } else if (sourceAction instanceof LoopbackAction) {
+ targetAction.add(new Loopback());
+ } else if (sourceAction instanceof PopVlanAction) {
+ targetAction.add(new PopVlan());
+ } else if (sourceAction instanceof PushVlanAction) {
+ PushVlanAction pushVlanAction = (PushVlanAction) sourceAction;
+ PushVlan pushVlan = pushVlanFrom(pushVlanAction);
+ if (pushVlan != null) {
+ targetAction.add(pushVlan);
}
- }
- } else if (sourceAction instanceof SetDlTypeAction) {
- EtherType dlType = ((SetDlTypeAction) sourceAction).getDlType();
- if (dlType != null) {
- Long dlTypeValue = dlType.getValue();
- if (dlTypeValue != null) {
- targetAction.add(new SetDlType(dlTypeValue.intValue()));
+ } else if (sourceAction instanceof SetDlDstAction) {
+ MacAddress addressL2Dest = ((SetDlDstAction) sourceAction).getAddress();
+ if (addressL2Dest != null) {
+ String addressValue = addressL2Dest.getValue();
+ if (addressValue != null) {
+ targetAction.add(new SetDlDst(addressValue.getBytes()));
+ }
}
- }
- } else if (sourceAction instanceof SetNextHopAction) {
- Address addressL3 = ((SetNextHopAction) sourceAction).getAddress();
+ } else if (sourceAction instanceof SetDlSrcAction) {
+ MacAddress addressL2Src = ((SetDlSrcAction) sourceAction).getAddress();
+ if (addressL2Src != null) {
+ String addressValue = addressL2Src.getValue();
+ if (addressValue != null) {
+ targetAction.add(new SetDlSrc(addressValue.getBytes()));
+ }
+ }
+ } else if (sourceAction instanceof SetDlTypeAction) {
+ EtherType dlType = ((SetDlTypeAction) sourceAction).getDlType();
+ if (dlType != null) {
+ Long dlTypeValue = dlType.getValue();
+ if (dlTypeValue != null) {
+ targetAction.add(new SetDlType(dlTypeValue.intValue()));
+ }
+ }
+ } else if (sourceAction instanceof SetNextHopAction) {
+ Address addressL3 = ((SetNextHopAction) sourceAction).getAddress();
- InetAddress inetAddress = inetAddressFrom(addressL3);
- if (inetAddress != null) {
- targetAction.add(new SetNextHop(inetAddress));
- }
- } else if (sourceAction instanceof SetNwDstAction) {
- Address addressL3 = ((SetNwDstAction) sourceAction).getAddress();
+ InetAddress inetAddress = inetAddressFrom(addressL3);
+ if (inetAddress != null) {
+ targetAction.add(new SetNextHop(inetAddress));
+ }
+ } else if (sourceAction instanceof SetNwDstAction) {
+ Address addressL3 = ((SetNwDstAction) sourceAction).getAddress();
- InetAddress inetAddress = inetAddressFrom(addressL3);
- if (inetAddress != null) {
- targetAction.add(new SetNwDst(inetAddress));
- }
- } else if (sourceAction instanceof SetNwSrcAction) {
- Address addressL3 = ((SetNwDstAction) sourceAction).getAddress();
+ InetAddress inetAddress = inetAddressFrom(addressL3);
+ if (inetAddress != null) {
+ targetAction.add(new SetNwDst(inetAddress));
+ }
+ } else if (sourceAction instanceof SetNwSrcAction) {
+ Address addressL3 = ((SetNwSrcAction) sourceAction).getAddress();
- InetAddress inetAddress = inetAddressFrom(addressL3);
- if (inetAddress != null) {
- targetAction.add(new SetNwSrc(inetAddress));
- }
- } else if (sourceAction instanceof SetNwTosAction) {
- Integer tos = ((SetNwTosAction) sourceAction).getTos();
- if (tos != null) {
- targetAction.add(new SetNwTos(tos));
- }
- } else if (sourceAction instanceof SetTpDstAction) {
- PortNumber port = ((SetTpDstAction) sourceAction).getPort();
- if (port != null) {
- Integer portValue = port.getValue();
- if (port.getValue() != null) {
- targetAction.add(new SetTpDst(portValue));
+ InetAddress inetAddress = inetAddressFrom(addressL3);
+ if (inetAddress != null) {
+ targetAction.add(new SetNwSrc(inetAddress));
}
- }
- } else if (sourceAction instanceof SetTpSrcAction) {
- PortNumber port = ((SetTpSrcAction) sourceAction).getPort();
- if (port != null) {
- Integer portValue = port.getValue();
- if (port.getValue() != null) {
- targetAction.add(new SetTpSrc(portValue));
+ } else if (sourceAction instanceof SetNwTosAction) {
+ Integer tos = ((SetNwTosAction) sourceAction).getTos();
+ if (tos != null) {
+ targetAction.add(new SetNwTos(tos));
}
- }
- } else if (sourceAction instanceof SetVlanCfiAction) {
- VlanCfi vlanCfi = ((SetVlanCfiAction) sourceAction).getVlanCfi();
- if (vlanCfi != null) {
- Integer vlanCfiValue = vlanCfi.getValue();
- if (vlanCfiValue != null) {
- targetAction.add(new SetVlanCfi(vlanCfiValue));
+ } else if (sourceAction instanceof SetTpDstAction) {
+ PortNumber port = ((SetTpDstAction) sourceAction).getPort();
+ if (port != null) {
+ Integer portValue = port.getValue();
+ if (port.getValue() != null) {
+ targetAction.add(new SetTpDst(portValue));
+ }
}
- }
- } else if (sourceAction instanceof SetVlanIdAction) {
- org.opendaylight.yang.gen.v1.urn.opendaylight.l2.types.rev130827.VlanId vlanID = ((SetVlanIdAction) sourceAction)
- .getVlanId();
- if (vlanID != null) {
- Integer vlanIdValue = vlanID.getValue();
- if (vlanIdValue != null) {
- targetAction.add(new SetVlanId(vlanIdValue));
+ } else if (sourceAction instanceof SetTpSrcAction) {
+ PortNumber port = ((SetTpSrcAction) sourceAction).getPort();
+ if (port != null) {
+ Integer portValue = port.getValue();
+ if (port.getValue() != null) {
+ targetAction.add(new SetTpSrc(portValue));
+ }
}
- }
- } else if (sourceAction instanceof SetVlanPcpAction) {
- VlanPcp vlanPcp = ((SetVlanPcpAction) sourceAction).getVlanPcp();
- if (vlanPcp != null) {
- Short vlanPcpValue = vlanPcp.getValue();
- if (vlanPcpValue != null) {
- targetAction.add(new SetVlanPcp(vlanPcpValue));
+ } else if (sourceAction instanceof SetVlanCfiAction) {
+ VlanCfi vlanCfi = ((SetVlanCfiAction) sourceAction).getVlanCfi();
+ if (vlanCfi != null) {
+ Integer vlanCfiValue = vlanCfi.getValue();
+ if (vlanCfiValue != null) {
+ targetAction.add(new SetVlanCfi(vlanCfiValue));
+ }
+ }
+ } else if (sourceAction instanceof SetVlanIdAction) {
+ org.opendaylight.yang.gen.v1.urn.opendaylight.l2.types.rev130827.VlanId vlanID = ((SetVlanIdAction) sourceAction)
+ .getVlanId();
+ if (vlanID != null) {
+ Integer vlanIdValue = vlanID.getValue();
+ if (vlanIdValue != null) {
+ targetAction.add(new SetVlanId(vlanIdValue));
+ }
+ }
+ } else if (sourceAction instanceof SetVlanPcpAction) {
+ VlanPcp vlanPcp = ((SetVlanPcpAction) sourceAction).getVlanPcp();
+ if (vlanPcp != null) {
+ Short vlanPcpValue = vlanPcp.getValue();
+ if (vlanPcpValue != null) {
+ targetAction.add(new SetVlanPcp(vlanPcpValue));
+ }
}
+ } else if (sourceAction instanceof SwPathAction) {
+ targetAction.add(new SwPath());
}
- } else if (sourceAction instanceof SwPathAction) {
- targetAction.add(new SwPath());
}
return targetAction;
--- /dev/null
+package org.opendaylight.controller.sal.compability;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+
+import java.math.BigInteger;
+import java.net.Inet4Address;
+import java.net.Inet6Address;
+import java.net.InetAddress;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.junit.Test;
+import org.opendaylight.controller.sal.action.*;
+import org.opendaylight.controller.sal.flowprogrammer.Flow;
+import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.Ipv4Prefix;
+import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.Ipv6Prefix;
+import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.PortNumber;
+import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.Uri;
+import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev100924.MacAddress;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.FlowAddedBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.NodeFlow;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev130819.VlanCfi;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev130819.action.action.*;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev130819.address.Address;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev130819.address.address.Ipv4Builder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev130819.address.address.Ipv6Builder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev130819.flow.Action;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev130819.flow.ActionBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev130819.flow.Match;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev130819.flow.MatchBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.l2.types.rev130827.EtherType;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.l2.types.rev130827.VlanId;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.l2.types.rev130827.VlanPcp;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev130819.match.EthernetMatchBuilder;
+
+import com.google.common.net.InetAddresses;
+
+public class TestToSalConversionsUtils {
+ // prefix:
+ // od|Od = Open Daylight
+
+ @Test
+ public void testToSalConversion() {
+ Flow salFlow = ToSalConversionsUtils.flowFrom(prepareOdFlow());
+ checkSalFlow(salFlow);
+ }
+
+ private void checkSalFlow(Flow salFlow) {
+ assertTrue("Id value is incorrect.", salFlow.getId() == 9223372036854775807L);
+ assertTrue("Hard timeout is incorrect.", salFlow.getHardTimeout() == 32767);
+ assertTrue("Iddle timeout is incorrect.", salFlow.getIdleTimeout() == 32767);
+ assertTrue("Priority value is incorrect.", salFlow.getPriority() == 32767);
+
+ checkSalActions(salFlow.getActions());
+ }
+
+ private void checkSalActions(List<org.opendaylight.controller.sal.action.Action> actions) {
+ checkSalAction(actions, Flood.class, 1);
+ checkSalAction(actions, FloodAll.class, 1);
+ checkSalAction(actions, HwPath.class, 1);
+ checkSalAction(actions, Loopback.class, 1);
+ checkSalAction(actions, Output.class, 2, true);
+ checkSalAction(actions, PopVlan.class, 1);
+ checkSalAction(actions, PushVlan.class, 1, true);
+ checkSalAction(actions, SetDlDst.class, 1, true);
+ checkSalAction(actions, SetDlSrc.class, 1, true);
+ checkSalAction(actions, SetDlType.class, 1, true);
+ checkSalAction(actions, SetNextHop.class, 2, true);
+ checkSalAction(actions, SetNwDst.class, 2, true);
+ checkSalAction(actions, SetNwSrc.class, 2, true);
+ checkSalAction(actions, SetNwTos.class, 1, true);
+ checkSalAction(actions, SetTpDst.class, 1, true);
+ checkSalAction(actions, SetTpSrc.class, 1, true);
+ checkSalAction(actions, SetVlanCfi.class, 1, true);
+ checkSalAction(actions, SetVlanId.class, 1, true);
+ checkSalAction(actions, SetVlanPcp.class, 1, true);
+ checkSalAction(actions, SwPath.class, 1);
+ }
+
+ private void checkSalAction(List<org.opendaylight.controller.sal.action.Action> actions, Class<?> cls,
+ int numOfActions) {
+ checkSalAction(actions, cls, numOfActions, false);
+ }
+
+ private void checkSalAction(List<org.opendaylight.controller.sal.action.Action> actions, Class<?> cls,
+ int numOfActions, boolean additionalCheck) {
+ int numOfEqualClass = 0;
+ for (org.opendaylight.controller.sal.action.Action action : actions) {
+ if (action.getClass().equals(cls)) {
+ if (additionalCheck) {
+ additionalActionCheck(action);
+ }
+ numOfEqualClass++;
+ }
+ }
+ assertEquals("Incorrect number of actions of type " + cls.getName() + " was found.", numOfActions,
+ numOfEqualClass);
+ }
+
+ // implement special checks
+ private void additionalActionCheck(org.opendaylight.controller.sal.action.Action action) {
+ if (action instanceof Output) {
+ // ((Output)action).getPort() //TODO finish check when mapping will
+ // be defined
+ } else if (action instanceof PushVlan) {
+ assertEquals("Wrong value for action PushVlan for tag.", 0x8100, ((PushVlan) action).getTag());
+ assertEquals("Wrong value for action PushVlan for pcp.", 7, ((PushVlan) action).getPcp());
+ assertEquals("Wrong value for action PushVlan for cfi.", 1, ((PushVlan) action).getCfi());
+ assertEquals("Wrong value for action PushVlan for vlanID.", 4095, ((PushVlan) action).getVlanId());
+ } else if (action instanceof SetDlDst) {
+ assertEquals("Wrong value for action SetDlDst for MAC address.", "3C:A9:F4:00:E0:C8", new String(
+ ((SetDlDst) action).getDlAddress()));
+ } else if (action instanceof SetDlSrc) {
+ assertEquals("Wrong value for action SetDlSrc for MAC address.", "24:77:03:7C:C5:F1", new String(
+ ((SetDlSrc) action).getDlAddress()));
+ } else if (action instanceof SetDlType) {
+ assertEquals("Wrong value for action SetDlType for.", 513l, ((SetDlType) action).getDlType());
+ } else if (action instanceof SetNextHop) {
+ InetAddress inetAddress = ((SetNextHop) action).getAddress();
+ checkIpAddresses(inetAddress, "192.168.100.100", "2001:db8:85a3::8a2e:370:7334");
+ } else if (action instanceof SetNwDst) {
+ InetAddress inetAddress = ((SetNwDst) action).getAddress();
+ checkIpAddresses(inetAddress, "192.168.100.101", "2001:db8:85a3::8a2e:370:7335");
+ } else if (action instanceof SetNwSrc) {
+ InetAddress inetAddress = ((SetNwSrc) action).getAddress();
+ checkIpAddresses(inetAddress, "192.168.100.102", "2001:db8:85a3::8a2e:370:7336");
+ } else if (action instanceof SetNwTos) {
+ assertEquals("Wrong value for action SetNwTos for tos.", 63, ((SetNwTos) action).getNwTos());
+ } else if (action instanceof SetTpDst) {
+ assertEquals("Wrong value for action SetTpDst for port.", 65535, ((SetTpDst) action).getPort());
+ } else if (action instanceof SetTpSrc) {
+ assertEquals("Wrong value for action SetTpSrc for port.", 65535, ((SetTpSrc) action).getPort());
+ } else if (action instanceof SetVlanCfi) {
+ assertEquals("Wrong value for action SetVlanCfi for port.", 1, ((SetVlanCfi) action).getCfi());
+ } else if (action instanceof SetVlanId) {
+ assertEquals("Wrong value for action SetVlanId for vlan ID.", 4095, ((SetVlanId) action).getVlanId());
+ } else if (action instanceof SetVlanPcp) {
+ assertEquals("Wrong value for action SetVlanPcp for vlan ID.", 7, ((SetVlanPcp) action).getPcp());
+ }
+ }
+
+ private void checkIpAddresses(InetAddress inetAddress, String ipv4, String ipv6) {
+ if (inetAddress instanceof Inet4Address) {
+ assertEquals("Wrong value for IP address.", ipv4, InetAddresses.toAddrString(inetAddress));
+ } else if (inetAddress instanceof Inet6Address) {
+ assertEquals("Wrong value for IP address.", ipv6, InetAddresses.toAddrString(inetAddress));
+ }
+ }
+
+ private NodeFlow prepareOdFlow() {
+ FlowAddedBuilder odNodeFlowBuilder = new FlowAddedBuilder();
+ odNodeFlowBuilder.setCookie(new BigInteger("9223372036854775807"));
+ odNodeFlowBuilder.setHardTimeout(32767);
+ odNodeFlowBuilder.setIdleTimeout(32767);
+ odNodeFlowBuilder.setPriority(32767);
+ odNodeFlowBuilder.setAction(prepareOdActions());
+ odNodeFlowBuilder.setMatch(prepareOdMatch());
+
+ return odNodeFlowBuilder.build();
+ }
+
+ private List<Action> prepareOdActions() {
+ List<Action> odActions = new ArrayList<>();
+
+ ControllerActionBuilder controllerActionBuilder = new ControllerActionBuilder();
+ DropActionBuilder dropActionBuilder = new DropActionBuilder();
+ FloodActionBuilder floodActionBuilder = new FloodActionBuilder();
+ FloodAllActionBuilder floodAllActionBuilder = new FloodAllActionBuilder();
+ HwPathActionBuilder hwPathActionBuilder = new HwPathActionBuilder();
+ LoopbackActionBuilder loopbackActionBuilder = new LoopbackActionBuilder();
+ OutputActionBuilder outputActionBuilder = new OutputActionBuilder();
+ PopMplsActionBuilder popMplsActionBuilder = new PopMplsActionBuilder();
+ PopVlanActionBuilder popVlanActionBuilder = new PopVlanActionBuilder();
+ PushMplsActionBuilder pushMplsActionBuilder = new PushMplsActionBuilder();
+ PushPbbActionBuilder pushPbbActionBuilder = new PushPbbActionBuilder();
+ PushVlanActionBuilder pushVlanActionBuilder = new PushVlanActionBuilder();
+ SetDlDstActionBuilder setDlDstActionBuilder = new SetDlDstActionBuilder();
+ SetDlSrcActionBuilder setDlSrcActionBuilder = new SetDlSrcActionBuilder();
+ SetDlTypeActionBuilder setDlTypeActionBuilder = new SetDlTypeActionBuilder();
+ SetMplsTtlActionBuilder setMplsTtlActionBuilder = new SetMplsTtlActionBuilder();
+ SetNwTosActionBuilder setNwTosActionBuilder = new SetNwTosActionBuilder();
+ SetNwTtlActionBuilder setNwTtlActionBuilder = new SetNwTtlActionBuilder();
+ SetQueueActionBuilder setQueueActionBuilder = new SetQueueActionBuilder();
+ SetTpDstActionBuilder setTpDstActionBuilder = new SetTpDstActionBuilder();
+ SetTpSrcActionBuilder setTpSrcActionBuilder = new SetTpSrcActionBuilder();
+ SetVlanCfiActionBuilder setVlanCfiActionBuilder = new SetVlanCfiActionBuilder();
+ SetVlanIdActionBuilder setVlanIdActionBuilder = new SetVlanIdActionBuilder();
+ SetVlanPcpActionBuilder setVlanPcpActionBuilder = new SetVlanPcpActionBuilder();
+ SwPathActionBuilder swPathActionBuilder = new SwPathActionBuilder();
+
+ prepareActionOutput(outputActionBuilder);
+ prepareActionPushVlan(pushVlanActionBuilder);
+ prepareActionSetDlDst(setDlDstActionBuilder);
+ prepareActionSetDlSrc(setDlSrcActionBuilder);
+ prepareActionSetDlType(setDlTypeActionBuilder);
+ prepareActionNextHop(odActions);
+ prepareActionSetNwDst(odActions);
+ prepareActionSetNwSrc(odActions);
+ prepareActionSetNwTos(setNwTosActionBuilder);
+ prepareActionSetTpDst(setTpDstActionBuilder);
+ prepareActionSetTpSrc(setTpSrcActionBuilder);
+ prepareActionSetVlanCfi(setVlanCfiActionBuilder);
+ prepareActionSetVladId(setVlanIdActionBuilder);
+ prepareActionSetVlanPcp(setVlanPcpActionBuilder);
+
+ odActions.add(new ActionBuilder().setAction(controllerActionBuilder.build()).build());
+ odActions.add(new ActionBuilder().setAction(dropActionBuilder.build()).build());
+ odActions.add(new ActionBuilder().setAction(floodActionBuilder.build()).build());
+ odActions.add(new ActionBuilder().setAction(floodAllActionBuilder.build()).build());
+ odActions.add(new ActionBuilder().setAction(hwPathActionBuilder.build()).build());
+ odActions.add(new ActionBuilder().setAction(loopbackActionBuilder.build()).build());
+ odActions.add(new ActionBuilder().setAction(outputActionBuilder.build()).build());
+ odActions.add(new ActionBuilder().setAction(popMplsActionBuilder.build()).build());
+ odActions.add(new ActionBuilder().setAction(popVlanActionBuilder.build()).build());
+ odActions.add(new ActionBuilder().setAction(pushMplsActionBuilder.build()).build());
+ odActions.add(new ActionBuilder().setAction(pushPbbActionBuilder.build()).build());
+ odActions.add(new ActionBuilder().setAction(pushVlanActionBuilder.build()).build());
+ odActions.add(new ActionBuilder().setAction(setDlDstActionBuilder.build()).build());
+ odActions.add(new ActionBuilder().setAction(setDlSrcActionBuilder.build()).build());
+ odActions.add(new ActionBuilder().setAction(setDlTypeActionBuilder.build()).build());
+ odActions.add(new ActionBuilder().setAction(setMplsTtlActionBuilder.build()).build());
+ odActions.add(new ActionBuilder().setAction(setNwTosActionBuilder.build()).build());
+ odActions.add(new ActionBuilder().setAction(setNwTtlActionBuilder.build()).build());
+ odActions.add(new ActionBuilder().setAction(setQueueActionBuilder.build()).build());
+ odActions.add(new ActionBuilder().setAction(setTpDstActionBuilder.build()).build());
+ odActions.add(new ActionBuilder().setAction(setTpSrcActionBuilder.build()).build());
+ odActions.add(new ActionBuilder().setAction(setVlanCfiActionBuilder.build()).build());
+ odActions.add(new ActionBuilder().setAction(setVlanIdActionBuilder.build()).build());
+ odActions.add(new ActionBuilder().setAction(setVlanPcpActionBuilder.build()).build());
+ odActions.add(new ActionBuilder().setAction(swPathActionBuilder.build()).build());
+
+ return odActions;
+ }
+
+ private void prepareActionSetVlanPcp(SetVlanPcpActionBuilder setVlanPcpActionBuilder) {
+ setVlanPcpActionBuilder.setVlanPcp(new VlanPcp((short) 7));
+ }
+
+ private void prepareActionSetVladId(SetVlanIdActionBuilder setVlanIdActionBuilder) {
+ setVlanIdActionBuilder.setVlanId(new VlanId(4095));
+ }
+
+ private void prepareActionSetVlanCfi(SetVlanCfiActionBuilder setVlanCfiActionBuilder) {
+ setVlanCfiActionBuilder.setVlanCfi(new VlanCfi(1));
+ }
+
+ private void prepareActionSetTpDst(SetTpDstActionBuilder setTpDstActionBuilder) {
+ setTpDstActionBuilder.setPort(new PortNumber(65535));
+ }
+
+ private void prepareActionSetTpSrc(SetTpSrcActionBuilder setTpSrcActionBuilder) {
+ setTpSrcActionBuilder.setPort(new PortNumber(65535));
+ }
+
+ private void prepareActionSetNwTos(SetNwTosActionBuilder setNwTosActionBuilder) {
+ setNwTosActionBuilder.setTos(63);
+ }
+
+ private void prepareActionSetNwSrc(List<Action> odActions) {
+ // test case for IPv4
+ SetNwSrcActionBuilder setNwSrcActionBuilderIpv4 = new SetNwSrcActionBuilder();
+ setNwSrcActionBuilderIpv4.setAddress(prapareIpv4Address("192.168.100.102"));
+ odActions.add(new ActionBuilder().setAction(setNwSrcActionBuilderIpv4.build()).build());
+
+ // test case for IPv6
+ SetNwSrcActionBuilder setNwSrcActionBuilderIpv6 = new SetNwSrcActionBuilder();
+ setNwSrcActionBuilderIpv6.setAddress(prapareIpv6Address("2001:0db8:85a3:0000:0000:8a2e:0370:7336"));
+ odActions.add(new ActionBuilder().setAction(setNwSrcActionBuilderIpv6.build()).build());
+ }
+
+ private void prepareActionSetNwDst(List<Action> odActions) {
+ // test case for IPv4
+ SetNwDstActionBuilder setNwDstActionBuilderIpv4 = new SetNwDstActionBuilder();
+ setNwDstActionBuilderIpv4.setAddress(prapareIpv4Address("192.168.100.101"));
+ odActions.add(new ActionBuilder().setAction(setNwDstActionBuilderIpv4.build()).build());
+
+ // test case for IPv6
+ SetNwDstActionBuilder setNwDstActionBuilderIpv6 = new SetNwDstActionBuilder();
+ setNwDstActionBuilderIpv6.setAddress(prapareIpv6Address("2001:0db8:85a3:0000:0000:8a2e:0370:7335"));
+ odActions.add(new ActionBuilder().setAction(setNwDstActionBuilderIpv6.build()).build());
+ }
+
+ private void prepareActionNextHop(List<Action> odActions) {
+ // test case for IPv4
+ SetNextHopActionBuilder setNextHopActionBuilderIpv4 = new SetNextHopActionBuilder();
+ setNextHopActionBuilderIpv4.setAddress(prapareIpv4Address("192.168.100.100"));
+ odActions.add(new ActionBuilder().setAction(setNextHopActionBuilderIpv4.build()).build());
+
+ // test case for IPv6
+ SetNextHopActionBuilder setNextHopActionBuilderIpv6 = new SetNextHopActionBuilder();
+ setNextHopActionBuilderIpv6.setAddress(prapareIpv6Address("2001:0db8:85a3:0000:0000:8a2e:0370:7334"));
+ odActions.add(new ActionBuilder().setAction(setNextHopActionBuilderIpv6.build()).build());
+ }
+
+ private Address prapareIpv4Address(String ipv4Address) {
+ Ipv4Builder ipv4Builder = new Ipv4Builder();
+ ipv4Builder.setIpv4Address(new Ipv4Prefix(ipv4Address));
+ return ipv4Builder.build();
+ }
+
+ private Address prapareIpv6Address(String ipv6Address) {
+ Ipv6Builder ipv6Builder = new Ipv6Builder();
+ ipv6Builder.setIpv6Address(new Ipv6Prefix(ipv6Address));
+ return ipv6Builder.build();
+ }
+
+ private void prepareActionSetDlType(SetDlTypeActionBuilder setDlTypeActionBuilder) {
+ setDlTypeActionBuilder.setDlType(new EtherType(513l));
+ }
+
+ private void prepareActionSetDlSrc(SetDlSrcActionBuilder setDlSrcActionBuilder) {
+ setDlSrcActionBuilder.setAddress(new MacAddress("24:77:03:7C:C5:F1"));
+ }
+
+ private void prepareActionSetDlDst(SetDlDstActionBuilder setDlDstActionBuilder) {
+ setDlDstActionBuilder.setAddress(new MacAddress("3C:A9:F4:00:E0:C8"));
+ }
+
+ private void prepareActionPushVlan(PushVlanActionBuilder pushVlanActionBuilder) {
+ pushVlanActionBuilder.setPcp(7); // 3 bits
+ pushVlanActionBuilder.setCfi(new VlanCfi(1)); // 1 bit
+ pushVlanActionBuilder.setVlanId(new VlanId(4095));
+ pushVlanActionBuilder.setTag(0x8100); // 12 bit
+ }
+
+ private void prepareActionOutput(OutputActionBuilder outputActionBuilder) {
+ List<Uri> uris = new ArrayList<>();
+ uris.add(new Uri("uri1"));
+ uris.add(new Uri("uri2"));
+ outputActionBuilder.setOutputNodeConnector(uris);
+ }
+
+ private Match prepareOdMatch() {
+ MatchBuilder odMatchBuilder = new MatchBuilder();
+ EthernetMatchBuilder odEthernetMatchBuilder = new EthernetMatchBuilder();
+ odMatchBuilder.setEthernetMatch(odEthernetMatchBuilder.build());
+
+ return odMatchBuilder.build();
+ }
+}
<nexusproxy>http://nexus.opendaylight.org/content</nexusproxy>\r
<enunciate.version>1.26.2</enunciate.version>\r
</properties>\r
+ <scm>\r
+ <connection>scm:git:ssh://git.opendaylight.org:29418/controller.git</connection>\r
+ <developerConnection>scm:git:ssh://git.opendaylight.org:29418/controller.git</developerConnection>\r
+ <url>https://wiki.opendaylight.org/view/OpenDaylight_Controller:Main</url>\r
+ </scm>\r
\r
<distributionManagement>\r
<!-- OpenDayLight Released artifact -->\r
<nexusproxy>http://nexus.opendaylight.org/content</nexusproxy>\r
<enunciate.version>1.26.2</enunciate.version>\r
</properties>\r
+ <scm>\r
+ <connection>scm:git:ssh://git.opendaylight.org:29418/controller.git</connection>\r
+ <developerConnection>scm:git:ssh://git.opendaylight.org:29418/controller.git</developerConnection>\r
+ <url>https://wiki.opendaylight.org/view/OpenDaylight_Controller:Main</url>\r
+ </scm>\r
<distributionManagement>\r
<!-- OpenDayLight Released artifact -->\r
<repository>\r
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
- <version>2.3.6</version>
+ <version>${bundle.plugin.version}</version>
<extensions>true</extensions>
<configuration>
<instructions>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
- <version>2.3.6</version>
+ <version>${bundle.plugin.version}</version>
<extensions>true</extensions>
<configuration>
<instructions>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
- <version>2.3.6</version>
+ <version>${bundle.plugin.version}</version>
<extensions>true</extensions>
<configuration>
<instructions>
<version>1.4.0-SNAPSHOT</version>
<relativePath>../../commons/opendaylight</relativePath>
</parent>
+ <scm>
+ <connection>scm:git:ssh://git.opendaylight.org:29418/controller.git</connection>
+ <developerConnection>scm:git:ssh://git.opendaylight.org:29418/controller.git</developerConnection>
+ <url>https://wiki.opendaylight.org/view/OpenDaylight_Controller:Main</url>
+ </scm>
<groupId>org.opendaylight.controller</groupId>
<artifactId>containermanager.northbound</artifactId>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
- <version>2.3.6</version>
+ <version>${bundle.plugin.version}</version>
<extensions>true</extensions>
<configuration>
<instructions>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
- <version>2.3.6</version>
+ <version>${bundle.plugin.version}</version>
<extensions>true</extensions>
<configuration>
<instructions>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
- <version>2.3.6</version>
+ <version>${bundle.plugin.version}</version>
<extensions>true</extensions>
<configuration>
<instructions>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
- <version>2.3.6</version>
+ <version>${bundle.plugin.version}</version>
<extensions>true</extensions>
<configuration>
<instructions>
<nexusproxy>http://nexus.opendaylight.org/content</nexusproxy>\r
<enunciate.version>1.26.2</enunciate.version>\r
</properties>\r
+ <scm>\r
+ <connection>scm:git:ssh://git.opendaylight.org:29418/controller.git</connection>\r
+ <developerConnection>scm:git:ssh://git.opendaylight.org:29418/controller.git</developerConnection>\r
+ <url>https://wiki.opendaylight.org/view/OpenDaylight_Controller:Main</url>\r
+ </scm>\r
\r
<distributionManagement>\r
<!-- OpenDayLight Released artifact -->\r
<dependency>\r
<groupId>org.opendaylight.controller</groupId>\r
<artifactId>containermanager</artifactId>\r
- <version>0.4.0-SNAPSHOT</version>\r
+ <version>0.5.0-SNAPSHOT</version>\r
</dependency>\r
<dependency>\r
<groupId>org.opendaylight.controller</groupId>\r
<version>2.5.0</version>\r
</dependency>\r
</dependencies>\r
-</project>
\ No newline at end of file
+</project>\r
Boolean bShared = null;\r
Boolean bRouterExternal = null;\r
if (queryAdminStateUp != null)\r
- bAdminStateUp = new Boolean(queryAdminStateUp);\r
+ bAdminStateUp = Boolean.valueOf(queryAdminStateUp);\r
if (queryShared != null)\r
- bShared = new Boolean(queryShared);\r
+ bShared = Boolean.valueOf(queryShared);\r
if (queryRouterExternal != null)\r
- bRouterExternal = new Boolean(queryRouterExternal);\r
+ bRouterExternal = Boolean.valueOf(queryRouterExternal);\r
if ((queryID == null || queryID.equals(oSN.getID())) &&\r
(queryName == null || queryName.equals(oSN.getNetworkName())) &&\r
(bAdminStateUp == null || bAdminStateUp.booleanValue() == oSN.isAdminStateUp()) &&\r
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
- <version>2.3.6</version>
+ <version>${bundle.plugin.version}</version>
<extensions>true</extensions>
<configuration>
<instructions>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
- <version>2.3.6</version>
+ <version>${bundle.plugin.version}</version>
<extensions>true</extensions>
<configuration>
<instructions>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
- <version>2.3.6</version>
+ <version>${bundle.plugin.version}</version>
<extensions>true</extensions>
<configuration>
<instructions>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
- <version>2.3.6</version>
+ <version>${bundle.plugin.version}</version>
<extensions>true</extensions>
<configuration>
<instructions>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
- <version>2.3.6</version>
+ <version>${bundle.plugin.version}</version>
<extensions>true</extensions>
<configuration>
<instructions>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
- <version>2.3.6</version>
+ <version>${bundle.plugin.version}</version>
<extensions>true</extensions>
<configuration>
<instructions>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
- <version>2.3.6</version>
+ <version>${bundle.plugin.version}</version>
<extensions>true</extensions>
<configuration>
<instructions>
import org.opendaylight.controller.protocol_plugin.openflow.core.IMessageListener;
import org.opendaylight.controller.protocol_plugin.openflow.core.ISwitch;
import org.opendaylight.controller.protocol_plugin.openflow.core.ISwitchStateListener;
+import org.opendaylight.controller.sal.connection.ConnectionLocality;
import org.opendaylight.controller.sal.connection.IPluginOutConnectionService;
import org.opendaylight.controller.sal.core.Actions;
import org.opendaylight.controller.sal.core.Buffers;
}
// Add this node
- addNode(sw);
+ if (connectionOutService.getLocalityStatus(node) != ConnectionLocality.NOT_CONNECTED) {
+ addNode(sw);
+ } else {
+ logger.debug("Skipping node addition due to Connectivity Status : {}", connectionOutService.getLocalityStatus(node).name());
+ }
}
@Override
this.actions = this.actionFactory.parseActions(data, action_len);
}
- @Override
- public void writeTo(ByteBuffer data) {
- super.writeTo(data);//TBD. This Fn needs work. Should never get called though.
-
- }
-
@Override
public int hashCode() {
final int prime = 31;
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
- <version>2.3.6</version>
+ <version>${bundle.plugin.version}</version>
<extensions>true</extensions>
<configuration>
<instructions>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
- <version>2.3.6</version>
+ <version>${bundle.plugin.version}</version>
<extensions>true</extensions>
<configuration>
<instructions>
<plugin>\r
<groupId>org.apache.felix</groupId>\r
<artifactId>maven-bundle-plugin</artifactId>\r
- <version>2.3.6</version>\r
+ <version>${bundle.plugin.version}</version>\r
<extensions>true</extensions>\r
<configuration>\r
<instructions>\r
<plugin>\r
<groupId>org.apache.felix</groupId>\r
<artifactId>maven-bundle-plugin</artifactId>\r
- <version>2.3.6</version>\r
+ <version>${bundle.plugin.version}</version>\r
<extensions>true</extensions>\r
<configuration>\r
<instructions>\r
-package org.opendaylight.controller.connectionmanager;
+package org.opendaylight.controller.sal.connection;
public enum ConnectionLocality {
/**
* @return true if node is local to this controller. false otherwise.
*/
public boolean isLocal(Node node);
+
+ public ConnectionLocality getLocalityStatus(Node node);
}
\ No newline at end of file
<plugin>\r
<groupId>org.apache.felix</groupId>\r
<artifactId>maven-bundle-plugin</artifactId>\r
- <version>2.3.6</version>\r
+ <version>${bundle.plugin.version}</version>\r
<extensions>true</extensions>\r
<configuration>\r
<instructions>\r
import java.util.concurrent.ConcurrentMap;
import org.opendaylight.controller.sal.connection.ConnectionConstants;
+import org.opendaylight.controller.sal.connection.ConnectionLocality;
import org.opendaylight.controller.sal.connection.IConnectionListener;
import org.opendaylight.controller.sal.connection.IConnectionService;
import org.opendaylight.controller.sal.connection.IPluginInConnectionService;
return connectionListener.isLocal(node);
}
+ @Override
+ public ConnectionLocality getLocalityStatus(Node node) {
+ if (this.connectionListener == null) return ConnectionLocality.NOT_CONNECTED;
+ return connectionListener.getLocalityStatus(node);
+ }
+
@Override
public Node connect (String type, String connectionIdentifier, Map<ConnectionConstants, String> params) {
IPluginInConnectionService s = pluginService.get(type);
<plugin>\r
<groupId>org.apache.felix</groupId>\r
<artifactId>maven-bundle-plugin</artifactId>\r
- <version>2.3.6</version>\r
+ <version>${bundle.plugin.version}</version>\r
<extensions>true</extensions>\r
<configuration>\r
<instructions>\r
<plugin>\r
<groupId>org.apache.felix</groupId>\r
<artifactId>maven-bundle-plugin</artifactId>\r
- <version>2.3.6</version>\r
+ <version>${bundle.plugin.version}</version>\r
<extensions>true</extensions>\r
<configuration>\r
<instructions>\r
<plugin>\r
<groupId>org.apache.felix</groupId>\r
<artifactId>maven-bundle-plugin</artifactId>\r
- <version>2.3.6</version>\r
+ <version>${bundle.plugin.version}</version>\r
<extensions>true</extensions>\r
<configuration>\r
<instructions>\r
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
- <version>2.3.6</version>
+ <version>${bundle.plugin.version}</version>
<extensions>true</extensions>
<configuration>
<instructions>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
- <version>2.3.6</version>
+ <version>${bundle.plugin.version}</version>
<extensions>true</extensions>
<configuration>
<instructions>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
- <version>2.3.6</version>
+ <version>${bundle.plugin.version}</version>
<extensions>true</extensions>
<configuration>
<instructions>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
- <version>2.3.6</version>
+ <version>${bundle.plugin.version}</version>
<extensions>true</extensions>
<configuration>
<instructions>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
- <version>2.3.6</version>
+ <version>${bundle.plugin.version}</version>
<extensions>true</extensions>
<configuration>
<instructions>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
- <version>2.3.6</version>
+ <version>${bundle.plugin.version}</version>
<extensions>true</extensions>
<configuration>
<instructions>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
- <version>2.3.6</version>
+ <version>${bundle.plugin.version}</version>
<extensions>true</extensions>
<configuration>
<instructions>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
- <version>2.3.6</version>
+ <version>${bundle.plugin.version}</version>
<extensions>true</extensions>
<configuration>
<instructions>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
- <version>2.3.6</version>
+ <version>${bundle.plugin.version}</version>
<extensions>true</extensions>
<configuration>
<instructions>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
- <version>2.3.6</version>
+ <version>${bundle.plugin.version}</version>
<extensions>true</extensions>
<configuration>
<instructions>
private static final boolean strongPasswordCheck = Boolean.getBoolean("enableStrongPasswordCheck");
private static final String BAD_PASSWORD = "Bad Password";
private static final int USERNAME_MAXLENGTH = 32;
- protected static final String PASSWORD_REGEX = "(?=.*[^\\w])(?=.*\\d)(?=.*[a-z])(?=.*[A-Z]).{8,256}$";
+ protected static final String PASSWORD_REGEX = "(?=.*[^a-zA-Z0-9])(?=.*\\d)(?=.*[a-z])(?=.*[A-Z]).{8,256}$";
private static final Pattern INVALID_USERNAME_CHARACTERS = Pattern.compile("([/\\s\\.\\?#%;\\\\]+)");
private static MessageDigest oneWayFunction = null;
static {
// No special characters
password = "aBc4ef7H8";
assertFalse(password.matches(regex));
+
+ // Underscore is a special character
+ password = "Azmb_123 ";
+ assertTrue(password.matches(regex));
}
}
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
- <version>2.3.6</version>
+ <version>${bundle.plugin.version}</version>
<extensions>true</extensions>
<configuration>
<instructions>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
- <version>2.3.6</version>
+ <version>${bundle.plugin.version}</version>
<extensions>true</extensions>
<configuration>
<instructions>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
- <version>2.3.6</version>
+ <version>${bundle.plugin.version}</version>
<extensions>true</extensions>
<configuration>
<instructions>
nodeDatum.put("mode", modeStr);
nodeDatum.put("json", gson.toJson(nodeDatum));
- nodeDatum.put("mac", HexEncode.bytesToHexString(device.getDataLayerAddress()));
+ nodeDatum.put("mac", HexEncode.bytesToHexStringFormat(device.getDataLayerAddress()));
StringBuffer sb1 = new StringBuffer();
Set<NodeConnector> nodeConnectorSet = device.getNodeConnectors();
if (nodeConnectorSet != null && nodeConnectorSet.size() > 0) {
footer: {
updateNode: function() {
var footer = [];
- var saveButton = one.lib.dashlet.button.single("Save", one.f.switchmanager.nodesLearnt.id.modal.save, "btn-success", "");
+ var saveButton = one.lib.dashlet.button.single("Save", one.f.switchmanager.nodesLearnt.id.modal.save, "btn-primary", "");
var $saveButton = one.lib.dashlet.button.button(saveButton);
footer.push($saveButton);
},
{
property: 'mac',
- label: 'MAC',
+ label: 'MAC Address',
sortable: true
},
{
one.f.switchmanager.subnetGatewayConfig.id.dashlet.addPorts, "btn-primary", "btn-mini");
var $button = one.lib.dashlet.button.button(button);
$button.click(function() {
+ if (one.f.switchmanager.subnetGatewayConfig.registry.gateways.length === 0) {
+ alert('No Gateways Exist');
+ return false;
+ }
var $modal = one.f.switchmanager.subnetGatewayConfig.modal.initialize.ports();
$modal.modal();
});
// gateway IP Mask
var $label = one.lib.form.label("Gateway IP Address/Mask");
var $input = one.lib.form.input("Gateway IP Address/Mask");
+ var $help = one.lib.form.help('Example: 192.168.10.254/16');
$input.attr('id', one.f.switchmanager.subnetGatewayConfig.id.modal.form.gatewayIPAddress);
- $fieldset.append($label).append($input);
+ $fieldset.append($label).append($input).append($help);
$form.append($fieldset);
return $form;
var $label = one.lib.form.label("Gateway Name");
var $select = one.lib.form.select.create(one.f.switchmanager.subnetGatewayConfig.registry.gateways);
$select.attr('id', one.f.switchmanager.subnetGatewayConfig.id.modal.form.name);
+ one.lib.form.select.prepend($select, { '' : 'Please Select a Gateway' });
$select.val($select.find("option:first").val());
$fieldset.append($label).append($select);
// ports
var $label = one.lib.form.label("Select Port");
var $select = one.lib.form.select.create();
+ one.lib.form.select.prepend($select, { '' : 'Please Select a Port' });
$select.attr('id', one.f.switchmanager.subnetGatewayConfig.id.modal.form.ports);
$fieldset.append($label).append($select);
},
footer : function() {
var footer = [];
- var saveButton = one.lib.dashlet.button.single("Save", one.f.switchmanager.subnetGatewayConfig.id.modal.save, "btn-success", "");
+ var saveButton = one.lib.dashlet.button.single("Save", one.f.switchmanager.subnetGatewayConfig.id.modal.save, "btn-primary", "");
var $saveButton = one.lib.dashlet.button.button(saveButton);
footer.push($saveButton);
return footer;
// static route IP Mask
var $label = one.lib.form.label("Static Route");
var $input = one.lib.form.input("Static Route");
+ var $help = one.lib.form.help('Example: 53.55.0.0/16');
$input.attr('id', one.f.switchmanager.staticRouteConfig.id.modal.form.staticRoute);
- $fieldset.append($label).append($input);
+ $fieldset.append($label).append($input).append($help);
// static route IP Mask
var $label = one.lib.form.label("Next Hop");
var $input = one.lib.form.input("Next Hop");
+ var $help = one.lib.form.help('Example: 192.168.10.254');
$input.attr('id', one.f.switchmanager.staticRouteConfig.id.modal.form.nextHop);
- $fieldset.append($label).append($input);
+ $fieldset.append($label).append($input).append($help);
// return
$form.append($fieldset);
return $form;
},
footer : function() {
var footer = [];
- var saveButton = one.lib.dashlet.button.single("Save", one.f.switchmanager.staticRouteConfig.id.modal.save, "btn-success", "");
+ var saveButton = one.lib.dashlet.button.single("Save", one.f.switchmanager.staticRouteConfig.id.modal.save, "btn-primary", "");
var $saveButton = one.lib.dashlet.button.button(saveButton);
footer.push($saveButton);
return footer;
// retrieve port value
var nodeId = $(this).find('option:selected').attr('value');
one.f.switchmanager.spanPortConfig.registry['currentNode'] = nodeId;
- var $ports = $('#' + one.f.switchmanager.spanPortConfig.id.modal.form.port);
+ var $ports = $('#'+one.f.switchmanager.spanPortConfig.id.modal.form.port);
var ports = one.f.switchmanager.spanPortConfig.registry['nodePorts'][nodeId]
var options = {};
$(ports).each(function(idx, val) {
options[val.internalPortName] = val.portName+' ('+val.portId+')';
});
one.lib.form.select.inject($ports, options);
+ one.lib.form.select.prepend($ports, {'':'Please Select a Port'});
+ $ports.val($ports.find('option:first').val());
});
$fieldset.append($label).append($select);
// input port
var $label = one.lib.form.label("Input Port");
var $select = one.lib.form.select.create();
+ one.lib.form.select.prepend($select, {'':'None'});
$select.attr('id', one.f.switchmanager.spanPortConfig.id.modal.form.port);
+ $select.val($select.find('option:first').val());
$fieldset.append($label).append($select);
// return
},
footer : function() {
var footer = [];
- var saveButton = one.lib.dashlet.button.single("Save", one.f.switchmanager.spanPortConfig.id.modal.save, "btn-success", "");
+ var saveButton = one.lib.dashlet.button.single("Save", one.f.switchmanager.spanPortConfig.id.modal.save, "btn-primary", "");
var $saveButton = one.lib.dashlet.button.button(saveButton);
footer.push($saveButton);
return footer;
},
removeMultiple: {
dialog: function(spanPortsToDelete) {
- var h3 = 'Remove Span Port';
+ var h3 = 'Remove SPAN Port';
var footer = one.f.switchmanager.spanPortConfig.modal.removeMultiple.footer();
var $body = one.f.switchmanager.spanPortConfig.modal.removeMultiple.body(spanPortsToDelete);
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
- <version>2.3.6</version>
+ <version>${bundle.plugin.version}</version>
<extensions>true</extensions>
<configuration>
<instructions>
var $form = $(document.createElement('form'));
var $fieldset = $(document.createElement('fieldset'));
// flow description
- var $legend = one.lib.form.legend("Flow Description");
+ var $legend = one.lib.form.legend("");
+ $legend.css('visibility', 'hidden');
$fieldset.append($legend);
// name
var $label = one.lib.form.label("Name");
$fieldset.append($label).append($input).append($help);
// srcMac
var $label = one.lib.form.label("Source MAC Address");
- var $input = one.lib.form.input("Source MAC Address");
+ var $input = one.lib.form.input("3c:97:0e:75:c3:f7");
$input.attr('id', one.f.flows.id.modal.form.srcMac);
- var $help = one.lib.form.help("Example: 00:11:22:aa:bb:cc");
- $fieldset.append($label).append($input).append($help);
+ $fieldset.append($label).append($input);
// dstMac
var $label = one.lib.form.label("Destination MAC Address");
- var $input = one.lib.form.input("Destination MAC Address");
+ var $input = one.lib.form.input("7c:d1:c3:e8:e6:99");
$input.attr('id', one.f.flows.id.modal.form.dstMac);
- var $help = one.lib.form.help("Example: 00:11:22:aa:bb:cc");
- $fieldset.append($label).append($input).append($help);
+ $fieldset.append($label).append($input);
// layer 3
var $legend = one.lib.form.legend("Layer 3");
$fieldset.append($legend);
// srcIp
var $label = one.lib.form.label("Source IP Address");
- var $input = one.lib.form.input("Source IP Address");
+ var $input = one.lib.form.input("192.168.3.128");
$input.attr('id', one.f.flows.id.modal.form.srcIp);
- var $help = one.lib.form.help("Example: 127.0.0.1");
- $fieldset.append($label).append($input).append($help);
+ $fieldset.append($label).append($input);
// dstIp
var $label = one.lib.form.label("Destination IP Address");
- var $input = one.lib.form.input("Destination IP Address");
+ var $input = one.lib.form.input("2001:2334::0/32");
$input.attr('id', one.f.flows.id.modal.form.dstIp);
- var $help = one.lib.form.help("Example: 127.0.0.1");
- $fieldset.append($label).append($input).append($help);
+ $fieldset.append($label).append($input);
// tosBits
var $label = one.lib.form.label("TOS Bits");
var $input = one.lib.form.input("TOS Bits");
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
- <version>2.3.6</version>
+ <version>${bundle.plugin.version}</version>
<extensions>true</extensions>
<configuration>
<instructions>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
- <version>2.3.6</version>
+ <version>${bundle.plugin.version}</version>
<extensions>true</extensions>
<configuration>
<instructions>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
- <version>2.3.6</version>
+ <version>${bundle.plugin.version}</version>
<extensions>true</extensions>
<configuration>
<instructions>
<version>1.1.0-SNAPSHOT</version>
<relativePath>../commons/thirdparty</relativePath>
</parent>
+ <scm>
+ <connection>scm:git:ssh://git.opendaylight.org:29418/controller.git</connection>
+ <developerConnection>scm:git:ssh://git.opendaylight.org:29418/controller.git</developerConnection>
+ <url>https://wiki.opendaylight.org/view/OpenDaylight_Controller:Main</url>
+ </scm>
<modelVersion>4.0.0</modelVersion>
<groupId>org.opendaylight.controller.thirdparty</groupId>
<artifactId>org.apache.catalina.filters.CorsFilter</artifactId>