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

Java PacketPriority类代码示例

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

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



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

示例1: requestIntercepts

import org.onosproject.net.packet.PacketPriority; //导入依赖的package包/类
/**
 * Request packet intercepts.
 */
private void requestIntercepts() {
    TrafficSelector.Builder selector = DefaultTrafficSelector.builder();
    selector.matchEthType(Ethernet.TYPE_ARP);
    packetService.requestPackets(selector.build(), PacketPriority.CONTROL, appId);

    // IPv6 Neighbor Solicitation packet.
    selector.matchEthType(Ethernet.TYPE_IPV6);
    selector.matchIPProtocol(IPv6.PROTOCOL_ICMP6);
    selector.matchIcmpv6Type(ICMP6.NEIGHBOR_SOLICITATION);
    if (ipv6NeighborDiscovery) {
        packetService.requestPackets(selector.build(), PacketPriority.CONTROL, appId);
    } else {
        packetService.cancelPackets(selector.build(), PacketPriority.CONTROL, appId);
    }

    // IPv6 Neighbor Advertisement packet.
    selector.matchIcmpv6Type(ICMP6.NEIGHBOR_ADVERTISEMENT);
    if (ipv6NeighborDiscovery) {
        packetService.requestPackets(selector.build(), PacketPriority.CONTROL, appId);
    } else {
        packetService.cancelPackets(selector.build(), PacketPriority.CONTROL, appId);
    }
}
 
开发者ID:shlee89,项目名称:athena,代码行数:27,代码来源:HostLocationProvider.java


示例2: withdrawIntercepts

import org.onosproject.net.packet.PacketPriority; //导入依赖的package包/类
/**
 * Withdraw packet intercepts.
 */
private void withdrawIntercepts() {
    TrafficSelector.Builder selector = DefaultTrafficSelector.builder();
    selector.matchEthType(Ethernet.TYPE_ARP);
    packetService.cancelPackets(selector.build(), PacketPriority.CONTROL, appId);

    // IPv6 Neighbor Solicitation packet.
    selector.matchEthType(Ethernet.TYPE_IPV6);
    selector.matchIPProtocol(IPv6.PROTOCOL_ICMP6);
    selector.matchIcmpv6Type(ICMP6.NEIGHBOR_SOLICITATION);
    packetService.cancelPackets(selector.build(), PacketPriority.CONTROL, appId);

    // IPv6 Neighbor Advertisement packet.
    selector.matchIcmpv6Type(ICMP6.NEIGHBOR_ADVERTISEMENT);
    packetService.cancelPackets(selector.build(), PacketPriority.CONTROL, appId);
}
 
开发者ID:shlee89,项目名称:athena,代码行数:19,代码来源:HostLocationProvider.java


示例3: activate

import org.onosproject.net.packet.PacketPriority; //导入依赖的package包/类
/**
 * Active MulticastForwardingIntent.
 */
@Activate
public void activate() {
    appId = coreService.registerApplication("org.onosproject.mfwd");

    mcastIntentManager = new McastIntentManager();
    mcastRouteManager.addListener(mcastIntentManager);

    packetService.addProcessor(processor, PacketProcessor.director(2));

    // Build a traffic selector for all multicast traffic
    TrafficSelector.Builder selector = DefaultTrafficSelector.builder();
    selector.matchEthType(Ethernet.TYPE_IPV4);
    selector.matchIPDst(IpPrefix.IPV4_MULTICAST_PREFIX);

    packetService.requestPackets(selector.build(), PacketPriority.REACTIVE, appId);

    log.info("Started");
}
 
开发者ID:shlee89,项目名称:athena,代码行数:22,代码来源:McastForwarding.java


示例4: activate

import org.onosproject.net.packet.PacketPriority; //导入依赖的package包/类
/**
 * Activate the PIM component.
 */
@Activate
public void activate() {
    // Get our application ID
    appId = coreService.registerApplication("org.onosproject.pim");

    // Build the traffic selector for PIM packets
    TrafficSelector.Builder selector = DefaultTrafficSelector.builder();
    selector.matchEthType(Ethernet.TYPE_IPV4);
    selector.matchIPProtocol(IPv4.PROTOCOL_PIM);

    // Use the traffic selector to tell the packet service which packets we want.
    packetService.addProcessor(processor, PacketProcessor.director(5));

    packetService.requestPackets(selector.build(), PacketPriority.CONTROL,
            appId, Optional.empty());

    // Get a copy of the PIM Packet Handler
    pimPacketHandler = new PimPacketHandler();

    log.info("Started");
}
 
