Add L2 selector options to connectivity intents
Added --etherType, --etherSrc, and --etherDst to
PointToPointIntent and MultiPontToSinglePointIntent
creation in the ONOS CLI.
Change-Id: Ibccd3c0b331e7f89be6903f264a6889ac1ad5f17
diff --git a/cli/src/main/java/org/onlab/onos/cli/net/EthTypeCompleter.java b/cli/src/main/java/org/onlab/onos/cli/net/EthTypeCompleter.java
new file mode 100644
index 0000000..51513ae
--- /dev/null
+++ b/cli/src/main/java/org/onlab/onos/cli/net/EthTypeCompleter.java
@@ -0,0 +1,28 @@
+package org.onlab.onos.cli.net;
+
+import java.util.List;
+import java.util.SortedSet;
+
+import org.apache.karaf.shell.console.Completer;
+import org.apache.karaf.shell.console.completer.StringsCompleter;
+
+/**
+ * Ethernet type completer.
+ */
+public class EthTypeCompleter implements Completer {
+ @Override
+ public int complete(String buffer, int cursor, List<String> candidates) {
+ // Delegate string completer
+ StringsCompleter delegate = new StringsCompleter();
+ SortedSet<String> strings = delegate.getStrings();
+ strings.add(EthType.ARP.toString());
+ strings.add(EthType.BSN.toString());
+ strings.add(EthType.IPV4.toString());
+ strings.add(EthType.LLDP.toString());
+ strings.add(EthType.RARP.toString());
+
+ // Now let the completer do the work for figuring out what to offer.
+ return delegate.complete(buffer, cursor, candidates);
+ }
+
+}