Pfx.bset
You're seeing just the function
bset
, go back to Pfx module for more information.
Specs
Sets all bits of pfx
to either 0
or 1
.
If bit
is not provided, it defaults to 0
.
Examples
iex> bset("1.1.1.0/24")
"0.0.0.0/24"
iex> bset("1.1.1.0/24", 1)
"255.255.255.0/24"
iex> bset({{1, 1, 1, 0}, 24}, 1)
{{255, 255, 255, 0}, 24}
iex> bset(%Pfx{bits: <<1, 1, 1>>, maxlen: 32})
%Pfx{bits: <<0, 0, 0>>, maxlen: 32}
iex> bset(%Pfx{bits: <<1, 1, 1>>, maxlen: 32}, 1)
%Pfx{bits: <<255, 255, 255>>, maxlen: 32}