开发者ID:shlee89,项目名称:athena,代码行数:25,代码来源:PimApplication.java


示例5: deactivate

import org.onosproject.net.packet.PacketPriority; //导入依赖的package包/类
@Deactivate
protected void deactivate() {
    packetService.removeProcessor(packetProcessor);
    packetService.cancelPackets(DefaultTrafficSelector.builder()
                    .matchEthType(Ethernet.TYPE_IPV4).build(),
            PacketPriority.REACTIVE, appId);

    intentMap.values().forEach(intent -> {
        intentService.withdraw(intent);
        intentService.purge(intent);
    });
    intentMap.clear();

    log.info("Stopped");

}
 
开发者ID:MaoJianwei,项目名称:ONOS_LoadBalance_Routing_Forward,代码行数:17,代码来源:MaoRoutingManager.java


示例6: activate

import org.onosproject.net.packet.PacketPriority; //导入依赖的package包/类
@Activate
public void activate(ComponentContext context) {
    cfgService.registerProperties(getClass());
    appId = coreService.registerApplication("org.onosproject.fwd");

    packetService.addProcessor(processor, PacketProcessor.ADVISOR_MAX + 2);
    readComponentConfiguration(context);

    TrafficSelector.Builder selector = DefaultTrafficSelector.builder();
    selector.matchEthType(Ethernet.TYPE_IPV4);
    packetService.requestPackets(selector.build(), PacketPriority.REACTIVE,
                                 appId);
    selector.matchEthType(Ethernet.TYPE_ARP);
    packetService.requestPackets(selector.build(), PacketPriority.REACTIVE,
                                 appId);

    if (ipv6Forwarding) {
        selector.matchEthType(Ethernet.TYPE_IPV6);
        packetService.requestPackets(selector.build(),
                                     PacketPriority.REACTIVE, appId);
    }

    log.info("Started with Application ID {}", appId.id());
}
 
开发者ID:ravikumaran2015,项目名称:ravikumaran201504,代码行数:25,代码来源:ReactiveForwarding.java


示例7: requestPackets

import org.onosproject.net.packet.PacketPriority; //导入依赖的package包/类
@Override
public void requestPackets(TrafficSelector selector, PacketPriority priority,
                           ApplicationId appId, FlowRule.Type tableType) {
    checkNotNull(selector, "Selector cannot be null");
    checkNotNull(appId, "Application ID cannot be null");
    checkNotNull(tableType, "Table Type cannot be null. For requesting packets +"
            + "without table hints, use other methods in the packetService API");

    PacketRequest request =
            new DefaultPacketRequest(selector, priority, appId, tableType);

    if (store.requestPackets(request)) {
        pushToAllDevices(request);
    }

}
 
开发者ID:ravikumaran2015,项目名称:ravikumaran201504,代码行数:17,代码来源:PacketManager.java


示例8: buildPuntTableRule

import org.onosproject.net.packet.PacketPriority; //导入依赖的package包/类
/**
 * Creates punt table entry that matches IN_PORT and VLAN_VID and points to
 * a group that pop vlan and punt.
 *
 * @param portNumber port number
 * @param assignedVlan internally assigned vlan id
 * @return punt table flow rule
 */
private FlowRule buildPuntTableRule(PortNumber portNumber, VlanId assignedVlan) {
    TrafficSelector.Builder sbuilder = DefaultTrafficSelector.builder()
            .matchInPort(portNumber)
            .matchVlanId(assignedVlan);
    TrafficTreatment.Builder tbuilder = DefaultTrafficTreatment.builder()
            .group(new GroupId(POP_VLAN_PUNT_GROUP_ID));

    return DefaultFlowRule.builder()
            .forDevice(deviceId)
            .withSelector(sbuilder.build())
            .withTreatment(tbuilder.build())
            .withPriority(PacketPriority.CONTROL.priorityValue())
            .fromApp(driverId)
            .makePermanent()
            .forTable(PUNT_TABLE).build();
}
 
