use of org.openkilda.floodlight.switchmanager.factory.SwitchFlowTuple in project open-kilda by telstra.
the class SwitchManager method buildExpectedServer42FlowRttFlows.
@Override
public List<OFFlowMod> buildExpectedServer42FlowRttFlows(DatapathId dpid, boolean server42FlowRttFeatureToggle, boolean server42FlowRttSwitchProperty, Integer server42Port, Integer server42Vlan, org.openkilda.model.MacAddress server42MacAddress, Set<Integer> customerPorts) throws SwitchNotFoundException {
List<SwitchFlowGenerator> generators = new ArrayList<>();
if (server42FlowRttFeatureToggle) {
generators.add(switchFlowFactory.getServer42FlowRttTurningFlowGenerator());
generators.add(switchFlowFactory.getServer42FlowRttVxlanTurningFlowGenerator());
if (server42FlowRttSwitchProperty) {
for (Integer port : customerPorts) {
generators.add(switchFlowFactory.getServer42FlowRttInputFlowGenerator(server42Port, port, server42MacAddress));
}
generators.add(switchFlowFactory.getServer42FlowRttOutputVlanFlowGenerator(server42Port, server42Vlan, server42MacAddress));
generators.add(switchFlowFactory.getServer42FlowRttOutputVxlanFlowGenerator(server42Port, server42Vlan, server42MacAddress));
}
}
IOFSwitch sw = lookupSwitch(dpid);
return generators.stream().map(g -> g.generateFlow(sw)).map(SwitchFlowTuple::getFlow).filter(Objects::nonNull).collect(toList());
}
use of org.openkilda.floodlight.switchmanager.factory.SwitchFlowTuple in project open-kilda by telstra.
the class SwitchManager method installDefaultFlow.
private Long installDefaultFlow(DatapathId dpid, SwitchFlowGenerator flowGeneratorSupplier, String flowDescription) throws SwitchNotFoundException, OfInstallException {
IOFSwitch sw = lookupSwitch(dpid);
SwitchFlowTuple switchFlowTuple = flowGeneratorSupplier.generateFlow(sw);
if (switchFlowTuple.getFlow() == null) {
logger.debug("Skip installation of {} rule for switch {}", flowDescription, dpid);
return null;
} else {
String flowName = flowDescription + dpid.toString();
installSwitchFlowTuple(switchFlowTuple, flowName);
return switchFlowTuple.getFlow().getCookie().getValue();
}
}
use of org.openkilda.floodlight.switchmanager.factory.SwitchFlowTuple in project open-kilda by telstra.
the class SwitchManager method buildExpectedServer42IslRttFlows.
@Override
public List<OFFlowMod> buildExpectedServer42IslRttFlows(DatapathId dpid, boolean server42IslRtt, Integer server42Port, Integer server42Vlan, org.openkilda.model.MacAddress server42MacAddress, Collection<Integer> islPorts) throws SwitchNotFoundException {
List<SwitchFlowGenerator> generators = new ArrayList<>();
if (server42IslRtt) {
generators.add(switchFlowFactory.getServer42IslRttTurningFlowGenerator());
generators.add(switchFlowFactory.getServer42IslRttOutputFlowGenerator(server42Port, server42Vlan, server42MacAddress));
for (Integer islPort : islPorts) {
generators.add(switchFlowFactory.getServer42IslRttInputFlowGenerator(server42Port, islPort));
}
}
IOFSwitch sw = lookupSwitch(dpid);
return generators.stream().map(g -> g.generateFlow(sw)).map(SwitchFlowTuple::getFlow).filter(Objects::nonNull).collect(toList());
}
Aggregations