6060import org .osgi .service .component .annotations .Deactivate ;
6161import org .osgi .service .component .annotations .Reference ;
6262import org .osgi .service .component .annotations .ReferenceCardinality ;
63- import org .onosproject .ngsdn .tutorial .common .Srv6DeviceConfig ;
63+ import org .onosproject .ngsdn .tutorial .common .FabricDeviceConfig ;
6464import org .onosproject .ngsdn .tutorial .common .Utils ;
6565import org .slf4j .Logger ;
6666import org .slf4j .LoggerFactory ;
@@ -571,11 +571,6 @@ private void setUpSpineRoutes(DeviceId spineId) {
571571 final MacAddress leafMac = getMyStationMac (leafId );
572572 final Set <Ip6Prefix > subnetsToRoute = getInterfaceIpv6Prefixes (leafId );
573573
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-
579574 // Create a group with only one member.
580575 int groupId = macToGroupId (leafMac );
581576
@@ -628,24 +623,6 @@ private void setUpLeafRoutes(DeviceId leafId) {
628623 .collect (Collectors .toList ());
629624
630625 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- });
649626 }
650627
651628 //--------------------------------------------------------------------------
@@ -660,7 +637,7 @@ private void setUpLeafRoutes(DeviceId leafId) {
660637 * @return true if the device is a spine, false otherwise
661638 */
662639 private boolean isSpine (DeviceId deviceId ) {
663- return getDeviceConfig (deviceId ).map (Srv6DeviceConfig ::isSpine )
640+ return getDeviceConfig (deviceId ).map (FabricDeviceConfig ::isSpine )
664641 .orElseThrow (() -> new ItemNotFoundException (
665642 "Missing isSpine config for " + deviceId ));
666643 }
@@ -684,20 +661,20 @@ private boolean isLeaf(DeviceId deviceId) {
684661 */
685662 private MacAddress getMyStationMac (DeviceId deviceId ) {
686663 return getDeviceConfig (deviceId )
687- .map (Srv6DeviceConfig ::myStationMac )
664+ .map (FabricDeviceConfig ::myStationMac )
688665 .orElseThrow (() -> new ItemNotFoundException (
689666 "Missing myStationMac config for " + deviceId ));
690667 }
691668
692669 /**
693- * Returns the Srv6 config object for the given device.
670+ * Returns the fabric config object for the given device.
694671 *
695672 * @param deviceId the device ID
696- * @return Srv6 device config
673+ * @return fabric device config
697674 */
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 );
701678 return Optional .ofNullable (config );
702679 }
703680
@@ -749,19 +726,6 @@ private void insertInOrder(GroupDescription group, Collection<FlowRule> flowRule
749726 }
750727 }
751728
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-
765729 /**
766730 * Sets up IPv6 routing on all devices known by ONOS and for which this ONOS
767731 * node instance is currently master.
0 commit comments