@Override public boolean equals(Object obj) { if (this == obj) return true; if (getClass() != obj.getClass()) return false; Dot11ManagementHeader other = (Dot11ManagementHeader) obj; if (!address1.equals(other.address1)) return false; if (!address2.equals(other.address2)) return false; if (!address3.equals(other.address3)) return false; if (duration != other.duration) return false; if (!frameControl.equals(other.frameControl)) return false; if (htControl == null) { if (other.htControl != null) { return false; } } else if (!htControl.equals(other.htControl)) return false; if (!sequenceControl.equals(other.sequenceControl)) return false; return true; } }
@Override public boolean equals(Object obj) { if (obj == this) { return true; } if (!this.getClass().isInstance(obj)) { return false; } ArpHeader other = (ArpHeader) obj; return operation.equals(other.getOperation()) && srcHardwareAddr.equals(other.srcHardwareAddr) && srcProtocolAddr.equals(other.srcProtocolAddr) && dstHardwareAddr.equals(other.dstHardwareAddr) && dstProtocolAddr.equals(other.dstProtocolAddr) && hardwareType.equals(other.hardwareType) && protocolType.equals(other.protocolType) && hardwareAddrLength == other.hardwareAddrLength && protocolAddrLength == other.protocolAddrLength; }
public static boolean matchesDestination(Packet packet, MacAddress addr) { EthernetPacket etherPacket = packet.get(EthernetPacket.class); if (etherPacket == null) { throw new IllegalArgumentException(packet.toString()); } MacAddress dst = etherPacket.getHeader().getDstAddr(); return dst.equals(addr) || dst.equals(MacAddress.ETHER_BROADCAST_ADDRESS); }
@Override public boolean equals(Object obj) { if (this == obj) return true; if (getClass() != obj.getClass()) return false; Dot11ManagementHeader other = (Dot11ManagementHeader) obj; if (!address1.equals(other.address1)) return false; if (!address2.equals(other.address2)) return false; if (!address3.equals(other.address3)) return false; if (duration != other.duration) return false; if (!frameControl.equals(other.frameControl)) return false; if (htControl == null) { if (other.htControl != null) { return false; } } else if (!htControl.equals(other.htControl)) return false; if (!sequenceControl.equals(other.sequenceControl)) return false; return true; } }
@Override public boolean equals(Object obj) { if (obj == this) { return true; } if (!this.getClass().isInstance(obj)) { return false; } ArpHeader other = (ArpHeader) obj; return operation.equals(other.getOperation()) && srcHardwareAddr.equals(other.srcHardwareAddr) && srcProtocolAddr.equals(other.srcProtocolAddr) && dstHardwareAddr.equals(other.dstHardwareAddr) && dstProtocolAddr.equals(other.dstProtocolAddr) && hardwareType.equals(other.hardwareType) && protocolType.equals(other.protocolType) && hardwareAddrLength == other.hardwareAddrLength && protocolAddrLength == other.protocolAddrLength; }