Seancfoley IPAddress Versions Save

Java library for handling IP addresses and subnets, both IPv4 and IPv6

v4.3.1

4 years ago
  • fix to leading zeros detection for issue #20
  • fix to generation of IPv6 sections from bytes
  • adjusted IPAddress.toAddressString() to improve toHostAddress() in resulting IPAddressString
  • added toZeroNetwork() to get IP address with network bits zeroed
  • added getNetworkMask() and getHostMask() to IPAddressSegmentSeries as requested in issue #27
  • multicast fix and fix to toInetAddress()

v5.0.2

5 years ago

v5.0.1

5 years ago
  • fixes to IPAddressString.contains (no issues exist with IPAddress.contains)
  • span with and merge to prefix blocks return only addresses with prefix lengths (including bit-count prefix lengths)
  • span with and merge to sequential blocks return no addresses with prefix lengths
  • removeBitCountPrefixLength() removes bit-count prefix lengths

v1.0.1

5 years ago

Version 1.0.1 source can be compiled with a Java 6 compiler. The IPAddress.jar included with this release is compiled with a Java 6 compiler, and hence can be run on Java 6, Java 7, and up.

v5.0.0

5 years ago

This version introduces new address range classes and reorganizes classes and code in the inet.ipaddr.format package.

This version is compatible with java 8 and the distributed jars are compiled with java 8, but those jars also include the module-info class for the Java Platform Module System (JPMS) introduced with Java 9, and hence can be used as the JPMS inet.ipaddr module with Java 9, 10, and 11. When compiling the source for Java 8 the module-info source file must be ignored or removed. When running the distributed jars with Java 8 no changes are required since the module-info class will simply be ignored.

  • includes the parsing performance improvements introduced in version 4.3.0 as well as the other 4.3.0 improvements and additions
  • added address range functionality with the new IPAddressSeqRange class and the IPv4 and IPv6 subclasses, along with their associated operations and iterators
  • added IPAddressRange interface for commonality between IPAddress and IPAddressSeqRange ranges
  • reorganization of classes and interfaces in inet.ipaddr.format package to standard, large, and string subpackages
  • expansion of the large division functionality, which uses BigInteger for address division values, to match the standard functionality which uses longs for address divisions
  • new static toNormalizedString string production methods to produce strings directly without intervening objects
  • new iterators: blockIterator(int), sequentialBlockIterator(), prefixIterator(), prefixBlockIterator(int), and their associated count methods, namely getSequentialBlockCount to go with sequentialBlockIterator() and prefixCount to go with iterator(), nonZeroHostIterator() and prefixBlockIterator(). Also added the isSequential() method.
  • added mergeToSequentialBlocks to match mergeToPrefixBlocks
  • works with Java 8, 9, 10, 11 and upwards, comprises the inet.ipaddr module for Java 9 and upwards

The Java 8 code in this release and previous releases is fully compatible with Android using Android API level 24 or higher.

v4.3.0

