use of org.openkilda.messaging.command.flow.InstallOneSwitchMirrorFlow in project open-kilda by telstra.
the class FlowCommandFactory method makeOneSwitchMirrorRule.
/**
* Generate install one switch mirror flow command.
*
* @param flow the flow.
* @param flowPath flow path with segments to be used for building of install rules.
* @return install one switch flow command
*/
public InstallOneSwitchMirrorFlow makeOneSwitchMirrorRule(Flow flow, FlowPath flowPath, MirrorConfig mirrorConfig) {
boolean enableLldp = needToInstallOrRemoveLldpFlow(flowPath);
boolean enableArp = needToInstallOrRemoveArpFlow(flowPath);
boolean multiTable = flowPath.isSrcWithMultiTable();
FlowEndpoint ingressEndpoint = FlowSideAdapter.makeIngressAdapter(flow, flowPath).getEndpoint();
FlowEndpoint egressEndpoint = FlowSideAdapter.makeEgressAdapter(flow, flowPath).getEndpoint();
Long meterId = Optional.ofNullable(flowPath.getMeterId()).map(MeterId::getValue).orElse(null);
return new InstallOneSwitchMirrorFlow(transactionIdGenerator.generate(), flow.getFlowId(), flowPath.getCookie().toBuilder().mirror(true).build().getValue(), ingressEndpoint.getSwitchId(), ingressEndpoint.getPortNumber(), egressEndpoint.getPortNumber(), ingressEndpoint.getOuterVlanId(), ingressEndpoint.getInnerVlanId(), egressEndpoint.getOuterVlanId(), egressEndpoint.getInnerVlanId(), getOutputVlanType(flow, flowPath), flow.getBandwidth(), meterId, multiTable, enableLldp, enableArp, mirrorConfig);
}
Aggregations