IP.Scope (ip v2.0.3)

Implements scope lookup for all (currently) known scopes.

Please open a pull-request if this needs changing.

Summary

Functions

Return the scope of address

Return the scope of prefix

Functions

Link to this function

address_scope(address)

@spec address_scope(IP.Address.t()) :: binary()

Return the scope of address

Examples

iex> ~i(192.0.2.0)
...> |> IP.Scope.address_scope()
"DOCUMENTATION"

iex> ~i(2001:db8::)
...> |> IP.Scope.address_scope()
"DOCUMENTATION"
Link to this function

prefix_scope(prefix)

@spec prefix_scope(IP.Prefix.t()) :: binary()

Return the scope of prefix

Examples

iex> ~i(192.0.2.0/24)
...> |> IP.Scope.prefix_scope()
"DOCUMENTATION"

iex> ~i(2001:db8::/32)
...> |> IP.Scope.prefix_scope()
"DOCUMENTATION"