当前位置: 首页>>代码示例>>Java>>正文


Java PacketContext.isHandled方法代码示例

本文整理汇总了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();
    }
}
 
开发者ID:shlee89,项目名称:athena,代码行数:21,代码来源:LldpLinkProvider.java

示例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);
            }
        }
    }
}
 
开发者ID:shlee89,项目名称:athena,代码行数:27,代码来源:TunnellingConnectivityManager.java

示例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());
        }
    }
}
 
开发者ID:shlee89,项目名称:athena,代码行数:23,代码来源:IcmpHandler.java

示例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);
        }
    }
}
 
开发者ID:shlee89,项目名称:athena,代码行数:23,代码来源:SegmentRoutingManager.java

示例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);
}
 
开发者ID:opencord,项目名称:vtn,代码行数:24,代码来源:CordVtnDhcpProxy.java

示例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;
    }
}
 
开发者ID:opencord,项目名称:vtn,代码行数:23,代码来源:CordVtnArpProxy.java

示例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();
	}
}
 
开发者ID:ShakhMoves,项目名称:ShakhSDVPN,代码行数:18,代码来源:ARPHandler.java

示例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);
}
 
开发者ID:ravikumaran2015,项目名称:ravikumaran201504,代码行数:20,代码来源:ProxyArp.java

示例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);
        }
    }
}
 
开发者ID:ravikumaran2015,项目名称:ravikumaran201504,代码行数:23,代码来源:SegmentRoutingManager.java

示例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);
    }
}
 
开发者ID:opennetworkinglab,项目名称:onos,代码行数:20,代码来源:DefaultVirtualPacketProvider.java

示例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();
}
 
开发者ID:opennetworkinglab,项目名称:onos,代码行数:23,代码来源:DirectHostManager.java

示例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));
    }
}
 
开发者ID:opennetworkinglab,项目名称:onos,代码行数:23,代码来源:OpenstackRoutingArpHandler.java

示例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));
    }
}
 
开发者ID:opennetworkinglab,项目名称:onos,代码行数:25,代码来源:OpenstackRoutingIcmpHandler.java

示例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;
    }
}
 
开发者ID:opennetworkinglab,项目名称:onos,代码行数:19,代码来源:CastorArpManager.java

示例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);
}
 
开发者ID:opennetworkinglab,项目名称:onos,代码行数:26,代码来源:RouterAdvertisementManager.java


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