Search in sources :

Example 1 with InstallIngressMirrorFlow

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

the class FlowCommandFactory method buildInstallIngressMirrorFlow.

/**
 * Generate install ingress flow command.
 *
 * @param flow the flow.
 * @param flowPath flow path with segments to be used for building of install rules.
 * @param outputPortNo the number of output port.
 * @param encapsulationResources the encapsulation resources.
 * @param multiTable  \
 * @return install ingress flow command
 */
public InstallIngressMirrorFlow buildInstallIngressMirrorFlow(Flow flow, FlowPath flowPath, int outputPortNo, EncapsulationResources encapsulationResources, boolean multiTable, MirrorConfig mirrorConfig) {
    boolean enableLldp = needToInstallOrRemoveLldpFlow(flowPath);
    boolean enableArp = needToInstallOrRemoveArpFlow(flowPath);
    Long meterId = Optional.ofNullable(flowPath.getMeterId()).map(MeterId::getValue).orElse(null);
    FlowEndpoint ingressEndpoint = FlowSideAdapter.makeIngressAdapter(flow, flowPath).getEndpoint();
    FlowEndpoint egressEndpoint = FlowSideAdapter.makeEgressAdapter(flow, flowPath).getEndpoint();
    return new InstallIngressMirrorFlow(transactionIdGenerator.generate(), flow.getFlowId(), flowPath.getCookie().toBuilder().mirror(true).build().getValue(), ingressEndpoint.getSwitchId(), ingressEndpoint.getPortNumber(), outputPortNo, ingressEndpoint.getOuterVlanId(), ingressEndpoint.getInnerVlanId(), encapsulationResources.getTransitEncapsulationId(), encapsulationResources.getEncapsulationType(), getOutputVlanType(flow, flowPath), flow.getBandwidth(), meterId, egressEndpoint.getSwitchId(), multiTable, enableLldp, enableArp, mirrorConfig);
}
Also used : FlowEndpoint(org.openkilda.model.FlowEndpoint) InstallIngressMirrorFlow(org.openkilda.messaging.command.flow.InstallIngressMirrorFlow)

Aggregations

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