Pfx.network
You're seeing just the function
network
, go back to Pfx module for more information.
Specs
Returns the this-network prefix (full address) for given pfx
.
The result is in the same format as pfx
.
Examples
iex> network(%Pfx{bits: <<10, 10, 10>>, maxlen: 32})
%Pfx{bits: <<10, 10, 10, 0>>, maxlen: 32}
# mask is applied to address
iex> network({{10, 10, 10, 1}, 24})
{{10, 10, 10, 0}, 32}
# a full address is its own this-network
iex> network({10, 10, 10, 1})
{10, 10, 10, 1}
iex> network("10.10.10.1/24")
"10.10.10.0"
iex> network(%Pfx{bits: <<0xacdc::16, 0x1976::16>>, maxlen: 128})
%Pfx{bits: <<0xACDC::16, 0x1976::16, 0::96>>, maxlen: 128}
iex> network("acdc:1976::/32")
"acdc:1976:0:0:0:0:0:0"