CORD-472 Added additional flow rules for physical connection
Change-Id: Ic6d37024e4407182a440fbe68460e7688ecb6305
diff --git a/src/main/java/org/onosproject/cordvtn/CordVtnRuleInstaller.java b/src/main/java/org/onosproject/cordvtn/CordVtnRuleInstaller.java
index ef310c7..36767ea 100644
--- a/src/main/java/org/onosproject/cordvtn/CordVtnRuleInstaller.java
+++ b/src/main/java/org/onosproject/cordvtn/CordVtnRuleInstaller.java
@@ -441,6 +441,51 @@
processFlowRule(true, flowRule);
+ // take a packet to the local ip through Linux stack
+ selector = DefaultTrafficSelector.builder()
+ .matchInPort(phyPort)
+ .matchEthType(Ethernet.TYPE_IPV4)
+ .matchIPDst(localIp.toIpPrefix())
+ .build();
+
+ treatment = DefaultTrafficTreatment.builder()
+ .setOutput(PortNumber.LOCAL)
+ .build();
+
+ flowRule = DefaultFlowRule.builder()
+ .fromApp(appId)
+ .withSelector(selector)
+ .withTreatment(treatment)
+ .withPriority(HIGHER_PRIORITY)
+ .forDevice(deviceId)
+ .forTable(TABLE_FIRST)
+ .makePermanent()
+ .build();
+
+ processFlowRule(true, flowRule);
+
+ // take an arp packet from physical through Linux stack
+ selector = DefaultTrafficSelector.builder()
+ .matchInPort(phyPort)
+ .matchEthType(Ethernet.TYPE_ARP)
+ .build();
+
+ treatment = DefaultTrafficTreatment.builder()
+ .setOutput(PortNumber.LOCAL)
+ .build();
+
+ flowRule = DefaultFlowRule.builder()
+ .fromApp(appId)
+ .withSelector(selector)
+ .withTreatment(treatment)
+ .withPriority(HIGHER_PRIORITY)
+ .forDevice(deviceId)
+ .forTable(TABLE_FIRST)
+ .makePermanent()
+ .build();
+
+ processFlowRule(true, flowRule);
+
// take all else to the next table
selector = DefaultTrafficSelector.builder()
.build();