Committed by
Gerrit Code Review
Allow SingleSwitchFibInstaller to support untagged interfaces.
Added support in OVSCorsaPipeline and SoftRouter. Change-Id: I7242f0f26cbdf7d6d2205fc6f48458d604de5326
Showing
2 changed files
with
15 additions
and
9 deletions
... | @@ -29,6 +29,7 @@ import org.apache.felix.scr.annotations.ReferenceCardinality; | ... | @@ -29,6 +29,7 @@ import org.apache.felix.scr.annotations.ReferenceCardinality; |
29 | import org.onlab.packet.Ethernet; | 29 | import org.onlab.packet.Ethernet; |
30 | import org.onlab.packet.IpAddress; | 30 | import org.onlab.packet.IpAddress; |
31 | import org.onlab.packet.IpPrefix; | 31 | import org.onlab.packet.IpPrefix; |
32 | +import org.onlab.packet.VlanId; | ||
32 | import org.onosproject.core.ApplicationId; | 33 | import org.onosproject.core.ApplicationId; |
33 | import org.onosproject.core.CoreService; | 34 | import org.onosproject.core.CoreService; |
34 | import org.onosproject.incubator.net.intf.Interface; | 35 | import org.onosproject.incubator.net.intf.Interface; |
... | @@ -279,20 +280,23 @@ public class SingleSwitchFibInstaller { | ... | @@ -279,20 +280,23 @@ public class SingleSwitchFibInstaller { |
279 | 280 | ||
280 | NextHop nextHop = new NextHop(entry.nextHopIp(), entry.nextHopMac(), groupKey); | 281 | NextHop nextHop = new NextHop(entry.nextHopIp(), entry.nextHopMac(), groupKey); |
281 | 282 | ||
282 | - TrafficTreatment treatment = DefaultTrafficTreatment.builder() | 283 | + TrafficTreatment.Builder treatment = DefaultTrafficTreatment.builder() |
283 | .setEthSrc(egressIntf.mac()) | 284 | .setEthSrc(egressIntf.mac()) |
284 | - .setEthDst(nextHop.mac()) | 285 | + .setEthDst(nextHop.mac()); |
285 | - .pushVlan() | 286 | + |
286 | - .setVlanId(egressIntf.vlan()) | 287 | + if (!egressIntf.vlan().equals(VlanId.NONE)) { |
287 | - .setVlanPcp((byte) 0) | 288 | + treatment.pushVlan() |
288 | - .setOutput(egressIntf.connectPoint().port()) | 289 | + .setVlanId(egressIntf.vlan()) |
289 | - .build(); | 290 | + .setVlanPcp((byte) 0); |
291 | + } | ||
292 | + | ||
293 | + treatment.setOutput(egressIntf.connectPoint().port()); | ||
290 | 294 | ||
291 | int nextId = flowObjectiveService.allocateNextId(); | 295 | int nextId = flowObjectiveService.allocateNextId(); |
292 | 296 | ||
293 | NextObjective nextObjective = DefaultNextObjective.builder() | 297 | NextObjective nextObjective = DefaultNextObjective.builder() |
294 | .withId(nextId) | 298 | .withId(nextId) |
295 | - .addTreatment(treatment) | 299 | + .addTreatment(treatment.build()) |
296 | .withType(NextObjective.Type.SIMPLE) | 300 | .withType(NextObjective.Type.SIMPLE) |
297 | .fromApp(appId) | 301 | .fromApp(appId) |
298 | .add(); // TODO add callbacks | 302 | .add(); // TODO add callbacks | ... | ... |
... | @@ -275,7 +275,9 @@ public class SoftRouterPipeline extends AbstractHandlerBehaviour implements Pipe | ... | @@ -275,7 +275,9 @@ public class SoftRouterPipeline extends AbstractHandlerBehaviour implements Pipe |
275 | selector.matchVlanId(v.vlanId()); | 275 | selector.matchVlanId(v.vlanId()); |
276 | selector.matchEthDst(e.mac()); | 276 | selector.matchEthDst(e.mac()); |
277 | selector.matchEthType(Ethernet.TYPE_IPV4); | 277 | selector.matchEthType(Ethernet.TYPE_IPV4); |
278 | - treatment.popVlan(); | 278 | + if (!v.vlanId().equals(VlanId.NONE)) { |
279 | + treatment.popVlan(); | ||
280 | + } | ||
279 | treatment.transition(FIB_TABLE); // all other IPs to the FIB table | 281 | treatment.transition(FIB_TABLE); // all other IPs to the FIB table |
280 | FlowRule rule = DefaultFlowRule.builder() | 282 | FlowRule rule = DefaultFlowRule.builder() |
281 | .forDevice(deviceId) | 283 | .forDevice(deviceId) | ... | ... |
-
Please register or login to post a comment