@Test public void testL3DhcpDoraFlow() { IpAddress ipAddress = new IpAddress(new Ipv4Address("255.255.255.255")); MacAddress macAddress = new MacAddress(MAC_1); NodeConnectorId connectorId = new NodeConnectorId(CONNECTOR_1); MatchBuilder matchBuilder = new MatchBuilder(); matchBuilder.setEthernetMatch(FlowUtils.ethernetMatch(macAddress, null, FlowUtils.IPv4)) .setLayer3Match(new Ipv4MatchBuilder() .setIpv4Destination(new Ipv4Prefix(ipAddress.getIpv4Address().getValue() + IP_PREFIX_32)).build()) .setInPort(connectorId); Match match = matchBuilder.build(); Flow testFlow = buildFlow(FlowIdUtils.newFlowId(tableId, DHCP, match), tableId, 50, match, FlowUtils.gotoTableInstructions((short) 2)).build(); flows.l3DhcpDoraFlow((short) 2, new NodeConnectorId(CONNECTOR_1), new MacAddress(MAC_1), 50, ofWriter); verify(ofWriter, times(1)).writeFlow(NODE_ID, tableId, testFlow); }
void l3DhcpDoraFlow(short goToTable, NodeConnectorId connectorId, MacAddress macAddress, int priority, OfWriter ofWriter) { Long etherType = FlowUtils.IPv4; String iKey = "255.255.255.255/32"; Layer3Match layer3Match = new Ipv4MatchBuilder().setIpv4Destination(new Ipv4Prefix(iKey)).build(); Match match = new MatchBuilder() .setEthernetMatch(FlowUtils.ethernetMatch(macAddress, null, etherType)) .setLayer3Match(layer3Match) .setInPort(connectorId) .build(); FlowId flowid = FlowIdUtils.newFlowId(tableId, "dhcp", match); Flow flow = FlowUtils.base(tableId) .setPriority(priority) .setId(flowid) .setMatch(match) .setInstructions(FlowUtils.gotoTableInstructions(goToTable)) .build(); ofWriter.writeFlow(nodeId, tableId, flow); }
PortSecurityFlows { void l3DhcpDoraFlow(short goToTable, NodeConnectorId connectorId, MacAddress macAddress, int priority, OfWriter ofWriter) { Long etherType = FlowUtils.IPv4; String iKey = "255.255.255.255/32"; Layer3Match layer3Match = new Ipv4MatchBuilder().setIpv4Destination(new Ipv4Prefix(iKey)).build(); Match match = new MatchBuilder() .setEthernetMatch(FlowUtils.ethernetMatch(macAddress, null, etherType)) .setLayer3Match(layer3Match) .setInPort(connectorId) .build(); FlowId flowid = FlowIdUtils.newFlowId(tableId, "dhcp", match); Flow flow = FlowUtils.base(tableId) .setPriority(priority) .setId(flowid) .setMatch(match) .setInstructions(FlowUtils.gotoTableInstructions(goToTable)) .build(); ofWriter.writeFlow(nodeId, tableId, flow); } }
PortSecurityFlows { void l3DhcpDoraFlow(short goToTable, NodeConnectorId connectorId, MacAddress macAddress, int priority, OfWriter ofWriter) { Long etherType = FlowUtils.IPv4; String iKey = "255.255.255.255/32"; Layer3Match layer3Match = new Ipv4MatchBuilder().setIpv4Destination(new Ipv4Prefix(iKey)).build(); Match match = new MatchBuilder() .setEthernetMatch(FlowUtils.ethernetMatch(macAddress, null, etherType)) .setLayer3Match(layer3Match) .setInPort(connectorId) .build(); FlowId flowid = FlowIdUtils.newFlowId(tableId, "dhcp", 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 l3DhcpDoraFlow(short goToTable, NodeConnectorId connectorId, MacAddress macAddress, int priority, OfWriter ofWriter) { Long etherType = FlowUtils.IPv4; String iKey = "255.255.255.255/32"; Layer3Match layer3Match = new Ipv4MatchBuilder().setIpv4Destination(new Ipv4Prefix(iKey)).build(); Match match = new MatchBuilder() .setEthernetMatch(FlowUtils.ethernetMatch(macAddress, null, etherType)) .setLayer3Match(layer3Match) .setInPort(connectorId) .build(); FlowId flowid = FlowIdUtils.newFlowId(tableId, "dhcp", 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 l3DhcpDoraFlow(short goToTable, NodeConnectorId connectorId, MacAddress macAddress, int priority, OfWriter ofWriter) { Long etherType = FlowUtils.IPv4; String iKey = "255.255.255.255/32"; Layer3Match layer3Match = new Ipv4MatchBuilder().setIpv4Destination(new Ipv4Prefix(iKey)).build(); Match match = new MatchBuilder() .setEthernetMatch(FlowUtils.ethernetMatch(macAddress, null, etherType)) .setLayer3Match(layer3Match) .setInPort(connectorId) .build(); FlowId flowid = FlowIdUtils.newFlowId(tableId, "dhcp", 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);   }