Skip to content
Snippets Groups Projects
Commit 3481ef83 authored by Thomas Bellman's avatar Thomas Bellman
Browse files

Add 'trunc_to_net' flag to resolve_ipnets() function.

This new flag will cause resolve_ipnets() to mask the resolved IP
addresses with the specified netmask, thus "truncating" the address
down to the network address for the subnet.  For example, if the
hostname "exempel.se" resolves to 2001:db8:17:23::69:3:4711, then
"exempel.se/64" will return 2001:db8:17:23::/64, "exempel.se/112"
will return 2001:db8:17:23::69:3:0/112, and "exempel.se/96" will
yield the address 2001:db8:17:23:0:69::/96.

This can be useful if you have an "example" host, and want to specify
the entire subnet on which that host resides, but your application
requires the address part of the CIDR specification given to it to be
the network address, i.e. with all bits in the host part to be zero.
parent e3f2794a
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment