Search in sources :

Example 16 with DeleteRulesCriteria

use of org.openkilda.messaging.command.switches.DeleteRulesCriteria in project open-kilda by telstra.

the class RecordHandler method doDeleteSwitchRules.

private void doDeleteSwitchRules(final CommandMessage message) {
    SwitchRulesDeleteRequest request = (SwitchRulesDeleteRequest) message.getData();
    logger.info("Deleting rules from '{}' switch: action={}, criteria={}", request.getSwitchId(), request.getDeleteRulesAction(), request.getCriteria());
    final IKafkaProducerService producerService = getKafkaProducer();
    final String replyToTopic = context.getKafkaSwitchManagerTopic();
    DatapathId dpid = DatapathId.of(request.getSwitchId().toLong());
    DeleteRulesAction deleteAction = request.getDeleteRulesAction();
    DeleteRulesCriteria criteria = request.getCriteria();
    ISwitchManager switchManager = context.getSwitchManager();
    try {
        List<Long> removedRules = new ArrayList<>();
        if (deleteAction != null) {
            switch(deleteAction) {
                case REMOVE_DROP:
                    criteria = DeleteRulesCriteria.builder().cookie(DROP_RULE_COOKIE).build();
                    break;
                case REMOVE_BROADCAST:
                    criteria = DeleteRulesCriteria.builder().cookie(VERIFICATION_BROADCAST_RULE_COOKIE).build();
                    break;
                case REMOVE_UNICAST:
                    criteria = DeleteRulesCriteria.builder().cookie(VERIFICATION_UNICAST_RULE_COOKIE).build();
                    break;
                case REMOVE_VERIFICATION_LOOP:
                    criteria = DeleteRulesCriteria.builder().cookie(DROP_VERIFICATION_LOOP_RULE_COOKIE).build();
                    break;
                case REMOVE_BFD_CATCH:
                    criteria = DeleteRulesCriteria.builder().cookie(CATCH_BFD_RULE_COOKIE).build();
                    break;
                case REMOVE_ROUND_TRIP_LATENCY:
                    criteria = DeleteRulesCriteria.builder().cookie(ROUND_TRIP_LATENCY_RULE_COOKIE).build();
                    break;
                case REMOVE_UNICAST_VXLAN:
                    criteria = DeleteRulesCriteria.builder().cookie(VERIFICATION_UNICAST_VXLAN_RULE_COOKIE).build();
                    break;
                case REMOVE_MULTITABLE_PRE_INGRESS_PASS_THROUGH:
                    criteria = DeleteRulesCriteria.builder().cookie(MULTITABLE_PRE_INGRESS_PASS_THROUGH_COOKIE).build();
                    break;
                case REMOVE_MULTITABLE_INGRESS_DROP:
                    criteria = DeleteRulesCriteria.builder().cookie(MULTITABLE_INGRESS_DROP_COOKIE).build();
                    break;
                case REMOVE_MULTITABLE_POST_INGRESS_DROP:
                    criteria = DeleteRulesCriteria.builder().cookie(MULTITABLE_POST_INGRESS_DROP_COOKIE).build();
                    break;
                case REMOVE_MULTITABLE_EGRESS_PASS_THROUGH:
                    criteria = DeleteRulesCriteria.builder().cookie(MULTITABLE_EGRESS_PASS_THROUGH_COOKIE).build();
                    break;
                case REMOVE_MULTITABLE_TRANSIT_DROP:
                    criteria = DeleteRulesCriteria.builder().cookie(MULTITABLE_TRANSIT_DROP_COOKIE).build();
                    break;
                case REMOVE_LLDP_INPUT_PRE_DROP:
                    criteria = DeleteRulesCriteria.builder().cookie(LLDP_INPUT_PRE_DROP_COOKIE).build();
                    break;
                case REMOVE_LLDP_INGRESS:
                    criteria = DeleteRulesCriteria.builder().cookie(LLDP_INGRESS_COOKIE).build();
                    break;
                case REMOVE_LLDP_POST_INGRESS:
                    criteria = DeleteRulesCriteria.builder().cookie(LLDP_POST_INGRESS_COOKIE).build();
                    break;
                case REMOVE_LLDP_POST_INGRESS_VXLAN:
                    criteria = DeleteRulesCriteria.builder().cookie(LLDP_POST_INGRESS_VXLAN_COOKIE).build();
                    break;
                case REMOVE_LLDP_POST_INGRESS_ONE_SWITCH:
                    criteria = DeleteRulesCriteria.builder().cookie(LLDP_POST_INGRESS_ONE_SWITCH_COOKIE).build();
                    break;
                case REMOVE_LLDP_TRANSIT:
                    criteria = DeleteRulesCriteria.builder().cookie(LLDP_TRANSIT_COOKIE).build();
                    break;
                case REMOVE_ARP_INPUT_PRE_DROP:
                    criteria = DeleteRulesCriteria.builder().cookie(ARP_INPUT_PRE_DROP_COOKIE).build();
                    break;
                case REMOVE_ARP_INGRESS:
                    criteria = DeleteRulesCriteria.builder().cookie(ARP_INGRESS_COOKIE).build();
                    break;
                case REMOVE_ARP_POST_INGRESS:
                    criteria = DeleteRulesCriteria.builder().cookie(ARP_POST_INGRESS_COOKIE).build();
                    break;
                case REMOVE_ARP_POST_INGRESS_VXLAN:
                    criteria = DeleteRulesCriteria.builder().cookie(ARP_POST_INGRESS_VXLAN_COOKIE).build();
                    break;
                case REMOVE_ARP_POST_INGRESS_ONE_SWITCH:
                    criteria = DeleteRulesCriteria.builder().cookie(ARP_POST_INGRESS_ONE_SWITCH_COOKIE).build();
                    break;
                case REMOVE_ARP_TRANSIT:
                    criteria = DeleteRulesCriteria.builder().cookie(ARP_TRANSIT_COOKIE).build();
                    break;
                case REMOVE_SERVER_42_FLOW_RTT_TURNING:
                case REMOVE_SERVER_42_TURNING:
                    criteria = DeleteRulesCriteria.builder().cookie(SERVER_42_FLOW_RTT_TURNING_COOKIE).build();
                    break;
                case REMOVE_SERVER_42_FLOW_RTT_VXLAN_TURNING:
                    criteria = DeleteRulesCriteria.builder().cookie(SERVER_42_FLOW_RTT_VXLAN_TURNING_COOKIE).build();
                    break;
                case REMOVE_SERVER_42_FLOW_RTT_OUTPUT_VLAN:
                case REMOVE_SERVER_42_OUTPUT_VLAN:
                    criteria = DeleteRulesCriteria.builder().cookie(SERVER_42_FLOW_RTT_OUTPUT_VLAN_COOKIE).build();
                    break;
                case REMOVE_SERVER_42_FLOW_RTT_OUTPUT_VXLAN:
                case REMOVE_SERVER_42_OUTPUT_VXLAN:
                    criteria = DeleteRulesCriteria.builder().cookie(SERVER_42_FLOW_RTT_OUTPUT_VXLAN_COOKIE).build();
                    break;
                case REMOVE_SERVER_42_ISL_RTT_TURNING:
                    criteria = DeleteRulesCriteria.builder().cookie(SERVER_42_ISL_RTT_TURNING_COOKIE).build();
                    break;
                case REMOVE_SERVER_42_ISL_RTT_OUTPUT:
                    criteria = DeleteRulesCriteria.builder().cookie(SERVER_42_ISL_RTT_OUTPUT_COOKIE).build();
                    break;
                default:
                    logger.warn("Received unexpected delete switch rule action: {}", deleteAction);
            }
            // The cases when we delete all non-default rules.
            if (deleteAction.nonDefaultRulesToBeRemoved()) {
                removedRules.addAll(switchManager.deleteAllNonDefaultRules(dpid));
            }
            // The cases when we delete the default rules.
            if (deleteAction.defaultRulesToBeRemoved()) {
                removedRules.addAll(switchManager.deleteDefaultRules(dpid, request.getIslPorts(), request.getFlowPorts(), request.getFlowLldpPorts(), request.getFlowArpPorts(), request.getServer42FlowRttPorts(), request.isMultiTable(), request.isSwitchLldp(), request.isSwitchArp(), request.isServer42FlowRttFeatureToggle() && request.isServer42FlowRttSwitchProperty(), request.isServer42IslRttEnabled()));
            }
        }
        // The case when we either delete by criteria or a specific default rule.
        if (criteria != null) {
            removedRules.addAll(switchManager.deleteRulesByCriteria(dpid, false, null, criteria));
        }
        // The cases when we (re)install the default rules.
        if (deleteAction != null && deleteAction.defaultRulesToBeInstalled()) {
            switchManager.installDefaultRules(dpid);
            if (request.isMultiTable()) {
                processInstallDefaultFlowByCookie(request.getSwitchId(), MULTITABLE_PRE_INGRESS_PASS_THROUGH_COOKIE);
                processInstallDefaultFlowByCookie(request.getSwitchId(), MULTITABLE_INGRESS_DROP_COOKIE);
                processInstallDefaultFlowByCookie(request.getSwitchId(), MULTITABLE_POST_INGRESS_DROP_COOKIE);
                processInstallDefaultFlowByCookie(request.getSwitchId(), MULTITABLE_EGRESS_PASS_THROUGH_COOKIE);
                processInstallDefaultFlowByCookie(request.getSwitchId(), MULTITABLE_TRANSIT_DROP_COOKIE);
                processInstallDefaultFlowByCookie(request.getSwitchId(), LLDP_POST_INGRESS_COOKIE);
                processInstallDefaultFlowByCookie(request.getSwitchId(), LLDP_POST_INGRESS_VXLAN_COOKIE);
                processInstallDefaultFlowByCookie(request.getSwitchId(), LLDP_POST_INGRESS_ONE_SWITCH_COOKIE);
                processInstallDefaultFlowByCookie(request.getSwitchId(), ARP_POST_INGRESS_COOKIE);
                processInstallDefaultFlowByCookie(request.getSwitchId(), ARP_POST_INGRESS_VXLAN_COOKIE);
                processInstallDefaultFlowByCookie(request.getSwitchId(), ARP_POST_INGRESS_ONE_SWITCH_COOKIE);
                for (int port : request.getIslPorts()) {
                    switchManager.installMultitableEndpointIslRules(dpid, port);
                }
                for (int port : request.getFlowPorts()) {
                    switchManager.installIntermediateIngressRule(dpid, port);
                }
                for (Integer port : request.getFlowLldpPorts()) {
                    switchManager.installLldpInputCustomerFlow(dpid, port);
                }
                for (Integer port : request.getFlowArpPorts()) {
                    switchManager.installArpInputCustomerFlow(dpid, port);
                }
                if (request.isSwitchLldp()) {
                    processInstallDefaultFlowByCookie(request.getSwitchId(), LLDP_INPUT_PRE_DROP_COOKIE);
                    processInstallDefaultFlowByCookie(request.getSwitchId(), LLDP_TRANSIT_COOKIE);
                    processInstallDefaultFlowByCookie(request.getSwitchId(), LLDP_INGRESS_COOKIE);
                }
                if (request.isSwitchArp()) {
                    processInstallDefaultFlowByCookie(request.getSwitchId(), ARP_INPUT_PRE_DROP_COOKIE);
                    processInstallDefaultFlowByCookie(request.getSwitchId(), ARP_TRANSIT_COOKIE);
                    processInstallDefaultFlowByCookie(request.getSwitchId(), ARP_INGRESS_COOKIE);
                }
            }
            Integer server42Port = request.getServer42Port();
            Integer server42Vlan = request.getServer42Vlan();
            MacAddress server42MacAddress = request.getServer42MacAddress();
            if (request.isServer42FlowRttFeatureToggle()) {
                switchManager.installServer42FlowRttTurningFlow(dpid);
                switchManager.installServer42FlowRttVxlanTurningFlow(dpid);
                if (request.isServer42FlowRttSwitchProperty() && server42Port != null && server42Vlan != null && server42MacAddress != null) {
                    switchManager.installServer42FlowRttOutputVlanFlow(dpid, server42Port, server42Vlan, server42MacAddress);
                    switchManager.installServer42FlowRttOutputVxlanFlow(dpid, server42Port, server42Vlan, server42MacAddress);
                    for (Integer port : request.getServer42FlowRttPorts()) {
                        switchManager.installServer42FlowRttInputFlow(dpid, server42Port, port, server42MacAddress);
                    }
                }
            }
            if (request.isServer42IslRttEnabled()) {
                switchManager.installServer42IslRttTurningFlow(dpid);
                switchManager.installServer42IslRttOutputFlow(dpid, server42Port, server42Vlan, server42MacAddress);
                for (Integer port : request.getIslPorts()) {
                    switchManager.installServer42IslRttInputFlow(dpid, server42Port, port);
                }
            }
        }
        SwitchRulesResponse response = new SwitchRulesResponse(removedRules);
        InfoMessage infoMessage = new InfoMessage(response, System.currentTimeMillis(), message.getCorrelationId());
        producerService.sendMessageAndTrack(replyToTopic, record.key(), infoMessage);
    } catch (SwitchNotFoundException e) {
        logger.error("Deleting switch rules was unsuccessful. Switch '{}' not found", request.getSwitchId());
        anError(ErrorType.NOT_FOUND).withMessage(e.getMessage()).withDescription(request.getSwitchId().toString()).withCorrelationId(message.getCorrelationId()).withTopic(replyToTopic).withKey(record.key()).sendVia(producerService);
    } catch (SwitchOperationException e) {
        logger.error("Failed to delete switch '{}' rules.", request.getSwitchId(), e);
        anError(ErrorType.DELETION_FAILURE).withMessage(e.getMessage()).withDescription(request.getSwitchId().toString()).withCorrelationId(message.getCorrelationId()).withTopic(replyToTopic).withKey(record.key()).sendVia(producerService);
    }
}
Also used : SwitchOperationException(org.openkilda.floodlight.error.SwitchOperationException) UnsupportedSwitchOperationException(org.openkilda.floodlight.error.UnsupportedSwitchOperationException) ISwitchManager(org.openkilda.floodlight.switchmanager.ISwitchManager) ArrayList(java.util.ArrayList) DeleteRulesCriteria(org.openkilda.messaging.command.switches.DeleteRulesCriteria) DatapathId(org.projectfloodlight.openflow.types.DatapathId) MacAddress(org.openkilda.model.MacAddress) SwitchNotFoundException(org.openkilda.floodlight.error.SwitchNotFoundException) FlowEndpoint(org.openkilda.model.FlowEndpoint) IKafkaProducerService(org.openkilda.floodlight.service.kafka.IKafkaProducerService) InfoMessage(org.openkilda.messaging.info.InfoMessage) SwitchRulesResponse(org.openkilda.messaging.info.switches.SwitchRulesResponse) DeleteRulesAction(org.openkilda.messaging.command.switches.DeleteRulesAction) SwitchRulesDeleteRequest(org.openkilda.messaging.command.switches.SwitchRulesDeleteRequest)

