Pfx.mask

You're seeing just the function mask, go back to Pfx module for more information.

Specs

mask(prefix()) :: prefix()

Return the mask for given pfx.

The result is in the same format as pfx.

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(%Pfx{bits: <<10, 10, 10, 0::1>>, maxlen: 32})
%Pfx{bits: <<255, 255, 255, 128>>, maxlen: 32}