Jonathan Hart
Committed by Gerrit Code Review

Set VLAN ID at the OLT.

Change-Id: I399d8f10da88687fd44328c4dd2c4ad8f17d7bf2
......@@ -352,7 +352,6 @@ public class OnosXOSIntegrationManager implements VoltTenantService {
provisionVlanOnPort(OLT_DEVICE_ID, OLT_UPLINK_PORT, onuPort, subscriberVlan.toShort());
//provisionDataPlane(tenantToCreate);
String retJson = postRest(json);
......@@ -389,7 +388,7 @@ public class OnosXOSIntegrationManager implements VoltTenantService {
private void provisionVlanOnPort(DeviceId deviceId, int uplinkPort, PortNumber p, short vlanId) {
TrafficSelector upstream = DefaultTrafficSelector.builder()
.matchVlanId(VlanId.vlanId(vlanId))
.matchVlanId(VlanId.ANY)
.matchInPort(p)
.build();
......@@ -399,10 +398,12 @@ public class OnosXOSIntegrationManager implements VoltTenantService {
.build();
TrafficTreatment upstreamTreatment = DefaultTrafficTreatment.builder()
.setVlanId(VlanId.vlanId(vlanId))
.setOutput(PortNumber.portNumber(uplinkPort))
.build();
TrafficTreatment downstreamTreatment = DefaultTrafficTreatment.builder()
.popVlan()
.setOutput(p)
.build();
......
......@@ -530,7 +530,11 @@ public class FlowEntryBuilder {
vlanId = VlanId.ANY;
}
} else {
vlanId = VlanId.vlanId(match.get(MatchField.VLAN_VID).getVlan());
if (!match.get(MatchField.VLAN_VID).isPresentBitSet()) {
vlanId = VlanId.NONE;
} else {
vlanId = VlanId.vlanId(match.get(MatchField.VLAN_VID).getVlan());
}
}
if (vlanId != null) {
builder.matchVlanId(vlanId);
......
......@@ -208,6 +208,8 @@ public abstract class FlowModBuilder {
if (vid.vlanId().equals(VlanId.ANY)) {
mBuilder.setMasked(MatchField.VLAN_VID, OFVlanVidMatch.PRESENT,
OFVlanVidMatch.PRESENT);
} else if (vid.vlanId().equals(VlanId.NONE)) {
mBuilder.setExact(MatchField.VLAN_VID, OFVlanVidMatch.NONE);
} else {
mBuilder.setExact(MatchField.VLAN_VID,
OFVlanVidMatch.ofVlanVid(VlanVid.ofVlan(vid.vlanId().toShort())));
......