adding gfast support
Change-Id: I9970df58f18e839af5b201c5fcf1803a67dc1e32
diff --git a/src/main/java/org/onosproject/olt/OLT.java b/src/main/java/org/onosproject/olt/OLT.java
index d31ec05..8fbdc9a 100644
--- a/src/main/java/org/onosproject/olt/OLT.java
+++ b/src/main/java/org/onosproject/olt/OLT.java
@@ -73,6 +73,7 @@
public static final int UPLINK_PORT = 129;
public static final String OLT_DEVICE = "of:90e2ba82f97791e9";
+ public static final String GFAST_DEVICE = "of:0011223344551357";
@Property(name = "uplinkPort", intValue = UPLINK_PORT,
label = "The OLT's uplink port number")
@@ -83,10 +84,14 @@
label = "The OLT device id")
private String oltDevice = OLT_DEVICE;
+ @Property(name = "gfastDevice", value = GFAST_DEVICE,
+ label = "The gfast device id")
+ private String gfastDevice = GFAST_DEVICE;
+
@Activate
public void activate() {
- appId = coreService.registerApplication("org.onosproject.mobility");
+ appId = coreService.registerApplication("org.onosproject.olt");
deviceService.getPorts(DeviceId.deviceId(oltDevice)).stream().forEach(
port -> {
@@ -97,6 +102,16 @@
}
}
);
+
+
+ deviceService.getPorts(DeviceId.deviceId(gfastDevice)).stream().forEach(
+ port -> {
+ if (port.isEnabled()) {
+ short vlanId = (short) (fetchVlanId(port.number()) + OFFSET);
+ provisionVlanOnPort(port.number(), vlanId);
+ }
+ }
+ );
log.info("Started with Application ID {}", appId.id());
}