minor fix for olt
Change-Id: Ic0511b9cd669ea554e2d6ccead19da91a49ecfe3
Showing
1 changed file
with
14 additions
and
10 deletions
... | @@ -95,10 +95,12 @@ public class OLT { | ... | @@ -95,10 +95,12 @@ public class OLT { |
95 | 95 | ||
96 | deviceService.getPorts(DeviceId.deviceId(oltDevice)).stream().forEach( | 96 | deviceService.getPorts(DeviceId.deviceId(oltDevice)).stream().forEach( |
97 | port -> { | 97 | port -> { |
98 | - if (port.isEnabled()) { | 98 | + if (!port.number().isLogical() && port.isEnabled()) { |
99 | short vlanId = fetchVlanId(port.number()); | 99 | short vlanId = fetchVlanId(port.number()); |
100 | - provisionVlanOnPort(port.number(), (short) 7); | 100 | + if (vlanId > 0) { |
101 | - provisionVlanOnPort(port.number(), vlanId); | 101 | + provisionVlanOnPort(oltDevice, port.number(), (short) 7); |
102 | + provisionVlanOnPort(oltDevice, port.number(), vlanId); | ||
103 | + } | ||
102 | } | 104 | } |
103 | } | 105 | } |
104 | ); | 106 | ); |
... | @@ -106,9 +108,11 @@ public class OLT { | ... | @@ -106,9 +108,11 @@ public class OLT { |
106 | 108 | ||
107 | deviceService.getPorts(DeviceId.deviceId(gfastDevice)).stream().forEach( | 109 | deviceService.getPorts(DeviceId.deviceId(gfastDevice)).stream().forEach( |
108 | port -> { | 110 | port -> { |
109 | - if (port.isEnabled()) { | 111 | + if (!port.number().isLogical() && port.isEnabled()) { |
110 | short vlanId = (short) (fetchVlanId(port.number()) + OFFSET); | 112 | short vlanId = (short) (fetchVlanId(port.number()) + OFFSET); |
111 | - provisionVlanOnPort(port.number(), vlanId); | 113 | + if (vlanId > 0) { |
114 | + provisionVlanOnPort(gfastDevice, port.number(), vlanId); | ||
115 | + } | ||
112 | } | 116 | } |
113 | } | 117 | } |
114 | ); | 118 | ); |
... | @@ -144,8 +148,8 @@ public class OLT { | ... | @@ -144,8 +148,8 @@ public class OLT { |
144 | } | 148 | } |
145 | 149 | ||
146 | 150 | ||
147 | - private void provisionVlanOnPort(PortNumber p, short vlanId) { | 151 | + private void provisionVlanOnPort(String deviceId, PortNumber p, short vlanId) { |
148 | - | 152 | + DeviceId did = DeviceId.deviceId(deviceId); |
149 | 153 | ||
150 | TrafficSelector upstream = DefaultTrafficSelector.builder() | 154 | TrafficSelector upstream = DefaultTrafficSelector.builder() |
151 | .matchVlanId(VlanId.vlanId(vlanId)) | 155 | .matchVlanId(VlanId.vlanId(vlanId)) |
... | @@ -184,8 +188,8 @@ public class OLT { | ... | @@ -184,8 +188,8 @@ public class OLT { |
184 | .withTreatment(downStreamTreatment) | 188 | .withTreatment(downStreamTreatment) |
185 | .add(); | 189 | .add(); |
186 | 190 | ||
187 | - flowObjectiveService.forward(DeviceId.deviceId(oltDevice), upFwd); | 191 | + flowObjectiveService.forward(did, upFwd); |
188 | - flowObjectiveService.forward(DeviceId.deviceId(oltDevice), downFwd); | 192 | + flowObjectiveService.forward(did, downFwd); |
189 | 193 | ||
190 | } | 194 | } |
191 | 195 | ||
... | @@ -198,7 +202,7 @@ public class OLT { | ... | @@ -198,7 +202,7 @@ public class OLT { |
198 | case PORT_UPDATED: | 202 | case PORT_UPDATED: |
199 | if (devId.equals(event.subject().id()) && event.port().isEnabled()) { | 203 | if (devId.equals(event.subject().id()) && event.port().isEnabled()) { |
200 | short vlanId = fetchVlanId(event.port().number()); | 204 | short vlanId = fetchVlanId(event.port().number()); |
201 | - provisionVlanOnPort(event.port().number(), vlanId); | 205 | + provisionVlanOnPort(gfastDevice, event.port().number(), vlanId); |
202 | } | 206 | } |
203 | break; | 207 | break; |
204 | case DEVICE_ADDED: | 208 | case DEVICE_ADDED: | ... | ... |
-
Please register or login to post a comment