VintageNet.IP.to_subnet
You're seeing just the function
to_subnet
, go back to VintageNet.IP module for more information.
Specs
to_subnet(:inet.ip_address(), VintageNet.prefix_length()) :: :inet.ip_address()
Utility function to trim an IP address to its subnet
Examples:
iex> VintageNet.IP.to_subnet({192, 168, 1, 50}, 24)
{192, 168, 1, 0}
iex> VintageNet.IP.to_subnet({192, 168, 255, 50}, 22)
{192, 168, 252, 0}
iex> VintageNet.IP.to_subnet({64768, 43690, 0, 0, 4144, 58623, 65276, 33158}, 64)
{64768, 43690, 0, 0, 0, 0, 0, 0}