[CORD-575] Implements VPWS transport in SR app
Changes:
- Enables the BoS==False use case;
- Adds RandomNeighborSet to emulate the hashing;
Change-Id: I5cc05eb25f5185e612061880fcdb194ed71277d8
diff --git a/apps/segmentrouting/src/main/java/org/onosproject/segmentrouting/SegmentRoutingManager.java b/apps/segmentrouting/src/main/java/org/onosproject/segmentrouting/SegmentRoutingManager.java
index a78f093..e7cf32f 100644
--- a/apps/segmentrouting/src/main/java/org/onosproject/segmentrouting/SegmentRoutingManager.java
+++ b/apps/segmentrouting/src/main/java/org/onosproject/segmentrouting/SegmentRoutingManager.java
@@ -585,15 +585,16 @@
* @param deviceId Device ID
* @param ns NegighborSet
* @param meta metadata passed into the creation of a Next Objective
+ * @param isBos indicates if it is BoS or not
* @return next objective ID or -1 if an error was encountered during the
* creation of the nextObjective
*/
public int getNextObjectiveId(DeviceId deviceId, NeighborSet ns,
- TrafficSelector meta) {
+ TrafficSelector meta, boolean isBos) {
if (groupHandlerMap.get(deviceId) != null) {
log.trace("getNextObjectiveId query in device {}", deviceId);
return groupHandlerMap
- .get(deviceId).getNextObjectiveId(ns, meta);
+ .get(deviceId).getNextObjectiveId(ns, meta, isBos);
} else {
log.warn("getNextObjectiveId query - groupHandler for device {} "
+ "not found", deviceId);
@@ -602,6 +603,23 @@
}
/**
+ * Returns the next objective ID for the given NeighborSet.
+ * If the nextObjective does not exist, a new one is created and
+ * its id is returned.
+ *
+ * @param deviceId Device ID
+ * @param ns NegighborSet
+ * @param meta metadata passed into the creation of a Next Objective
+ * @return next objective ID or -1 if an error was encountered during the
+ * creation of the nextObjective
+ */
+ public int getNextObjectiveId(DeviceId deviceId,
+ NeighborSet ns,
+ TrafficSelector meta) {
+ return this.getNextObjectiveId(deviceId, ns, meta, true);
+ }
+
+ /**
* Returns the next objective ID for the given subnet prefix. It is expected
* that the next-objective has been pre-created from configuration.
*