Search in sources :

Example 1 with InstallIngressLoopFlow

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

the class FlowCommandFactory method buildInstallIngressLoopFlow.

/**
 * Generate install ingress flow loop command.
 *
 * @param flow the flow.
 * @param flowPath flow path with segments to be used for building of install rules.
 * @param encapsulationResources the encapsulation resources.
 * @param multiTable  \
 * @return install ingress flow command
 */
public InstallIngressLoopFlow buildInstallIngressLoopFlow(Flow flow, FlowPath flowPath, EncapsulationResources encapsulationResources, boolean multiTable) {
    FlowEndpoint ingressEndpoint = FlowSideAdapter.makeIngressAdapter(flow, flowPath).getEndpoint();
    FlowEndpoint egressEndpoint = FlowSideAdapter.makeEgressAdapter(flow, flowPath).getEndpoint();
    return new InstallIngressLoopFlow(transactionIdGenerator.generate(), flow.getFlowId(), flowPath.getCookie().toBuilder().looped(true).build().getValue(), ingressEndpoint.getSwitchId(), ingressEndpoint.getPortNumber(), 0, encapsulationResources.getTransitEncapsulationId(), encapsulationResources.getEncapsulationType(), egressEndpoint.getOuterVlanId(), egressEndpoint.getInnerVlanId(), getOutputVlanType(flow, flowPath), multiTable, ingressEndpoint, null);
}
Also used : FlowEndpoint(org.openkilda.model.FlowEndpoint) InstallIngressLoopFlow(org.openkilda.messaging.command.flow.InstallIngressLoopFlow)

Aggregations

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