60
60
import org .osgi .service .component .annotations .Deactivate ;
61
61
import org .osgi .service .component .annotations .Reference ;
62
62
import org .osgi .service .component .annotations .ReferenceCardinality ;
63
- import org .onosproject .ngsdn .tutorial .common .Srv6DeviceConfig ;
63
+ import org .onosproject .ngsdn .tutorial .common .FabricDeviceConfig ;
64
64
import org .onosproject .ngsdn .tutorial .common .Utils ;
65
65
import org .slf4j .Logger ;
66
66
import org .slf4j .LoggerFactory ;
@@ -571,11 +571,6 @@ private void setUpSpineRoutes(DeviceId spineId) {
571
571
final MacAddress leafMac = getMyStationMac (leafId );
572
572
final Set <Ip6Prefix > subnetsToRoute = getInterfaceIpv6Prefixes (leafId );
573
573
574
- // Since we're here, we also add a route for SRv6, to forward
575
- // packets with IPv6 dst the SID of a leaf switch.
576
- final Ip6Address leafSid = getDeviceSid (leafId );
577
- subnetsToRoute .add (Ip6Prefix .valueOf (leafSid , 128 ));
578
-
579
574
// Create a group with only one member.
580
575
int groupId = macToGroupId (leafMac );
581
576
@@ -628,24 +623,6 @@ private void setUpLeafRoutes(DeviceId leafId) {
628
623
.collect (Collectors .toList ());
629
624
630
625
insertInOrder (ecmpGroup , flowRules );
631
-
632
- // Since we're here, we also add a route for SRv6, to forward
633
- // packets with IPv6 dst the SID of a spine switch, in this case using a
634
- // single-member group.
635
- stream (deviceService .getDevices ())
636
- .map (Device ::id )
637
- .filter (this ::isSpine )
638
- .forEach (spineId -> {
639
- MacAddress spineMac = getMyStationMac (spineId );
640
- Ip6Address spineSid = getDeviceSid (spineId );
641
- int spineGroupId = macToGroupId (spineMac );
642
- GroupDescription group = createNextHopGroup (
643
- spineGroupId , Collections .singleton (spineMac ), leafId );
644
- FlowRule routingRule = createRoutingRule (
645
- leafId , Ip6Prefix .valueOf (spineSid , 128 ),
646
- spineGroupId );
647
- insertInOrder (group , Collections .singleton (routingRule ));
648
- });
649
626
}
650
627
651
628
//--------------------------------------------------------------------------
@@ -660,7 +637,7 @@ private void setUpLeafRoutes(DeviceId leafId) {
660
637
* @return true if the device is a spine, false otherwise
661
638
*/
662
639
private boolean isSpine (DeviceId deviceId ) {
663
- return getDeviceConfig (deviceId ).map (Srv6DeviceConfig ::isSpine )
640
+ return getDeviceConfig (deviceId ).map (FabricDeviceConfig ::isSpine )
664
641
.orElseThrow (() -> new ItemNotFoundException (
665
642
"Missing isSpine config for " + deviceId ));
666
643
}
@@ -684,20 +661,20 @@ private boolean isLeaf(DeviceId deviceId) {
684
661
*/
685
662
private MacAddress getMyStationMac (DeviceId deviceId ) {
686
663
return getDeviceConfig (deviceId )
687
- .map (Srv6DeviceConfig ::myStationMac )
664
+ .map (FabricDeviceConfig ::myStationMac )
688
665
.orElseThrow (() -> new ItemNotFoundException (
689
666
"Missing myStationMac config for " + deviceId ));
690
667
}
691
668
692
669
/**
693
- * Returns the Srv6 config object for the given device.
670
+ * Returns the fabric config object for the given device.
694
671
*
695
672
* @param deviceId the device ID
696
- * @return Srv6 device config
673
+ * @return fabric device config
697
674
*/
698
- private Optional <Srv6DeviceConfig > getDeviceConfig (DeviceId deviceId ) {
699
- Srv6DeviceConfig config = networkConfigService .getConfig (
700
- deviceId , Srv6DeviceConfig .class );
675
+ private Optional <FabricDeviceConfig > getDeviceConfig (DeviceId deviceId ) {
676
+ FabricDeviceConfig config = networkConfigService .getConfig (
677
+ deviceId , FabricDeviceConfig .class );
701
678
return Optional .ofNullable (config );
702
679
}
703
680
@@ -749,19 +726,6 @@ private void insertInOrder(GroupDescription group, Collection<FlowRule> flowRule
749
726
}
750
727
}
751
728
752
- /**
753
- * Gets Srv6 SID for the given device.
754
- *
755
- * @param deviceId the device ID
756
- * @return SID for the device
757
- */
758
- private Ip6Address getDeviceSid (DeviceId deviceId ) {
759
- return getDeviceConfig (deviceId )
760
- .map (Srv6DeviceConfig ::mySid )
761
- .orElseThrow (() -> new ItemNotFoundException (
762
- "Missing mySid config for " + deviceId ));
763
- }
764
-
765
729
/**
766
730
* Sets up IPv6 routing on all devices known by ONOS and for which this ONOS
767
731
* node instance is currently master.
0 commit comments