[ONOS-5420] CP/untagged ifaces support in VPLS
Changes:
- Tests to account for tag-tag and tag-notag connectivity
- Introducing untagged ifaces in netcfg and topo files
Change-Id: If56fd4d8bbe4f1f2505e4d5d85c3eeda8c22ac5c
diff --git a/apps/vpls/src/main/java/org/onosproject/vpls/VplsNeighbourHandler.java b/apps/vpls/src/main/java/org/onosproject/vpls/VplsNeighbourHandler.java
index f2bfa9d..817c49e 100644
--- a/apps/vpls/src/main/java/org/onosproject/vpls/VplsNeighbourHandler.java
+++ b/apps/vpls/src/main/java/org/onosproject/vpls/VplsNeighbourHandler.java
@@ -35,11 +35,11 @@
import org.onosproject.net.config.NetworkConfigEvent;
import org.onosproject.net.config.NetworkConfigListener;
import org.onosproject.net.config.NetworkConfigService;
+import org.onosproject.net.device.DeviceService;
import org.onosproject.net.host.HostService;
-import org.onosproject.vpls.config.VplsConfigurationService;
+import org.onosproject.vpls.config.VplsConfigService;
import org.slf4j.Logger;
-import java.util.Collection;
import java.util.Set;
import static org.slf4j.LoggerFactory.getLogger;
@@ -59,13 +59,16 @@
protected CoreService coreService;
@Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY)
+ protected DeviceService deviceService;
+
+ @Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY)
protected InterfaceService interfaceService;
@Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY)
protected NeighbourResolutionService neighbourService;
@Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY)
- protected VplsConfigurationService vplsConfigService;
+ protected VplsConfigService vplsConfigService;
@Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY)
protected NetworkConfigService configService;
@@ -144,14 +147,11 @@
* @param context the message context
*/
protected void handleRequest(NeighbourMessageContext context) {
-
- SetMultimap<String, Interface> vpls =
+ SetMultimap<String, Interface> interfaces =
vplsConfigService.ifacesByVplsName(context.vlan(),
- context.inPort());
-
- if (vpls != null) {
- Collection<Interface> vplsInterfaces = vpls.values();
- vplsInterfaces.stream()
+ context.inPort());
+ if (interfaces != null) {
+ interfaces.values().stream()
.filter(intf -> !context.inPort().equals(intf.connectPoint()))
.forEach(context::forward);
@@ -168,15 +168,12 @@
*/
protected void handleReply(NeighbourMessageContext context,
HostService hostService) {
-
- SetMultimap<String, Interface> vpls =
- vplsConfigService.ifacesByVplsName(context.vlan(),
- context.inPort());
-
Set<Host> hosts = hostService.getHostsByMac(context.dstMac());
- if (vpls != null) {
- Collection<Interface> vplsInterfaces = vpls.values();
- hosts.forEach(host -> vplsInterfaces.stream()
+ SetMultimap<String, Interface> interfaces =
+ vplsConfigService.ifacesByVplsName(context.vlan(),
+ context.inPort());
+ if (interfaces != null) {
+ hosts.forEach(host -> interfaces.values().stream()
.filter(intf -> intf.connectPoint().equals(host.location()))
.filter(intf -> intf.vlan().equals(host.vlan()))
.forEach(context::forward));
@@ -206,5 +203,4 @@
configNeighbourHandler();
}
}
-
-}
+}
\ No newline at end of file