@Test public void testL3flow_ipv4() { Endpoint testEp = buildEndpoint(IPV4_0, MAC_0, CONNECTOR_0).build(); MatchBuilder matchBuilder = new MatchBuilder(); matchBuilder.setEthernetMatch(FlowUtils.ethernetMatch(MAC_0, null, FlowUtils.IPv4)) .setLayer3Match(new Ipv4MatchBuilder() .setIpv4Source(new Ipv4Prefix(IPV4_0.getValue() + IP_PREFIX_32)).build()) .setInPort(new NodeConnectorId(CONNECTOR_0)); Match match = matchBuilder.build(); Flow testFlow = buildFlow(FlowIdUtils.newFlowId(tableId, L3, match), tableId, 100, match, FlowUtils.gotoTableInstructions((short) 2)).build(); flows.l3Flow((short) 2, testEp, new NodeConnectorId(CONNECTOR_0), new MacAddress(MAC_0), 100, false, ofWriter); verify(ofWriter, times(1)).writeFlow(NODE_ID, tableId, testFlow); }
void l3Flow(short goToTable, Endpoint endpoint, NodeConnectorId connectorId, MacAddress macAddress, int priority, boolean arp, OfWriter ofWriter) { if (endpoint.getL3Address() != null) { for (L3Address l3Address : endpoint.getL3Address()) { if (l3Address.getIpAddress() == null) { continue; } Match match; if (arp) { match = createL3ArpMatch(connectorId, macAddress, l3Address.getIpAddress()); } else { match = createL3IpMatch(connectorId, macAddress, l3Address.getIpAddress()); } if (match == null) { continue; } FlowId flowid = FlowIdUtils.newFlowId(tableId, "L3", match); Flow flow = FlowUtils.base(tableId) .setPriority(priority) .setId(flowid) .setMatch(match) .setInstructions(FlowUtils.gotoTableInstructions(goToTable)) .build(); ofWriter.writeFlow(nodeId, tableId, flow); } } }
PortSecurityFlows { void l3Flow(short goToTable, Endpoint endpoint, NodeConnectorId connectorId, MacAddress macAddress, int priority, boolean arp, OfWriter ofWriter) { if (endpoint.getL3Address() != null) { for (L3Address l3Address : endpoint.getL3Address()) { if (l3Address.getIpAddress() == null) { continue; } Match match; if (arp) { match = createL3ArpMatch(connectorId, macAddress, l3Address.getIpAddress()); } else { match = createL3IpMatch(connectorId, macAddress, l3Address.getIpAddress()); } if (match == null) { continue; } FlowId flowid = FlowIdUtils.newFlowId(tableId, "L3", match); Flow flow = FlowUtils.base(tableId) .setPriority(priority) .setId(flowid) .setMatch(match) .setInstructions(FlowUtils.gotoTableInstructions(goToTable)) .build(); ofWriter.writeFlow(nodeId, tableId, flow); } } } }
PortSecurityFlows { void l3Flow(short goToTable, Endpoint endpoint, NodeConnectorId connectorId, MacAddress macAddress, int priority, boolean arp, OfWriter ofWriter) { if (endpoint.getL3Address() != null) { for (L3Address l3Address : endpoint.getL3Address()) { if (l3Address.getIpAddress() == null) { continue; } Match match; if (arp) { match = createL3ArpMatch(connectorId, macAddress, l3Address.getIpAddress()); } else { match = createL3IpMatch(connectorId, macAddress, l3Address.getIpAddress()); } if (match == null) { continue; } FlowId flowid = FlowIdUtils.newFlowId(tableId, "L3", match); Flow flow = FlowUtils.base(tableId) .setPriority(priority) .setId(flowid) .setMatch(match) .setInstructions(FlowUtils.gotoTableInstructions(goToTable)) .build(); ofWriter.writeFlow(nodeId, tableId, flow); } } } PortSecurityFlows(NodeId nodeId, Short tableId); }
PortSecurityFlows { void l3Flow(short goToTable, Endpoint endpoint, NodeConnectorId connectorId, MacAddress macAddress, int priority, boolean arp, OfWriter ofWriter) { if (endpoint.getL3Address() != null) { for (L3Address l3Address : endpoint.getL3Address()) { if (l3Address.getIpAddress() == null) { continue; } Match match; if (arp) { match = createL3ArpMatch(connectorId, macAddress, l3Address.getIpAddress()); } else { match = createL3IpMatch(connectorId, macAddress, l3Address.getIpAddress()); } if (match == null) { continue; } FlowId flowid = FlowIdUtils.newFlowId(tableId, "L3", match); Flow flow = FlowUtils.base(tableId) .setPriority(priority) .setId(flowid) .setMatch(match) .setInstructions(FlowUtils.gotoTableInstructions(goToTable)) .build(); ofWriter.writeFlow(nodeId, tableId, flow); } } } PortSecurityFlows(NodeId nodeId, Short tableId);  }
PortSecurityFlows { void l3Flow(short goToTable, Endpoint endpoint, NodeConnectorId connectorId, MacAddress macAddress, int priority, boolean arp, OfWriter ofWriter) { if (endpoint.getL3Address() != null) { for (L3Address l3Address : endpoint.getL3Address()) { if (l3Address.getIpAddress() == null) { continue; } Match match; if (arp) { match = createL3ArpMatch(connectorId, macAddress, l3Address.getIpAddress()); } else { match = createL3IpMatch(connectorId, macAddress, l3Address.getIpAddress()); } if (match == null) { continue; } FlowId flowid = FlowIdUtils.newFlowId(tableId, "L3", match); Flow flow = FlowUtils.base(tableId) .setPriority(priority) .setId(flowid) .setMatch(match) .setInstructions(FlowUtils.gotoTableInstructions(goToTable)) .build(); ofWriter.writeFlow(nodeId, tableId, flow); } } } PortSecurityFlows(NodeId nodeId, Short tableId);   }