Committed by
Gerrit Code Review
adding gfast support
Change-Id: I9970df58f18e839af5b201c5fcf1803a67dc1e32
Showing
1 changed file
with
16 additions
and
1 deletions
... | @@ -73,6 +73,7 @@ public class OLT { | ... | @@ -73,6 +73,7 @@ public class OLT { |
73 | public static final int UPLINK_PORT = 129; | 73 | public static final int UPLINK_PORT = 129; |
74 | 74 | ||
75 | public static final String OLT_DEVICE = "of:90e2ba82f97791e9"; | 75 | public static final String OLT_DEVICE = "of:90e2ba82f97791e9"; |
76 | + public static final String GFAST_DEVICE = "of:0011223344551357"; | ||
76 | 77 | ||
77 | @Property(name = "uplinkPort", intValue = UPLINK_PORT, | 78 | @Property(name = "uplinkPort", intValue = UPLINK_PORT, |
78 | label = "The OLT's uplink port number") | 79 | label = "The OLT's uplink port number") |
... | @@ -83,10 +84,14 @@ public class OLT { | ... | @@ -83,10 +84,14 @@ public class OLT { |
83 | label = "The OLT device id") | 84 | label = "The OLT device id") |
84 | private String oltDevice = OLT_DEVICE; | 85 | private String oltDevice = OLT_DEVICE; |
85 | 86 | ||
87 | + @Property(name = "gfastDevice", value = GFAST_DEVICE, | ||
88 | + label = "The gfast device id") | ||
89 | + private String gfastDevice = GFAST_DEVICE; | ||
90 | + | ||
86 | 91 | ||
87 | @Activate | 92 | @Activate |
88 | public void activate() { | 93 | public void activate() { |
89 | - appId = coreService.registerApplication("org.onosproject.mobility"); | 94 | + appId = coreService.registerApplication("org.onosproject.olt"); |
90 | 95 | ||
91 | deviceService.getPorts(DeviceId.deviceId(oltDevice)).stream().forEach( | 96 | deviceService.getPorts(DeviceId.deviceId(oltDevice)).stream().forEach( |
92 | port -> { | 97 | port -> { |
... | @@ -97,6 +102,16 @@ public class OLT { | ... | @@ -97,6 +102,16 @@ public class OLT { |
97 | } | 102 | } |
98 | } | 103 | } |
99 | ); | 104 | ); |
105 | + | ||
106 | + | ||
107 | + deviceService.getPorts(DeviceId.deviceId(gfastDevice)).stream().forEach( | ||
108 | + port -> { | ||
109 | + if (port.isEnabled()) { | ||
110 | + short vlanId = (short) (fetchVlanId(port.number()) + OFFSET); | ||
111 | + provisionVlanOnPort(port.number(), vlanId); | ||
112 | + } | ||
113 | + } | ||
114 | + ); | ||
100 | log.info("Started with Application ID {}", appId.id()); | 115 | log.info("Started with Application ID {}", appId.id()); |
101 | } | 116 | } |
102 | 117 | ... | ... |
-
Please register or login to post a comment