IP.Scope (ip v1.2.3)

Implements scope lookup for all (currently) known scopes.

Please open a pull-request if this needs changing.

Link to this section Summary

Functions

Return the scope of address

Return the scope of prefix

Link to this section Functions

Link to this function

address_scope(address)

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

Return the scope of address

examples

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

Examples

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

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