@Test public void createBroadcastFlow() { DestinationMapperUtils utils = new DestinationMapperUtils(ctx); EndpointBuilder endpointBuilder = buildEndpoint(IPV4_0, MAC_1, CONNECTOR_1); endpointBuilder.setTenant(buildTenant().getId()); OrdinalFactory.EndpointFwdCtxOrdinals ordinals = utils.getEndpointOrdinals(endpointBuilder.build()); MatchBuilder matchBuilder = new MatchBuilder().setEthernetMatch(new EthernetMatchBuilder() .setEthernetDestination(new EthernetDestinationBuilder().setAddress(MAC_0).setMask(MAC_0).build()).build()); addNxRegMatch(matchBuilder, FlowUtils.RegMatch.of(NxmNxReg5.class, (long) ordinals.getFdId())); Match match = matchBuilder.build(); List<Action> actions = new ArrayList<>(); actions.add(nxLoadTunIdAction(BigInteger.valueOf(ordinals.getFdId()), false)); actions.add(groupAction((long) ordinals.getFdId())); List<Instruction> instructions = new ArrayList<>(); InstructionBuilder instructionBuilder = new InstructionBuilder(); instructionBuilder.setInstruction(applyActionIns(actions.toArray(new Action[actions.size()]))).setOrder(0); instructions.add(instructionBuilder.build()); InstructionsBuilder instructionsBuilder = new InstructionsBuilder(); instructionsBuilder.setInstruction(instructions); Flow flow = buildFlow(FlowIdUtils.newFlowId(tableId, "broadcast", match), tableId, 40, match, instructionsBuilder.build()).build(); flows.createBroadcastFlow(40, ordinals, MAC_0, ofWriter); verify(ofWriter, times(1)).writeFlow(any(NodeId.class), anyShort(), eq(flow)); }
void createBroadcastFlow(int priority, OrdinalFactory.EndpointFwdCtxOrdinals ordinals, MacAddress mac, OfWriter ofWriter) { MatchBuilder matchBuilder = new MatchBuilder() .setEthernetMatch(new EthernetMatchBuilder() .setEthernetDestination(new EthernetDestinationBuilder().setAddress(mac).setMask(mac).build()) .build()); addNxRegMatch(matchBuilder, FlowUtils.RegMatch.of(NxmNxReg5.class, (long) ordinals.getFdId())); Match match = matchBuilder.build(); FlowId flowId = FlowIdUtils.newFlowId(tableId, "broadcast", match); FlowBuilder flowBuilder = base(tableId) .setPriority(priority) .setId(flowId) .setMatch(match) .setInstructions(instructions(applyActionIns(nxLoadTunIdAction(BigInteger .valueOf(ordinals.getFdId()), false), groupAction((long) ordinals.getFdId())))); ofWriter.writeFlow(nodeId, tableId, flowBuilder.build()); }
DestinationMapperFlows { void createBroadcastFlow(int priority, OrdinalFactory.EndpointFwdCtxOrdinals ordinals, MacAddress mac, OfWriter ofWriter) { MatchBuilder matchBuilder = new MatchBuilder() .setEthernetMatch(new EthernetMatchBuilder() .setEthernetDestination(new EthernetDestinationBuilder().setAddress(mac).setMask(mac).build()) .build()); addNxRegMatch(matchBuilder, FlowUtils.RegMatch.of(NxmNxReg5.class, (long) ordinals.getFdId())); Match match = matchBuilder.build(); FlowId flowId = FlowIdUtils.newFlowId(tableId, "broadcast", match); FlowBuilder flowBuilder = base(tableId) .setPriority(priority) .setId(flowId) .setMatch(match) .setInstructions(instructions(applyActionIns(nxLoadTunIdAction(BigInteger .valueOf(ordinals.getFdId()), false), groupAction((long) ordinals.getFdId())))); ofWriter.writeFlow(nodeId, tableId, flowBuilder.build()); } }
DestinationMapperFlows { void createBroadcastFlow(int priority, OrdinalFactory.EndpointFwdCtxOrdinals ordinals, MacAddress mac, OfWriter ofWriter) { MatchBuilder matchBuilder = new MatchBuilder() .setEthernetMatch(new EthernetMatchBuilder() .setEthernetDestination(new EthernetDestinationBuilder().setAddress(mac).setMask(mac).build()) .build()); addNxRegMatch(matchBuilder, FlowUtils.RegMatch.of(NxmNxReg5.class, (long) ordinals.getFdId())); Match match = matchBuilder.build(); FlowId flowId = FlowIdUtils.newFlowId(tableId, "broadcast", match); FlowBuilder flowBuilder = base(tableId) .setPriority(priority) .setId(flowId) .setMatch(match) .setInstructions(instructions(applyActionIns(nxLoadTunIdAction(BigInteger .valueOf(ordinals.getFdId()), false), groupAction((long) ordinals.getFdId())))); ofWriter.writeFlow(nodeId, tableId, flowBuilder.build()); } DestinationMapperFlows(DestinationMapperUtils utils, NodeId nodeId, short tableId); }
DestinationMapperFlows { void createBroadcastFlow(int priority, OrdinalFactory.EndpointFwdCtxOrdinals ordinals, MacAddress mac, OfWriter ofWriter) { MatchBuilder matchBuilder = new MatchBuilder() .setEthernetMatch(new EthernetMatchBuilder() .setEthernetDestination(new EthernetDestinationBuilder().setAddress(mac).setMask(mac).build()) .build()); addNxRegMatch(matchBuilder, FlowUtils.RegMatch.of(NxmNxReg5.class, (long) ordinals.getFdId())); Match match = matchBuilder.build(); FlowId flowId = FlowIdUtils.newFlowId(tableId, "broadcast", match); FlowBuilder flowBuilder = base(tableId) .setPriority(priority) .setId(flowId) .setMatch(match) .setInstructions(instructions(applyActionIns(nxLoadTunIdAction(BigInteger .valueOf(ordinals.getFdId()), false), groupAction((long) ordinals.getFdId())))); ofWriter.writeFlow(nodeId, tableId, flowBuilder.build()); } DestinationMapperFlows(DestinationMapperUtils utils, NodeId nodeId, short tableId);  }
DestinationMapperFlows { void createBroadcastFlow(int priority, OrdinalFactory.EndpointFwdCtxOrdinals ordinals, MacAddress mac, OfWriter ofWriter) { MatchBuilder matchBuilder = new MatchBuilder() .setEthernetMatch(new EthernetMatchBuilder() .setEthernetDestination(new EthernetDestinationBuilder().setAddress(mac).setMask(mac).build()) .build()); addNxRegMatch(matchBuilder, FlowUtils.RegMatch.of(NxmNxReg5.class, (long) ordinals.getFdId())); Match match = matchBuilder.build(); FlowId flowId = FlowIdUtils.newFlowId(tableId, "broadcast", match); FlowBuilder flowBuilder = base(tableId) .setPriority(priority) .setId(flowId) .setMatch(match) .setInstructions(instructions(applyActionIns(nxLoadTunIdAction(BigInteger .valueOf(ordinals.getFdId()), false), groupAction((long) ordinals.getFdId())))); ofWriter.writeFlow(nodeId, tableId, flowBuilder.build()); } DestinationMapperFlows(DestinationMapperUtils utils, NodeId nodeId, short tableId);   }