Pfx.mask
You're seeing just the function
mask
, go back to Pfx module for more information.
Specs
Return the mask for given pfx
.
The result is always a full length prefix.
Examples
iex> mask("10.10.10.0/25")
"255.255.255.128"
iex> mask({10, 10, 10, 0})
{255, 255, 255, 255}
iex> mask({{10, 10, 10, 0}, 25})
{{255, 255, 255, 128}, 32}
iex> mask("acdc:1976::/32")
"ffff:ffff:0:0:0:0:0:0"
# and now for something completely different:
iex> mask(%Pfx{bits: <<10, 10, 0::1>>, maxlen: 20})
%Pfx{bits: <<255, 255, 8::4>>, maxlen: 20}