View Source locus_mmdb_tree (locus v2.3.9)
Summary
Functions
Looks up for a
DataIndex
for Address
within Tree
Instantiates a new
Tree
out of TreeData
, a few metadata properties and DataSectionSize
Types
-type index() :: non_neg_integer().
-type ip4_address_prefix() :: {inet:ip4_address(), 0..32}.
-type ip6_address_prefix() :: {inet:ip6_address(), 0..128}.
-type ip_address_prefix() :: ip4_address_prefix() | ip6_address_prefix().
-opaque t()
Functions
-spec lookup(Address, Tree) -> {ok, DataIndex} | not_found | {error, Reason} when Address :: inet:ip_address(), Tree :: t(), DataIndex :: locus_mmdb_data_codec:index(), Reason :: ipv4_database | not_found.
DataIndex
for Address
within Tree
-spec new(TreeData, NodeCount, RecordSize, IpVersion, DataSectionSize) -> {ok, Tree} | {error, Reason} when TreeData :: binary(), NodeCount :: non_neg_integer(), RecordSize :: non_neg_integer(), IpVersion :: 4 | 6, DataSectionSize :: non_neg_integer(), Tree :: t(), Reason :: term().
Tree
out of TreeData
, a few metadata properties and DataSectionSize