Example 17 with DeleteRulesCriteria

use of org.openkilda.messaging.command.switches.DeleteRulesCriteria in project open-kilda by telstra.

the class SwitchManager method deleteRulesByCriteria.

@Override
public List<Long> deleteRulesByCriteria(DatapathId dpid, boolean multiTable, RuleType ruleType, DeleteRulesCriteria... criteria) throws SwitchOperationException {
    List<OFFlowStatsEntry> flowStatsBefore = dumpFlowTable(dpid);
    IOFSwitch sw = lookupSwitch(dpid);
    OFFactory ofFactory = sw.getOFFactory();
    for (DeleteRulesCriteria criteriaEntry : criteria) {
        OFFlowDelete dropFlowDelete = buildFlowDeleteByCriteria(ofFactory, criteriaEntry, multiTable, ruleType);
        logger.info("Rules by criteria {} are to be removed from switch {}.", criteria, dpid);
        pushFlow(sw, "--DeleteFlow--", dropFlowDelete);
    }
    // Wait for OFFlowDelete to be processed.
    sendBarrierRequest(sw);
    List<OFFlowStatsEntry> flowStatsAfter = dumpFlowTable(dpid);
    Set<Long> cookiesAfter = flowStatsAfter.stream().map(entry -> entry.getCookie().getValue()).collect(Collectors.toSet());
    return flowStatsBefore.stream().map(entry -> entry.getCookie().getValue()).filter(cookie -> !cookiesAfter.contains(cookie)).peek(cookie -> logger.info("Rule with cookie {} has been removed from switch {}.", cookie, dpid)).collect(toList());
}
Also used : OFFlowStatsEntry(org.projectfloodlight.openflow.protocol.OFFlowStatsEntry) TableId(org.projectfloodlight.openflow.types.TableId) U64(org.projectfloodlight.openflow.types.U64) Arrays(java.util.Arrays) DEFAULT_METERS(org.openkilda.model.MeterId.DEFAULT_METERS) OFPortMod(org.projectfloodlight.openflow.protocol.OFPortMod) MeteredFlowGenerator(org.openkilda.floodlight.switchmanager.factory.generator.MeteredFlowGenerator) DROP_VERIFICATION_LOOP_RULE_COOKIE(org.openkilda.model.cookie.Cookie.DROP_VERIFICATION_LOOP_RULE_COOKIE) OFFlowStatsRequest(org.projectfloodlight.openflow.protocol.OFFlowStatsRequest) OFPortDesc(org.projectfloodlight.openflow.protocol.OFPortDesc) VERIFICATION_UNICAST_VXLAN_RULE_COOKIE(org.openkilda.model.cookie.Cookie.VERIFICATION_UNICAST_VXLAN_RULE_COOKIE) IOFSwitch(net.floodlightcontroller.core.IOFSwitch) Collections.singletonList(java.util.Collections.singletonList) InetAddress(java.net.InetAddress) MULTITABLE_POST_INGRESS_DROP_COOKIE(org.openkilda.model.cookie.Cookie.MULTITABLE_POST_INGRESS_DROP_COOKIE) OFBucket(org.projectfloodlight.openflow.protocol.OFBucket) Future(java.util.concurrent.Future) SERVER_42_FLOW_RTT_VXLAN_TURNING_COOKIE(org.openkilda.model.cookie.Cookie.SERVER_42_FLOW_RTT_VXLAN_TURNING_COOKIE) Arrays.asList(java.util.Arrays.asList) Map(java.util.Map) OFGroupDescStatsRequest(org.projectfloodlight.openflow.protocol.OFGroupDescStatsRequest) OFMeterModCommand(org.projectfloodlight.openflow.protocol.OFMeterModCommand) Match(org.projectfloodlight.openflow.protocol.match.Match) OFMessage(org.projectfloodlight.openflow.protocol.OFMessage) OFVlanVidMatch(org.projectfloodlight.openflow.types.OFVlanVidMatch) OFFactory(org.projectfloodlight.openflow.protocol.OFFactory) OFGroupType(org.projectfloodlight.openflow.protocol.OFGroupType) OFBarrierReply(org.projectfloodlight.openflow.protocol.OFBarrierReply) IKafkaProducerService(org.openkilda.floodlight.service.kafka.IKafkaProducerService) OFGroupAdd(org.projectfloodlight.openflow.protocol.OFGroupAdd) OFMeterConfigStatsRequest(org.projectfloodlight.openflow.protocol.OFMeterConfigStatsRequest) InvalidMeterIdException(org.openkilda.floodlight.error.InvalidMeterIdException) MULTITABLE_PRE_INGRESS_PASS_THROUGH_COOKIE(org.openkilda.model.cookie.Cookie.MULTITABLE_PRE_INGRESS_PASS_THROUGH_COOKIE) Set(java.util.Set) OFActionOutput(org.projectfloodlight.openflow.protocol.action.OFActionOutput) RuleType(org.openkilda.messaging.command.flow.RuleType) IRestApiService(net.floodlightcontroller.restserver.IRestApiService) OFAction(org.projectfloodlight.openflow.protocol.action.OFAction) OFMeterConfig(org.projectfloodlight.openflow.protocol.OFMeterConfig) ROUND_TRIP_LATENCY_RULE_COOKIE(org.openkilda.model.cookie.Cookie.ROUND_TRIP_LATENCY_RULE_COOKIE) CorrelationContext(org.openkilda.floodlight.utils.CorrelationContext) Stream(java.util.stream.Stream) LLDP_INGRESS_COOKIE(org.openkilda.model.cookie.Cookie.LLDP_INGRESS_COOKIE) Meter(org.openkilda.model.Meter) OF_12(org.projectfloodlight.openflow.protocol.OFVersion.OF_12) OF_13(org.projectfloodlight.openflow.protocol.OFVersion.OF_13) SwitchFlowUtils.isOvs(org.openkilda.floodlight.switchmanager.SwitchFlowUtils.isOvs) OFBufferId(org.projectfloodlight.openflow.types.OFBufferId) OFOxms(org.projectfloodlight.openflow.protocol.oxm.OFOxms) LLDP_POST_INGRESS_ONE_SWITCH_METER_ID(org.openkilda.model.MeterId.LLDP_POST_INGRESS_ONE_SWITCH_METER_ID) OFInstructionWriteMetadata(org.projectfloodlight.openflow.protocol.instruction.OFInstructionWriteMetadata) IOFSwitchService(net.floodlightcontroller.core.internal.IOFSwitchService) LLDP_POST_INGRESS_VXLAN_METER_ID(org.openkilda.model.MeterId.LLDP_POST_INGRESS_VXLAN_METER_ID) CollectionUtils(org.apache.commons.collections4.CollectionUtils) VERIFICATION_UNICAST_VXLAN_METER_ID(org.openkilda.model.MeterId.VERIFICATION_UNICAST_VXLAN_METER_ID) ArrayList(java.util.ArrayList) EthType(org.projectfloodlight.openflow.types.EthType) Lists(com.google.common.collect.Lists) OFMeterFlags(org.projectfloodlight.openflow.protocol.OFMeterFlags) OFActionType(org.projectfloodlight.openflow.protocol.OFActionType) OFFlowStatsReply(org.projectfloodlight.openflow.protocol.OFFlowStatsReply) MacAddress(org.projectfloodlight.openflow.types.MacAddress) Cookie.isDefaultRule(org.openkilda.model.cookie.Cookie.isDefaultRule) SwitchFlowFactory(org.openkilda.floodlight.switchmanager.factory.SwitchFlowFactory) LLDP_TRANSIT_COOKIE(org.openkilda.model.cookie.Cookie.LLDP_TRANSIT_COOKIE) FloodlightContext(net.floodlightcontroller.core.FloodlightContext) Builder(org.projectfloodlight.openflow.protocol.match.Match.Builder) ErrorType(org.openkilda.messaging.error.ErrorType) OFInstructionGotoTable(org.projectfloodlight.openflow.protocol.instruction.OFInstructionGotoTable) SERVER_42_ISL_RTT_OUTPUT_COOKIE(org.openkilda.model.cookie.Cookie.SERVER_42_ISL_RTT_OUTPUT_COOKIE) ARP_INPUT_PRE_DROP_METER_ID(org.openkilda.model.MeterId.ARP_INPUT_PRE_DROP_METER_ID) DROP_RULE_COOKIE(org.openkilda.model.cookie.Cookie.DROP_RULE_COOKIE) ARP_POST_INGRESS_VXLAN_METER_ID(org.openkilda.model.MeterId.ARP_POST_INGRESS_VXLAN_METER_ID) FeatureDetectorService(org.openkilda.floodlight.service.FeatureDetectorService) OFActions(org.projectfloodlight.openflow.protocol.action.OFActions) FlowSharedSegmentCookie(org.openkilda.model.cookie.FlowSharedSegmentCookie) ExecutionException(java.util.concurrent.ExecutionException) KafkaUtilityService(org.openkilda.floodlight.service.kafka.KafkaUtilityService) NewCorrelationContextRequired(org.openkilda.floodlight.utils.NewCorrelationContextRequired) RoutingMetadata(org.openkilda.floodlight.utils.metadata.RoutingMetadata) FloodlightModuleConfigurationProvider(org.openkilda.floodlight.config.provider.FloodlightModuleConfigurationProvider) OFMeterBandDrop(org.projectfloodlight.openflow.protocol.meterband.OFMeterBandDrop) VERIFICATION_UNICAST_RULE_COOKIE(org.openkilda.model.cookie.Cookie.VERIFICATION_UNICAST_RULE_COOKIE) OFMeterMod(org.projectfloodlight.openflow.protocol.OFMeterMod) IFloodlightService(net.floodlightcontroller.core.module.IFloodlightService) ARP_POST_INGRESS_METER_ID(org.openkilda.model.MeterId.ARP_POST_INGRESS_METER_ID) IpProtocol(org.projectfloodlight.openflow.types.IpProtocol) OFFlowDelete(org.projectfloodlight.openflow.protocol.OFFlowDelete) ARP_POST_INGRESS_ONE_SWITCH_METER_ID(org.openkilda.model.MeterId.ARP_POST_INGRESS_ONE_SWITCH_METER_ID) DatapathId(org.projectfloodlight.openflow.types.DatapathId) VERIFICATION_BROADCAST_RULE_COOKIE(org.openkilda.model.cookie.Cookie.VERIFICATION_BROADCAST_RULE_COOKIE) VERIFICATION_BROADCAST_METER_ID(org.openkilda.model.MeterId.VERIFICATION_BROADCAST_METER_ID) OFActionSetField(org.projectfloodlight.openflow.protocol.action.OFActionSetField) ErrorMessage(org.openkilda.messaging.error.ErrorMessage) OfPortDescConverter(org.openkilda.floodlight.converter.OfPortDescConverter) ARP_POST_INGRESS_COOKIE(org.openkilda.model.cookie.Cookie.ARP_POST_INGRESS_COOKIE) DeleteRulesCriteria(org.openkilda.messaging.command.switches.DeleteRulesCriteria) KildaCore(org.openkilda.floodlight.KildaCore) SwitchFeature(org.openkilda.model.SwitchFeature) LLDP_POST_INGRESS_COOKIE(org.openkilda.model.cookie.Cookie.LLDP_POST_INGRESS_COOKIE) LoggerFactory(org.slf4j.LoggerFactory) TimeoutException(java.util.concurrent.TimeoutException) ARP_INPUT_PRE_DROP_COOKIE(org.openkilda.model.cookie.Cookie.ARP_INPUT_PRE_DROP_COOKIE) SwitchOperationException(org.openkilda.floodlight.error.SwitchOperationException) ARP_TRANSIT_METER_ID(org.openkilda.model.MeterId.ARP_TRANSIT_METER_ID) SERVER_42_FLOW_RTT_OUTPUT_VXLAN_COOKIE(org.openkilda.model.cookie.Cookie.SERVER_42_FLOW_RTT_OUTPUT_VXLAN_COOKIE) OFFlowStatsEntry(org.projectfloodlight.openflow.protocol.OFFlowStatsEntry) FlowModUtils(net.floodlightcontroller.util.FlowModUtils) TransportPort(org.projectfloodlight.openflow.types.TransportPort) ConnectModeRequest(org.openkilda.messaging.command.switches.ConnectModeRequest) LLDP_TRANSIT_METER_ID(org.openkilda.model.MeterId.LLDP_TRANSIT_METER_ID) OFGroupDescStatsEntry(org.projectfloodlight.openflow.protocol.OFGroupDescStatsEntry) Collectors.toSet(java.util.stream.Collectors.toSet) LLDP_POST_INGRESS_VXLAN_COOKIE(org.openkilda.model.cookie.Cookie.LLDP_POST_INGRESS_VXLAN_COOKIE) OFGroupDelete(org.projectfloodlight.openflow.protocol.OFGroupDelete) OFInstruction(org.projectfloodlight.openflow.protocol.instruction.OFInstruction) ImmutableSet(com.google.common.collect.ImmutableSet) OFPortConfig(org.projectfloodlight.openflow.protocol.OFPortConfig) ImmutableMap(com.google.common.collect.ImmutableMap) Collections.emptyList(java.util.Collections.emptyList) Collection(java.util.Collection) LLDP_POST_INGRESS_METER_ID(org.openkilda.model.MeterId.LLDP_POST_INGRESS_METER_ID) FloodlightModuleContext(net.floodlightcontroller.core.module.FloodlightModuleContext) NOVIFLOW_PUSH_POP_VXLAN(org.openkilda.model.SwitchFeature.NOVIFLOW_PUSH_POP_VXLAN) InetSocketAddress(java.net.InetSocketAddress) Collectors(java.util.stream.Collectors) String.format(java.lang.String.format) VERIFICATION_UNICAST_METER_ID(org.openkilda.model.MeterId.VERIFICATION_UNICAST_METER_ID) UnsupportedSwitchOperationException(org.openkilda.floodlight.error.UnsupportedSwitchOperationException) IOFMessageListener(net.floodlightcontroller.core.IOFMessageListener) Objects(java.util.Objects) OFPort(org.projectfloodlight.openflow.types.OFPort) MULTITABLE_EGRESS_PASS_THROUGH_COOKIE(org.openkilda.model.cookie.Cookie.MULTITABLE_EGRESS_PASS_THROUGH_COOKIE) List(java.util.List) SwitchNotFoundException(org.openkilda.floodlight.error.SwitchNotFoundException) SwitchFlowTuple(org.openkilda.floodlight.switchmanager.factory.SwitchFlowTuple) OFMetadata(org.projectfloodlight.openflow.types.OFMetadata) IFloodlightProviderService(net.floodlightcontroller.core.IFloodlightProviderService) Optional(java.util.Optional) ARP_POST_INGRESS_VXLAN_COOKIE(org.openkilda.model.cookie.Cookie.ARP_POST_INGRESS_VXLAN_COOKIE) OFType(org.projectfloodlight.openflow.protocol.OFType) ARP_INGRESS_COOKIE(org.openkilda.model.cookie.Cookie.ARP_INGRESS_COOKIE) OFGroup(org.projectfloodlight.openflow.types.OFGroup) MULTITABLE_TRANSIT_DROP_COOKIE(org.openkilda.model.cookie.Cookie.MULTITABLE_TRANSIT_DROP_COOKIE) SERVER_42_FLOW_RTT_TURNING_COOKIE(org.openkilda.model.cookie.Cookie.SERVER_42_FLOW_RTT_TURNING_COOKIE) ListenableFuture(com.google.common.util.concurrent.ListenableFuture) SwitchFlowGenerator(org.openkilda.floodlight.switchmanager.factory.generator.SwitchFlowGenerator) HashMap(java.util.HashMap) KILDA_OVS_PUSH_POP_MATCH_VXLAN(org.openkilda.model.SwitchFeature.KILDA_OVS_PUSH_POP_MATCH_VXLAN) ARP_POST_INGRESS_ONE_SWITCH_COOKIE(org.openkilda.model.cookie.Cookie.ARP_POST_INGRESS_ONE_SWITCH_COOKIE) CATCH_BFD_RULE_COOKIE(org.openkilda.model.cookie.Cookie.CATCH_BFD_RULE_COOKIE) HashSet(java.util.HashSet) ImmutableList(com.google.common.collect.ImmutableList) MULTITABLE_INGRESS_DROP_COOKIE(org.openkilda.model.cookie.Cookie.MULTITABLE_INGRESS_DROP_COOKIE) IPathVerificationService(org.openkilda.floodlight.pathverification.IPathVerificationService) Cookie(org.openkilda.model.cookie.Cookie) OFErrorMsg(org.projectfloodlight.openflow.protocol.OFErrorMsg) OFBarrierRequest(org.projectfloodlight.openflow.protocol.OFBarrierRequest) SERVER_42_FLOW_RTT_OUTPUT_VLAN_COOKIE(org.openkilda.model.cookie.Cookie.SERVER_42_FLOW_RTT_OUTPUT_VLAN_COOKIE) FlowEncapsulationType(org.openkilda.model.FlowEncapsulationType) Logger(org.slf4j.Logger) POST_INGRESS(org.openkilda.messaging.command.flow.RuleType.POST_INGRESS) ARP_INGRESS_METER_ID(org.openkilda.model.MeterId.ARP_INGRESS_METER_ID) OFMeterConfigStatsReply(org.projectfloodlight.openflow.protocol.OFMeterConfigStatsReply) ARP_TRANSIT_COOKIE(org.openkilda.model.cookie.Cookie.ARP_TRANSIT_COOKIE) LLDP_INPUT_PRE_DROP_COOKIE(org.openkilda.model.cookie.Cookie.LLDP_INPUT_PRE_DROP_COOKIE) SwitchManagerWebRoutable(org.openkilda.floodlight.switchmanager.web.SwitchManagerWebRoutable) IPv4Address(org.projectfloodlight.openflow.types.IPv4Address) SwitchFlowUtils.convertDpIdToMac(org.openkilda.floodlight.switchmanager.SwitchFlowUtils.convertDpIdToMac) MeterId.createMeterIdForDefaultRule(org.openkilda.model.MeterId.createMeterIdForDefaultRule) FloodlightModuleException(net.floodlightcontroller.core.module.FloodlightModuleException) IFloodlightModule(net.floodlightcontroller.core.module.IFloodlightModule) MeterId(org.openkilda.model.MeterId) TimeUnit(java.util.concurrent.TimeUnit) OFGroupDescStatsReply(org.projectfloodlight.openflow.protocol.OFGroupDescStatsReply) Collectors.toList(java.util.stream.Collectors.toList) SERVER_42_ISL_RTT_TURNING_COOKIE(org.openkilda.model.cookie.Cookie.SERVER_42_ISL_RTT_TURNING_COOKIE) LLDP_INPUT_PRE_DROP_METER_ID(org.openkilda.model.MeterId.LLDP_INPUT_PRE_DROP_METER_ID) OfInstallException(org.openkilda.floodlight.error.OfInstallException) SwitchId(org.openkilda.model.SwitchId) OFFlowMod(org.projectfloodlight.openflow.protocol.OFFlowMod) Destination(org.openkilda.messaging.Destination) MatchField(org.projectfloodlight.openflow.protocol.match.MatchField) LLDP_INGRESS_METER_ID(org.openkilda.model.MeterId.LLDP_INGRESS_METER_ID) VisibleForTesting(com.google.common.annotations.VisibleForTesting) LATENCY_PACKET_UDP_PORT(org.openkilda.floodlight.pathverification.PathVerificationService.LATENCY_PACKET_UDP_PORT) ErrorData(org.openkilda.messaging.error.ErrorData) GroupId(org.openkilda.model.GroupId) Collections(java.util.Collections) LLDP_POST_INGRESS_ONE_SWITCH_COOKIE(org.openkilda.model.cookie.Cookie.LLDP_POST_INGRESS_ONE_SWITCH_COOKIE) IOFSwitch(net.floodlightcontroller.core.IOFSwitch) OFFlowDelete(org.projectfloodlight.openflow.protocol.OFFlowDelete) OFFactory(org.projectfloodlight.openflow.protocol.OFFactory) DeleteRulesCriteria(org.openkilda.messaging.command.switches.DeleteRulesCriteria)

Aggregations

DeleteRulesCriteria (org.openkilda.messaging.command.switches.DeleteRulesCriteria)17 Test (org.junit.Test)13 OFFlowMod (org.projectfloodlight.openflow.protocol.OFFlowMod)10 EasyMock.anyLong (org.easymock.EasyMock.anyLong)9 SwitchOperationException (org.openkilda.floodlight.error.SwitchOperationException)3 UnsupportedSwitchOperationException (org.openkilda.floodlight.error.UnsupportedSwitchOperationException)3 RemoveFlow (org.openkilda.messaging.command.flow.RemoveFlow)3 FlowEntry (org.openkilda.messaging.info.rule.FlowEntry)3 FlowEncapsulationType (org.openkilda.model.FlowEncapsulationType)3 FlowSegmentCookie (org.openkilda.model.cookie.FlowSegmentCookie)3 VisibleForTesting (com.google.common.annotations.VisibleForTesting)2 ArrayList (java.util.ArrayList)2 SwitchNotFoundException (org.openkilda.floodlight.error.SwitchNotFoundException)2 IKafkaProducerService (org.openkilda.floodlight.service.kafka.IKafkaProducerService)2 DatapathId (org.projectfloodlight.openflow.types.DatapathId)2 ImmutableList (com.google.common.collect.ImmutableList)1 ImmutableMap (com.google.common.collect.ImmutableMap)1 ImmutableSet (com.google.common.collect.ImmutableSet)1 Lists (com.google.common.collect.Lists)1 ListenableFuture (com.google.common.util.concurrent.ListenableFuture)1