@Test public void testNatFlows_ipv6() { EndpointL3 endpointL3 = buildL3Endpoint(IPV6_1, IPV6_2, MAC_0, L2).build(); MatchBuilder matchBuilder = new MatchBuilder(); matchBuilder.setEthernetMatch(FlowUtils.ethernetMatch(null, null, FlowUtils.IPv6)) .setLayer3Match(new Ipv6MatchBuilder().setIpv6Source(new Ipv6Prefix(IPV6_2.getValue() + IP_PREFIX_128)).build()); FlowUtils.addNxRegMatch(matchBuilder, FlowUtils.RegMatch.of(NxmNxReg6.class, (long) 0)); Match match = matchBuilder.build(); InstructionsBuilder instructionsBuilder = new InstructionsBuilder(); InstructionBuilder apply = new InstructionBuilder(); apply.setOrder(0).setInstruction(FlowUtils.applyActionIns(FlowUtils.setIpv6SrcAction(new Ipv6Address(IPV6_1)))); InstructionBuilder goTo = new InstructionBuilder(); goTo.setOrder(1).setInstruction(FlowUtils.gotoTableIns((short) 6)); List<Instruction> instructions = new ArrayList<>(); instructions.add(apply.build()); instructions.add(goTo.build()); instructionsBuilder.setInstruction(instructions); Flow testFlow = buildFlow(new FlowId(EGRESS_NAT + new IpAddress(new Ipv6Address(IPV6_2)) + "|" + new IpAddress(new Ipv6Address(IPV6_1))), tableId, 80, match, instructionsBuilder.build()).build(); flows.natFlows((short) 6, endpointL3, 80, ofWriter); verify(ofWriter, times(1)).writeFlow(NODE_ID, tableId, testFlow); }
void natFlows(short goToTable, EndpointL3 l3Endpoint, int priority, OfWriter ofWriter) { NatAddress natAugL3Endpoint = l3Endpoint.getAugmentation(NatAddress.class); if (natAugL3Endpoint == null) { return; } Flow flow = buildNatFlow(goToTable, priority, l3Endpoint.getIpAddress(), natAugL3Endpoint.getNatAddress(), l3Endpoint.getTenant(), l3Endpoint.getL3Context()); ofWriter.writeFlow(nodeId, tableId, flow); }
EgressNatMapperFlows { void natFlows(short goToTable, EndpointL3 l3Endpoint, int priority, OfWriter ofWriter) { NatAddress natAugL3Endpoint = l3Endpoint.getAugmentation(NatAddress.class); if (natAugL3Endpoint == null) { return; } Flow flow = buildNatFlow(goToTable, priority, l3Endpoint.getIpAddress(), natAugL3Endpoint.getNatAddress(), l3Endpoint.getTenant(), l3Endpoint.getL3Context()); ofWriter.writeFlow(nodeId, tableId, flow); } }
EgressNatMapperFlows { void natFlows(short goToTable, EndpointL3 l3Endpoint, int priority, OfWriter ofWriter) { NatAddress natAugL3Endpoint = l3Endpoint.getAugmentation(NatAddress.class); if (natAugL3Endpoint == null) { return; } Flow flow = buildNatFlow(goToTable, priority, l3Endpoint.getIpAddress(), natAugL3Endpoint.getNatAddress(), l3Endpoint.getTenant(), l3Endpoint.getL3Context()); ofWriter.writeFlow(nodeId, tableId, flow); } EgressNatMapperFlows(NodeId nodeId, short tableId); }
EgressNatMapperFlows { void natFlows(short goToTable, EndpointL3 l3Endpoint, int priority, OfWriter ofWriter) { NatAddress natAugL3Endpoint = l3Endpoint.getAugmentation(NatAddress.class); if (natAugL3Endpoint == null) { return; } Flow flow = buildNatFlow(goToTable, priority, l3Endpoint.getIpAddress(), natAugL3Endpoint.getNatAddress(), l3Endpoint.getTenant(), l3Endpoint.getL3Context()); ofWriter.writeFlow(nodeId, tableId, flow); } EgressNatMapperFlows(NodeId nodeId, short tableId);  }
EgressNatMapperFlows { void natFlows(short goToTable, EndpointL3 l3Endpoint, int priority, OfWriter ofWriter) { NatAddress natAugL3Endpoint = l3Endpoint.getAugmentation(NatAddress.class); if (natAugL3Endpoint == null) { return; } Flow flow = buildNatFlow(goToTable, priority, l3Endpoint.getIpAddress(), natAugL3Endpoint.getNatAddress(), l3Endpoint.getTenant(), l3Endpoint.getL3Context()); ofWriter.writeFlow(nodeId, tableId, flow); } EgressNatMapperFlows(NodeId nodeId, short tableId);   }