开发者ID:opennetworkinglab,项目名称:onos,代码行数:25,代码来源:CpqdOfdpa2Pipeline.java


示例9: buildArpPunt

import org.onosproject.net.packet.PacketPriority; //导入依赖的package包/类
/**
 * Builds a punt to the controller rule for the arp protocol.
 * <p>
 * NOTE: CpqD cannot punt correctly in group bucket. The current impl will
 *       pop VLAN before sending to controller disregarding whether
 *       it's an internally assigned VLAN or a natural VLAN.
 *       Therefore, trunk port is not supported in CpqD.
 *
 * @param assignedVlan the internal assigned vlan id
 * @param applicationId the application id
 * @return the punt flow rule for the arp
 */
private FlowRule buildArpPunt(VlanId assignedVlan, ApplicationId applicationId) {
    TrafficSelector.Builder sbuilder = DefaultTrafficSelector.builder()
            .matchEthType(Ethernet.TYPE_ARP)
            .matchVlanId(assignedVlan);
    TrafficTreatment.Builder tbuilder = DefaultTrafficTreatment.builder()
            .popVlan()
            .punt();

    return DefaultFlowRule.builder()
            .forDevice(deviceId)
            .withSelector(sbuilder.build())
            .withTreatment(tbuilder.build())
            .withPriority(PacketPriority.CONTROL.priorityValue() + 1)
            .fromApp(applicationId)
            .makePermanent()
            .forTable(ACL_TABLE).build();
}
 
开发者ID:opennetworkinglab,项目名称:onos,代码行数:30,代码来源:CpqdOfdpa2Pipeline.java


示例10: buildIcmpV6Punt

import org.onosproject.net.packet.PacketPriority; //导入依赖的package包/类
/**
 * Builds a punt to the controller rule for the icmp v6 messages.
 * <p>
 * NOTE: CpqD cannot punt correctly in group bucket. The current impl will
 *       pop VLAN before sending to controller disregarding whether
 *       it's an internally assigned VLAN or a natural VLAN.
 *       Therefore, trunk port is not supported in CpqD.
 *
 * @param assignedVlan the internal assigned vlan id
 * @param applicationId the application id
 * @return the punt flow rule for the icmp v6 messages
 */
private FlowRule buildIcmpV6Punt(VlanId assignedVlan, ApplicationId applicationId) {
    TrafficSelector.Builder sbuilder = DefaultTrafficSelector.builder()
            .matchVlanId(assignedVlan)
            .matchEthType(Ethernet.TYPE_IPV6)
            .matchIPProtocol(PROTOCOL_ICMP6);
    TrafficTreatment.Builder tbuilder = DefaultTrafficTreatment.builder()
            .popVlan()
            .punt();

    return DefaultFlowRule.builder()
            .forDevice(deviceId)
            .withSelector(sbuilder.build())
            .withTreatment(tbuilder.build())
            .withPriority(PacketPriority.CONTROL.priorityValue() + 1)
            .fromApp(applicationId)
            .makePermanent()
            .forTable(ACL_TABLE).build();
}
 
开发者ID:opennetworkinglab,项目名称:onos,代码行数:31,代码来源:CpqdOfdpa2Pipeline.java


示例11: activate

import org.onosproject.net.packet.PacketPriority; //导入依赖的package包/类
/**
 * Create a variable of the SwitchPacketProcessor class using the PacketProcessor defined above.
 * Activates the app.
 *
 * Create code to add a processor
 */
@Activate
protected void activate() {
    log.info("Started");
    appId = coreService.getAppId("org.onosproject.learningswitch"); //equal to the name shown in pom.xml file

    //Create and processor and add it using packetService

    /*
     * Restricts packet types to IPV4 and ARP by only requesting those types
     */
    packetService.requestPackets(DefaultTrafficSelector.builder()
            .matchEthType(Ethernet.TYPE_IPV4).build(), PacketPriority.REACTIVE, appId, Optional.empty());
    packetService.requestPackets(DefaultTrafficSelector.builder()
            .matchEthType(Ethernet.TYPE_ARP).build(), PacketPriority.REACTIVE, appId, Optional.empty());
}
 
