@Override public void process(PacketContext context) { if (context.isHandled()) { return; } InboundPacket pkt = context.inPacket(); Ethernet ethernet = pkt.parsed(); if (ethernet != null && ethernet.getEtherType() == Ethernet.TYPE_ARP) { arpHandler.processPacketIn(pkt, openstackPortInfoMap.values()); } } }
private void handlePacket(PacketContext context) { InboundPacket pkt = context.inPacket(); Ethernet ethPkt = pkt.parsed(); NeighbourMessageContext msgContext = DefaultNeighbourMessageContext.createContext(ethPkt, pkt.receivedFrom(), actions); if (msgContext == null) { return; } if (handleMessage(msgContext)) { context.block(); } }
@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(); } } }
@Override public void process(PacketContext context) { // Stop processing if the packet has been handled, since we // can't do any more to it. log.debug("Received trigger for label DB sync."); if (context.isHandled()) { return; } InboundPacket pkt = context.inPacket(); if (pkt == null) { return; } Ethernet ethernet = pkt.parsed(); if (ethernet == null || ethernet.getEtherType() != Ethernet.TYPE_IPV4) { return; } IPv4 ipPacket = (IPv4) ethernet.getPayload(); if (ipPacket == null || ipPacket.getProtocol() != IPv4.PROTOCOL_TCP) { return; } TCP tcp = (TCP) ipPacket.getPayload(); if (tcp == null || tcp.getDestinationPort() != PCEP_PORT) { return; } syncLabelDb(pkt.receivedFrom().deviceId()); } }
@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; } InboundPacket pkt = context.inPacket(); Ethernet ethPkt = pkt.parsed(); if (ethPkt == null) { return; } if (ethPkt.getEtherType() == TYPE_ARP) { // handle ARP packets handlePacket(context); } else if (ethPkt.getEtherType() == TYPE_IPV6) { IPv6 ipv6 = (IPv6) ethPkt.getPayload(); if (ipv6.getNextHeader() == IPv6.PROTOCOL_ICMP6) { ICMP6 icmp6 = (ICMP6) ipv6.getPayload(); if (icmp6.getIcmpType() == NEIGHBOR_SOLICITATION || icmp6.getIcmpType() == NEIGHBOR_ADVERTISEMENT) { // handle ICMPv6 solicitations and advertisements (NDP) handlePacket(context); } } } } }
Ethernet ethRequest = pkt.parsed(); ARP arp = (ARP) ethRequest.getPayload();
@Override public void process(PacketContext context) { InboundPacket pkt = context.inPacket(); ConnectPoint connectPoint = pkt.receivedFrom(); DeviceId deviceId = connectPoint.deviceId(); Ethernet ethPkt = pkt.parsed(); if (ethPkt == null) { return; } if (ethPkt.getEtherType() == Ethernet.TYPE_ARP) { ARP arpPacket = (ARP) ethPkt.getPayload(); if ((arpPacket.getOpCode() == ARP.OP_REQUEST)) { arprequestProcess(arpPacket, deviceId); } else if (arpPacket.getOpCode() == ARP.OP_REPLY) { arpresponceProcess(arpPacket, deviceId); } } else if (ethPkt.getEtherType() == Ethernet.TYPE_IPV4) { if (ethPkt.getDestinationMAC().isMulticast()) { return; } IPv4 ip = (IPv4) ethPkt.getPayload(); upStreamPacketProcessor(ip, deviceId); } else { return; } }
Ethernet ethPkt = pkt.parsed(); if (ethPkt == null) { return;
Ethernet eth = packetContext.inPacket().parsed(); if (eth == null) { return false;
@Override public void process(PacketContext context) { Ethernet packet = context.inPacket().parsed(); if (packet == null || portChainService.getPortChainCount() == 0) { return;