cidr2list.1 (1292B)
- .\" utils-cidr: utilities to manipulate CIDR ip-ranges
- .\" Copyright 2025 Haelwenn (lanodan) Monnier <contact+utils-cidr@hacktivis.me>
- .\" SPDX-License-Identifier: MPL-2.0
- .Dd October 18, 2025
- .Dt CIDR2LIST 1
- .Os
- .Sh NAME
- .Nm cidr2list
- .Nd expand CIDR ranges into a list
- .Sh SYNOPSIS
- .Nm
- .Sh DESCRIPTION
- .Nm
- reads CIDR ranges and CIDR-less IPv4 addresses from standard
- input and prints the full list of the addresses of their range,
- assuming a /32 for CIDR-less addresses.
- .Sh EXIT STATUS
- .Ex -std
- .Sh EXAMPLES
- .Bd -literal
- $ printf '%s\en' 192.168.0.42/31 192.168.0.69/31 | cidr2list
- 192.168.0.42
- 192.168.0.43
- 192.168.0.68
- 192.168.0.69
- .Ed
- .Sh RATIONALES
- .Nm
- doesn't supports IPv6 because the typical usage would be extremely
- large ranges like /48 and /64 which would respectively imply
- printing 2^(128-48) and 2^(128-64) IPv6 addresses.
- Which cannot fit into current (2025) storage, let alone RAM.
- .Pp
- Meanwhile listing out 0.0.0.0/0 (all of IPv4),
- is exactly 2^32\ *\ 4\ =\ 16\ GiB if kept in binary representation,
- and less than 2^32\ *\ (3*4\ +\ 3\ +\ 1)\ =\ 64\ GiB in textual representation.
- .Pp
- Testing it out, it takes 61\ 337\ 501\ 696\ bytes\ (~57.125\ GiB), and about
- 17\ minutes with
- .Nm
- going at ~54.8MiB/s.
- .Sh AUTHORS
- .An Haelwenn (lanodan) Monnier Aq Mt contact@hacktivis.me