5 years ago
  • address string parsing performance improvements
  • changed source encoding to UTF-8 from Cp1252 and changed source to unix line separators
  • new incrementBoundary method to increment from lower or upper subnet boundary
  • increment method changed for consistency between single addresses and subnets: changed increment(long) behaviour for subnets to match array indexing, with increment 0 the first element in the subnet, and also matching the behavior for non-subnets, with an increment of 1 giving the element above the upper element of the range
  • fixed issue with incrementing a multiple prefix block subnet
  • added byte copy that takes an index into the target bytes
  • made IPAddressCreator static
  • added prefixEquals and contains methods to IPAddressString for optimized containment checks
  • performance improvement caching Integer prefix lengths of length 128
  • fixed ArrayIndexOutOfBoundException in isPrefixSubnet (issue #10)

v4.2.0

6 years ago
  • better categorization of local addresses, for more consistency and for better alignment with IPv4/IPv6 standards
    • added isPrivate() method to IPv4
    • added isUnspecified() to both IPv4 and IPv6
    • added checking for local multicast addresses, both IPv4 and IPv6
    • refinement of local addresses to be more exact with isLocal(), including removal of isSiteLocal() from IPv4
  • new increment(long) method allowing for addition and subtraction outside of subnets as well as jumping into the middle of subnets rather than iterating individually
  • new mergePrefixBlocks method merges addresses and subnets into a minimal number of prefix blocks
  • new spanWithPrefixBlocks method provides the minimal set of prefix blocks that spans all addresses between any two addresses or subnets
  • added the prefixBlockIterator method which allows you to iterate through prefix block subnets rather than individual addresses, and the method getPrefixCount which counts the number of prefixes in a subnet (which matches the count for the prefix block iterator)
  • added the methods containsPrefixBlock and containsSinglePrefixBlock across all addresses and address sections to test for prefix blocks of any prefix length
  • added option to not zero out bits moving across the prefix when adjusting prefix lengths, now there is the choice of whether to zero or not, which can help with subnetting
  • parsing service names in place of port numbers with HostName, including the "*" denoting all services or ports
  • made parsing of host names with port using HostName more flexible, parsing potentially ambiguous formats involving non-bracketed IPv6 addresses and ports in more than one way, and allowing combinations of zone, prefix, and port/service
  • also added "expectPort" parsing option to handle cases in which ports are ambiguous with terminating ipv6 segments
  • allow combination of zone and prefix in ipv6 address strings (previously was supported only in HostName)
  • added zone validation to check for prefix length or port indicator
  • proper handling of encoded characters in zones inside bracketed host names

v4.1.0

6 years ago
  • added sign extension for byte arrays used to construct sections and addresses, compatible with both two's complement and BigInteger byte arrays.
  • support for specifying indices into byte arrays used to construct sections and addresses
  • new methods toMaxHost and toZeroHost to get those specific single hosts from a subnet (network and broadcast address for IPv4), added new methods includesZero and includes Max. Complements existing method toPrefixBlock() which goes from address to subnet
  • changed the default toString() strings to use compression for IPv6
  • added additional validation for prefix lengths throughout the API

v4.0.0

6 years ago

The main change in version 4 is a change to the way IP addresses with prefix length are handled. The old behaviour remains supported, see the doc section on prefix length handling to switch back (as simple as assigning a static field). The new behaviour is to recognize addresses with a zero host as the prefix-block subnet, while addresses with non-zero hosts are now considered individual addresses with an associated prefix length. This is consistent with common usage conventions for IPv4 and IPv6.

  • added the new prefix behaviour and prefix length handling options
  • changes to network classes and address classes to support the new prefix handling options
  • runtime exception refactoring (AddressTypeException is now AddressValueException, other new exceptions added) and added more error checking
  • added new method options to ignore IPv4 network address or IPv6 anycast address (ie the zero-host address) when iterating or getting the lowest address in a subnet
  • added new conversions to/from BigInteger, int, long
  • added intersect method
  • added toPrefixBlock method (gives prefix block for any individual address with prefix length)
  • added IPAddressSegmentSeries interface for a shared interface amongst IP addresses and address sections
  • renamed a bunch of methods (consistent with the new prefix length handling): isRangeEquivalentToPrefix renamed to isSinglePrefixBlock getEquivalentPrefix renamed to getPrefixLengthForSingleBlock toPrefixedEquivalent renamed to assignPrefixForSingleBlock isRangeUnchanged renamed to isPrefixBlock(Integer) getMinPrefix renamed to getMinPrefixLengthForBlock toMinPrefixedEquivalent renamed to assignMinPrefixForBlock getMaskPrefixLength renamed to getBlockMaskPrefixLength matchesWithPrefix renamed to matchesWithPrefixMask isRangeEquivalent renamed to isPrefixBlock isMultipleByNetworkPrefix is replaced by isSinglePrefixBlock
  • moved a few static methods: IPAddress.getStandardLoopbackStrings, IPAddress.getLoopback available from class IPAddressNetwork IPAddress.from available as IPAddressNetwork.IPAddressGenerator.from IPAddress.getLocalHost is removed. Instead use IPAddressNetwork.IPAddressGenerator.from on the result of InetAddress.getLocalHost().getAddress()
  • Some network object access methods have been changed. You can address default network object directly from defaultIpv4Network, defaultIpv6Network and defaultMACNetwork in class Address.

Version 4 is not backwards compatible with version 3, but migration is straightforward. Most of the API has not changed.

v2.0.2

6 years ago
  • get/toHostAddress in IPAddressString for getting host address of prefixed address