Search in sources :

Example 46 with FlowEndpoint

use of org.openkilda.model.FlowEndpoint in project open-kilda by telstra.

the class FlowCommandFactory method buildInstallEgressFlow.

/**
 * Generate install egress flow 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 buildInstallEgressFlow(FlowPath flowPath, int inputPortNo, EncapsulationResources encapsulationResources, boolean multiTable) {
    Flow flow = flowPath.getFlow();
    FlowEndpoint ingressEndpoint = FlowSideAdapter.makeIngressAdapter(flow, flowPath).getEndpoint();
    FlowEndpoint egressEndpoint = FlowSideAdapter.makeEgressAdapter(flow, flowPath).getEndpoint();
    return new InstallEgressFlow(transactionIdGenerator.generate(), flow.getFlowId(), flowPath.getCookie().getValue(), egressEndpoint.getSwitchId(), inputPortNo, egressEndpoint.getPortNumber(), encapsulationResources.getTransitEncapsulationId(), encapsulationResources.getEncapsulationType(), egressEndpoint.getOuterVlanId(), egressEndpoint.getInnerVlanId(), getOutputVlanType(flow, flowPath), multiTable, ingressEndpoint, null);
}
Also used : FlowEndpoint(org.openkilda.model.FlowEndpoint) InstallEgressFlow(org.openkilda.messaging.command.flow.InstallEgressFlow) InstallTransitFlow(org.openkilda.messaging.command.flow.InstallTransitFlow) InstallServer42IngressFlow(org.openkilda.messaging.command.flow.InstallServer42IngressFlow) InstallOneSwitchMirrorFlow(org.openkilda.messaging.command.flow.InstallOneSwitchMirrorFlow) Flow(org.openkilda.model.Flow) InstallIngressLoopFlow(org.openkilda.messaging.command.flow.InstallIngressLoopFlow) InstallIngressMirrorFlow(org.openkilda.messaging.command.flow.InstallIngressMirrorFlow) InstallTransitLoopFlow(org.openkilda.messaging.command.flow.InstallTransitLoopFlow) InstallOneSwitchFlow(org.openkilda.messaging.command.flow.InstallOneSwitchFlow) InstallEgressFlow(org.openkilda.messaging.command.flow.InstallEgressFlow) InstallEgressMirrorFlow(org.openkilda.messaging.command.flow.InstallEgressMirrorFlow) InstallIngressFlow(org.openkilda.messaging.command.flow.InstallIngressFlow)

Example 47 with FlowEndpoint

use of org.openkilda.model.FlowEndpoint in project open-kilda by telstra.

the class RecordHandler method makeFlowSegmentWrappedCommand.

private FlowSegmentWrapperCommand makeFlowSegmentWrappedCommand(InstallOneSwitchMirrorFlow request, MessageContext messageContext, FlowSegmentResponseFactory responseFactory) {
    FlowEndpoint endpoint = new FlowEndpoint(request.getSwitchId(), request.getInputPort(), request.getInputVlanId(), request.getInputInnerVlanId(), request.isEnableLldp(), request.isEnableArp());
    FlowEndpoint egressEndpoint = new FlowEndpoint(request.getSwitchId(), request.getOutputPort(), request.getOutputVlanId(), request.getOutputInnerVlanId());
    MeterConfig meterConfig = makeMeterConfig(request.getMeterId(), request.getBandwidth());
    OneSwitchMirrorFlowInstallCommand command = new OneSwitchMirrorFlowInstallCommand(messageContext, EMPTY_COMMAND_ID, makeSegmentMetadata(request), endpoint, meterConfig, egressEndpoint, new RulesContext(), request.getMirrorConfig());
    return new FlowSegmentWrapperCommand(command, responseFactory);
}
Also used : FlowSegmentWrapperCommand(org.openkilda.floodlight.command.flow.FlowSegmentWrapperCommand) FlowEndpoint(org.openkilda.model.FlowEndpoint) OneSwitchMirrorFlowInstallCommand(org.openkilda.floodlight.command.flow.ingress.OneSwitchMirrorFlowInstallCommand) RulesContext(org.openkilda.floodlight.model.RulesContext) OFMeterConfig(org.projectfloodlight.openflow.protocol.OFMeterConfig) MeterConfig(org.openkilda.model.MeterConfig)

Example 48 with FlowEndpoint

use of org.openkilda.model.FlowEndpoint in project open-kilda by telstra.

the class RecordHandler method makeFlowSegmentWrappedCommand.

private FlowSegmentWrapperCommand makeFlowSegmentWrappedCommand(InstallIngressMirrorFlow request, MessageContext messageContext, FlowSegmentResponseFactory responseFactory) {
    FlowEndpoint endpoint = new FlowEndpoint(request.getSwitchId(), request.getInputPort(), request.getInputVlanId(), request.getInputInnerVlanId(), request.isEnableLldp(), request.isEnableArp());
    MeterConfig meterConfig = makeMeterConfig(request.getMeterId(), request.getBandwidth());
    IngressMirrorFlowSegmentInstallCommand command = new IngressMirrorFlowSegmentInstallCommand(messageContext, EMPTY_COMMAND_ID, makeSegmentMetadata(request), endpoint, meterConfig, request.getEgressSwitchId(), request.getOutputPort(), makeTransitEncapsulation(request), new RulesContext(), request.getMirrorConfig());
    return new FlowSegmentWrapperCommand(command, responseFactory);
}
Also used : FlowSegmentWrapperCommand(org.openkilda.floodlight.command.flow.FlowSegmentWrapperCommand) FlowEndpoint(org.openkilda.model.FlowEndpoint) RulesContext(org.openkilda.floodlight.model.RulesContext) IngressMirrorFlowSegmentInstallCommand(org.openkilda.floodlight.command.flow.ingress.IngressMirrorFlowSegmentInstallCommand) OFMeterConfig(org.projectfloodlight.openflow.protocol.OFMeterConfig) MeterConfig(org.openkilda.model.MeterConfig)

Example 49 with FlowEndpoint

use of org.openkilda.model.FlowEndpoint in project open-kilda by telstra.

the class RecordHandler method makeFlowSegmentWrappedCommand.

private FlowSegmentWrapperCommand makeFlowSegmentWrappedCommand(InstallEgressMirrorFlow request, MessageContext messageContext, FlowSegmentResponseFactory responseFactory) {
    FlowEndpoint endpoint = new FlowEndpoint(request.getSwitchId(), request.getOutputPort(), request.getOutputVlanId(), request.getOutputInnerVlanId());
    EgressMirrorFlowSegmentInstallCommand command = new EgressMirrorFlowSegmentInstallCommand(messageContext, EMPTY_COMMAND_ID, makeSegmentMetadata(request), endpoint, request.getIngressEndpoint(), request.getInputPort(), makeTransitEncapsulation(request), request.getMirrorConfig());
    return new FlowSegmentWrapperCommand(command, responseFactory);
}
Also used : FlowSegmentWrapperCommand(org.openkilda.floodlight.command.flow.FlowSegmentWrapperCommand) FlowEndpoint(org.openkilda.model.FlowEndpoint) EgressMirrorFlowSegmentInstallCommand(org.openkilda.floodlight.command.flow.egress.EgressMirrorFlowSegmentInstallCommand)

Example 50 with FlowEndpoint

use of org.openkilda.model.FlowEndpoint in project open-kilda by telstra.

the class RecordHandler method makeFlowSegmentWrappedCommand.

private FlowSegmentWrapperCommand makeFlowSegmentWrappedCommand(InstallIngressFlow request, MessageContext messageContext, FlowSegmentResponseFactory responseFactory) {
    FlowEndpoint endpoint = new FlowEndpoint(request.getSwitchId(), request.getInputPort(), request.getInputVlanId(), request.getInputInnerVlanId(), request.isEnableLldp(), request.isEnableArp());
    MeterConfig meterConfig = makeMeterConfig(request.getMeterId(), request.getBandwidth());
    IngressFlowSegmentInstallCommand command = new IngressFlowSegmentInstallCommand(messageContext, EMPTY_COMMAND_ID, makeSegmentMetadata(request), endpoint, meterConfig, request.getEgressSwitchId(), request.getOutputPort(), makeTransitEncapsulation(request), new RulesContext(), request.getMirrorConfig());
    return new FlowSegmentWrapperCommand(command, responseFactory);
}
Also used : IngressFlowSegmentInstallCommand(org.openkilda.floodlight.command.flow.ingress.IngressFlowSegmentInstallCommand) FlowSegmentWrapperCommand(org.openkilda.floodlight.command.flow.FlowSegmentWrapperCommand) FlowEndpoint(org.openkilda.model.FlowEndpoint) RulesContext(org.openkilda.floodlight.model.RulesContext) OFMeterConfig(org.projectfloodlight.openflow.protocol.OFMeterConfig) MeterConfig(org.openkilda.model.MeterConfig)

Aggregations

FlowEndpoint (org.openkilda.model.FlowEndpoint)105 Test (org.junit.Test)26 Flow (org.openkilda.model.Flow)22 ArrayList (java.util.ArrayList)15 RoutingMetadata (org.openkilda.floodlight.utils.metadata.RoutingMetadata)12 YFlow (org.openkilda.model.YFlow)11 FlowPath (org.openkilda.model.FlowPath)10 FlowSpeakerData (org.openkilda.rulemanager.FlowSpeakerData)9 SpeakerData (org.openkilda.rulemanager.SpeakerData)9 SwitchId (org.openkilda.model.SwitchId)8 YSubFlow (org.openkilda.model.YSubFlow)8 HashSet (java.util.HashSet)7 FlowSideAdapter (org.openkilda.adapter.FlowSideAdapter)7 FlowSourceAdapter (org.openkilda.adapter.FlowSourceAdapter)7 IngressFlowSegmentInstallCommand (org.openkilda.floodlight.command.flow.ingress.IngressFlowSegmentInstallCommand)7 EffectiveIds (org.openkilda.floodlight.model.EffectiveIds)7 FlowSegmentWrapperCommand (org.openkilda.floodlight.command.flow.FlowSegmentWrapperCommand)6 FlowProcessingException (org.openkilda.wfm.topology.flowhs.exception.FlowProcessingException)6 OFFlowAdd (org.projectfloodlight.openflow.protocol.OFFlowAdd)6 MessageContext (org.openkilda.messaging.MessageContext)5