The libsysctl is an interface to the kernel sysctl-mib-tree.
It implements wrappers around undocumented "sysctl.*" kernel states to get mib-entries info and provides a convenient API to build a mib-entry, entries-list and mib-tree in userspace.
The advantages to have libsysctl are:
- an easy API to the kernel sysctl mib-tree,
- a handy mib-entry implementation,
- building entries-list and mib-tree in userspace,
- writing quickly a custom sysctl(8) tool,
- changes to kern_sysctl.c interface won't upset userspace tools.
Overview and some implementation notes in [[ https://lists.freebsd.org/pipermail/freebsd-hackers/2018-December/053767.html | Mailing List Thread ]].
The [[ https://gitlab.com/alfix/libsysctl/blob/master/README.md | README.md ]] shows every function and links to examples.
[[ https://wiki.freebsd.org/AlfonsoSiciliano/libsysctl | libsysctl wiki page ]] collects info and links.