Class DhcpScope

java.lang.Object
org.netxms.client.dhcp.DhcpScope

public class DhcpScope extends Object
DHCP scope (subnet or address pool) on DHCP server
  • Constructor Details

    • DhcpScope

      public DhcpScope(NXCPMessage msg, long baseId)
      Create scope object from NXCP message.
      Parameters:
      msg - NXCP message
      baseId - base field ID
  • Method Details

    • getId

      public String getId()
      Get scope ID (unique within DHCP server).
      Returns:
      scope ID
    • getNetwork

      public InetAddressEx getNetwork()
      Get scope network address.
      Returns:
      scope network address (may be invalid if network is not known)
    • getName

      public String getName()
      Get scope name.
      Returns:
      scope name (empty string if not set)
    • getRanges

      public String getRanges()
      Get address ranges in human readable form.
      Returns:
      address ranges
    • isEnabled

      public boolean isEnabled()
      Check if scope is enabled.
      Returns:
      true if scope is enabled
    • getTotalAddresses

      public long getTotalAddresses()
      Get total number of addresses in scope.
      Returns:
      total number of addresses
    • getUsedAddresses

      public long getUsedAddresses()
      Get number of addresses currently leased.
      Returns:
      number of used addresses
    • getDeclinedAddresses

      public long getDeclinedAddresses()
      Get number of declined addresses. Valid only if isDeclinedAddressesKnown() returns true.
      Returns:
      number of declined addresses
    • isDeclinedAddressesKnown

      public boolean isDeclinedAddressesKnown()
      Check if DHCP server reports number of declined addresses (some servers, like Microsoft DHCP Server or dnsmasq, do not).
      Returns:
      true if number of declined addresses is known
    • getFreeAddresses

      public long getFreeAddresses()
      Get number of free addresses.
      Returns:
      number of free addresses
    • getUtilization

      public double getUtilization()
      Get scope utilization (used addresses as percentage of total).
      Returns:
      scope utilization in percents
    • toString

      public String toString()
      Overrides:
      toString in class Object
      See Also: