Jonathan Hart
Committed by Gerrit Code Review

Allow SingleSwitchFibInstaller to support untagged interfaces.

Added support in OVSCorsaPipeline and SoftRouter.

Change-Id: I7242f0f26cbdf7d6d2205fc6f48458d604de5326
......@@ -29,6 +29,7 @@ import org.apache.felix.scr.annotations.ReferenceCardinality;
import org.onlab.packet.Ethernet;
import org.onlab.packet.IpAddress;
import org.onlab.packet.IpPrefix;
import org.onlab.packet.VlanId;
import org.onosproject.core.ApplicationId;
import org.onosproject.core.CoreService;
import org.onosproject.incubator.net.intf.Interface;
......@@ -279,20 +280,23 @@ public class SingleSwitchFibInstaller {
NextHop nextHop = new NextHop(entry.nextHopIp(), entry.nextHopMac(), groupKey);
TrafficTreatment treatment = DefaultTrafficTreatment.builder()
TrafficTreatment.Builder treatment = DefaultTrafficTreatment.builder()
.setEthSrc(egressIntf.mac())
.setEthDst(nextHop.mac())
.pushVlan()
.setVlanId(egressIntf.vlan())
.setVlanPcp((byte) 0)
.setOutput(egressIntf.connectPoint().port())
.build();
.setEthDst(nextHop.mac());
if (!egressIntf.vlan().equals(VlanId.NONE)) {
treatment.pushVlan()
.setVlanId(egressIntf.vlan())
.setVlanPcp((byte) 0);
}
treatment.setOutput(egressIntf.connectPoint().port());
int nextId = flowObjectiveService.allocateNextId();
NextObjective nextObjective = DefaultNextObjective.builder()
.withId(nextId)
.addTreatment(treatment)
.addTreatment(treatment.build())
.withType(NextObjective.Type.SIMPLE)
.fromApp(appId)
.add(); // TODO add callbacks
......
......@@ -275,7 +275,9 @@ public class SoftRouterPipeline extends AbstractHandlerBehaviour implements Pipe
selector.matchVlanId(v.vlanId());
selector.matchEthDst(e.mac());
selector.matchEthType(Ethernet.TYPE_IPV4);
treatment.popVlan();
if (!v.vlanId().equals(VlanId.NONE)) {
treatment.popVlan();
}
treatment.transition(FIB_TABLE); // all other IPs to the FIB table
FlowRule rule = DefaultFlowRule.builder()
.forDevice(deviceId)
......