开发者ID:opennetworkinglab,项目名称:onos,代码行数:22,代码来源:LearningSwitchTutorial.java


示例12: activate

import org.onosproject.net.packet.PacketPriority; //导入依赖的package包/类
/**
 * Create a variable of the SwitchPacketProcessor class using the PacketProcessor defined above.
 * Activates the app.
 */
@Activate
protected void activate() {
    log.info("Started");
    appId = coreService.getAppId("org.onosproject.learningswitch"); //equal to the name shown in pom.xml file

    processor = new SwitchPacketProcessor();
    packetService.addProcessor(processor, PacketProcessor.director(3));

    /*
     * Restricts packet types to IPV4 and ARP by only requesting those types.
     */
    packetService.requestPackets(DefaultTrafficSelector.builder()
            .matchEthType(Ethernet.TYPE_IPV4).build(), PacketPriority.REACTIVE, appId, Optional.empty());
    packetService.requestPackets(DefaultTrafficSelector.builder()
            .matchEthType(Ethernet.TYPE_ARP).build(), PacketPriority.REACTIVE, appId, Optional.empty());
}
 
开发者ID:opennetworkinglab,项目名称:onos,代码行数:21,代码来源:LearningSwitchSolution.java


示例13: registerIntercepts

import org.onosproject.net.packet.PacketPriority; //导入依赖的package包/类
/**
 * Request packet in via the PacketService.
 */
private void registerIntercepts() {
    // register default intercepts on packetService for broder routing intercepts

    packetService.requestPackets(
        DefaultTrafficSelector.builder().matchEthType(Ethernet.TYPE_IPV4).build(),
        PacketPriority.REACTIVE, reactiveAppId);

    if (simpleFabric.ALLOW_IPV6) {
        packetService.requestPackets(
            DefaultTrafficSelector.builder().matchEthType(Ethernet.TYPE_IPV6).build(),
            PacketPriority.REACTIVE, reactiveAppId);
    }

    log.info("simple fabric reactive routing ip packet intercepts started");
}
 
开发者ID:opennetworkinglab,项目名称:onos,代码行数:19,代码来源:SimpleFabricReactiveRouting.java


示例14: withdrawIntercepts

import org.onosproject.net.packet.PacketPriority; //导入依赖的package包/类
/**
 * Cancel request for packet in via PacketService.
 */
private void withdrawIntercepts() {
    // unregister default intercepts on packetService

    packetService.cancelPackets(
        DefaultTrafficSelector.builder().matchEthType(Ethernet.TYPE_IPV4).build(),
        PacketPriority.REACTIVE, reactiveAppId);

    if (simpleFabric.ALLOW_IPV6) {
        packetService.cancelPackets(
            DefaultTrafficSelector.builder().matchEthType(Ethernet.TYPE_IPV6).build(),
            PacketPriority.REACTIVE, reactiveAppId);
    }

    log.info("simple fabric reactive routing ip packet intercepts stopped");
}
 
开发者ID:opennetworkinglab,项目名称:onos,代码行数:19,代码来源:SimpleFabricReactiveRouting.java


示例15: setUp

import org.onosproject.net.packet.PacketPriority; //导入依赖的package包/类
@Before
public void setUp() throws Exception {
    neighbourManager = new NeighbourResolutionManager();

    packetService = createMock(PacketService.class);
    packetService.requestPackets(anyObject(TrafficSelector.class),
            anyObject(PacketPriority.class), anyObject(ApplicationId.class));
    expectLastCall().anyTimes();
    packetService.addProcessor(anyObject(PacketProcessor.class), anyInt());
    expectLastCall().andDelegateTo(new TestPacketService()).once();
    packetService.cancelPackets(anyObject(TrafficSelector.class),
            anyObject(PacketPriority.class), anyObject(ApplicationId.class));
    expectLastCall().anyTimes();
    replay(packetService);

    neighbourManager.packetService = packetService;

    CoreService coreService = createNiceMock(CoreService.class);
    replay(coreService);
    neighbourManager.coreService = coreService;

    neighbourManager.componentConfigService = new ComponentConfigAdapter();

    neighbourManager.activate(new ComponentContextAdapter());
}
 
