@Test public void testArpFlow() { EndpointL3 testEndpointL3 = buildL3Endpoint(IPV4_0, IPV4_1, MAC_0, null).build(); List<Instruction> instructions = new ArrayList<>(); Action[] arpActions = {nxMoveEthSrcToEthDstAction(), setDlSrcAction(new MacAddress(MAC_0)), nxLoadArpOpAction(BigInteger.valueOf(2L)), nxMoveArpShaToArpThaAction(), nxLoadArpShaAction(new BigInteger("0")), nxMoveArpSpaToArpTpaAction(), nxLoadArpSpaAction(IPV4_0.getValue()), outputAction(new NodeConnectorId(NODE_ID.getValue() + ":INPORT"))}; instructions.add(new InstructionBuilder().setOrder(0) .setInstruction(FlowUtils.applyActionIns(ArrayUtils.addAll(arpActions))).build()); InstructionsBuilder instructionsBuilder = new InstructionsBuilder(); instructionsBuilder.setInstruction(instructions); MatchBuilder matchBuilder = new MatchBuilder(); matchBuilder.setEthernetMatch(FlowUtils.ethernetMatch(null, null, FlowUtils.ARP)); matchBuilder.setLayer3Match(new ArpMatchBuilder().setArpOp(1).setArpTargetTransportAddress(new Ipv4Prefix(IPV4_0.getValue() + IP_PREFIX_32)).build()); Match match = matchBuilder.build(); Flow testFlow = buildFlow(FlowIdUtils.newFlowId(tableId, "outside-ip-arp", match), tableId, 60, match, instructionsBuilder.build()).build(); flows.createArpFlow(getTestIndexedTenant(), testEndpointL3, 60, ofWriter); verify(ofWriter, times(1)).writeFlow(NODE_ID, tableId, testFlow); }
void createArpFlow(IndexedTenant tenant, EndpointL3 l3Ep, int priority, OfWriter ofWriter) { NatAddress natAugL3Endpoint = l3Ep.getAugmentation(NatAddress.class); if (natAugL3Endpoint == null || natAugL3Endpoint.getNatAddress() == null) { return; } if (l3Ep.getIpAddress() != null) { Flow flow = createOutsideArpFlow(tenant, priority, natAugL3Endpoint.getNatAddress(), l3Ep.getMacAddress(), nodeId); if (flow != null) { ofWriter.writeFlow(nodeId, tableId, flow); } } }
IngressNatMapperFlows { void createArpFlow(IndexedTenant tenant, EndpointL3 l3Ep, int priority, OfWriter ofWriter) { NatAddress natAugL3Endpoint = l3Ep.getAugmentation(NatAddress.class); if (natAugL3Endpoint == null || natAugL3Endpoint.getNatAddress() == null) { return; } if (l3Ep.getIpAddress() != null) { Flow flow = createOutsideArpFlow(tenant, priority, natAugL3Endpoint.getNatAddress(), l3Ep.getMacAddress(), nodeId); if (flow != null) { ofWriter.writeFlow(nodeId, tableId, flow); } } } }
IngressNatMapperFlows { void createArpFlow(IndexedTenant tenant, EndpointL3 l3Ep, int priority, OfWriter ofWriter) { NatAddress natAugL3Endpoint = l3Ep.getAugmentation(NatAddress.class); if (natAugL3Endpoint == null || natAugL3Endpoint.getNatAddress() == null) { return; } if (l3Ep.getIpAddress() != null) { Flow flow = createOutsideArpFlow(tenant, priority, natAugL3Endpoint.getNatAddress(), l3Ep.getMacAddress(), nodeId); if (flow != null) { ofWriter.writeFlow(nodeId, tableId, flow); } } } IngressNatMapperFlows(NodeId nodeId, short tableId); }
IngressNatMapperFlows { void createArpFlow(IndexedTenant tenant, EndpointL3 l3Ep, int priority, OfWriter ofWriter) { NatAddress natAugL3Endpoint = l3Ep.getAugmentation(NatAddress.class); if (natAugL3Endpoint == null || natAugL3Endpoint.getNatAddress() == null) { return; } if (l3Ep.getIpAddress() != null) { Flow flow = createOutsideArpFlow(tenant, priority, natAugL3Endpoint.getNatAddress(), l3Ep.getMacAddress(), nodeId); if (flow != null) { ofWriter.writeFlow(nodeId, tableId, flow); } } } IngressNatMapperFlows(NodeId nodeId, short tableId);  }
IngressNatMapperFlows { void createArpFlow(IndexedTenant tenant, EndpointL3 l3Ep, int priority, OfWriter ofWriter) { NatAddress natAugL3Endpoint = l3Ep.getAugmentation(NatAddress.class); if (natAugL3Endpoint == null || natAugL3Endpoint.getNatAddress() == null) { return; } if (l3Ep.getIpAddress() != null) { Flow flow = createOutsideArpFlow(tenant, priority, natAugL3Endpoint.getNatAddress(), l3Ep.getMacAddress(), nodeId); if (flow != null) { ofWriter.writeFlow(nodeId, tableId, flow); } } } IngressNatMapperFlows(NodeId nodeId, short tableId);   }