From f0c48b5b4c90bfdf434e4e7d97fd6a2fd66ff51d Mon Sep 17 00:00:00 2001 From: Yuriy Andamasov Date: Tue, 28 Apr 2026 23:22:41 +0300 Subject: general: T8595: add CLAUDE.md --- CLAUDE.md | 55 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 CLAUDE.md (limited to 'CLAUDE.md') diff --git a/CLAUDE.md b/CLAUDE.md new file mode 100644 index 0000000..ba5ae84 --- /dev/null +++ b/CLAUDE.md @@ -0,0 +1,55 @@ +# CLAUDE.md + +## Project purpose + +C utility for IPv4/IPv6 address and prefix validation in shell scripts. Used by VyOS as the canonical "is this string a valid IP / network / host / CIDR?" checker invoked from XML validators and conf-mode scripts. Fast and exit-status-driven (intended for `if ipaddrcheck --is-ipv4 ...; then ...`). + +## Tech stack + +- C, autotools (`configure.ac`, `Makefile.am`, autoconf 2.x). +- Dependencies: `libcidr` (parsing), `libpcre2-8` (regex), `check >= 0.9.4` (test framework). +- Debian packaging under `debian/`. Current source version `1.1`. + +## Build / test / run + +``` +autoreconf -fi # generate configure +./configure +make +make check # uses libcheck unit tests under tests/ +make install # installs into AC_PREFIX_DEFAULT (/usr) +# Debian package +dpkg-buildpackage -uc -us -tc -b +``` + +## Repository layout + +- `src/` — C sources (`ipaddrcheck.c`, headers, autotools `Makefile.am`). +- `tests/` — libcheck unit tests. +- `man/` — manpages. +- `debian/` — Debian packaging. +- `configure.ac`, `Makefile.am`, `INSTALL`, `NEWS`, `ChangeLog`, `AUTHORS`, `COPYING` (GPL-2), `COPYING-LGPL` (LGPL-2.1). + +## Cross-repo context + +One of the canonical 14 VyOS-image build packages, listed in `VyOS-Networks/vyos-build-packages/repos.toml`. Built into VyOS images by `vyos-build` and invoked at runtime by `vyos-1x` validators and conf-mode scripts. Sits in the §3.5 native-libraries category alongside `hvinfo`, `udp-broadcast-relay`, etc. + +## Conventions + +- Commit / PR title format: `component: T12345: description` (Phorge task ID at https://vyos.dev mandatory). Enforced by `vyos/.github` reusable workflows where consumed. +- Branch model: `current` (rolling), `circinus` (1.5 LTS), `sagitta` (1.4 LTS), `equuleus` (1.3 LTS). +- Maintained by the VyOS team (`maintainers@vyos.net`); license is GPL-2 + LGPL-2.1 dual. + +## Mirror relationship + +Mirror twin: `VyOS-Networks/ipaddrcheck`. Canonical side is **here** (`vyos/ipaddrcheck`). + +## Notes for future contributors + +- Used as a CLI-level validator — exit status 0/1 is the contract. Don't break stdout/stderr conventions or add chatty output. +- `libcidr` is by Matthew Fuller (http://www.over-yonder.net/~fullermd/projects/libcidr) — Debian-packaged. +- Adding a new flag: extend `src/ipaddrcheck.c`'s argument table and add a libcheck test under `tests/`. + +--- + +This file is mirrored on Confluence: [`vyos/ipaddrcheck`](https://internal.confluence.vyos.com/wiki/spaces/VYOS/pages/818479310). The Confluence page also carries the per-repo audit data (settings, workflows, secret counts, hygiene) that complements this CLAUDE.md. Edit either side; resync via the documentation pipeline. -- cgit v1.2.3