From 052306bafe00ddea9ce9624cfa7da44c72675e18 Mon Sep 17 00:00:00 2001 From: Jarvis Jr Hermes Date: Wed, 22 Jul 2026 19:29:13 +0000 Subject: [PATCH] refactor: sort IP registry files by range --- address-book/ip-addresses.md | 2 +- ...0-0--8.md => 000-000-000-000--08--iana.md} | 0 ...md => 001-000-000-000--16--placeholder.md} | 0 ...md => 001-001-000-000--24--placeholder.md} | 0 ...0--24.md => 001-001-001-000--24--apnic.md} | 0 registry-ips/README.md | 25 +++++++++++-------- scripts/validate.py | 8 +++--- 7 files changed, 20 insertions(+), 15 deletions(-) rename registry-ips/{iana--0-0-0-0--8.md => 000-000-000-000--08--iana.md} (100%) rename registry-ips/{apnic--1-0-0-0--16.md => 001-000-000-000--16--placeholder.md} (100%) rename registry-ips/{apnic--1-1-0-0--24.md => 001-001-000-000--24--placeholder.md} (100%) rename registry-ips/{apnic--1-1-1-0--24.md => 001-001-001-000--24--apnic.md} (100%) diff --git a/address-book/ip-addresses.md b/address-book/ip-addresses.md index 7f4fc8b..d0820f0 100644 --- a/address-book/ip-addresses.md +++ b/address-book/ip-addresses.md @@ -21,4 +21,4 @@ For every address, investigate these independently: 6. **Infrastructure relationships** — IXPs, facilities, upstreams, cables, and geography where evidence permits. 7. **Time and provenance** — registry and routing facts can change, so every claim needs a source and verification date. -The canonical structured records are in [`data/ip-addresses.csv`](../data/ip-addresses.csv). Range-level knowledge is indexed in [`registry-ips/`](../registry-ips/README.md), using filenames such as `apnic--1-1-1-0--24.md`. +The canonical structured records are in [`data/ip-addresses.csv`](../data/ip-addresses.csv). Range-level knowledge is indexed in [`registry-ips/`](../registry-ips/README.md), using numerically sortable IP-first filenames such as `001-001-001-000--24--apnic.md`. diff --git a/registry-ips/iana--0-0-0-0--8.md b/registry-ips/000-000-000-000--08--iana.md similarity index 100% rename from registry-ips/iana--0-0-0-0--8.md rename to registry-ips/000-000-000-000--08--iana.md diff --git a/registry-ips/apnic--1-0-0-0--16.md b/registry-ips/001-000-000-000--16--placeholder.md similarity index 100% rename from registry-ips/apnic--1-0-0-0--16.md rename to registry-ips/001-000-000-000--16--placeholder.md diff --git a/registry-ips/apnic--1-1-0-0--24.md b/registry-ips/001-001-000-000--24--placeholder.md similarity index 100% rename from registry-ips/apnic--1-1-0-0--24.md rename to registry-ips/001-001-000-000--24--placeholder.md diff --git a/registry-ips/apnic--1-1-1-0--24.md b/registry-ips/001-001-001-000--24--apnic.md similarity index 100% rename from registry-ips/apnic--1-1-1-0--24.md rename to registry-ips/001-001-001-000--24--apnic.md diff --git a/registry-ips/README.md b/registry-ips/README.md index cbeeb04..a07c36f 100644 --- a/registry-ips/README.md +++ b/registry-ips/README.md @@ -5,21 +5,26 @@ This folder is the human-readable registry of IP knowledge collected by this rep ## Filename convention ```text -----.md +----.md ``` Examples: ```text -iana--0-0-0-0--8.md -apnic--1-1-1-0--24.md +000-000-000-000--08--iana.md +001-000-000-000--16--placeholder.md +001-001-001-000--24--apnic.md ``` The parts mean: -- `registry`: authoritative number registry currently responsible for the record (`iana`, `afrinic`, `apnic`, `arin`, `lacnic`, or `ripe-ncc`); -- `network-address-with-hyphens`: canonical network address with dots replaced by hyphens; -- `prefix-length`: CIDR range number without `/`. +- `zero-padded-network-address`: canonical IPv4 network address, each octet padded to three digits and separated by hyphens; +- `zero-padded-prefix-length`: CIDR range number without `/`, padded to two digits; +- `registry-or-status`: authoritative number registry when the range has been researched (`iana`, `afrinic`, `apnic`, `arin`, `lacnic`, or `ripe-ncc`), otherwise `placeholder`. + +A known top-level registry is not enough to put that registry in the suffix. If the exact range's holder, routing, and subdivision have not been investigated, use `placeholder`. + +The zero padding is required because repository browsers sort filenames lexicographically: without it, `1-10...` would appear before `1-2...`. IPv6 filenames use the same rule, with colons replaced by hyphens and compressed notation expanded to avoid ambiguous names. @@ -27,10 +32,10 @@ IPv6 filenames use the same rule, with colons replaced by hyphens and compressed | Range | Registry | Classification | Status | Known exact addresses | Record | |---|---|---|---|---|---| -| `0.0.0.0/8` | IANA | Special-purpose | Researched | `0.0.0.0` | [record](iana--0-0-0-0--8.md) | -| `1.0.0.0/16` | APNIC | Pending subdivision/research | Placeholder | — | [record](apnic--1-0-0-0--16.md) | -| `1.1.0.0/24` | APNIC | Pending research | Placeholder | — | [record](apnic--1-1-0-0--24.md) | -| `1.1.1.0/24` | APNIC | Public unicast | Researched | `1.1.1.1` | [record](apnic--1-1-1-0--24.md) | +| `0.0.0.0/8` | IANA | Special-purpose | Researched | `0.0.0.0` | [record](000-000-000-000--08--iana.md) | +| `1.0.0.0/16` | APNIC | Pending subdivision/research | Placeholder | — | [record](001-000-000-000--16--placeholder.md) | +| `1.1.0.0/24` | APNIC | Pending research | Placeholder | — | [record](001-001-000-000--24--placeholder.md) | +| `1.1.1.0/24` | APNIC | Public unicast | Researched | `1.1.1.1` | [record](001-001-001-000--24--apnic.md) | These four files now provide contiguous documented coverage from `0.0.0.0` through `1.1.1.255`. The two middle files are explicitly marked as placeholders and must not be interpreted as fully researched ownership records. diff --git a/scripts/validate.py b/scripts/validate.py index 3d09142..444d2d7 100644 --- a/scripts/validate.py +++ b/scripts/validate.py @@ -121,10 +121,10 @@ def main() -> int: ROOT / "address-book" / "ip-addresses.md", ROOT / "docs" / "04-ip-address-model.md", ROOT / "registry-ips" / "README.md", - ROOT / "registry-ips" / "iana--0-0-0-0--8.md", - ROOT / "registry-ips" / "apnic--1-0-0-0--16.md", - ROOT / "registry-ips" / "apnic--1-1-0-0--24.md", - ROOT / "registry-ips" / "apnic--1-1-1-0--24.md", + ROOT / "registry-ips" / "000-000-000-000--08--iana.md", + ROOT / "registry-ips" / "001-000-000-000--16--placeholder.md", + ROOT / "registry-ips" / "001-001-000-000--24--placeholder.md", + ROOT / "registry-ips" / "001-001-001-000--24--apnic.md", ROOT / "research" / "next-round.md", ] for path in required_docs: