Java Code Examples for org.onosproject.net.flowobjective.FilteringObjective#type()

The following examples show how to use org.onosproject.net.flowobjective.FilteringObjective#type() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: AbstractHPPipeline.java    From onos with Apache License 2.0 5 votes vote down vote up
@Override
public void filter(FilteringObjective filteringObjective) {
    if (filteringObjective.type() == FilteringObjective.Type.PERMIT) {
        processFilter(filteringObjective,
                      filteringObjective.op() == Objective.Operation.ADD,
                      filteringObjective.appId());
    } else {
        fail(filteringObjective, ObjectiveError.UNSUPPORTED);
    }
}
 
Example 2
Source File: SoftRouterPipeline.java    From onos with Apache License 2.0 5 votes vote down vote up
@Override
public void filter(FilteringObjective filteringObjective) {
    if (filteringObjective.type() == FilteringObjective.Type.PERMIT) {
        processFilter(filteringObjective,
                      filteringObjective.op() == Objective.Operation.ADD,
                      filteringObjective.appId());
    } else {
        fail(filteringObjective, ObjectiveError.UNSUPPORTED);
    }
}
 
Example 3
Source File: Ofdpa2Pipeline.java    From onos with Apache License 2.0 5 votes vote down vote up
@Override
public void filter(FilteringObjective filteringObjective) {
    if (filteringObjective.type() == FilteringObjective.Type.PERMIT) {
        processFilter(filteringObjective,
                      filteringObjective.op() == Objective.Operation.ADD,
                      filteringObjective.appId());
    } else {
        // Note that packets that don't match the PERMIT filter are
        // automatically denied. The DENY filter is used to deny packets
        // that are otherwise permitted by the PERMIT filter.
        // Use ACL table flow rules here for DENY filtering objectives
        log.warn("filter objective other than PERMIT currently not supported");
        fail(filteringObjective, ObjectiveError.UNSUPPORTED);
    }
}
 
Example 4
Source File: NokiaOltPipeline.java    From onos with Apache License 2.0 5 votes vote down vote up
private void buildAndApplyRule(FilteringObjective filter, TrafficSelector selector,
                               TrafficTreatment treatment, int priority) {
    FlowRule rule = DefaultFlowRule.builder()
            .fromApp(filter.appId())
            .forDevice(deviceId)
            .forTable(0)
            .makePermanent()
            .withSelector(selector)
            .withTreatment(treatment)
            .withPriority(priority)
            .build();

    FlowRuleOperations.Builder opsBuilder = FlowRuleOperations.builder();

    switch (filter.type()) {
        case PERMIT:
            opsBuilder.add(rule);
            break;
        case DENY:
            opsBuilder.remove(rule);
            break;
        default:
            log.warn("Unknown filter type : {}", filter.type());
            fail(filter, ObjectiveError.UNSUPPORTED);
    }

    applyFlowRules(opsBuilder, filter);
}
 
Example 5
Source File: CentecV350Pipeline.java    From onos with Apache License 2.0 5 votes vote down vote up
@Override
public void filter(FilteringObjective filteringObjective) {
    if (filteringObjective.type() == FilteringObjective.Type.PERMIT) {
        processFilter(filteringObjective,
                filteringObjective.op() == Objective.Operation.ADD,
                filteringObjective.appId());
    } else {
        fail(filteringObjective, ObjectiveError.UNSUPPORTED);
    }
}
 
Example 6
Source File: SpringOpenTTP.java    From onos with Apache License 2.0 5 votes vote down vote up
@Override
public void filter(FilteringObjective filteringObjective) {
    if (filteringObjective.type() == FilteringObjective.Type.PERMIT) {
        log.debug("processing PERMIT filter objective");
        processFilter(filteringObjective,
                      filteringObjective.op() == Objective.Operation.ADD,
                      filteringObjective.appId());
    } else {
        log.debug("filter objective other than PERMIT not supported");
        fail(filteringObjective, ObjectiveError.UNSUPPORTED);
    }
}
 
Example 7
Source File: OltPipeline.java    From onos with Apache License 2.0 5 votes vote down vote up
private void buildAndApplyRule(FilteringObjective filter, TrafficSelector selector,
                               TrafficTreatment treatment) {
    FlowRule rule = DefaultFlowRule.builder()
            .fromApp(filter.appId())
            .forDevice(deviceId)
            .forTable(0)
            .makePermanent()
            .withSelector(selector)
            .withTreatment(treatment)
            .withPriority(filter.priority())
            .build();

    FlowRuleOperations.Builder opsBuilder = FlowRuleOperations.builder();

    switch (filter.type()) {
        case PERMIT:
            opsBuilder.add(rule);
            break;
        case DENY:
            opsBuilder.remove(rule);
            break;
        default:
            log.warn("Unknown filter type : {}", filter.type());
            fail(filter, ObjectiveError.UNSUPPORTED);
    }

    applyFlowRules(opsBuilder, filter);
}
 
Example 8
Source File: PicaPipeline.java    From onos with Apache License 2.0 5 votes vote down vote up
@Override
public void filter(FilteringObjective filteringObjective) {
    if (filteringObjective.type() == FilteringObjective.Type.PERMIT) {
        processFilter(filteringObjective,
                      filteringObjective.op() == Objective.Operation.ADD,
                      filteringObjective.appId());
    } else {
        fail(filteringObjective, ObjectiveError.UNSUPPORTED);
    }
}
 
Example 9
Source File: AbstractCorsaPipeline.java    From onos with Apache License 2.0 5 votes vote down vote up
@Override
public void filter(FilteringObjective filteringObjective) {
    if (filteringObjective.type() == FilteringObjective.Type.PERMIT) {
        processFilter(filteringObjective,
                filteringObjective.op() == ADD,
                filteringObjective.appId());
    } else {
        fail(filteringObjective, ObjectiveError.UNSUPPORTED);
    }
}