Esempio n. 1
0
File: ARP.java Progetto: jmdbo/CGR
 @Override
 public boolean equals(Object obj) {
   if (this == obj) return true;
   if (!super.equals(obj)) return false;
   if (getClass() != obj.getClass()) return false;
   ARP other = (ARP) obj;
   if (hardwareAddressLength != other.hardwareAddressLength) return false;
   if (hardwareType != other.hardwareType) return false;
   if (opCode == null) {
     if (other.opCode != null) return false;
   } else if (!opCode.equals(other.opCode)) return false;
   if (protocolAddressLength != other.protocolAddressLength) return false;
   if (protocolType != other.protocolType) return false;
   if (senderHardwareAddress == null) {
     if (other.senderHardwareAddress != null) return false;
   } else if (!senderHardwareAddress.equals(other.senderHardwareAddress)) return false;
   if (senderProtocolAddress == null) {
     if (other.senderProtocolAddress != null) return false;
   } else if (!senderProtocolAddress.equals(other.senderProtocolAddress)) return false;
   if (targetHardwareAddress == null) {
     if (other.targetHardwareAddress != null) return false;
   } else if (!targetHardwareAddress.equals(other.targetHardwareAddress)) return false;
   if (targetProtocolAddress == null) {
     if (other.targetProtocolAddress != null) return false;
   } else if (!targetProtocolAddress.equals(other.targetProtocolAddress)) return false;
   return true;
 }
  @Override
  public boolean equals(Object obj) {
    if (this == obj) return true;
    if (obj == null) return false;
    if (getClass() != obj.getClass()) return false;
    OFOxmArpTpaMaskedVer12 other = (OFOxmArpTpaMaskedVer12) obj;

    if (value == null) {
      if (other.value != null) return false;
    } else if (!value.equals(other.value)) return false;
    if (mask == null) {
      if (other.mask != null) return false;
    } else if (!mask.equals(other.mask)) return false;
    return true;
  }
  @Override
  public boolean equals(Object obj) {
    if (this == obj) return true;
    if (obj == null) return false;
    if (getClass() != obj.getClass()) return false;
    OFActionSetNwDstVer11 other = (OFActionSetNwDstVer11) obj;

    if (nwAddr == null) {
      if (other.nwAddr != null) return false;
    } else if (!nwAddr.equals(other.nwAddr)) return false;
    return true;
  }
Esempio n. 4
0
 /**
  * Completely removes the DHCPBinding object with IP address {@code byte[]} ip from the DHCPPool
  *
  * @param {@code byte[]} ip: The IP address to remove from the pool. This address will not be
  *     available for lease after removal.
  * @return none
  */
 public void removeIPv4FromDHCPPool(IPv4Address ip) {
   if (ip == null || getDHCPbindingFromIPv4(ip) == null) return;
   if (ip.equals(STARTING_ADDRESS)) {
     DHCPBinding lowest = null;
     // Locate the lowest address (other than ip), which will be the new starting address
     for (DHCPBinding binding : DHCP_POOL) {
       if (lowest == null) {
         lowest = binding;
       } else if (binding.getIPv4Address().getInt() < lowest.getIPv4Address().getInt()
           && !binding.getIPv4Address().equals(ip)) {
         lowest = binding;
       }
     }
     // lowest is new starting address
     STARTING_ADDRESS = lowest.getIPv4Address();
   }
   DHCP_POOL.remove(this.getDHCPbindingFromIPv4(ip));
   this.setPoolSize(this.getPoolSize() - 1);
   this.setPoolAvailability(this.getPoolAvailability() - 1);
   if (this.getPoolAvailability() == 0) this.setPoolFull(true);
 }
Esempio n. 5
0
File: ARP.java Progetto: jmdbo/CGR
  /** @return True if gratuitous ARP (SPA = TPA), false otherwise */
  public boolean isGratuitous() {
    assert (senderProtocolAddress.getLength() == targetProtocolAddress.getLength());

    return senderProtocolAddress.equals(targetProtocolAddress);
  }