本文整理汇总了Java中org.onosproject.net.packet.PacketPriority类的典型用法代码示例。如果您正苦于以下问题:Java PacketPriority类的具体用法?Java PacketPriority怎么用?Java PacketPriority使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
PacketPriority类属于org.onosproject.net.packet包,在下文中一共展示了PacketPriority类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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);
}
}
示例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);
}
示例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");
}
示例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");
}
示例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");
}
示例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());
}
示例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);
}
}
示例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();
}
示例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();
}
示例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();
}
示例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());
}
示例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());
}
示例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");
}
示例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");
}
示例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());
}