• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java DefaultFlowRule类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.onosproject.net.flow.DefaultFlowRule的典型用法代码示例。如果您正苦于以下问题:Java DefaultFlowRule类的具体用法?Java DefaultFlowRule怎么用?Java DefaultFlowRule使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



DefaultFlowRule类属于org.onosproject.net.flow包,在下文中一共展示了DefaultFlowRule类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: processEthDstOnlyFilter

import org.onosproject.net.flow.DefaultFlowRule; //导入依赖的package包/类
@Override
protected List<FlowRule> processEthDstOnlyFilter(EthCriterion ethCriterion,
        ApplicationId applicationId) {
    TrafficSelector.Builder selector = DefaultTrafficSelector.builder();
    TrafficTreatment.Builder treatment = DefaultTrafficTreatment.builder();
    selector.matchEthType(Ethernet.TYPE_IPV4);
    selector.matchEthDst(ethCriterion.mac());
    /*
     * Note: CpqD switches do not handle MPLS-related operation properly
     * for a packet with VLAN tag. We pop VLAN here as a workaround.
     * Side effect: HostService learns redundant hosts with same MAC but
     * different VLAN. No known side effect on the network reachability.
     */
    treatment.popVlan();
    treatment.transition(UNICAST_ROUTING_TABLE);
    FlowRule rule = DefaultFlowRule.builder()
            .forDevice(deviceId)
            .withSelector(selector.build())
            .withTreatment(treatment.build())
            .withPriority(DEFAULT_PRIORITY)
            .fromApp(applicationId)
            .makePermanent()
            .forTable(TMAC_TABLE).build();
    return ImmutableList.<FlowRule>builder().add(rule).build();
}
 
开发者ID:shlee89,项目名称:athena,代码行数:26,代码来源:CpqdOfdpa2Pipeline.java


示例2: processForward

import org.onosproject.net.flow.DefaultFlowRule; //导入依赖的package包/类
private Collection<FlowRule> processForward(ForwardingObjective fwd) {

        log.debug("Processing forwarding object");

        FlowRule.Builder ruleBuilder = DefaultFlowRule.builder()
                .forDevice(deviceId)
                .withSelector(fwd.selector())
                .withTreatment(fwd.treatment())
                .withPriority(fwd.priority())
                .fromApp(fwd.appId())
                .forTable(SOFTWARE_TABLE_START);

        if (fwd.permanent()) {
            ruleBuilder.makePermanent();
        } else {
            ruleBuilder.makeTemporary(TIME_OUT);
        }

        return Collections.singletonList(ruleBuilder.build());
    }
 
开发者ID:shlee89,项目名称:athena,代码行数:21,代码来源:HpPipeline.java


示例3: processVniTable

import org.onosproject.net.flow.DefaultFlowRule; //导入依赖的package包/类
private void processVniTable(boolean install) {
    TrafficSelector.Builder selector = DefaultTrafficSelector.builder();
    TrafficTreatment.Builder treatment = DefaultTrafficTreatment.builder();

    treatment.transition(FORWARDING_TABLE);

    FlowRule flowRule = DefaultFlowRule.builder()
            .forDevice(deviceId)
            .withSelector(selector.build())
            .withTreatment(treatment.build())
            .withPriority(DROP_PRIORITY)
            .fromApp(appId)
            .makePermanent()
            .forTable(VNI_TABLE)
            .build();

    applyRules(install, flowRule);
}
 
开发者ID:shlee89,项目名称:athena,代码行数:19,代码来源:OpenstackPipeline.java


示例4: processForwardingTable

import org.onosproject.net.flow.DefaultFlowRule; //导入依赖的package包/类
private void processForwardingTable(boolean install) {
    TrafficSelector.Builder selector = DefaultTrafficSelector.builder();
    TrafficTreatment.Builder treatment = DefaultTrafficTreatment.builder();

    treatment.drop();

    FlowRule flowRule = DefaultFlowRule.builder()
            .forDevice(deviceId)
            .withSelector(selector.build())
            .withTreatment(treatment.build())
            .withPriority(DROP_PRIORITY)
            .fromApp(appId)
            .makePermanent()
            .forTable(FORWARDING_TABLE)
            .build();

    applyRules(install, flowRule);
}
 
