NetAddr.erl_ip_to_netaddr
You're seeing just the function
erl_ip_to_netaddr
, go back to NetAddr module for more information.
Specs
Constructs a NetAddr.t/0
struct given an Erlang/OTP
IP address tuple.
Examples
iex> NetAddr.erl_ip_to_netaddr({192, 0, 2, 1})
{:ok, %NetAddr.IPv4{address: <<192, 0, 2, 1>>, length: 32}}
iex> NetAddr.erl_ip_to_netaddr({0x2001, 0xdb8, 0, 0, 0, 0, 0, 1})
{:ok, %NetAddr.IPv6{address: <<0x2001::16, 0xdb8::16, 0::5*16, 1::16>>, length: 128}}