Skip to content

Releases: a-sit-plus/cidre

0.4.0

Choose a tag to compare

@JesusMcCloud JesusMcCloud released this 01 Jul 07:27
  • Add subnetting and supernetting helpers on IpNetwork
    • subnet(newPrefix: UInt)
    • subnetRelative(prefixDiff: UInt)
    • supernet(newPrefix: UInt)
    • supernetRelative(prefixDiff: UInt)
  • Add fixture-backed JVM tests for subnetting and supernetting (subnetting.json, supernetting.json)
  • Add additional fixture-backed JVM coverage:
    • overlaps_containment.json
    • python_oracle.json generated from Python stdlib ipaddress
    • set_operations.json (union collapse/covering, intersection, difference)
  • Add Python-oracle fixture generator:
    • python-testgen/gen_python_oracle.py
  • Add network set-operations on IpNetwork:
    • unionCollapse
    • unionCovering
    • intersection
    • difference
  • Keep set-operation API surface explicit and unambiguous; no alias variants (union, spanningUnion, intersect, minus)
  • Add range/relation APIs on IpNetwork:
    • toRange()
    • fromRange(start, end)
    • relationTo(other) with Relation enum (EQUAL, CONTAINS, WITHIN, ADJACENT, DISJOINT)
  • Define canonical set-operation output contract (sorted, non-overlapping, maximally collapsed) and enforce it in operation results
  • Add explicit runtime family guards for network operations/containment: mixed IPv4/IPv6 inputs now fail fast with IllegalArgumentException (no implicit cross-family coercion)
  • Add randomized property-style JVM tests for set-operation invariants and range summarization roundtrips (IPv4 and IPv6)
  • Add IpAddress.V4.LeadingPrefix for explicit bit-prefix modeling with:
    • UByte constructor (leadingPrefixLength, leadingPrefixValue)
    • signed-number constructor (Int, Int)
    • bit-string constructor (String, e.g. "110")
    • canonical bit-string rendering via toString()
  • Clean up JVM fixture tests by removing noisy prints, tightening type handling to avoid broad unchecked-cast patterns, and renaming overlong test identifiers consistently
  • Fix network flag semantics to use containment instead of exact-network equality:
    • isLoopback
    • isLinkLocal
    • isMulticast
    • isPrivate
    • IPv6 range flags (isGlobalUnicast, isUniqueLocal, isUniqueLocalLocallyAssigned, isIpV4Mapped, isIpV4Compatible, isDocumentation, isDiscardOnly, isReserved)
  • Fix IPv6 reserved special ranges initialization (4000::/3, 6000::/3) to avoid invalid-network initialization errors
  • Fix IpNetwork.contains(IpInterface) to also validate that the interface address is inside the network
  • Fix addressSpace for /32 and /128 to avoid duplicate single-address emission
  • Fix IpAddress.V6.toString(expanded = true) to emit fully padded 4-digit hextets
  • Tighten IpAddress.V4.LeadingPrefix(Int, Int) validation to reject values outside 0..255 before conversion
  • Add withSameFamily scopes for unknown-family IpAddress and IpNetwork values, exposing same-family arithmetic, bitwise, comparison, containment, overlap, adjacency, and merge operations, including network/address membership checks in both receiver directions.
  • Add generic isSameFamily predicates for IpAddress and IpAddressAndPrefix.
  • Fix generic IpAddress.isV4() / IpAddress.isV6() checks.
  • Kotlin 2.4.0

0.3.1

Choose a tag to compare

@StjepanovicSrdjan StjepanovicSrdjan released this 06 Nov 14:25

Add hashCode() and equals() in IpInterface.

0.3.0

Choose a tag to compare

@StjepanovicSrdjan StjepanovicSrdjan released this 29 Sep 07:41
f13e344
  • Add methods in IpAddressAndPrefix interface for parsing ByteArray representing address and subnet mask in X509 IpAddressName
    • fromX509Octets
    • toX509Octets

0.2.0

Choose a tag to compare

@JesusMcCloud JesusMcCloud released this 14 Sep 19:12
  • Revised generic type arguments
  • Introduce CidrNumber optimized for CIDR operations
    • CidrNumber.V4 for IPv4
    • CidrNumber.V6 for IPv6
  • CIDR math helpers on IP Addresses:
    • toCidrNumber to get numeric representation
    • plus
    • minus
    • shl
    • shr
    • and
    • or
    • xor
    • inv
  • More properties:
    • hostMask
    • numberOfHostBits
    • lastAddress
    • firstAssignableHost
    • lastAssignableHost
    • assignableHostRange
    • addressSpace
    • lastAddress
    • overlaps
    • isSubnetOf
    • isSupernetOf
    • isAdjacentTo
    • boradcastAddress (IPv4 only)
  • Fix native interop package

0.1.0

Choose a tag to compare

@JesusMcCloud JesusMcCloud released this 09 Sep 08:29
98ffd49
  1. Data model:
  • IP addresses, networks, netmasks and prefixes
  • Type-safety: Never mix up IPv6 and IPv4!
  • Generic properties (isLoopback, isLinkLocal, etc…)
  • IPv4-specific properties (isPrivate/isPublic)
  • IPv6-specific properties (isGlobalUnicast, isIpV4Mapped, and many more)
  1. Parser
  2. Encoder (including IPv6 canonicalization)
  3. Masking
  4. Containment Checks
  5. Various ByteArray-level OPs