开发者ID:opennetworkinglab,项目名称:onos,代码行数:26,代码来源:NeighbourResolutionManagerTest.java


示例16: decode

import org.onosproject.net.packet.PacketPriority; //导入依赖的package包/类
@Override
public PacketRequest decode(ObjectNode json, CodecContext context) {
    if (json == null || !json.isObject()) {
        return null;
    }

    final JsonCodec<TrafficSelector> trafficSelectorCodec =
           context.codec(TrafficSelector.class);
    TrafficSelector trafficSelector = trafficSelectorCodec.decode(
            get(json, TRAFFIC_SELECTOR), context);
    NodeId nodeId = NodeId.nodeId(extractMember(NODE_ID, json));
    PacketPriority priority = PacketPriority.valueOf(extractMember(PRIORITY, json));

    CoreService coreService = context.getService(CoreService.class);
    // TODO check appId (currently hardcoded - should it be read from json node?)
    ApplicationId appId = coreService.registerApplication(REST_APP_ID);

    DeviceId deviceId = null;
    JsonNode node = json.get(DEVICE_ID);
    if (node != null) {
         deviceId = DeviceId.deviceId(node.asText());
    }

    return new DefaultPacketRequest(trafficSelector, priority, appId, nodeId, Optional.ofNullable(deviceId));
}
 
开发者ID:opennetworkinglab,项目名称:onos,代码行数:26,代码来源:PacketRequestCodec.java


示例17: requestIntercepts

import org.onosproject.net.packet.PacketPriority; //导入依赖的package包/类
/**
 * Requests packet intercepts.
 */
private void requestIntercepts() {
    TrafficSelector.Builder selector = DefaultTrafficSelector.builder();
    selector.matchEthType(TYPE_LLDP);
    packetService.requestPackets(selector.build(), PacketPriority.CONTROL, appId);

    selector.matchEthType(TYPE_BSN);
    if (useBddp) {
        packetService.requestPackets(selector.build(), PacketPriority.CONTROL, appId);
    } else {
        packetService.cancelPackets(selector.build(), PacketPriority.CONTROL, appId);
    }
}
 
开发者ID:shlee89,项目名称:athena,代码行数:16,代码来源:LldpLinkProvider.java


示例18: withdrawIntercepts

import org.onosproject.net.packet.PacketPriority; //导入依赖的package包/类
/**
 * Withdraws packet intercepts.
 */
private void withdrawIntercepts() {
    TrafficSelector.Builder selector = DefaultTrafficSelector.builder();
    selector.matchEthType(TYPE_LLDP);
    packetService.cancelPackets(selector.build(), PacketPriority.CONTROL, appId);
    selector.matchEthType(TYPE_BSN);
    packetService.cancelPackets(selector.build(), PacketPriority.CONTROL, appId);
}
 
开发者ID:shlee89,项目名称:athena,代码行数:11,代码来源:LldpLinkProvider.java


示例19: requestIntercepts

import org.onosproject.net.packet.PacketPriority; //导入依赖的package包/类
/**
 * Requests packet intercepts.
 */
private void requestIntercepts() {
    TrafficSelector.Builder selector = DefaultTrafficSelector.builder();
    selector.matchEthType(TYPE_LLDP);
    packetService.requestPackets(selector.build(), PacketPriority.CONTROL,
                                 appId, Optional.empty());

    selector.matchEthType(TYPE_BSN);

    packetService.requestPackets(selector.build(), PacketPriority.CONTROL,
                                 appId, Optional.empty());

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


示例20: withdrawIntercepts

import org.onosproject.net.packet.PacketPriority; //导入依赖的package包/类
/**
 * Withdraws packet intercepts.
 */
private void withdrawIntercepts() {
    TrafficSelector.Builder selector = DefaultTrafficSelector.builder();
    selector.matchEthType(TYPE_LLDP);
    packetService.cancelPackets(selector.build(), PacketPriority.CONTROL,
                                appId, Optional.empty());
    selector.matchEthType(TYPE_BSN);
    packetService.cancelPackets(selector.build(), PacketPriority.CONTROL,
                                appId, Optional.empty());
}
 
开发者ID:shlee89,项目名称:athena,代码行数:13,代码来源:NetworkConfigLinksProvider.java



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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