开发者ID:shlee89,项目名称:athena,代码行数:19,代码来源:OpenstackPipeline.java


示例5: processAclTable

import org.onosproject.net.flow.DefaultFlowRule; //导入依赖的package包/类
private void processAclTable(boolean install) {
    TrafficSelector.Builder selector = DefaultTrafficSelector.builder();
    TrafficTreatment.Builder treatment = DefaultTrafficTreatment.builder();

    treatment.wipeDeferred();
    treatment.drop();

    FlowRule flowRule = DefaultFlowRule.builder()
            .forDevice(deviceId)
            .withSelector(selector.build())
            .withTreatment(treatment.build())
            .withPriority(DROP_PRIORITY)
            .fromApp(appId)
            .makePermanent()
            .forTable(ACL_TABLE)
            .build();

    applyRules(install, flowRule);
}
 
开发者ID:shlee89,项目名称:athena,代码行数:20,代码来源:OpenstackPipeline.java


示例6: processEthDstOnlyFilter

import org.onosproject.net.flow.DefaultFlowRule; //导入依赖的package包/类
protected List<FlowRule> processEthDstOnlyFilter(EthCriterion ethCriterion,
        ApplicationId applicationId) {
    TrafficSelector.Builder selector = DefaultTrafficSelector.builder();
    TrafficTreatment.Builder treatment = DefaultTrafficTreatment.builder();
    selector.matchEthType(Ethernet.TYPE_IPV4);
    selector.matchEthDst(ethCriterion.mac());
    treatment.transition(UNICAST_ROUTING_TABLE);
    FlowRule rule = DefaultFlowRule.builder()
            .forDevice(deviceId)
            .withSelector(selector.build())
            .withTreatment(treatment.build())
            .withPriority(DEFAULT_PRIORITY)
            .fromApp(applicationId)
            .makePermanent()
            .forTable(TMAC_TABLE).build();
    return ImmutableList.<FlowRule>builder().add(rule).build();
}
 
开发者ID:shlee89,项目名称:athena,代码行数:18,代码来源:Ofdpa2Pipeline.java


示例7: processMcastEthDstFilter

import org.onosproject.net.flow.DefaultFlowRule; //导入依赖的package包/类
protected List<FlowRule> processMcastEthDstFilter(EthCriterion ethCriterion,
        ApplicationId applicationId) {
    TrafficSelector.Builder selector = DefaultTrafficSelector.builder();
    TrafficTreatment.Builder treatment = DefaultTrafficTreatment.builder();
    selector.matchEthType(Ethernet.TYPE_IPV4);
    selector.matchEthDstMasked(ethCriterion.mac(), ethCriterion.mask());
    treatment.transition(MULTICAST_ROUTING_TABLE);
    FlowRule rule = DefaultFlowRule.builder()
            .forDevice(deviceId)
            .withSelector(selector.build())
            .withTreatment(treatment.build())
            .withPriority(DEFAULT_PRIORITY)
            .fromApp(applicationId)
            .makePermanent()
            .forTable(TMAC_TABLE).build();
    return ImmutableList.<FlowRule>builder().add(rule).build();
}
 
开发者ID:shlee89,项目名称:athena,代码行数:18,代码来源:Ofdpa2Pipeline.java


示例8: processVersatile

import org.onosproject.net.flow.DefaultFlowRule; //导入依赖的package包/类
private Collection<FlowRule> processVersatile(ForwardingObjective fwd) {
    log.debug("Processing versatile forwarding objective");
    TrafficSelector selector = fwd.selector();
    TrafficTreatment tb = fwd.treatment();
    FlowRule.Builder ruleBuilder = DefaultFlowRule.builder().fromApp(fwd.appId()).withPriority(fwd.priority())
            .forDevice(deviceId).withSelector(selector).withTreatment(tb).makeTemporary(TIME_OUT);
    ruleBuilder.withPriority(fwd.priority());
    if (fwd.priority() == 100) {
        ruleBuilder.forTable(ENCAP_OUTPUT_TABLE);
    } else if (fwd.priority() == 200) {
        ruleBuilder.forTable(TUN_SEND_TABLE);
    } else {
        ruleBuilder.forTable(CLASSIFIER_TABLE);
    }

    if (fwd.permanent()) {
        ruleBuilder.makePermanent();
    }
    return Collections.singletonList(ruleBuilder.build());
}
 
