/** * @return True is the Ethernet frame is multicast, False otherwise */ public boolean isMulticast() { return this.destinationMACAddress.isMulticast(); }
(ethDst.mac().isBroadcast() || ethDst.mac().isMulticast());
@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; } }
if (ethPkt.getDestinationMAC().isMulticast()) { return;