aboutsummaryrefslogtreecommitdiff
path: root/package/base-files/files/lib/functions/ipv4.sh
Commit message (Collapse)AuthorAge
* base-files: ipcalc.sh: Add tests for unroutable, etcPhilip Prindeville2023-12-12
| | | | | | See RFC-1918, RFC-3927, and RFC-1122. Signed-off-by: Philip Prindeville <philipp@redfish-solutions.com>
* base-files: ipcalc.sh: Add netmask2prefix functionPhilip Prindeville2023-12-12
| | | | | | Also add is_contiguous to check if it's a valid netmask. Signed-off-by: Philip Prindeville <philipp@redfish-solutions.com>
* base-files: ipcalc.sh: Add prefix-to-netmask conversionPhilip Prindeville2023-12-12
| | | | | | | Seems like it might be used in other places, so factor it into the library. Signed-off-by: Philip Prindeville <philipp@redfish-solutions.com>
* base-files: ipcalc.sh: Add some commentary, etc.Philip Prindeville2023-12-12
| | | | | | | | Explain some of the more obscure logic, or where we deviate from what the original awk code did. Also, give a count of the usable addresses on the subnet. Signed-off-by: Philip Prindeville <philipp@redfish-solutions.com>
* base-files: ipcalc.sh: Rewrite in pure shellPhilip Prindeville2023-12-12
Also add better error checking on input. Signed-off-by: Philip Prindeville <philipp@redfish-solutions.com>