Repository navigation
Description
Context
#57 / #40 landed IPv6 in Test-IPInSubnet, Get-LocalARPTable / ConvertFrom-ArpText, and DrawIO subnet parenting. The stable inventory path still rejects v6:
Import-Inventoryalways callsConvertTo-NormalizedIPv4Address/ConvertTo-NormalizedIPv4Cidrand throws on IPv6 literals.- README still documents: “The stable inventory contract is IPv4-only … IPv6 is rejected explicitly.”
So ARP can surface v6 neighbors and DrawIO can parent them, but users cannot round-trip a dual-stack inventory through the documented import path. That leaves #40’s “nodes survive import” incomplete for the inventory contract.
What
Extend the inventory contract to dual-stack:
- Accept IPv4 and IPv6 device
ipvalues and subnetcidrvalues. - Normalize both families (canonical string form; clear host bits in CIDRs for v4 and v6).
- Keep uniqueness per normalized address string; reject duplicates across the inventory.
- Mixed-family subnet placement continues to return false via existing
Test-IPInSubnet(never throw). - Update README inventory section + template comments to match the new contract (not “IPv4-only”).
Prefer small helpers (ConvertTo-NormalizedIPAddress / ConvertTo-NormalizedCidr) rather than forcing callers through IPv4-named functions.
Why it matters
Without import support, dual-stack sites cannot author or re-import inventories that the rest of the module can already render. Docs and behavior currently contradict each other.
Acceptance criteria
-
Import-Inventoryaccepts a fixture with IPv4 + IPv6 devices and both family CIDRs; nodes retain normalized IPs. - IPv6-only inventory imports and
Export-DrawIOparents each v6 node into its matching v6 container (reuse / extend existing IPv6 nodes survive import, subnet matching and export #40 tests). - Invalid addresses still throw with a context that names the field index; malformed mixed junk still fails closed.
- Duplicate normalized addresses (including compressed vs expanded v6 equivalents if normalized) are rejected.
- README inventory contract no longer claims IPv4-only rejection; example JSON shows at least one v6 device/subnet.
- Pester covers: v6 import, dual-stack import, duplicate v6, invalid v6, and DrawIO parenting after import.
Out of scope
Wizard / Invoke-NetworkDiscovery IPv6 scanning (separate follow-on). SNMP credential-map v6 CIDR keys. Gallery version bump.
Related
Follows #57 / #40. Complements remaining IPv4-only discovery surfaces.
Activity
feat(inventory): accept dual-stack IPv6 addresses and CIDRs (#58) (#68)
docs: sync README/CHANGELOG/STRUCTURE after #55–#58 (#60)
docs: sync README/CHANGELOG/STRUCTURE after #55–#58 (#60) (#70)