本文整理汇总了Java中org.onosproject.net.packet.PacketContext.isHandled方法的典型用法代码示例。如果您正苦于以下问题:Java PacketContext.isHandled方法的具体用法?Java PacketContext.isHandled怎么用?Java PacketContext.isHandled使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.onosproject.net.packet.PacketContext
的用法示例。
在下文中一共展示了PacketContext.isHandled方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: process
import org.onosproject.net.packet.PacketContext; //导入方法依赖的package包/类
@Override
public void process(PacketContext context) {
if (context == null || context.isHandled()) {
return;
}
Ethernet eth = context.inPacket().parsed();
if (eth == null || (eth.getEtherType() != TYPE_LLDP && eth.getEtherType() != TYPE_BSN)) {
return;
}
LinkDiscovery ld = discoverers.get(context.inPacket().receivedFrom().deviceId());
if (ld == null) {
return;
}
if (ld.handleLldp(context)) {
context.block();
}
}
示例2: process
import org.onosproject.net.packet.PacketContext; //导入方法依赖的package包/类
@Override
public void process(PacketContext context) {
// Stop processing if the packet has been handled, since we
// can't do any more to it.
if (context.isHandled()) {
return;
}
Ethernet packet = context.inPacket().parsed();
if (packet == null) {
return;
}
if (packet.getEtherType() == Ethernet.TYPE_IPV4) {
IPv4 ipv4Packet = (IPv4) packet.getPayload();
if (ipv4Packet.getProtocol() == IPv4.PROTOCOL_TCP) {
TCP tcpPacket = (TCP) ipv4Packet.getPayload();
if (tcpPacket.getDestinationPort() == BGP_PORT ||
tcpPacket.getSourcePort() == BGP_PORT) {
forward(context);
}
}
}
}
示例3: process
import org.onosproject.net.packet.PacketContext; //导入方法依赖的package包/类
@Override
public void process(PacketContext context) {
// Stop processing if the packet has been handled, since we
// can't do any more to it.
if (context.isHandled()) {
return;
}
Ethernet packet = context.inPacket().parsed();
if (packet == null) {
return;
}
if (packet.getEtherType() == Ethernet.TYPE_IPV4) {
IPv4 ipv4Packet = (IPv4) packet.getPayload();
if (ipv4Packet.getProtocol() == IPv4.PROTOCOL_ICMP) {
processPacketIn(context.inPacket());
}
}
}
示例4: process
import org.onosproject.net.packet.PacketContext; //导入方法依赖的package包/类
@Override
public void process(PacketContext context) {
if (context.isHandled()) {
return;
}
InboundPacket pkt = context.inPacket();
Ethernet ethernet = pkt.parsed();
log.trace("Rcvd pktin: {}", ethernet);
if (ethernet.getEtherType() == Ethernet.TYPE_ARP) {
arpHandler.processPacketIn(pkt);
} else if (ethernet.getEtherType() == Ethernet.TYPE_IPV4) {
IPv4 ipPacket = (IPv4) ethernet.getPayload();
ipHandler.addToPacketBuffer(ipPacket);
if (ipPacket.getProtocol() == IPv4.PROTOCOL_ICMP) {
icmpHandler.processPacketIn(pkt);
} else {
ipHandler.processPacketIn(pkt);
}
}
}
示例5: process
import org.onosproject.net.packet.PacketContext; //导入方法依赖的package包/类
@Override
public void process(PacketContext context) {
if (context.isHandled()) {
return;
}
Ethernet ethPacket = context.inPacket().parsed();
if (ethPacket == null || ethPacket.getEtherType() != Ethernet.TYPE_IPV4) {
return;
}
IPv4 ipv4Packet = (IPv4) ethPacket.getPayload();
if (ipv4Packet.getProtocol() != IPv4.PROTOCOL_UDP) {
return;
}
UDP udpPacket = (UDP) ipv4Packet.getPayload();
if (udpPacket.getDestinationPort() != UDP.DHCP_SERVER_PORT ||
udpPacket.getSourcePort() != UDP.DHCP_CLIENT_PORT) {
return;
}
DHCP dhcpPacket = (DHCP) udpPacket.getPayload();
processDhcp(context, dhcpPacket);
}
示例6: process
import org.onosproject.net.packet.PacketContext; //导入方法依赖的package包/类
@Override
public void process(PacketContext context) {
if (context.isHandled()) {
return;
}
Ethernet ethPacket = context.inPacket().parsed();
if (ethPacket == null || ethPacket.getEtherType() != Ethernet.TYPE_ARP) {
return;
}
ARP arpPacket = (ARP) ethPacket.getPayload();
switch (arpPacket.getOpCode()) {
case ARP.OP_REQUEST:
processArpRequest(context, ethPacket);
break;
case ARP.OP_REPLY:
processArpReply(context, ethPacket);
break;
default:
break;
}
}
示例7: process
import org.onosproject.net.packet.PacketContext; //导入方法依赖的package包/类
@Override
public void process(PacketContext context) {
if (context.isHandled()) {
return;
}
InboundPacket pkt = context.inPacket();
Ethernet ethPkt = pkt.parsed();
if (ethPkt == null) {
return;
}
if (ethPkt.getEtherType() == EtherType.ARP.ethType().toShort()) {
context.treatmentBuilder().setOutput(PortNumber.FLOOD);
context.send();
}
}
示例8: process
import org.onosproject.net.packet.PacketContext; //导入方法依赖的package包/类
@Override
public void process(PacketContext context) {
// Stop processing if the packet has been handled, since we
// can't do any more to it.
if (context.isHandled()) {
return;
}
// If IPv6 NDP is disabled, don't handle IPv6 frames.
InboundPacket pkt = context.inPacket();
Ethernet ethPkt = pkt.parsed();
if (ethPkt == null) {
return;
}
if (!ipv6NeighborDiscovery && (ethPkt.getEtherType() == Ethernet.TYPE_IPV6)) {
return;
}
//handle the arp packet.
proxyArpService.handlePacket(context);
}
示例9: process
import org.onosproject.net.packet.PacketContext; //导入方法依赖的package包/类
@Override
public void process(PacketContext context) {
if (context.isHandled()) {
return;
}
InboundPacket pkt = context.inPacket();
Ethernet ethernet = pkt.parsed();
if (ethernet.getEtherType() == Ethernet.TYPE_ARP) {
arpHandler.processPacketIn(pkt);
} else if (ethernet.getEtherType() == Ethernet.TYPE_IPV4) {
IPv4 ipPacket = (IPv4) ethernet.getPayload();
ipHandler.addToPacketBuffer(ipPacket);
if (ipPacket.getProtocol() == IPv4.PROTOCOL_ICMP) {
icmpHandler.processPacketIn(pkt);
} else {
ipHandler.processPacketIn(pkt);
}
}
}
示例10: process
import org.onosproject.net.packet.PacketContext; //导入方法依赖的package包/类
@Override
public void process(PacketContext context) {
if (context.isHandled()) {
return;
}
VirtualPacketContext vContexts = virtualize(context);
if (vContexts == null) {
return;
}
VirtualPacketProviderService service =
(VirtualPacketProviderService) providerRegistryService
.getProviderService(vContexts.networkId(),
VirtualPacketProvider.class);
if (service != null) {
service.processPacket(vContexts);
}
}
示例11: process
import org.onosproject.net.packet.PacketContext; //导入方法依赖的package包/类
@Override
public void process(PacketContext context) {
if (context.isHandled()) {
return;
}
if (interfaceService.getInterfacesByPort(context.inPacket().receivedFrom()).isEmpty()) {
// Don't handle packets that don't come from one of our configured interfaces
return;
}
Ethernet eth = context.inPacket().parsed();
if (eth == null) {
return;
}
if (!handle(eth)) {
return;
}
context.block();
}
示例12: process
import org.onosproject.net.packet.PacketContext; //导入方法依赖的package包/类
@Override
public void process(PacketContext context) {
if (context.isHandled()) {
return;
}
Set<DeviceId> gateways = osNodeService.completeNodes(GATEWAY)
.stream().map(OpenstackNode::intgBridge)
.collect(Collectors.toSet());
if (!gateways.contains(context.inPacket().receivedFrom().deviceId())) {
// return if the packet is not from gateway nodes
return;
}
InboundPacket pkt = context.inPacket();
Ethernet ethernet = pkt.parsed();
if (ethernet != null &&
ethernet.getEtherType() == Ethernet.TYPE_ARP) {
eventExecutor.execute(() -> processArpPacket(context, ethernet));
}
}
示例13: process
import org.onosproject.net.packet.PacketContext; //导入方法依赖的package包/类
@Override
public void process(PacketContext context) {
Set<DeviceId> gateways = osNodeService.completeNodes(GATEWAY)
.stream().map(OpenstackNode::intgBridge)
.collect(Collectors.toSet());
if (context.isHandled()) {
return;
} else if (!gateways.contains(context.inPacket().receivedFrom().deviceId())) {
// return if the packet is not from gateway nodes
return;
}
InboundPacket pkt = context.inPacket();
Ethernet ethernet = pkt.parsed();
if (ethernet == null || ethernet.getEtherType() == Ethernet.TYPE_ARP) {
return;
}
IPv4 iPacket = (IPv4) ethernet.getPayload();
if (iPacket.getProtocol() == IPv4.PROTOCOL_ICMP) {
eventExecutor.execute(() -> processIcmpPacket(context, ethernet));
}
}
示例14: process
import org.onosproject.net.packet.PacketContext; //导入方法依赖的package包/类
@Override
public void process(PacketContext context) {
if (context.isHandled()) {
return;
}
InboundPacket pkt = context.inPacket();
Ethernet ethPkt = pkt.parsed();
if (ethPkt == null) {
return;
}
if (ethPkt.getEtherType() == TYPE_ARP) {
//handle the arp packet.
handlePacket(context);
} else {
return;
}
}
示例15: process
import org.onosproject.net.packet.PacketContext; //导入方法依赖的package包/类
@Override
public void process(PacketContext context) {
if (context.isHandled()) {
return;
}
// Ensure packet is IPv6 Solicited RA
InboundPacket pkt = context.inPacket();
Ethernet ethernet = pkt.parsed();
if ((ethernet == null) || (ethernet.getEtherType() != Ethernet.TYPE_IPV6)) {
return;
}
IPv6 ipv6Packet = (IPv6) ethernet.getPayload();
if (ipv6Packet.getNextHeader() != IPv6.PROTOCOL_ICMP6) {
return;
}
ICMP6 icmp6Packet = (ICMP6) ipv6Packet.getPayload();
if (icmp6Packet.getIcmpType() != ICMP6.ROUTER_SOLICITATION) {
return;
}
// Start solicited-RA handling thread
SolicitedRAWorkerThread sraWorkerThread = new SolicitedRAWorkerThread(pkt);
executors.schedule(sraWorkerThread, 0, TimeUnit.SECONDS);
}