[ONOS-4687] GoldenEye - Label map download issues.
Change-Id: I5b56ccc6b8bad3c585f4d33ddd6d9094751c8797
Showing
15 changed files
with
184 additions
and
142 deletions
... | @@ -893,9 +893,7 @@ public class PceManager implements PceService { | ... | @@ -893,9 +893,7 @@ public class PceManager implements PceService { |
893 | 893 | ||
894 | // Check whether device has SR-TE Capability | 894 | // Check whether device has SR-TE Capability |
895 | if (cfg.labelStackCap()) { | 895 | if (cfg.labelStackCap()) { |
896 | - if (!srTeHandler.allocateNodeLabel(deviceId, lsrId)) { | 896 | + srTeHandler.allocateNodeLabel(deviceId, lsrId); |
897 | - log.error("Node label allocation for a device id {} has failed.", deviceId.toString()); | ||
898 | - } | ||
899 | } | 897 | } |
900 | } | 898 | } |
901 | 899 | ||
... | @@ -974,10 +972,7 @@ public class PceManager implements PceService { | ... | @@ -974,10 +972,7 @@ public class PceManager implements PceService { |
974 | 972 | ||
975 | // Check whether device has SR-TE Capability | 973 | // Check whether device has SR-TE Capability |
976 | if (cfg.labelStackCap()) { | 974 | if (cfg.labelStackCap()) { |
977 | - if (!srTeHandler.allocateAdjacencyLabel(link)) { | 975 | + srTeHandler.allocateAdjacencyLabel(link); |
978 | - log.error("Unable to allocate adjacency label for a link {}.", link.toString()); | ||
979 | - return; | ||
980 | - } | ||
981 | } | 976 | } |
982 | 977 | ||
983 | return; | 978 | return; |
... | @@ -1209,16 +1204,13 @@ public class PceManager implements PceService { | ... | @@ -1209,16 +1204,13 @@ public class PceManager implements PceService { |
1209 | if (cfg.labelStackCap()) { | 1204 | if (cfg.labelStackCap()) { |
1210 | if (mastershipService.getLocalRole(deviceId) == MastershipRole.MASTER) { | 1205 | if (mastershipService.getLocalRole(deviceId) == MastershipRole.MASTER) { |
1211 | // Allocate node-label | 1206 | // Allocate node-label |
1212 | - if (!srTeHandler.allocateNodeLabel(deviceId, lsrId)) { | 1207 | + srTeHandler.allocateNodeLabel(deviceId, lsrId); |
1213 | - log.error("Node label allocation for a device id {} has failed.", deviceId.toString()); | ||
1214 | - } | ||
1215 | 1208 | ||
1216 | // Allocate adjacency label to links which are | 1209 | // Allocate adjacency label to links which are |
1217 | // originated from this specific device id | 1210 | // originated from this specific device id |
1218 | Set<Link> links = linkService.getDeviceEgressLinks(deviceId); | 1211 | Set<Link> links = linkService.getDeviceEgressLinks(deviceId); |
1219 | for (Link link : links) { | 1212 | for (Link link : links) { |
1220 | if (!srTeHandler.allocateAdjacencyLabel(link)) { | 1213 | if (!srTeHandler.allocateAdjacencyLabel(link)) { |
1221 | - log.debug("Unable to allocate adjacency labels for a link {}.", link.toString()); | ||
1222 | return; | 1214 | return; |
1223 | } | 1215 | } |
1224 | } | 1216 | } |
... | @@ -1240,40 +1232,42 @@ public class PceManager implements PceService { | ... | @@ -1240,40 +1232,42 @@ public class PceManager implements PceService { |
1240 | return false; | 1232 | return false; |
1241 | } | 1233 | } |
1242 | 1234 | ||
1243 | - Map<DeviceId, LabelResourceId> globalNodeLabelMap = pceStore.getGlobalNodeLabels(); | 1235 | + if (pceStore.getGlobalNodeLabel(deviceId) != null) { |
1236 | + Map<DeviceId, LabelResourceId> globalNodeLabelMap = pceStore.getGlobalNodeLabels(); | ||
1244 | 1237 | ||
1245 | - for (Entry<DeviceId, LabelResourceId> entry : globalNodeLabelMap.entrySet()) { | 1238 | + for (Entry<DeviceId, LabelResourceId> entry : globalNodeLabelMap.entrySet()) { |
1246 | 1239 | ||
1247 | - // Convert from DeviceId to TunnelEndPoint | 1240 | + // Convert from DeviceId to TunnelEndPoint |
1248 | - Device srcDevice = deviceService.getDevice(entry.getKey()); | 1241 | + Device srcDevice = deviceService.getDevice(entry.getKey()); |
1249 | 1242 | ||
1250 | - /* | 1243 | + /* |
1251 | - * If there is a slight difference in timing such that if device subsystem has removed the device but PCE | 1244 | + * If there is a slight difference in timing such that if device subsystem has removed the device but |
1252 | - * store still has it, just ignore such devices. | 1245 | + * PCE store still has it, just ignore such devices. |
1253 | - */ | 1246 | + */ |
1254 | - if (srcDevice == null) { | 1247 | + if (srcDevice == null) { |
1255 | - continue; | 1248 | + continue; |
1256 | - } | 1249 | + } |
1257 | 1250 | ||
1258 | - String srcLsrId = srcDevice.annotations().value(LSRID); | 1251 | + String srcLsrId = srcDevice.annotations().value(LSRID); |
1259 | - if (srcLsrId == null) { | 1252 | + if (srcLsrId == null) { |
1260 | - continue; | 1253 | + continue; |
1261 | - } | 1254 | + } |
1262 | 1255 | ||
1263 | - srTeHandler.advertiseNodeLabelRule(deviceId, | 1256 | + srTeHandler.advertiseNodeLabelRule(deviceId, |
1264 | - entry.getValue(), | 1257 | + entry.getValue(), |
1265 | - IpPrefix.valueOf(IpAddress.valueOf(srcLsrId), PREFIX_LENGTH), | 1258 | + IpPrefix.valueOf(IpAddress.valueOf(srcLsrId), PREFIX_LENGTH), |
1266 | - Objective.Operation.ADD, false); | 1259 | + Objective.Operation.ADD, false); |
1267 | - } | 1260 | + } |
1268 | 1261 | ||
1269 | - Map<Link, LabelResourceId> adjLabelMap = pceStore.getAdjLabels(); | 1262 | + Map<Link, LabelResourceId> adjLabelMap = pceStore.getAdjLabels(); |
1270 | - for (Entry<Link, LabelResourceId> entry : adjLabelMap.entrySet()) { | 1263 | + for (Entry<Link, LabelResourceId> entry : adjLabelMap.entrySet()) { |
1271 | - if (entry.getKey().src().deviceId().equals(deviceId)) { | 1264 | + if (entry.getKey().src().deviceId().equals(deviceId)) { |
1272 | - srTeHandler.installAdjLabelRule(deviceId, | 1265 | + srTeHandler.installAdjLabelRule(deviceId, |
1273 | - entry.getValue(), | 1266 | + entry.getValue(), |
1274 | - entry.getKey().src().port(), | 1267 | + entry.getKey().src().port(), |
1275 | - entry.getKey().dst().port(), | 1268 | + entry.getKey().dst().port(), |
1276 | - Objective.Operation.ADD); | 1269 | + Objective.Operation.ADD); |
1270 | + } | ||
1277 | } | 1271 | } |
1278 | } | 1272 | } |
1279 | 1273 | ... | ... |
... | @@ -28,7 +28,6 @@ import java.util.Set; | ... | @@ -28,7 +28,6 @@ import java.util.Set; |
28 | import org.onlab.packet.IpAddress; | 28 | import org.onlab.packet.IpAddress; |
29 | import org.onlab.packet.IpPrefix; | 29 | import org.onlab.packet.IpPrefix; |
30 | import org.onlab.packet.MplsLabel; | 30 | import org.onlab.packet.MplsLabel; |
31 | -import org.onlab.packet.TpPort; | ||
32 | import org.onosproject.core.ApplicationId; | 31 | import org.onosproject.core.ApplicationId; |
33 | import org.onosproject.incubator.net.resource.label.DefaultLabelResource; | 32 | import org.onosproject.incubator.net.resource.label.DefaultLabelResource; |
34 | import org.onosproject.incubator.net.resource.label.LabelResource; | 33 | import org.onosproject.incubator.net.resource.label.LabelResource; |
... | @@ -184,7 +183,7 @@ public final class PceccSrTeBeHandler { | ... | @@ -184,7 +183,7 @@ public final class PceccSrTeBeHandler { |
184 | 183 | ||
185 | // Check whether node-label was already configured for this specific device. | 184 | // Check whether node-label was already configured for this specific device. |
186 | if (pceStore.getGlobalNodeLabel(specificDeviceId) != null) { | 185 | if (pceStore.getGlobalNodeLabel(specificDeviceId) != null) { |
187 | - log.error("Node label was already configured for device {}.", specificDeviceId.toString()); | 186 | + log.debug("Node label was already configured for device {}.", specificDeviceId.toString()); |
188 | return false; | 187 | return false; |
189 | } | 188 | } |
190 | 189 | ||
... | @@ -228,12 +227,15 @@ public final class PceccSrTeBeHandler { | ... | @@ -228,12 +227,15 @@ public final class PceccSrTeBeHandler { |
228 | 227 | ||
229 | // Push to device | 228 | // Push to device |
230 | // Push label information of specificDeviceId to otherDevId in list and vice versa. | 229 | // Push label information of specificDeviceId to otherDevId in list and vice versa. |
231 | - advertiseNodeLabelRule(otherDevId, specificLabelId, | 230 | + if (!otherDevId.equals(specificDeviceId)) { |
232 | - IpPrefix.valueOf(IpAddress.valueOf(specificLsrId), PREFIX_LENGTH), | 231 | + advertiseNodeLabelRule(otherDevId, specificLabelId, |
233 | - Objective.Operation.ADD, false); | 232 | + IpPrefix.valueOf(IpAddress.valueOf(specificLsrId), PREFIX_LENGTH), |
234 | - advertiseNodeLabelRule(specificDeviceId, otherLabelId, | 233 | + Objective.Operation.ADD, false); |
235 | - IpPrefix.valueOf(IpAddress.valueOf(otherLsrId), PREFIX_LENGTH), | 234 | + |
236 | - Objective.Operation.ADD, false); | 235 | + advertiseNodeLabelRule(specificDeviceId, otherLabelId, |
236 | + IpPrefix.valueOf(IpAddress.valueOf(otherLsrId), PREFIX_LENGTH), | ||
237 | + Objective.Operation.ADD, false); | ||
238 | + } | ||
237 | } | 239 | } |
238 | 240 | ||
239 | return true; | 241 | return true; |
... | @@ -519,8 +521,8 @@ public final class PceccSrTeBeHandler { | ... | @@ -519,8 +521,8 @@ public final class PceccSrTeBeHandler { |
519 | TrafficSelector.Builder selectorBuilder = DefaultTrafficSelector.builder(); | 521 | TrafficSelector.Builder selectorBuilder = DefaultTrafficSelector.builder(); |
520 | 522 | ||
521 | selectorBuilder.matchMplsLabel(MplsLabel.mplsLabel(labelId.id().intValue())); | 523 | selectorBuilder.matchMplsLabel(MplsLabel.mplsLabel(labelId.id().intValue())); |
522 | - selectorBuilder.matchTcpSrc(TpPort.tpPort((int) srcPortNum.toLong())); | 524 | + selectorBuilder.matchIPSrc(IpPrefix.valueOf((int) srcPortNum.toLong(), 32)); |
523 | - selectorBuilder.matchTcpDst(TpPort.tpPort((int) dstPortNum.toLong())); | 525 | + selectorBuilder.matchIPDst(IpPrefix.valueOf((int) dstPortNum.toLong(), 32)); |
524 | 526 | ||
525 | TrafficTreatment treatment = DefaultTrafficTreatment.builder().build(); | 527 | TrafficTreatment treatment = DefaultTrafficTreatment.builder().build(); |
526 | 528 | ... | ... |
... | @@ -219,19 +219,19 @@ public class DistributedPceStore implements PceStore { | ... | @@ -219,19 +219,19 @@ public class DistributedPceStore implements PceStore { |
219 | @Override | 219 | @Override |
220 | public LabelResourceId getGlobalNodeLabel(DeviceId id) { | 220 | public LabelResourceId getGlobalNodeLabel(DeviceId id) { |
221 | checkNotNull(id, DEVICE_ID_NULL); | 221 | checkNotNull(id, DEVICE_ID_NULL); |
222 | - return globalNodeLabelMap.get(id).value(); | 222 | + return globalNodeLabelMap.get(id) == null ? null : globalNodeLabelMap.get(id).value(); |
223 | } | 223 | } |
224 | 224 | ||
225 | @Override | 225 | @Override |
226 | public LabelResourceId getAdjLabel(Link link) { | 226 | public LabelResourceId getAdjLabel(Link link) { |
227 | checkNotNull(link, LINK_NULL); | 227 | checkNotNull(link, LINK_NULL); |
228 | - return adjLabelMap.get(link).value(); | 228 | + return adjLabelMap.get(link) == null ? null : adjLabelMap.get(link).value(); |
229 | } | 229 | } |
230 | 230 | ||
231 | @Override | 231 | @Override |
232 | public PceccTunnelInfo getTunnelInfo(TunnelId tunnelId) { | 232 | public PceccTunnelInfo getTunnelInfo(TunnelId tunnelId) { |
233 | checkNotNull(tunnelId, TUNNEL_ID_NULL); | 233 | checkNotNull(tunnelId, TUNNEL_ID_NULL); |
234 | - return tunnelInfoMap.get(tunnelId).value(); | 234 | + return tunnelInfoMap.get(tunnelId) == null ? null : tunnelInfoMap.get(tunnelId).value(); |
235 | } | 235 | } |
236 | 236 | ||
237 | @Override | 237 | @Override | ... | ... |
... | @@ -13,7 +13,7 @@ | ... | @@ -13,7 +13,7 @@ |
13 | * See the License for the specific language governing permissions and | 13 | * See the License for the specific language governing permissions and |
14 | * limitations under the License. | 14 | * limitations under the License. |
15 | */ | 15 | */ |
16 | -package org.onosproject.provider.pcep.tunnel.impl; | 16 | +package org.onosproject.pcep.controller; |
17 | 17 | ||
18 | /** | 18 | /** |
19 | * Collection of keys for annotation for PCEP tunnels. | 19 | * Collection of keys for annotation for PCEP tunnels. | ... | ... |
... | @@ -13,7 +13,7 @@ | ... | @@ -13,7 +13,7 @@ |
13 | * See the License for the specific language governing permissions and | 13 | * See the License for the specific language governing permissions and |
14 | * limitations under the License. | 14 | * limitations under the License. |
15 | */ | 15 | */ |
16 | -package org.onosproject.provider.pcep.tunnel.impl; | 16 | +package org.onosproject.pcep.controller; |
17 | 17 | ||
18 | import static org.slf4j.LoggerFactory.getLogger; | 18 | import static org.slf4j.LoggerFactory.getLogger; |
19 | 19 | ... | ... |
... | @@ -62,6 +62,8 @@ import org.onosproject.pcepio.types.PcepValueType; | ... | @@ -62,6 +62,8 @@ import org.onosproject.pcepio.types.PcepValueType; |
62 | import org.slf4j.Logger; | 62 | import org.slf4j.Logger; |
63 | import org.slf4j.LoggerFactory; | 63 | import org.slf4j.LoggerFactory; |
64 | 64 | ||
65 | +import static org.onosproject.pcep.controller.PcepSyncStatus.NOT_SYNCED; | ||
66 | + | ||
65 | /** | 67 | /** |
66 | * Channel handler deals with the pcc client connection and dispatches | 68 | * Channel handler deals with the pcc client connection and dispatches |
67 | * messages from client to the appropriate locations. | 69 | * messages from client to the appropriate locations. |
... | @@ -233,6 +235,11 @@ class PcepChannelHandler extends IdleStateAwareChannelHandler { | ... | @@ -233,6 +235,11 @@ class PcepChannelHandler extends IdleStateAwareChannelHandler { |
233 | h.pcepPacketStats); | 235 | h.pcepPacketStats); |
234 | //Get pc instance and set capabilities | 236 | //Get pc instance and set capabilities |
235 | h.pc.setCapability(h.capability); | 237 | h.pc.setCapability(h.capability); |
238 | + | ||
239 | + // Initilialize DB sync status. | ||
240 | + h.pc.setLspDbSyncStatus(NOT_SYNCED); | ||
241 | + h.pc.setLabelDbSyncStatus(NOT_SYNCED); | ||
242 | + | ||
236 | // set the status of pcc as connected | 243 | // set the status of pcc as connected |
237 | h.pc.setConnected(true); | 244 | h.pc.setConnected(true); |
238 | h.pc.setChannel(h.channel); | 245 | h.pc.setChannel(h.channel); |
... | @@ -258,6 +265,7 @@ class PcepChannelHandler extends IdleStateAwareChannelHandler { | ... | @@ -258,6 +265,7 @@ class PcepChannelHandler extends IdleStateAwareChannelHandler { |
258 | log.debug("Keep alive time : " + keepAliveTimer); | 265 | log.debug("Keep alive time : " + keepAliveTimer); |
259 | 266 | ||
260 | //set the state handshake completion. | 267 | //set the state handshake completion. |
268 | + | ||
261 | h.sendKeepAliveMessage(); | 269 | h.sendKeepAliveMessage(); |
262 | h.pcepPacketStats.addOutPacket(); | 270 | h.pcepPacketStats.addOutPacket(); |
263 | h.setHandshakeComplete(true); | 271 | h.setHandshakeComplete(true); | ... | ... |
... | @@ -434,10 +434,16 @@ public class PcepClientControllerImpl implements PcepClientController { | ... | @@ -434,10 +434,16 @@ public class PcepClientControllerImpl implements PcepClientController { |
434 | } | 434 | } |
435 | 435 | ||
436 | List<PcepStateReport> syncStateRptList = pc.getSyncMsgList(pccId); | 436 | List<PcepStateReport> syncStateRptList = pc.getSyncMsgList(pccId); |
437 | + if (syncStateRptList == null) { | ||
438 | + // When there are no LSPs to sync, directly end-of-sync PCRpt will come and the | ||
439 | + // list will be null. | ||
440 | + syncStateRptList = Collections.EMPTY_LIST; | ||
441 | + } | ||
442 | + | ||
437 | Iterator<PcepStateReport> stateRptListIterator = syncStateRptList.iterator(); | 443 | Iterator<PcepStateReport> stateRptListIterator = syncStateRptList.iterator(); |
438 | 444 | ||
439 | // For every report, fetch PLSP id, local LSP id and symbolic path name from the message. | 445 | // For every report, fetch PLSP id, local LSP id and symbolic path name from the message. |
440 | - while (syncStateRptList.iterator().hasNext()) { | 446 | + while (stateRptListIterator.hasNext()) { |
441 | PcepStateReport stateRpt = stateRptListIterator.next(); | 447 | PcepStateReport stateRpt = stateRptListIterator.next(); |
442 | Tunnel tunnel = null; | 448 | Tunnel tunnel = null; |
443 | 449 | ... | ... |
... | @@ -73,7 +73,7 @@ public class PcepClientImpl implements PcepClientDriver { | ... | @@ -73,7 +73,7 @@ public class PcepClientImpl implements PcepClientDriver { |
73 | private byte sessionId; | 73 | private byte sessionId; |
74 | private PcepPacketStatsImpl pktStats; | 74 | private PcepPacketStatsImpl pktStats; |
75 | private Map<LspKey, Boolean> lspDelegationInfo; | 75 | private Map<LspKey, Boolean> lspDelegationInfo; |
76 | - private Map<PccId, List<PcepStateReport>> sycRptCache = new HashMap<>(); | 76 | + private Map<PccId, List<PcepStateReport>> syncRptCache = new HashMap<>(); |
77 | 77 | ||
78 | @Override | 78 | @Override |
79 | public void init(PccId pccId, PcepVersion pcepVersion, PcepPacketStats pktStats) { | 79 | public void init(PccId pccId, PcepVersion pcepVersion, PcepPacketStats pktStats) { |
... | @@ -267,24 +267,24 @@ public class PcepClientImpl implements PcepClientDriver { | ... | @@ -267,24 +267,24 @@ public class PcepClientImpl implements PcepClientDriver { |
267 | @Override | 267 | @Override |
268 | public void initializeSyncMsgList(PccId pccId) { | 268 | public void initializeSyncMsgList(PccId pccId) { |
269 | List<PcepStateReport> rptMsgList = new LinkedList<>(); | 269 | List<PcepStateReport> rptMsgList = new LinkedList<>(); |
270 | - sycRptCache.put(pccId, rptMsgList); | 270 | + syncRptCache.put(pccId, rptMsgList); |
271 | } | 271 | } |
272 | 272 | ||
273 | @Override | 273 | @Override |
274 | public List<PcepStateReport> getSyncMsgList(PccId pccId) { | 274 | public List<PcepStateReport> getSyncMsgList(PccId pccId) { |
275 | - return sycRptCache.get(pccId); | 275 | + return syncRptCache.get(pccId); |
276 | } | 276 | } |
277 | 277 | ||
278 | @Override | 278 | @Override |
279 | public void removeSyncMsgList(PccId pccId) { | 279 | public void removeSyncMsgList(PccId pccId) { |
280 | - sycRptCache.remove(pccId); | 280 | + syncRptCache.remove(pccId); |
281 | } | 281 | } |
282 | 282 | ||
283 | @Override | 283 | @Override |
284 | public void addSyncMsgToList(PccId pccId, PcepStateReport rptMsg) { | 284 | public void addSyncMsgToList(PccId pccId, PcepStateReport rptMsg) { |
285 | - List<PcepStateReport> rptMsgList = sycRptCache.get(pccId); | 285 | + List<PcepStateReport> rptMsgList = syncRptCache.get(pccId); |
286 | rptMsgList.add(rptMsg); | 286 | rptMsgList.add(rptMsg); |
287 | - sycRptCache.put(pccId, rptMsgList); | 287 | + syncRptCache.put(pccId, rptMsgList); |
288 | } | 288 | } |
289 | 289 | ||
290 | @Override | 290 | @Override | ... | ... |
... | @@ -15,6 +15,9 @@ | ... | @@ -15,6 +15,9 @@ |
15 | */ | 15 | */ |
16 | package org.onosproject.provider.bgpcep.flow.impl; | 16 | package org.onosproject.provider.bgpcep.flow.impl; |
17 | 17 | ||
18 | +import java.util.ArrayList; | ||
19 | +import java.util.Collection; | ||
20 | +import java.util.Collections; | ||
18 | import java.util.LinkedList; | 21 | import java.util.LinkedList; |
19 | import java.util.List; | 22 | import java.util.List; |
20 | 23 | ||
... | @@ -28,7 +31,6 @@ import org.onlab.packet.IpAddress; | ... | @@ -28,7 +31,6 @@ import org.onlab.packet.IpAddress; |
28 | import org.onlab.packet.IpPrefix; | 31 | import org.onlab.packet.IpPrefix; |
29 | import org.onlab.packet.MplsLabel; | 32 | import org.onlab.packet.MplsLabel; |
30 | import org.onosproject.bgp.controller.BgpController; | 33 | import org.onosproject.bgp.controller.BgpController; |
31 | -import org.onosproject.cfg.ComponentConfigService; | ||
32 | import org.onosproject.core.ApplicationId; | 34 | import org.onosproject.core.ApplicationId; |
33 | import org.onosproject.incubator.net.resource.label.LabelResourceId; | 35 | import org.onosproject.incubator.net.resource.label.LabelResourceId; |
34 | import org.onosproject.incubator.net.tunnel.IpTunnelEndPoint; | 36 | import org.onosproject.incubator.net.tunnel.IpTunnelEndPoint; |
... | @@ -42,21 +44,24 @@ import org.onosproject.net.Link; | ... | @@ -42,21 +44,24 @@ import org.onosproject.net.Link; |
42 | import org.onosproject.net.Path; | 44 | import org.onosproject.net.Path; |
43 | import org.onosproject.net.PortNumber; | 45 | import org.onosproject.net.PortNumber; |
44 | import org.onosproject.net.device.DeviceService; | 46 | import org.onosproject.net.device.DeviceService; |
47 | +import org.onosproject.net.flow.CompletedBatchOperation; | ||
48 | +import org.onosproject.net.flow.DefaultFlowEntry; | ||
49 | +import org.onosproject.net.flow.FlowEntry; | ||
45 | import org.onosproject.net.flow.FlowRule; | 50 | import org.onosproject.net.flow.FlowRule; |
51 | +import org.onosproject.net.flow.FlowRuleBatchEntry; | ||
46 | import org.onosproject.net.flow.FlowRuleBatchOperation; | 52 | import org.onosproject.net.flow.FlowRuleBatchOperation; |
47 | import org.onosproject.net.flow.FlowRuleProvider; | 53 | import org.onosproject.net.flow.FlowRuleProvider; |
48 | import org.onosproject.net.flow.FlowRuleProviderRegistry; | 54 | import org.onosproject.net.flow.FlowRuleProviderRegistry; |
49 | import org.onosproject.net.flow.FlowRuleProviderService; | 55 | import org.onosproject.net.flow.FlowRuleProviderService; |
50 | import org.onosproject.net.flow.TrafficSelector; | 56 | import org.onosproject.net.flow.TrafficSelector; |
57 | +import org.onosproject.net.flow.FlowEntry.FlowEntryState; | ||
51 | import org.onosproject.net.flow.criteria.Criterion; | 58 | import org.onosproject.net.flow.criteria.Criterion; |
52 | import org.onosproject.net.flow.criteria.IPCriterion; | 59 | import org.onosproject.net.flow.criteria.IPCriterion; |
53 | import org.onosproject.net.flow.criteria.MetadataCriterion; | 60 | import org.onosproject.net.flow.criteria.MetadataCriterion; |
54 | import org.onosproject.net.flow.criteria.MplsBosCriterion; | 61 | import org.onosproject.net.flow.criteria.MplsBosCriterion; |
55 | import org.onosproject.net.flow.criteria.MplsCriterion; | 62 | import org.onosproject.net.flow.criteria.MplsCriterion; |
56 | import org.onosproject.net.flow.criteria.PortCriterion; | 63 | import org.onosproject.net.flow.criteria.PortCriterion; |
57 | -import org.onosproject.net.flow.criteria.TcpPortCriterion; | ||
58 | import org.onosproject.net.flow.criteria.TunnelIdCriterion; | 64 | import org.onosproject.net.flow.criteria.TunnelIdCriterion; |
59 | -import org.onosproject.net.flowobjective.Objective; | ||
60 | import org.onosproject.net.provider.AbstractProvider; | 65 | import org.onosproject.net.provider.AbstractProvider; |
61 | import org.onosproject.net.provider.ProviderId; | 66 | import org.onosproject.net.provider.ProviderId; |
62 | import org.onosproject.net.resource.ResourceService; | 67 | import org.onosproject.net.resource.ResourceService; |
... | @@ -81,13 +86,14 @@ import org.onosproject.pcepio.types.PcepLabelDownload; | ... | @@ -81,13 +86,14 @@ import org.onosproject.pcepio.types.PcepLabelDownload; |
81 | import org.onosproject.pcepio.types.PcepLabelMap; | 86 | import org.onosproject.pcepio.types.PcepLabelMap; |
82 | import org.onosproject.pcepio.types.PcepValueType; | 87 | import org.onosproject.pcepio.types.PcepValueType; |
83 | import org.onosproject.pcepio.types.StatefulIPv4LspIdentifiersTlv; | 88 | import org.onosproject.pcepio.types.StatefulIPv4LspIdentifiersTlv; |
84 | -import org.onosproject.provider.pcep.tunnel.impl.SrpIdGenerators; | 89 | +import org.onosproject.pcep.controller.SrpIdGenerators; |
85 | -import org.onosproject.provider.pcep.tunnel.impl.PcepAnnotationKeys; | 90 | +import org.onosproject.pcep.controller.PcepAnnotationKeys; |
86 | import org.osgi.service.component.ComponentContext; | 91 | import org.osgi.service.component.ComponentContext; |
87 | import org.slf4j.Logger; | 92 | import org.slf4j.Logger; |
88 | 93 | ||
89 | import static org.onosproject.pcep.controller.PcepSyncStatus.IN_SYNC; | 94 | import static org.onosproject.pcep.controller.PcepSyncStatus.IN_SYNC; |
90 | import static org.onosproject.pcep.controller.PcepSyncStatus.SYNCED; | 95 | import static org.onosproject.pcep.controller.PcepSyncStatus.SYNCED; |
96 | +import static org.onosproject.net.flow.criteria.Criterion.Type.EXTENSION; | ||
91 | import static com.google.common.base.Preconditions.checkNotNull; | 97 | import static com.google.common.base.Preconditions.checkNotNull; |
92 | import static org.slf4j.LoggerFactory.getLogger; | 98 | import static org.slf4j.LoggerFactory.getLogger; |
93 | 99 | ||
... | @@ -104,9 +110,6 @@ public class BgpcepFlowRuleProvider extends AbstractProvider | ... | @@ -104,9 +110,6 @@ public class BgpcepFlowRuleProvider extends AbstractProvider |
104 | protected FlowRuleProviderRegistry providerRegistry; | 110 | protected FlowRuleProviderRegistry providerRegistry; |
105 | 111 | ||
106 | @Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY) | 112 | @Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY) |
107 | - protected ComponentConfigService cfgService; | ||
108 | - | ||
109 | - @Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY) | ||
110 | protected BgpController bgpController; | 113 | protected BgpController bgpController; |
111 | 114 | ||
112 | @Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY) | 115 | @Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY) |
... | @@ -129,6 +132,12 @@ public class BgpcepFlowRuleProvider extends AbstractProvider | ... | @@ -129,6 +132,12 @@ public class BgpcepFlowRuleProvider extends AbstractProvider |
129 | public static final long SET = 0xFFFFFFFFL; | 132 | public static final long SET = 0xFFFFFFFFL; |
130 | private static final String LSRID = "lsrId"; | 133 | private static final String LSRID = "lsrId"; |
131 | 134 | ||
135 | + private enum PcepFlowType { | ||
136 | + ADD, | ||
137 | + MODIFY, | ||
138 | + REMOVE | ||
139 | + } | ||
140 | + | ||
132 | /** | 141 | /** |
133 | * Creates a BgpFlow host provider. | 142 | * Creates a BgpFlow host provider. |
134 | */ | 143 | */ |
... | @@ -138,14 +147,12 @@ public class BgpcepFlowRuleProvider extends AbstractProvider | ... | @@ -138,14 +147,12 @@ public class BgpcepFlowRuleProvider extends AbstractProvider |
138 | 147 | ||
139 | @Activate | 148 | @Activate |
140 | public void activate(ComponentContext context) { | 149 | public void activate(ComponentContext context) { |
141 | - cfgService.registerProperties(getClass()); | ||
142 | providerService = providerRegistry.register(this); | 150 | providerService = providerRegistry.register(this); |
143 | log.info("Started"); | 151 | log.info("Started"); |
144 | } | 152 | } |
145 | 153 | ||
146 | @Deactivate | 154 | @Deactivate |
147 | public void deactivate(ComponentContext context) { | 155 | public void deactivate(ComponentContext context) { |
148 | - cfgService.unregisterProperties(getClass(), false); | ||
149 | providerRegistry.unregister(this); | 156 | providerRegistry.unregister(this); |
150 | providerService = null; | 157 | providerService = null; |
151 | log.info("Stopped"); | 158 | log.info("Stopped"); |
... | @@ -154,26 +161,25 @@ public class BgpcepFlowRuleProvider extends AbstractProvider | ... | @@ -154,26 +161,25 @@ public class BgpcepFlowRuleProvider extends AbstractProvider |
154 | @Override | 161 | @Override |
155 | public void applyFlowRule(FlowRule... flowRules) { | 162 | public void applyFlowRule(FlowRule... flowRules) { |
156 | for (FlowRule flowRule : flowRules) { | 163 | for (FlowRule flowRule : flowRules) { |
157 | - processRule(flowRule, Objective.Operation.ADD); | 164 | + processRule(flowRule, PcepFlowType.ADD); |
158 | } | 165 | } |
159 | } | 166 | } |
160 | 167 | ||
161 | @Override | 168 | @Override |
162 | public void removeFlowRule(FlowRule... flowRules) { | 169 | public void removeFlowRule(FlowRule... flowRules) { |
163 | for (FlowRule flowRule : flowRules) { | 170 | for (FlowRule flowRule : flowRules) { |
164 | - processRule(flowRule, Objective.Operation.REMOVE); | 171 | + processRule(flowRule, PcepFlowType.REMOVE); |
165 | } | 172 | } |
166 | } | 173 | } |
167 | 174 | ||
168 | - private void processRule(FlowRule flowRule, Objective.Operation type) { | 175 | + private void processRule(FlowRule flowRule, PcepFlowType type) { |
169 | MplsLabel mplsLabel = null; | 176 | MplsLabel mplsLabel = null; |
170 | - IpPrefix ip4Prefix = null; | 177 | + IpPrefix ip4PrefixSrc = null; |
178 | + IpPrefix ip4PrefixDst = null; | ||
171 | PortNumber port = null; | 179 | PortNumber port = null; |
172 | TunnelId tunnelId = null; | 180 | TunnelId tunnelId = null; |
173 | long labelType = 0; | 181 | long labelType = 0; |
174 | boolean bottomOfStack = false; | 182 | boolean bottomOfStack = false; |
175 | - int srcPort = 0; | ||
176 | - int dstPort = 0; | ||
177 | 183 | ||
178 | TrafficSelector selector = flowRule.selector(); | 184 | TrafficSelector selector = flowRule.selector(); |
179 | for (Criterion c : selector.criteria()) { | 185 | for (Criterion c : selector.criteria()) { |
... | @@ -184,20 +190,16 @@ public class BgpcepFlowRuleProvider extends AbstractProvider | ... | @@ -184,20 +190,16 @@ public class BgpcepFlowRuleProvider extends AbstractProvider |
184 | break; | 190 | break; |
185 | case IPV4_SRC: | 191 | case IPV4_SRC: |
186 | IPCriterion ipCriterion = (IPCriterion) c; | 192 | IPCriterion ipCriterion = (IPCriterion) c; |
187 | - ip4Prefix = ipCriterion.ip().getIp4Prefix(); | 193 | + ip4PrefixSrc = ipCriterion.ip().getIp4Prefix(); |
194 | + break; | ||
195 | + case IPV4_DST: | ||
196 | + ipCriterion = (IPCriterion) c; | ||
197 | + ip4PrefixDst = ipCriterion.ip().getIp4Prefix(); | ||
188 | break; | 198 | break; |
189 | case IN_PORT: | 199 | case IN_PORT: |
190 | PortCriterion inPort = (PortCriterion) c; | 200 | PortCriterion inPort = (PortCriterion) c; |
191 | port = inPort.port(); | 201 | port = inPort.port(); |
192 | break; | 202 | break; |
193 | - case TCP_SRC: | ||
194 | - TcpPortCriterion srcTcpPort = (TcpPortCriterion) c; | ||
195 | - srcPort = srcTcpPort.tcpPort().toInt(); | ||
196 | - break; | ||
197 | - case TCP_DST: | ||
198 | - TcpPortCriterion dstTcpPort = (TcpPortCriterion) c; | ||
199 | - dstPort = dstTcpPort.tcpPort().toInt(); | ||
200 | - break; | ||
201 | case TUNNEL_ID: | 203 | case TUNNEL_ID: |
202 | TunnelIdCriterion tc = (TunnelIdCriterion) c; | 204 | TunnelIdCriterion tc = (TunnelIdCriterion) c; |
203 | tunnelId = TunnelId.valueOf(String.valueOf(tc.tunnelId())); | 205 | tunnelId = TunnelId.valueOf(String.valueOf(tc.tunnelId())); |
... | @@ -224,13 +226,12 @@ public class BgpcepFlowRuleProvider extends AbstractProvider | ... | @@ -224,13 +226,12 @@ public class BgpcepFlowRuleProvider extends AbstractProvider |
224 | return; | 226 | return; |
225 | } | 227 | } |
226 | 228 | ||
227 | - if (srcPort != 0 && dstPort != 0) { | 229 | + if (ip4PrefixDst != null) { |
228 | - pushAdjacencyLabel(flowRule.deviceId(), label, PortNumber.portNumber(srcPort), | 230 | + pushAdjacencyLabel(flowRule.deviceId(), label, ip4PrefixSrc, ip4PrefixDst, type); |
229 | - PortNumber.portNumber(dstPort), type); | ||
230 | return; | 231 | return; |
231 | } | 232 | } |
232 | 233 | ||
233 | - pushGlobalNodeLabel(flowRule.deviceId(), label, ip4Prefix, type, bottomOfStack); | 234 | + pushGlobalNodeLabel(flowRule.deviceId(), label, ip4PrefixSrc, type, bottomOfStack); |
234 | 235 | ||
235 | } catch (PcepParseException e) { | 236 | } catch (PcepParseException e) { |
236 | log.error("Exception occured while sending label message to PCC {}", e.getMessage()); | 237 | log.error("Exception occured while sending label message to PCC {}", e.getMessage()); |
... | @@ -255,7 +256,7 @@ public class BgpcepFlowRuleProvider extends AbstractProvider | ... | @@ -255,7 +256,7 @@ public class BgpcepFlowRuleProvider extends AbstractProvider |
255 | 256 | ||
256 | //Pushes node labels to the specified device. | 257 | //Pushes node labels to the specified device. |
257 | private void pushGlobalNodeLabel(DeviceId deviceId, LabelResourceId labelId, | 258 | private void pushGlobalNodeLabel(DeviceId deviceId, LabelResourceId labelId, |
258 | - IpPrefix ipPrefix, Objective.Operation type, boolean isBos) throws PcepParseException { | 259 | + IpPrefix ipPrefix, PcepFlowType type, boolean isBos) throws PcepParseException { |
259 | 260 | ||
260 | checkNotNull(deviceId); | 261 | checkNotNull(deviceId); |
261 | checkNotNull(labelId); | 262 | checkNotNull(labelId); |
... | @@ -271,7 +272,7 @@ public class BgpcepFlowRuleProvider extends AbstractProvider | ... | @@ -271,7 +272,7 @@ public class BgpcepFlowRuleProvider extends AbstractProvider |
271 | 272 | ||
272 | if (ipPrefix == null) { | 273 | if (ipPrefix == null) { |
273 | // Pushing self node label to device. | 274 | // Pushing self node label to device. |
274 | - IpPrefix.valueOf(pc.getPccId().ipAddress(), 32); | 275 | + ipPrefix = IpPrefix.valueOf(pc.getPccId().ipAddress(), 32); |
275 | } | 276 | } |
276 | 277 | ||
277 | PcepFecObjectIPv4 fecObject = pc.factory().buildFecObjectIpv4() | 278 | PcepFecObjectIPv4 fecObject = pc.factory().buildFecObjectIpv4() |
... | @@ -279,16 +280,9 @@ public class BgpcepFlowRuleProvider extends AbstractProvider | ... | @@ -279,16 +280,9 @@ public class BgpcepFlowRuleProvider extends AbstractProvider |
279 | .build(); | 280 | .build(); |
280 | 281 | ||
281 | boolean bSFlag = false; | 282 | boolean bSFlag = false; |
282 | - if (pc.labelDbSyncStatus() == IN_SYNC) { | 283 | + if (pc.labelDbSyncStatus() == IN_SYNC && !isBos) { |
283 | - if (isBos) { | 284 | + // Need to set sync flag in all messages till sync completes. |
284 | - /* | 285 | + bSFlag = true; |
285 | - * Now the sync is completed. | ||
286 | - * Need to send label DB end-of-sync msg, i.e. S flag in SRP id is reset. | ||
287 | - */ | ||
288 | - pc.setLabelDbSyncStatus(SYNCED); | ||
289 | - } else { | ||
290 | - bSFlag = true; | ||
291 | - } | ||
292 | } | 286 | } |
293 | 287 | ||
294 | PcepSrpObject srpObj = getSrpObject(pc, type, bSFlag); | 288 | PcepSrpObject srpObj = getSrpObject(pc, type, bSFlag); |
... | @@ -312,14 +306,19 @@ public class BgpcepFlowRuleProvider extends AbstractProvider | ... | @@ -312,14 +306,19 @@ public class BgpcepFlowRuleProvider extends AbstractProvider |
312 | .build(); | 306 | .build(); |
313 | 307 | ||
314 | pc.sendMessage(labelMsg); | 308 | pc.sendMessage(labelMsg); |
309 | + | ||
310 | + if (isBos) { | ||
311 | + // Sync is completed. | ||
312 | + pc.setLabelDbSyncStatus(SYNCED); | ||
313 | + } | ||
315 | } | 314 | } |
316 | 315 | ||
317 | - private PcepSrpObject getSrpObject(PcepClient pc, Objective.Operation type, boolean bSFlag) | 316 | + private PcepSrpObject getSrpObject(PcepClient pc, PcepFlowType type, boolean bSFlag) |
318 | throws PcepParseException { | 317 | throws PcepParseException { |
319 | PcepSrpObject srpObj; | 318 | PcepSrpObject srpObj; |
320 | boolean bRFlag = false; | 319 | boolean bRFlag = false; |
321 | 320 | ||
322 | - if (!type.equals(Objective.Operation.ADD)) { | 321 | + if (!type.equals(PcepFlowType.ADD)) { |
323 | // To cleanup labels, R bit is set | 322 | // To cleanup labels, R bit is set |
324 | bRFlag = true; | 323 | bRFlag = true; |
325 | } | 324 | } |
... | @@ -334,13 +333,14 @@ public class BgpcepFlowRuleProvider extends AbstractProvider | ... | @@ -334,13 +333,14 @@ public class BgpcepFlowRuleProvider extends AbstractProvider |
334 | } | 333 | } |
335 | 334 | ||
336 | //Pushes adjacency labels to the specified device. | 335 | //Pushes adjacency labels to the specified device. |
337 | - private void pushAdjacencyLabel(DeviceId deviceId, LabelResourceId labelId, | 336 | + private void pushAdjacencyLabel(DeviceId deviceId, LabelResourceId labelId, IpPrefix ip4PrefixSrc, |
338 | - PortNumber srcPortNum, PortNumber dstPortNum, Objective.Operation type) throws PcepParseException { | 337 | + IpPrefix ip4PrefixDst, PcepFlowType type) |
338 | + throws PcepParseException { | ||
339 | 339 | ||
340 | checkNotNull(deviceId); | 340 | checkNotNull(deviceId); |
341 | checkNotNull(labelId); | 341 | checkNotNull(labelId); |
342 | - checkNotNull(srcPortNum); | 342 | + checkNotNull(ip4PrefixSrc); |
343 | - checkNotNull(dstPortNum); | 343 | + checkNotNull(ip4PrefixDst); |
344 | checkNotNull(type); | 344 | checkNotNull(type); |
345 | 345 | ||
346 | PcepClient pc = getPcepClient(deviceId); | 346 | PcepClient pc = getPcepClient(deviceId); |
... | @@ -351,17 +351,21 @@ public class BgpcepFlowRuleProvider extends AbstractProvider | ... | @@ -351,17 +351,21 @@ public class BgpcepFlowRuleProvider extends AbstractProvider |
351 | 351 | ||
352 | LinkedList<PcepLabelUpdate> labelUpdateList = new LinkedList<>(); | 352 | LinkedList<PcepLabelUpdate> labelUpdateList = new LinkedList<>(); |
353 | 353 | ||
354 | - long srcPortNo = srcPortNum.toLong(); | 354 | + int srcPortNo = ip4PrefixSrc.address().getIp4Address().toInt(); |
355 | - long dstPortNo = dstPortNum.toLong(); | 355 | + int dstPortNo = ip4PrefixDst.address().getIp4Address().toInt(); |
356 | - srcPortNo = ((srcPortNo & IDENTIFIER_SET) == IDENTIFIER_SET) ? srcPortNo & SET : srcPortNo; | ||
357 | - dstPortNo = ((dstPortNo & IDENTIFIER_SET) == IDENTIFIER_SET) ? dstPortNo & SET : dstPortNo; | ||
358 | 356 | ||
359 | PcepFecObjectIPv4Adjacency fecAdjObject = pc.factory().buildFecIpv4Adjacency() | 357 | PcepFecObjectIPv4Adjacency fecAdjObject = pc.factory().buildFecIpv4Adjacency() |
360 | - .seRemoteIPv4Address((int) dstPortNo) | 358 | + .seRemoteIPv4Address(dstPortNo) |
361 | - .seLocalIPv4Address((int) srcPortNo) | 359 | + .seLocalIPv4Address(srcPortNo) |
362 | .build(); | 360 | .build(); |
363 | 361 | ||
364 | - PcepSrpObject srpObj = getSrpObject(pc, type, false); | 362 | + boolean bSFlag = false; |
363 | + if (pc.labelDbSyncStatus() == IN_SYNC) { | ||
364 | + // Need to set sync flag in all messages till sync completes. | ||
365 | + bSFlag = true; | ||
366 | + } | ||
367 | + | ||
368 | + PcepSrpObject srpObj = getSrpObject(pc, type, bSFlag); | ||
365 | 369 | ||
366 | //Adjacency label object | 370 | //Adjacency label object |
367 | PcepLabelObject labelObject = pc.factory().buildLabelObject() | 371 | PcepLabelObject labelObject = pc.factory().buildLabelObject() |
... | @@ -387,7 +391,7 @@ public class BgpcepFlowRuleProvider extends AbstractProvider | ... | @@ -387,7 +391,7 @@ public class BgpcepFlowRuleProvider extends AbstractProvider |
387 | //Pushes local labels to the device which is specific to path [CR-case]. | 391 | //Pushes local labels to the device which is specific to path [CR-case]. |
388 | private void pushLocalLabels(DeviceId deviceId, LabelResourceId labelId, | 392 | private void pushLocalLabels(DeviceId deviceId, LabelResourceId labelId, |
389 | PortNumber portNum, TunnelId tunnelId, | 393 | PortNumber portNum, TunnelId tunnelId, |
390 | - Boolean isBos, Long labelType, Objective.Operation type) throws PcepParseException { | 394 | + Boolean isBos, Long labelType, PcepFlowType type) throws PcepParseException { |
391 | 395 | ||
392 | checkNotNull(deviceId); | 396 | checkNotNull(deviceId); |
393 | checkNotNull(labelId); | 397 | checkNotNull(labelId); |
... | @@ -559,6 +563,31 @@ public class BgpcepFlowRuleProvider extends AbstractProvider | ... | @@ -559,6 +563,31 @@ public class BgpcepFlowRuleProvider extends AbstractProvider |
559 | 563 | ||
560 | @Override | 564 | @Override |
561 | public void executeBatch(FlowRuleBatchOperation batch) { | 565 | public void executeBatch(FlowRuleBatchOperation batch) { |
562 | - //TODO | 566 | + Collection<FlowEntry> flowEntries = new ArrayList<>(); |
567 | + | ||
568 | + for (FlowRuleBatchEntry fbe : batch.getOperations()) { | ||
569 | + Criterion criteria = fbe.target().selector().getCriterion(EXTENSION); | ||
570 | + | ||
571 | + switch (fbe.operator()) { | ||
572 | + case ADD: | ||
573 | + if (criteria == null) { | ||
574 | + processRule(fbe.target(), PcepFlowType.ADD); | ||
575 | + flowEntries.add(new DefaultFlowEntry(fbe.target(), FlowEntryState.ADDED, 0, 0, 0)); | ||
576 | + } | ||
577 | + break; | ||
578 | + case REMOVE: | ||
579 | + if (criteria == null) { | ||
580 | + processRule(fbe.target(), PcepFlowType.REMOVE); | ||
581 | + flowEntries.add(new DefaultFlowEntry(fbe.target(), FlowEntryState.REMOVED, 0, 0, 0)); | ||
582 | + } | ||
583 | + break; | ||
584 | + default: | ||
585 | + log.error("Unknown flow operation: {}", fbe); | ||
586 | + } | ||
587 | + } | ||
588 | + | ||
589 | + CompletedBatchOperation status = new CompletedBatchOperation(true, Collections.emptySet(), batch.deviceId()); | ||
590 | + providerService.batchOperationCompleted(batch.id(), status); | ||
591 | + providerService.pushFlowMetrics(batch.deviceId(), flowEntries); | ||
563 | } | 592 | } |
564 | } | 593 | } | ... | ... |
... | @@ -82,6 +82,7 @@ import org.onosproject.pcep.controller.PcepClientListener; | ... | @@ -82,6 +82,7 @@ import org.onosproject.pcep.controller.PcepClientListener; |
82 | import org.onosproject.pcep.controller.PcepEventListener; | 82 | import org.onosproject.pcep.controller.PcepEventListener; |
83 | import org.onosproject.pcep.controller.PcepLspStatus; | 83 | import org.onosproject.pcep.controller.PcepLspStatus; |
84 | import org.onosproject.pcep.controller.PcepLspSyncAction; | 84 | import org.onosproject.pcep.controller.PcepLspSyncAction; |
85 | +import org.onosproject.pcep.controller.SrpIdGenerators; | ||
85 | import org.onosproject.pcepio.exceptions.PcepParseException; | 86 | import org.onosproject.pcepio.exceptions.PcepParseException; |
86 | import org.onosproject.pcepio.protocol.PcInitiatedLspRequest; | 87 | import org.onosproject.pcepio.protocol.PcInitiatedLspRequest; |
87 | import org.onosproject.pcepio.protocol.PcepAttribute; | 88 | import org.onosproject.pcepio.protocol.PcepAttribute; |
... | @@ -131,13 +132,13 @@ import static org.onosproject.net.PortNumber.portNumber; | ... | @@ -131,13 +132,13 @@ import static org.onosproject.net.PortNumber.portNumber; |
131 | import static org.onosproject.pcep.api.PcepDpid.uri; | 132 | import static org.onosproject.pcep.api.PcepDpid.uri; |
132 | import static org.onosproject.provider.pcep.tunnel.impl.LspType.WITH_SIGNALLING; | 133 | import static org.onosproject.provider.pcep.tunnel.impl.LspType.WITH_SIGNALLING; |
133 | import static org.onosproject.provider.pcep.tunnel.impl.LspType.SR_WITHOUT_SIGNALLING; | 134 | import static org.onosproject.provider.pcep.tunnel.impl.LspType.SR_WITHOUT_SIGNALLING; |
134 | -import static org.onosproject.provider.pcep.tunnel.impl.PcepAnnotationKeys.BANDWIDTH; | 135 | +import static org.onosproject.pcep.controller.PcepAnnotationKeys.BANDWIDTH; |
135 | -import static org.onosproject.provider.pcep.tunnel.impl.PcepAnnotationKeys.LOCAL_LSP_ID; | 136 | +import static org.onosproject.pcep.controller.PcepAnnotationKeys.LOCAL_LSP_ID; |
136 | -import static org.onosproject.provider.pcep.tunnel.impl.PcepAnnotationKeys.LSP_SIG_TYPE; | 137 | +import static org.onosproject.pcep.controller.PcepAnnotationKeys.LSP_SIG_TYPE; |
137 | -import static org.onosproject.provider.pcep.tunnel.impl.PcepAnnotationKeys.PCC_TUNNEL_ID; | 138 | +import static org.onosproject.pcep.controller.PcepAnnotationKeys.PCC_TUNNEL_ID; |
138 | -import static org.onosproject.provider.pcep.tunnel.impl.PcepAnnotationKeys.PLSP_ID; | 139 | +import static org.onosproject.pcep.controller.PcepAnnotationKeys.PLSP_ID; |
139 | -import static org.onosproject.provider.pcep.tunnel.impl.PcepAnnotationKeys.DELEGATE; | 140 | +import static org.onosproject.pcep.controller.PcepAnnotationKeys.DELEGATE; |
140 | -import static org.onosproject.provider.pcep.tunnel.impl.PcepAnnotationKeys.COST_TYPE; | 141 | +import static org.onosproject.pcep.controller.PcepAnnotationKeys.COST_TYPE; |
141 | import static org.onosproject.provider.pcep.tunnel.impl.RequestType.CREATE; | 142 | import static org.onosproject.provider.pcep.tunnel.impl.RequestType.CREATE; |
142 | import static org.onosproject.provider.pcep.tunnel.impl.RequestType.DELETE; | 143 | import static org.onosproject.provider.pcep.tunnel.impl.RequestType.DELETE; |
143 | import static org.onosproject.provider.pcep.tunnel.impl.RequestType.LSP_STATE_RPT; | 144 | import static org.onosproject.provider.pcep.tunnel.impl.RequestType.LSP_STATE_RPT; | ... | ... |
... | @@ -23,7 +23,7 @@ import static org.onosproject.net.DefaultAnnotations.EMPTY; | ... | @@ -23,7 +23,7 @@ import static org.onosproject.net.DefaultAnnotations.EMPTY; |
23 | import static org.onosproject.provider.pcep.tunnel.impl.LspType.WITH_SIGNALLING; | 23 | import static org.onosproject.provider.pcep.tunnel.impl.LspType.WITH_SIGNALLING; |
24 | import static org.onosproject.provider.pcep.tunnel.impl.LspType.SR_WITHOUT_SIGNALLING; | 24 | import static org.onosproject.provider.pcep.tunnel.impl.LspType.SR_WITHOUT_SIGNALLING; |
25 | import static org.onosproject.provider.pcep.tunnel.impl.LspType.WITHOUT_SIGNALLING_AND_WITHOUT_SR; | 25 | import static org.onosproject.provider.pcep.tunnel.impl.LspType.WITHOUT_SIGNALLING_AND_WITHOUT_SR; |
26 | -import static org.onosproject.provider.pcep.tunnel.impl.PcepAnnotationKeys.LSP_SIG_TYPE; | 26 | +import static org.onosproject.pcep.controller.PcepAnnotationKeys.LSP_SIG_TYPE; |
27 | 27 | ||
28 | import java.io.IOException; | 28 | import java.io.IOException; |
29 | import java.util.ArrayList; | 29 | import java.util.ArrayList; | ... | ... |
... | @@ -23,7 +23,7 @@ import static org.hamcrest.Matchers.nullValue; | ... | @@ -23,7 +23,7 @@ import static org.hamcrest.Matchers.nullValue; |
23 | import static org.onosproject.provider.pcep.tunnel.impl.LspType.WITH_SIGNALLING; | 23 | import static org.onosproject.provider.pcep.tunnel.impl.LspType.WITH_SIGNALLING; |
24 | import static org.onosproject.provider.pcep.tunnel.impl.LspType.SR_WITHOUT_SIGNALLING; | 24 | import static org.onosproject.provider.pcep.tunnel.impl.LspType.SR_WITHOUT_SIGNALLING; |
25 | import static org.onosproject.provider.pcep.tunnel.impl.LspType.WITHOUT_SIGNALLING_AND_WITHOUT_SR; | 25 | import static org.onosproject.provider.pcep.tunnel.impl.LspType.WITHOUT_SIGNALLING_AND_WITHOUT_SR; |
26 | -import static org.onosproject.provider.pcep.tunnel.impl.PcepAnnotationKeys.LSP_SIG_TYPE; | 26 | +import static org.onosproject.pcep.controller.PcepAnnotationKeys.LSP_SIG_TYPE; |
27 | 27 | ||
28 | import java.io.IOException; | 28 | import java.io.IOException; |
29 | import java.util.ArrayList; | 29 | import java.util.ArrayList; | ... | ... |
... | @@ -19,12 +19,12 @@ import static org.hamcrest.MatcherAssert.assertThat; | ... | @@ -19,12 +19,12 @@ import static org.hamcrest.MatcherAssert.assertThat; |
19 | import static org.hamcrest.core.Is.is; | 19 | import static org.hamcrest.core.Is.is; |
20 | import static org.onosproject.incubator.net.tunnel.Tunnel.Type.MPLS; | 20 | import static org.onosproject.incubator.net.tunnel.Tunnel.Type.MPLS; |
21 | import static org.onosproject.incubator.net.tunnel.Tunnel.State.INIT; | 21 | import static org.onosproject.incubator.net.tunnel.Tunnel.State.INIT; |
22 | -import static org.onosproject.provider.pcep.tunnel.impl.PcepAnnotationKeys.BANDWIDTH; | 22 | +import static org.onosproject.pcep.controller.PcepAnnotationKeys.BANDWIDTH; |
23 | -import static org.onosproject.provider.pcep.tunnel.impl.PcepAnnotationKeys.LOCAL_LSP_ID; | 23 | +import static org.onosproject.pcep.controller.PcepAnnotationKeys.LOCAL_LSP_ID; |
24 | -import static org.onosproject.provider.pcep.tunnel.impl.PcepAnnotationKeys.LSP_SIG_TYPE; | 24 | +import static org.onosproject.pcep.controller.PcepAnnotationKeys.LSP_SIG_TYPE; |
25 | -import static org.onosproject.provider.pcep.tunnel.impl.PcepAnnotationKeys.PCC_TUNNEL_ID; | 25 | +import static org.onosproject.pcep.controller.PcepAnnotationKeys.PCC_TUNNEL_ID; |
26 | -import static org.onosproject.provider.pcep.tunnel.impl.PcepAnnotationKeys.PLSP_ID; | 26 | +import static org.onosproject.pcep.controller.PcepAnnotationKeys.PLSP_ID; |
27 | -import static org.onosproject.provider.pcep.tunnel.impl.PcepAnnotationKeys.DELEGATE; | 27 | +import static org.onosproject.pcep.controller.PcepAnnotationKeys.DELEGATE; |
28 | import static org.onosproject.provider.pcep.tunnel.impl.LspType.WITHOUT_SIGNALLING_AND_WITHOUT_SR; | 28 | import static org.onosproject.provider.pcep.tunnel.impl.LspType.WITHOUT_SIGNALLING_AND_WITHOUT_SR; |
29 | import static org.onosproject.pcep.controller.PcepSyncStatus.SYNCED; | 29 | import static org.onosproject.pcep.controller.PcepSyncStatus.SYNCED; |
30 | import static org.onosproject.net.Device.Type.ROUTER; | 30 | import static org.onosproject.net.Device.Type.ROUTER; | ... | ... |
... | @@ -20,7 +20,7 @@ import static org.hamcrest.Matchers.nullValue; | ... | @@ -20,7 +20,7 @@ import static org.hamcrest.Matchers.nullValue; |
20 | import static org.hamcrest.core.IsNot.not; | 20 | import static org.hamcrest.core.IsNot.not; |
21 | import static org.onosproject.net.DefaultAnnotations.EMPTY; | 21 | import static org.onosproject.net.DefaultAnnotations.EMPTY; |
22 | import static org.onosproject.provider.pcep.tunnel.impl.LspType.WITH_SIGNALLING; | 22 | import static org.onosproject.provider.pcep.tunnel.impl.LspType.WITH_SIGNALLING; |
23 | -import static org.onosproject.provider.pcep.tunnel.impl.PcepAnnotationKeys.LSP_SIG_TYPE; | 23 | +import static org.onosproject.pcep.controller.PcepAnnotationKeys.LSP_SIG_TYPE; |
24 | 24 | ||
25 | import java.io.IOException; | 25 | import java.io.IOException; |
26 | import java.util.ArrayList; | 26 | import java.util.ArrayList; | ... | ... |
... | @@ -20,7 +20,9 @@ import static org.hamcrest.Matchers.nullValue; | ... | @@ -20,7 +20,9 @@ import static org.hamcrest.Matchers.nullValue; |
20 | import static org.hamcrest.core.Is.is; | 20 | import static org.hamcrest.core.Is.is; |
21 | import static org.hamcrest.core.IsNot.not; | 21 | import static org.hamcrest.core.IsNot.not; |
22 | import static org.onosproject.net.DefaultAnnotations.EMPTY; | 22 | import static org.onosproject.net.DefaultAnnotations.EMPTY; |
23 | -import static org.onosproject.provider.pcep.tunnel.impl.PcepAnnotationKeys.LSP_SIG_TYPE; | 23 | +import static org.onosproject.pcep.controller.PcepAnnotationKeys.LSP_SIG_TYPE; |
24 | +import static org.onosproject.pcep.controller.PcepAnnotationKeys.LOCAL_LSP_ID; | ||
25 | +import static org.onosproject.pcep.controller.PcepAnnotationKeys.PLSP_ID; | ||
24 | 26 | ||
25 | import java.io.IOException; | 27 | import java.io.IOException; |
26 | import java.util.ArrayList; | 28 | import java.util.ArrayList; |
... | @@ -112,8 +114,8 @@ public class PcepUpdateTunnelProviderTest { | ... | @@ -112,8 +114,8 @@ public class PcepUpdateTunnelProviderTest { |
112 | path = new DefaultPath(pid, links, 20, EMPTY); | 114 | path = new DefaultPath(pid, links, 20, EMPTY); |
113 | 115 | ||
114 | Annotations annotations = DefaultAnnotations.builder() | 116 | Annotations annotations = DefaultAnnotations.builder() |
115 | - .set(PcepAnnotationKeys.PLSP_ID, "1") | 117 | + .set(PLSP_ID, "1") |
116 | - .set(PcepAnnotationKeys.LOCAL_LSP_ID, "1") | 118 | + .set(LOCAL_LSP_ID, "1") |
117 | .set(LSP_SIG_TYPE, WITH_SIGNALLING.name()) | 119 | .set(LSP_SIG_TYPE, WITH_SIGNALLING.name()) |
118 | .build(); | 120 | .build(); |
119 | 121 | ||
... | @@ -173,8 +175,8 @@ public class PcepUpdateTunnelProviderTest { | ... | @@ -173,8 +175,8 @@ public class PcepUpdateTunnelProviderTest { |
173 | 175 | ||
174 | Annotations annotations = DefaultAnnotations.builder() | 176 | Annotations annotations = DefaultAnnotations.builder() |
175 | .set(LSP_SIG_TYPE, WITH_SIGNALLING.name()) | 177 | .set(LSP_SIG_TYPE, WITH_SIGNALLING.name()) |
176 | - .set(PcepAnnotationKeys.PLSP_ID, "1") | 178 | + .set(PLSP_ID, "1") |
177 | - .set(PcepAnnotationKeys.LOCAL_LSP_ID, "1") | 179 | + .set(LOCAL_LSP_ID, "1") |
178 | .build(); | 180 | .build(); |
179 | 181 | ||
180 | tunnel = new DefaultTunnel(pid, ipTunnelEndPointSrc, ipTunnelEndPointDst, Tunnel.Type.MPLS, | 182 | tunnel = new DefaultTunnel(pid, ipTunnelEndPointSrc, ipTunnelEndPointDst, Tunnel.Type.MPLS, |
... | @@ -233,8 +235,8 @@ public class PcepUpdateTunnelProviderTest { | ... | @@ -233,8 +235,8 @@ public class PcepUpdateTunnelProviderTest { |
233 | 235 | ||
234 | Annotations annotations = DefaultAnnotations.builder() | 236 | Annotations annotations = DefaultAnnotations.builder() |
235 | .set(LSP_SIG_TYPE, SR_WITHOUT_SIGNALLING.name()) | 237 | .set(LSP_SIG_TYPE, SR_WITHOUT_SIGNALLING.name()) |
236 | - .set(PcepAnnotationKeys.PLSP_ID, "1") | 238 | + .set(PLSP_ID, "1") |
237 | - .set(PcepAnnotationKeys.LOCAL_LSP_ID, "1") | 239 | + .set(LOCAL_LSP_ID, "1") |
238 | .build(); | 240 | .build(); |
239 | 241 | ||
240 | tunnel = new DefaultTunnel(pid, ipTunnelEndPointSrc, ipTunnelEndPointDst, Tunnel.Type.MPLS, | 242 | tunnel = new DefaultTunnel(pid, ipTunnelEndPointSrc, ipTunnelEndPointDst, Tunnel.Type.MPLS, |
... | @@ -293,8 +295,8 @@ public class PcepUpdateTunnelProviderTest { | ... | @@ -293,8 +295,8 @@ public class PcepUpdateTunnelProviderTest { |
293 | 295 | ||
294 | Annotations annotations = DefaultAnnotations.builder() | 296 | Annotations annotations = DefaultAnnotations.builder() |
295 | .set(LSP_SIG_TYPE, WITHOUT_SIGNALLING_AND_WITHOUT_SR.name()) | 297 | .set(LSP_SIG_TYPE, WITHOUT_SIGNALLING_AND_WITHOUT_SR.name()) |
296 | - .set(PcepAnnotationKeys.PLSP_ID, "1") | 298 | + .set(PLSP_ID, "1") |
297 | - .set(PcepAnnotationKeys.LOCAL_LSP_ID, "1") | 299 | + .set(LOCAL_LSP_ID, "1") |
298 | .build(); | 300 | .build(); |
299 | 301 | ||
300 | tunnel = new DefaultTunnel(pid, ipTunnelEndPointSrc, ipTunnelEndPointDst, Tunnel.Type.MPLS, | 302 | tunnel = new DefaultTunnel(pid, ipTunnelEndPointSrc, ipTunnelEndPointDst, Tunnel.Type.MPLS, | ... | ... |
-
Please register or login to post a comment