Iptrie.has_prefix-question-mark
You're seeing just the function
has_prefix-question-mark
, go back to Iptrie module for more information.
Specs
Returns true if given prefix
is present in trie
, false otherwise.
The check is done based on an exact match, unless the option match: :lpm
is provided to match based on longest prefix match.
Example
iex> t = new([{"1.1.1.1", 1}, {"1.1.1.0/24", 2}, {"acdc::/16", 3}])
iex> has_prefix?(t, "1.1.1.2")
false
iex> has_prefix?(t, "1.1.1.2", match: :lpm)
true
iex> has_prefix?(t, "1.1.1.1")
true
iex> has_prefix?(t, "acdc::/16")
true