开发者ID:shlee89,项目名称:athena,代码行数:21,代码来源:OpenVSwitchPipeline.java


示例9: processEthDstOnlyFilter

import org.onosproject.net.flow.DefaultFlowRule; //导入依赖的package包/类
protected List<FlowRule> processEthDstOnlyFilter(EthCriterion ethCriterion,
        ApplicationId applicationId, int priority) {
    TrafficSelector.Builder selector = DefaultTrafficSelector.builder();
    TrafficTreatment.Builder treatment = DefaultTrafficTreatment.builder();
    selector.matchEthType(Ethernet.TYPE_IPV4);
    selector.matchEthDst(ethCriterion.mac());
    treatment.transition(TABLE_IPV4_UNICAST);
    FlowRule rule = DefaultFlowRule.builder()
            .forDevice(deviceId)
            .withSelector(selector.build())
            .withTreatment(treatment.build())
            .withPriority(priority)
            .fromApp(applicationId)
            .makePermanent()
            .forTable(TABLE_TMAC).build();
    return ImmutableList.<FlowRule>builder().add(rule).build();
}
 
开发者ID:shlee89,项目名称:athena,代码行数:18,代码来源:SpringOpenTTP.java


示例10: populateTableMissEntry

import org.onosproject.net.flow.DefaultFlowRule; //导入依赖的package包/类
protected void populateTableMissEntry(int tableToAdd,
                                      boolean toControllerNow,
                                      boolean toControllerWrite,
                                      boolean toTable, int tableToSend) {
    TrafficSelector selector = DefaultTrafficSelector.builder().build();
    TrafficTreatment.Builder tBuilder = DefaultTrafficTreatment.builder();

    if (toControllerNow) {
        tBuilder.setOutput(PortNumber.CONTROLLER);
    }

    if (toControllerWrite) {
        tBuilder.deferred().setOutput(PortNumber.CONTROLLER);
    }

    if (toTable) {
        tBuilder.transition(tableToSend);
    }

    FlowRule flow = DefaultFlowRule.builder().forDevice(deviceId)
            .withSelector(selector).withTreatment(tBuilder.build())
            .withPriority(0).fromApp(appId).makePermanent()
            .forTable(tableToAdd).build();

    flowRuleService.applyFlowRules(flow);
}
 
开发者ID:shlee89,项目名称:athena,代码行数:27,代码来源:SpringOpenTTP.java


示例11: processTableMissDrop

import org.onosproject.net.flow.DefaultFlowRule; //导入依赖的package包/类
protected void processTableMissDrop(boolean install, int table, String description) {
    TrafficSelector.Builder selector = DefaultTrafficSelector.builder();

    TrafficTreatment.Builder treatment = DefaultTrafficTreatment.builder();
    treatment.drop();

    FlowRule rule = DefaultFlowRule.builder()
            .forDevice(deviceId)
            .withSelector(selector.build())
            .withTreatment(treatment.build())
            .withPriority(DROP_PRIORITY)
            .fromApp(appId)
            .makePermanent()
            .forTable(table).build();

    processFlowRule(install, rule, description);
}
 
开发者ID:shlee89,项目名称:athena,代码行数:18,代码来源:AbstractCorsaPipeline.java


示例12: processTableMissGoTo

import org.onosproject.net.flow.DefaultFlowRule; //导入依赖的package包/类
protected void processTableMissGoTo(boolean install, int table, int goTo, String description) {
    TrafficSelector.Builder selector = DefaultTrafficSelector.builder();

    TrafficTreatment.Builder treatment = DefaultTrafficTreatment.builder();
    treatment.transition(goTo);

    FlowRule rule = DefaultFlowRule.builder()
            .forDevice(deviceId)
            .withSelector(selector.build())
            .withTreatment(treatment.build())
            .withPriority(DROP_PRIORITY)
            .fromApp(appId)
            .makePermanent()
            .forTable(table).build();

    processFlowRule(install, rule, description);
}
 
开发者ID:shlee89,项目名称:athena,代码行数:18,代码来源:AbstractCorsaPipeline.java


示例13: processVlanFiler

import org.onosproject.net.flow.DefaultFlowRule; //导入依赖的package包/类
@Override
protected FlowRule.Builder processVlanFiler(FilteringObjective filt, VlanIdCriterion vlan, PortCriterion port) {
    log.debug("adding rule for VLAN: {}", vlan.vlanId());
    TrafficSelector.Builder selector = DefaultTrafficSelector.builder();
    TrafficTreatment.Builder treatment = DefaultTrafficTreatment.builder();
    selector.matchVlanId(vlan.vlanId());
    selector.matchInPort(port.port());
    treatment.transition(ETHER_TABLE);
    treatment.deferred().popVlan();
    return DefaultFlowRule.builder()
            .forDevice(deviceId)
            .withSelector(selector.build())
            .withTreatment(treatment.build())
            .withPriority(CONTROLLER_PRIORITY)
            .makePermanent()
            .forTable(VLAN_TABLE);
}
 
开发者ID:shlee89,项目名称:athena,代码行数:18,代码来源:OvsCorsaPipeline.java


示例14: processMacTable

import org.onosproject.net.flow.DefaultFlowRule; //导入依赖的package包/类
private void processMacTable(boolean install) {
    TrafficSelector.Builder selector;
    TrafficTreatment.Builder treatment;

    // Bcast rule
    selector = DefaultTrafficSelector.builder();
    treatment = DefaultTrafficTreatment.builder();

    selector.matchEthDst(MacAddress.BROADCAST);
    treatment.transition(VLAN_MPLS_TABLE);

    FlowRule rule = DefaultFlowRule.builder()
            .forDevice(deviceId)
            .withSelector(selector.build())
            .withTreatment(treatment.build())
            .withPriority(CONTROLLER_PRIORITY)
            .fromApp(appId)
            .makePermanent()
            .forTable(MAC_TABLE).build();
    processFlowRule(true, rule, "Provisioned mac table transition");

    //Drop rule
    processTableMissDrop(true, MAC_TABLE, "Provisioned mac table drop action");

}
 
开发者ID:shlee89,项目名称:athena,代码行数:26,代码来源:OvsCorsaPipeline.java


示例15: processVlanMplsTable

import org.onosproject.net.flow.DefaultFlowRule; //导入依赖的package包/类
protected void processVlanMplsTable(boolean install) {
    TrafficSelector.Builder selector = DefaultTrafficSelector.builder();
    TrafficTreatment.Builder treatment = DefaultTrafficTreatment
            .builder();
    FlowRuleOperations.Builder ops = FlowRuleOperations.builder();
    FlowRule rule;

    selector.matchVlanId(VlanId.ANY);
    treatment.transition(VLAN_TABLE);

    rule = DefaultFlowRule.builder()
            .forDevice(deviceId)
            .withSelector(selector.build())
            .withTreatment(treatment.build())
            .withPriority(CONTROLLER_PRIORITY)
            .fromApp(appId)
            .makePermanent()
            .forTable(VLAN_MPLS_TABLE).build();

    processFlowRule(true, rule, "Provisioned vlan/mpls table");
}
 
开发者ID:shlee89,项目名称:athena,代码行数:22,代码来源:OvsCorsaPipeline.java


示例16: processCosTable

import org.onosproject.net.flow.DefaultFlowRule; //导入依赖的package包/类
private void processCosTable(boolean install) {
    TrafficTreatment.Builder treatment = DefaultTrafficTreatment
            .builder()
            .transition(FIB_TABLE);
    TrafficSelector.Builder selector = DefaultTrafficSelector.builder();

    FlowRule rule = DefaultFlowRule.builder()
            .forDevice(deviceId)
            .withSelector(selector.build())
            .withTreatment(treatment.build())
            .withPriority(DROP_PRIORITY)
            .fromApp(appId)
            .makePermanent()
            .forTable(COS_MAP_TABLE).build();
    processFlowRule(true, rule, "Provisioned cos table");

}
 
开发者ID:shlee89,项目名称:athena,代码行数:18,代码来源:OvsCorsaPipeline.java


示例17: processLocalTable

import org.onosproject.net.flow.DefaultFlowRule; //导入依赖的package包/类
private void processLocalTable(boolean install) {
    TrafficSelector.Builder selector = DefaultTrafficSelector.builder();

    TrafficTreatment.Builder treatment = DefaultTrafficTreatment
            .builder()
    .punt();

    FlowRule rule = DefaultFlowRule.builder()
            .forDevice(deviceId)
            .withSelector(selector.build())
            .withTreatment(treatment.build())
            .withPriority(CONTROLLER_PRIORITY)
            .fromApp(appId)
            .makePermanent()
            .forTable(LOCAL_TABLE).build();

    processFlowRule(true, rule, "Provisioned Local table");
}
 
开发者ID:shlee89,项目名称:athena,代码行数:19,代码来源:OvsCorsaPipeline.java


示例18: processSpecificSwitch

import org.onosproject.net.flow.DefaultFlowRule; //导入依赖的package包/类
@Override
protected Collection<FlowRule> processSpecificSwitch(ForwardingObjective fwd) {
    TrafficSelector filteredSelector =
            DefaultTrafficSelector.builder()
                    .matchInPort(
                            ((PortCriterion) fwd.selector().getCriterion(Criterion.Type.IN_PORT)).port())
                    .matchVlanId(
                            ((VlanIdCriterion) fwd.selector().getCriterion(Criterion.Type.VLAN_VID)).vlanId())
                    .build();

    Builder ruleBuilder = DefaultFlowRule.builder()
            .fromApp(fwd.appId())
            .withPriority(fwd.priority())
            .forDevice(deviceId)
            .withSelector(filteredSelector)
            .withTreatment(fwd.treatment())
            .forTable(VLAN_CIRCUIT_TABLE);

    if (fwd.permanent()) {
        ruleBuilder.makePermanent();
    } else {
        ruleBuilder.makeTemporary(fwd.timeout());
    }

    return Collections.singletonList(ruleBuilder.build());
}
 
开发者ID:shlee89,项目名称:athena,代码行数:27,代码来源:CorsaPipelineV3.java


示例19: processVlanFiler

import org.onosproject.net.flow.DefaultFlowRule; //导入依赖的package包/类
@Override
protected Builder processVlanFiler(FilteringObjective filt, VlanIdCriterion vlan, PortCriterion port) {
    log.debug("adding rule for VLAN: {}", vlan.vlanId());
    TrafficSelector.Builder selector = DefaultTrafficSelector.builder();
    TrafficTreatment.Builder treatment = DefaultTrafficTreatment.builder();
    selector.matchVlanId(vlan.vlanId());
    selector.matchInPort(port.port());
            /* Static treatment for VLAN_CIRCUIT_TABLE */
    treatment.setVlanPcp(MAX_VLAN_PCP);
    treatment.setQueue(0);
    treatment.meter(MeterId.meterId(defaultMeterId.id())); /* use default meter (Green) */
    treatment.transition(L3_IF_MAC_DA_TABLE);
    return DefaultFlowRule.builder()
            .withSelector(selector.build())
            .withTreatment(treatment.build())
            .withPriority(CONTROLLER_PRIORITY)
            .makePermanent()
            .forTable(VLAN_CIRCUIT_TABLE);
}
 
开发者ID:shlee89,项目名称:athena,代码行数:20,代码来源:CorsaPipelineV3.java


示例20: processTaggedPackets

import org.onosproject.net.flow.DefaultFlowRule; //导入依赖的package包/类
protected void processTaggedPackets(boolean install) {
    TrafficSelector.Builder selector = DefaultTrafficSelector.builder();
    selector.matchVlanId(VlanId.ANY);

    TrafficTreatment.Builder treatment = DefaultTrafficTreatment.builder();
    treatment.transition(VLAN_MAC_XLATE_TABLE);

    FlowRule rule = DefaultFlowRule.builder()
            .forDevice(deviceId)
            .withSelector(selector.build())
            .withTreatment(treatment.build())
            .withPriority(CONTROLLER_PRIORITY)
            .fromApp(appId)
            .makePermanent()
            .forTable(VLAN_CHECK_TABLE).build();
    processFlowRule(install, rule, "Provisioned vlan table tagged packets");
}
 
开发者ID:shlee89,项目名称:athena,代码行数:18,代码来源:CorsaPipelineV3.java



注:本文中的org.onosproject.net.flow.DefaultFlowRule类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java GithubTarget类代码示例发布时间:2022-05-23
下一篇:
Java ArquillianSuiteDeployment类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap