Search in sources :

Example 1 with InstallTransitLoopFlow

use of org.openkilda.messaging.command.flow.InstallTransitLoopFlow in project open-kilda by telstra.

the class FlowCommandFactory method buildInstallTransitLoopFlow.

/**
 * Generate install transit flow loop command.
 *
 * @param flowPath flow path with segments to be used for building of install rules.
 * @param inputPortNo the number of input port.
 * @param encapsulationResources the encapsulation resources.
 * @param multiTable use multi table.
 * @return install egress flow command
 */
public InstallEgressFlow buildInstallTransitLoopFlow(Flow flow, FlowPath flowPath, int inputPortNo, EncapsulationResources encapsulationResources, boolean multiTable) {
    FlowEndpoint ingressEndpoint = FlowSideAdapter.makeIngressAdapter(flow, flowPath).getEndpoint();
    FlowEndpoint egressEndpoint = FlowSideAdapter.makeEgressAdapter(flow, flowPath).getEndpoint();
    return new InstallTransitLoopFlow(transactionIdGenerator.generate(), flow.getFlowId(), flowPath.getCookie().toBuilder().looped(true).build().getValue(), egressEndpoint.getSwitchId(), inputPortNo, egressEndpoint.getPortNumber(), encapsulationResources.getTransitEncapsulationId(), encapsulationResources.getEncapsulationType(), egressEndpoint.getOuterVlanId(), egressEndpoint.getInnerVlanId(), getOutputVlanType(flow, flowPath), multiTable, ingressEndpoint, null);
}
Also used : InstallTransitLoopFlow(org.openkilda.messaging.command.flow.InstallTransitLoopFlow) FlowEndpoint(org.openkilda.model.FlowEndpoint)

Aggregations

InstallTransitLoopFlow (org.openkilda.messaging.command.flow.InstallTransitLoopFlow)1 FlowEndpoint (org.openkilda.model.FlowEndpoint)1