Hyunsun Moon
Committed by Gerrit Code Review

Renamed some methods and removed unnecessary L3 flow rules

Change-Id: I44911e4370ac65724716f8c3869c9f8696ef18b0
...@@ -97,7 +97,7 @@ public class OpenstackSwitchingRulePopulator { ...@@ -97,7 +97,7 @@ public class OpenstackSwitchingRulePopulator {
97 * @param port port for the VM created 97 * @param port port for the VM created
98 */ 98 */
99 public void populateSwitchingRules(Device device, Port port) { 99 public void populateSwitchingRules(Device device, Port port) {
100 - populateFlowRulesForVMSetTunnelTag(device, port); 100 + populateFlowRulesForTunnelTag(device, port);
101 populateFlowRulesForTrafficToSameCnode(device, port); 101 populateFlowRulesForTrafficToSameCnode(device, port);
102 populateFlowRulesForTrafficToDifferentCnode(device, port); 102 populateFlowRulesForTrafficToDifferentCnode(device, port);
103 } 103 }
...@@ -108,13 +108,13 @@ public class OpenstackSwitchingRulePopulator { ...@@ -108,13 +108,13 @@ public class OpenstackSwitchingRulePopulator {
108 * @param device device to put the rules 108 * @param device device to put the rules
109 * @param port port info of the VM 109 * @param port port info of the VM
110 */ 110 */
111 - private void populateFlowRulesForVMSetTunnelTag(Device device, Port port) { 111 + private void populateFlowRulesForTunnelTag(Device device, Port port) {
112 Ip4Address vmIp = getFixedIpAddressForPort(port.annotations().value("portName")); 112 Ip4Address vmIp = getFixedIpAddressForPort(port.annotations().value("portName"));
113 String portName = port.annotations().value("portName"); 113 String portName = port.annotations().value("portName");
114 String vni = getVniForPort(portName); 114 String vni = getVniForPort(portName);
115 115
116 if (vmIp != null) { 116 if (vmIp != null) {
117 - setFlowRuleForVMSetTunnelTag(device.id(), port, vni); 117 + setFlowRuleForTunnelTag(device.id(), port, vni);
118 } 118 }
119 } 119 }
120 120
...@@ -253,7 +253,7 @@ public class OpenstackSwitchingRulePopulator { ...@@ -253,7 +253,7 @@ public class OpenstackSwitchingRulePopulator {
253 return port.macAddress(); 253 return port.macAddress();
254 } 254 }
255 255
256 - private void setFlowRuleForVMSetTunnelTag(DeviceId deviceId, Port port, String vni) { 256 + private void setFlowRuleForTunnelTag(DeviceId deviceId, Port port, String vni) {
257 257
258 TrafficSelector.Builder sBuilder = DefaultTrafficSelector.builder(); 258 TrafficSelector.Builder sBuilder = DefaultTrafficSelector.builder();
259 TrafficTreatment.Builder tBuilder = DefaultTrafficTreatment.builder(); 259 TrafficTreatment.Builder tBuilder = DefaultTrafficTreatment.builder();
...@@ -306,26 +306,6 @@ public class OpenstackSwitchingRulePopulator { ...@@ -306,26 +306,6 @@ public class OpenstackSwitchingRulePopulator {
306 .add(); 306 .add();
307 307
308 flowObjectiveService.forward(id, fo); 308 flowObjectiveService.forward(id, fo);
309 -
310 - //For L3 Ease-West Routing Case
311 - sBuilder = DefaultTrafficSelector.builder();
312 - tBuilder = DefaultTrafficTreatment.builder();
313 -
314 - sBuilder.matchEthType(Ethernet.TYPE_IPV4)
315 - .matchIPDst(ip4Address.toIpPrefix());
316 -
317 - tBuilder.setEthDst(vmMacAddress)
318 - .setOutput(port.number());
319 -
320 - fo = DefaultForwardingObjective.builder()
321 - .withSelector(sBuilder.build())
322 - .withTreatment(tBuilder.build())
323 - .withPriority(EAST_WEST_ROUTING_RULE_PRIORITY)
324 - .withFlag(ForwardingObjective.Flag.SPECIFIC)
325 - .fromApp(appId)
326 - .add();
327 -
328 - flowObjectiveService.forward(id, fo);
329 } 309 }
330 310
331 311
......