Ipconv::CIDR
Represents a Classless Inter-Domain Routing (CIDR) IP network block.
Constructors
Creates a CIDR from a base network Address and prefix length in bits.
Class methods
Computes the high 64 bits of an IPv6 network mask for the given prefix length.
Computes the low 64 bits of an IPv6 network mask for the given prefix length.
Computes an IPv4 32-bit network mask for the given prefix length and total bits.
Instance methods
Returns the first usable host address in this subnet. Handles /31 and /32 special cases for IPv4 (RFC 3021), and /127 and /128 for IPv6 (RFC 6164).
Returns the number of usable host addresses in this subnet as a UInt128.
Follows RFC 3021 (/31 = 2 hosts) and RFC 6164 (/127 = 2 hosts).
Returns the last usable host address in this subnet. Handles /31 and /32 special cases for IPv4 (RFC 3021), and /127 and /128 for IPv6 (RFC 6164).