use of org.openkilda.floodlight.model.RulesContext 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);
}
use of org.openkilda.floodlight.model.RulesContext 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);
}
use of org.openkilda.floodlight.model.RulesContext 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);
}
use of org.openkilda.floodlight.model.RulesContext in project open-kilda by telstra.
the class IngressFlowModFactory method makeServer42InputFlowMessage.
/**
* Route RTT packet received from Server 42 to Pre Ingress table. Shared across all flows for this physical port
* (if OF flow-mod ADD message use same match and priority fields with existing OF flow,
* existing OF flow will be replaced/not added).
* If rule could not be installed on this switch Optional.empty() will be returned.
*/
public Optional<OFFlowMod> makeServer42InputFlowMessage(int server42UpdPortOffset) {
RulesContext context = command.getRulesContext();
Optional<OFFlowMod> flowMod = Server42FlowRttInputFlowGenerator.generateFlowMod(of, switchFeatures, server42UpdPortOffset, command.getEndpoint().getPortNumber(), context.getServer42Port(), context.getServer42MacAddress());
return flowMod.map(ofFlowMod -> flowModBuilderFactory.makeBuilder(of, ofFlowMod.getTableId()).setPriority(ofFlowMod.getPriority()).setCookie(ofFlowMod.getCookie()).setCookieMask(ofFlowMod.getCookieMask()).setMatch(ofFlowMod.getMatch()).setInstructions(ofFlowMod.getInstructions()).build());
}
use of org.openkilda.floodlight.model.RulesContext in project open-kilda by telstra.
the class RecordHandler method makeFlowSegmentWrappedCommand.
private FlowSegmentWrapperCommand makeFlowSegmentWrappedCommand(InstallOneSwitchFlow 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());
OneSwitchFlowInstallCommand command = new OneSwitchFlowInstallCommand(messageContext, EMPTY_COMMAND_ID, makeSegmentMetadata(request), endpoint, meterConfig, egressEndpoint, new RulesContext(), request.getMirrorConfig());
return new FlowSegmentWrapperCommand(command, responseFactory);
}
Aggregations