@Test public void createRemoteL2Flow_ipV6() { NodeConnectorId connectorId = new NodeConnectorId(OPENFLOW + CONNECTOR_1); IpAddress ipAddress = new IpAddress(new Ipv6Address(IPV6_1)); EndpointBuilder endpointBuilder = buildEndpoint(IPV6_1, MAC_1, CONNECTOR_0); EndpointBuilder peerEndpointBuilder = buildEndpoint(IPV6_2, MAC_0, CONNECTOR_0); flows.createRemoteL2Flow(tableId, 70, endpointBuilder.build(), peerEndpointBuilder.build(), ipAddress, connectorId, ofWriter); verifyZeroInteractions(ofWriter); }
void createRemoteL2Flow(short goToTable, int priority, Endpoint endpoint, Endpoint peerEndpoint, IpAddress tunDst, NodeConnectorId connectorId, OfWriter ofWriter) { OrdinalFactory.EndpointFwdCtxOrdinals endpointOrdinals = utils.getEndpointOrdinals(endpoint); long port; try { port = getOfPortNum(connectorId); } catch (NumberFormatException ex) { LOG.warn("Could not parse port number {}", connectorId); return; } Action tunnelDestinationAction = null; if (tunDst.getIpv4Address() != null) { tunnelDestinationAction = nxLoadTunIPv4Action(tunDst.getIpv4Address().getValue(), false); } else if (tunDst.getIpv6Address() != null) { LOG.error("IPv6 tunnel destination {} for {} not supported", tunDst.getIpv6Address().getValue(), nodeId); return; } List<Action> applyActions = new ArrayList<>(); applyActions.add(nxLoadRegAction(NxmNxReg2.class, BigInteger.valueOf(endpointOrdinals.getEpgId()))); applyActions.add(nxLoadRegAction(NxmNxReg3.class, BigInteger.valueOf(endpointOrdinals.getCgId()))); applyActions.add(nxLoadRegAction(NxmNxReg7.class, BigInteger.valueOf(port))); applyActions.add(tunnelDestinationAction); int order = 0; Instruction applyActionsIns = new InstructionBuilder().setOrder(order++) .setInstruction(applyActionIns(applyActions.toArray(new Action[applyActions.size()]))) .build(); Instruction gotoTable = new InstructionBuilder().setOrder(order) .setInstruction(gotoTableIns(goToTable)) .build(); ArrayList<Instruction> instructions = new ArrayList<>(); instructions.add(applyActionsIns); instructions.add(gotoTable); MatchBuilder matchBuilder = new MatchBuilder() .setEthernetMatch(ethernetMatch(null, peerEndpoint.getMacAddress(), null)); addNxRegMatch(matchBuilder, RegMatch.of(NxmNxReg4.class, (long) endpointOrdinals.getBdId())); Match match = matchBuilder.build(); FlowId flowid = FlowIdUtils.newFlowId(tableId, "remoteL2", match); FlowBuilder flowBuilder = base(tableId).setId(flowid) .setPriority(priority) .setMatch(match) .setInstructions(new InstructionsBuilder().setInstruction(instructions).build()); ofWriter.writeFlow(nodeId, tableId, flowBuilder.build()); }
DestinationMapperFlows { void createRemoteL2Flow(short goToTable, int priority, Endpoint endpoint, Endpoint peerEndpoint, IpAddress tunDst, NodeConnectorId connectorId, OfWriter ofWriter) { OrdinalFactory.EndpointFwdCtxOrdinals endpointOrdinals = utils.getEndpointOrdinals(endpoint); long port; try { port = getOfPortNum(connectorId); } catch (NumberFormatException ex) { LOG.warn("Could not parse port number {}", connectorId); return; } Action tunnelDestinationAction = null; if (tunDst.getIpv4Address() != null) { tunnelDestinationAction = nxLoadTunIPv4Action(tunDst.getIpv4Address().getValue(), false); } else if (tunDst.getIpv6Address() != null) { LOG.error("IPv6 tunnel destination {} for {} not supported", tunDst.getIpv6Address().getValue(), nodeId); return; } List<Action> applyActions = new ArrayList<>(); applyActions.add(nxLoadRegAction(NxmNxReg2.class, BigInteger.valueOf(endpointOrdinals.getEpgId()))); applyActions.add(nxLoadRegAction(NxmNxReg3.class, BigInteger.valueOf(endpointOrdinals.getCgId()))); applyActions.add(nxLoadRegAction(NxmNxReg7.class, BigInteger.valueOf(port))); applyActions.add(tunnelDestinationAction); int order = 0; Instruction applyActionsIns = new InstructionBuilder().setOrder(order++) .setInstruction(applyActionIns(applyActions.toArray(new Action[applyActions.size()]))) .build(); Instruction gotoTable = new InstructionBuilder().setOrder(order) .setInstruction(gotoTableIns(goToTable)) .build(); ArrayList<Instruction> instructions = new ArrayList<>(); instructions.add(applyActionsIns); instructions.add(gotoTable); MatchBuilder matchBuilder = new MatchBuilder() .setEthernetMatch(ethernetMatch(null, peerEndpoint.getMacAddress(), null)); addNxRegMatch(matchBuilder, RegMatch.of(NxmNxReg4.class, (long) endpointOrdinals.getBdId())); Match match = matchBuilder.build(); FlowId flowid = FlowIdUtils.newFlowId(tableId, "remoteL2", match); FlowBuilder flowBuilder = base(tableId).setId(flowid) .setPriority(priority) .setMatch(match) .setInstructions(new InstructionsBuilder().setInstruction(instructions).build()); ofWriter.writeFlow(nodeId, tableId, flowBuilder.build()); } }
DestinationMapperFlows { void createRemoteL2Flow(short goToTable, int priority, Endpoint endpoint, Endpoint peerEndpoint, IpAddress tunDst, NodeConnectorId connectorId, OfWriter ofWriter) { OrdinalFactory.EndpointFwdCtxOrdinals endpointOrdinals = utils.getEndpointOrdinals(endpoint); long port; try { port = getOfPortNum(connectorId); } catch (NumberFormatException ex) { LOG.warn("Could not parse port number {}", connectorId); return; } Action tunnelDestinationAction = null; if (tunDst.getIpv4Address() != null) { tunnelDestinationAction = nxLoadTunIPv4Action(tunDst.getIpv4Address().getValue(), false); } else if (tunDst.getIpv6Address() != null) { LOG.error("IPv6 tunnel destination {} for {} not supported", tunDst.getIpv6Address().getValue(), nodeId); return; } List<Action> applyActions = new ArrayList<>(); applyActions.add(nxLoadRegAction(NxmNxReg2.class, BigInteger.valueOf(endpointOrdinals.getEpgId()))); applyActions.add(nxLoadRegAction(NxmNxReg3.class, BigInteger.valueOf(endpointOrdinals.getCgId()))); applyActions.add(nxLoadRegAction(NxmNxReg7.class, BigInteger.valueOf(port))); applyActions.add(tunnelDestinationAction); int order = 0; Instruction applyActionsIns = new InstructionBuilder().setOrder(order++) .setInstruction(applyActionIns(applyActions.toArray(new Action[applyActions.size()]))) .build(); Instruction gotoTable = new InstructionBuilder().setOrder(order) .setInstruction(gotoTableIns(goToTable)) .build(); ArrayList<Instruction> instructions = new ArrayList<>(); instructions.add(applyActionsIns); instructions.add(gotoTable); MatchBuilder matchBuilder = new MatchBuilder() .setEthernetMatch(ethernetMatch(null, peerEndpoint.getMacAddress(), null)); addNxRegMatch(matchBuilder, RegMatch.of(NxmNxReg4.class, (long) endpointOrdinals.getBdId())); Match match = matchBuilder.build(); FlowId flowid = FlowIdUtils.newFlowId(tableId, "remoteL2", match); FlowBuilder flowBuilder = base(tableId).setId(flowid) .setPriority(priority) .setMatch(match) .setInstructions(new InstructionsBuilder().setInstruction(instructions).build()); ofWriter.writeFlow(nodeId, tableId, flowBuilder.build()); } DestinationMapperFlows(DestinationMapperUtils utils, NodeId nodeId, short tableId); }
DestinationMapperFlows { void createRemoteL2Flow(short goToTable, int priority, Endpoint endpoint, Endpoint peerEndpoint, IpAddress tunDst, NodeConnectorId connectorId, OfWriter ofWriter) { OrdinalFactory.EndpointFwdCtxOrdinals endpointOrdinals = utils.getEndpointOrdinals(endpoint); long port; try { port = getOfPortNum(connectorId); } catch (NumberFormatException ex) { LOG.warn("Could not parse port number {}", connectorId); return; } Action tunnelDestinationAction = null; if (tunDst.getIpv4Address() != null) { tunnelDestinationAction = nxLoadTunIPv4Action(tunDst.getIpv4Address().getValue(), false); } else if (tunDst.getIpv6Address() != null) { LOG.error("IPv6 tunnel destination {} for {} not supported", tunDst.getIpv6Address().getValue(), nodeId); return; } List<Action> applyActions = new ArrayList<>(); applyActions.add(nxLoadRegAction(NxmNxReg2.class, BigInteger.valueOf(endpointOrdinals.getEpgId()))); applyActions.add(nxLoadRegAction(NxmNxReg3.class, BigInteger.valueOf(endpointOrdinals.getCgId()))); applyActions.add(nxLoadRegAction(NxmNxReg7.class, BigInteger.valueOf(port))); applyActions.add(tunnelDestinationAction); int order = 0; Instruction applyActionsIns = new InstructionBuilder().setOrder(order++) .setInstruction(applyActionIns(applyActions.toArray(new Action[applyActions.size()]))) .build(); Instruction gotoTable = new InstructionBuilder().setOrder(order) .setInstruction(gotoTableIns(goToTable)) .build(); ArrayList<Instruction> instructions = new ArrayList<>(); instructions.add(applyActionsIns); instructions.add(gotoTable); MatchBuilder matchBuilder = new MatchBuilder() .setEthernetMatch(ethernetMatch(null, peerEndpoint.getMacAddress(), null)); addNxRegMatch(matchBuilder, RegMatch.of(NxmNxReg4.class, (long) endpointOrdinals.getBdId())); Match match = matchBuilder.build(); FlowId flowid = FlowIdUtils.newFlowId(tableId, "remoteL2", match); FlowBuilder flowBuilder = base(tableId).setId(flowid) .setPriority(priority) .setMatch(match) .setInstructions(new InstructionsBuilder().setInstruction(instructions).build()); ofWriter.writeFlow(nodeId, tableId, flowBuilder.build()); } DestinationMapperFlows(DestinationMapperUtils utils, NodeId nodeId, short tableId);  }
DestinationMapperFlows { void createRemoteL2Flow(short goToTable, int priority, Endpoint endpoint, Endpoint peerEndpoint, IpAddress tunDst, NodeConnectorId connectorId, OfWriter ofWriter) { OrdinalFactory.EndpointFwdCtxOrdinals endpointOrdinals = utils.getEndpointOrdinals(endpoint); long port; try { port = getOfPortNum(connectorId); } catch (NumberFormatException ex) { LOG.warn("Could not parse port number {}", connectorId); return; } Action tunnelDestinationAction = null; if (tunDst.getIpv4Address() != null) { tunnelDestinationAction = nxLoadTunIPv4Action(tunDst.getIpv4Address().getValue(), false); } else if (tunDst.getIpv6Address() != null) { LOG.error("IPv6 tunnel destination {} for {} not supported", tunDst.getIpv6Address().getValue(), nodeId); return; } List<Action> applyActions = new ArrayList<>(); applyActions.add(nxLoadRegAction(NxmNxReg2.class, BigInteger.valueOf(endpointOrdinals.getEpgId()))); applyActions.add(nxLoadRegAction(NxmNxReg3.class, BigInteger.valueOf(endpointOrdinals.getCgId()))); applyActions.add(nxLoadRegAction(NxmNxReg7.class, BigInteger.valueOf(port))); applyActions.add(tunnelDestinationAction); int order = 0; Instruction applyActionsIns = new InstructionBuilder().setOrder(order++) .setInstruction(applyActionIns(applyActions.toArray(new Action[applyActions.size()]))) .build(); Instruction gotoTable = new InstructionBuilder().setOrder(order) .setInstruction(gotoTableIns(goToTable)) .build(); ArrayList<Instruction> instructions = new ArrayList<>(); instructions.add(applyActionsIns); instructions.add(gotoTable); MatchBuilder matchBuilder = new MatchBuilder() .setEthernetMatch(ethernetMatch(null, peerEndpoint.getMacAddress(), null)); addNxRegMatch(matchBuilder, RegMatch.of(NxmNxReg4.class, (long) endpointOrdinals.getBdId())); Match match = matchBuilder.build(); FlowId flowid = FlowIdUtils.newFlowId(tableId, "remoteL2", match); FlowBuilder flowBuilder = base(tableId).setId(flowid) .setPriority(priority) .setMatch(match) .setInstructions(new InstructionsBuilder().setInstruction(instructions).build()); ofWriter.writeFlow(nodeId, tableId, flowBuilder.build()); } DestinationMapperFlows(DestinationMapperUtils utils, NodeId nodeId, short tableId);   }