Modify MPLS/VLAN query
- ONOS-3507 VlanQuery to return available VLAN IDs
- ONOS-3508 MplsQuery to return available MPLS Labels
- Advertise that VLAN and MPLS resources are available on OVS
Change-Id: I74cd05393c8919b4823d0666348008adb93c9290
diff --git a/core/api/src/main/java/org/onosproject/net/behaviour/MplsQuery.java b/core/api/src/main/java/org/onosproject/net/behaviour/MplsQuery.java
index 0e9f466..80217a5 100644
--- a/core/api/src/main/java/org/onosproject/net/behaviour/MplsQuery.java
+++ b/core/api/src/main/java/org/onosproject/net/behaviour/MplsQuery.java
@@ -16,6 +16,10 @@
package org.onosproject.net.behaviour;
import com.google.common.annotations.Beta;
+
+import java.util.Set;
+
+import org.onlab.packet.MplsLabel;
import org.onosproject.net.PortNumber;
import org.onosproject.net.driver.HandlerBehaviour;
@@ -26,10 +30,11 @@
public interface MplsQuery extends HandlerBehaviour {
/**
- * Indicates if MPLS can be used at the port.
-
- * @param port port to be checked for the capability
- * @return true if MPLS can be used at the port, false otherwise.
+ * Returns set of MplsLabels which can be used at the port.
+ *
+ * @param port to be checked for the available resources.
+ * @return Set of MplsLabels which can be used at the port.
*/
- boolean isEnabled(PortNumber port);
+ Set<MplsLabel> queryMplsLabels(PortNumber port);
+
}
diff --git a/core/api/src/main/java/org/onosproject/net/behaviour/VlanQuery.java b/core/api/src/main/java/org/onosproject/net/behaviour/VlanQuery.java
index a1057c9..ce313f8 100644
--- a/core/api/src/main/java/org/onosproject/net/behaviour/VlanQuery.java
+++ b/core/api/src/main/java/org/onosproject/net/behaviour/VlanQuery.java
@@ -16,6 +16,9 @@
package org.onosproject.net.behaviour;
import com.google.common.annotations.Beta;
+
+import java.util.Set;
+import org.onlab.packet.VlanId;
import org.onosproject.net.PortNumber;
import org.onosproject.net.driver.HandlerBehaviour;
@@ -26,10 +29,11 @@
public interface VlanQuery extends HandlerBehaviour {
/**
- * Indicates if VLAN can be used at the port.
+ * Returns set of VlanIds which can be used at the port.
*
- * @param port port to be checked for the capability
- * @return true if VLAN can be used at the port, false otherwise.
+ * @param port to be checked for the available resources.
+ * @return Set of VlanIds which can be used at the port.
*/
- boolean isEnabled(PortNumber port);
+ Set<VlanId> queryVlanIds(PortNumber port);
+
}