@Test public void createExternalL2Flow_exceptionCaught() { EndpointBuilder endpointBuilder = buildEndpoint(IPV4_0, MAC_0, CONNECTOR_0); Set<NodeConnectorId> externalConnectors = new HashSet<>(); externalConnectors.add(new NodeConnectorId(CONNECTOR_0)); externalConnectors.add(new NodeConnectorId(CONNECTOR_1)); flows.createExternalL2Flow(tableId, 100, endpointBuilder.build(), externalConnectors, ofWriter); verifyZeroInteractions(ofWriter); }
void createExternalL2Flow(short goToTable, int priority, Endpoint peerEndpoint, Set<NodeConnectorId> externalPorts, OfWriter ofWriter) { OrdinalFactory.EndpointFwdCtxOrdinals peerOrdinals = utils.getEndpointOrdinals(peerEndpoint); if (peerOrdinals != null) { MatchBuilder matchBuilder = new MatchBuilder() .setEthernetMatch(ethernetMatch(null, peerEndpoint.getMacAddress(), null)); addNxRegMatch(matchBuilder, RegMatch.of(NxmNxReg4.class, (long) peerOrdinals.getBdId())); Match match = matchBuilder.build(); long port; for (NodeConnectorId externalPort : externalPorts) { try { port = getOfPortNum(externalPort); writeExternalL2Flow(goToTable, priority, peerOrdinals, port, match, ofWriter); } catch (NumberFormatException e) { LOG.warn("Invalid NodeConnectorId. External port: {}", externalPort); } } } }
DestinationMapperFlows { void createExternalL2Flow(short goToTable, int priority, Endpoint peerEndpoint, Set<NodeConnectorId> externalPorts, OfWriter ofWriter) { OrdinalFactory.EndpointFwdCtxOrdinals peerOrdinals = utils.getEndpointOrdinals(peerEndpoint); if (peerOrdinals != null) { MatchBuilder matchBuilder = new MatchBuilder() .setEthernetMatch(ethernetMatch(null, peerEndpoint.getMacAddress(), null)); addNxRegMatch(matchBuilder, RegMatch.of(NxmNxReg4.class, (long) peerOrdinals.getBdId())); Match match = matchBuilder.build(); long port; for (NodeConnectorId externalPort : externalPorts) { try { port = getOfPortNum(externalPort); writeExternalL2Flow(goToTable, priority, peerOrdinals, port, match, ofWriter); } catch (NumberFormatException e) { LOG.warn("Invalid NodeConnectorId. External port: {}", externalPort); } } } } }
DestinationMapperFlows { void createExternalL2Flow(short goToTable, int priority, Endpoint peerEndpoint, Set<NodeConnectorId> externalPorts, OfWriter ofWriter) { OrdinalFactory.EndpointFwdCtxOrdinals peerOrdinals = utils.getEndpointOrdinals(peerEndpoint); if (peerOrdinals != null) { MatchBuilder matchBuilder = new MatchBuilder() .setEthernetMatch(ethernetMatch(null, peerEndpoint.getMacAddress(), null)); addNxRegMatch(matchBuilder, RegMatch.of(NxmNxReg4.class, (long) peerOrdinals.getBdId())); Match match = matchBuilder.build(); long port; for (NodeConnectorId externalPort : externalPorts) { try { port = getOfPortNum(externalPort); writeExternalL2Flow(goToTable, priority, peerOrdinals, port, match, ofWriter); } catch (NumberFormatException e) { LOG.warn("Invalid NodeConnectorId. External port: {}", externalPort); } } } } DestinationMapperFlows(DestinationMapperUtils utils, NodeId nodeId, short tableId); }
DestinationMapperFlows { void createExternalL2Flow(short goToTable, int priority, Endpoint peerEndpoint, Set<NodeConnectorId> externalPorts, OfWriter ofWriter) { OrdinalFactory.EndpointFwdCtxOrdinals peerOrdinals = utils.getEndpointOrdinals(peerEndpoint); if (peerOrdinals != null) { MatchBuilder matchBuilder = new MatchBuilder() .setEthernetMatch(ethernetMatch(null, peerEndpoint.getMacAddress(), null)); addNxRegMatch(matchBuilder, RegMatch.of(NxmNxReg4.class, (long) peerOrdinals.getBdId())); Match match = matchBuilder.build(); long port; for (NodeConnectorId externalPort : externalPorts) { try { port = getOfPortNum(externalPort); writeExternalL2Flow(goToTable, priority, peerOrdinals, port, match, ofWriter); } catch (NumberFormatException e) { LOG.warn("Invalid NodeConnectorId. External port: {}", externalPort); } } } } DestinationMapperFlows(DestinationMapperUtils utils, NodeId nodeId, short tableId);  }
DestinationMapperFlows { void createExternalL2Flow(short goToTable, int priority, Endpoint peerEndpoint, Set<NodeConnectorId> externalPorts, OfWriter ofWriter) { OrdinalFactory.EndpointFwdCtxOrdinals peerOrdinals = utils.getEndpointOrdinals(peerEndpoint); if (peerOrdinals != null) { MatchBuilder matchBuilder = new MatchBuilder() .setEthernetMatch(ethernetMatch(null, peerEndpoint.getMacAddress(), null)); addNxRegMatch(matchBuilder, RegMatch.of(NxmNxReg4.class, (long) peerOrdinals.getBdId())); Match match = matchBuilder.build(); long port; for (NodeConnectorId externalPort : externalPorts) { try { port = getOfPortNum(externalPort); writeExternalL2Flow(goToTable, priority, peerOrdinals, port, match, ofWriter); } catch (NumberFormatException e) { LOG.warn("Invalid NodeConnectorId. External port: {}", externalPort); } } } } DestinationMapperFlows(DestinationMapperUtils utils, NodeId nodeId, short tableId);   }