IP Reserved v0.1.0 IpReserved View Source

Documentation for IpReserved, a tool that checks if the given IP is private / reserved or "normal". Works with IPv4 and IPv6 addresses.

Link to this section Summary

Functions

Returns whether an IP address is reserved or not.

Link to this section Types

Link to this type

ipv4_address()

View Source
ipv4_address() :: {0..255, 0..255, 0..255, 0..255}
Link to this type

ipv6_address()

View Source
ipv6_address() ::
  {0..65535, 0..65535, 0..65535, 0..65535, 0..65535, 0..65535, 0..65535,
   0..65535}

Link to this section Functions

Link to this function

is_reserved?(ip)

View Source
is_reserved?(String.t()) :: boolean()
is_reserved?(ip_address()) :: boolean()

Returns whether an IP address is reserved or not.

Examples

iex> IpReserved.is_reserved?("192.168.0.1")
true

iex> IpReserved.is_reserved?({8, 8, 1, 1})
false

iex> IpReserved.is_reserved?("2001:db8:0:85a3::ac1f:8001")
true