socket v0.3.9 Socket.Address

Summary

Functions

Get the addresses for the given host

Get the addresses for the given host, raising if an error occurs

Check if an IP address belong to a network

Parse a string to an ip address tuple

Convert an ip address tuple to a string

Check if the passed string is a valid IP address

Types

t()
t() :: String.t | charlist | :inet.ip_address

Functions

for(host, family)
for(t, :inet.address_family) ::
  {:ok, [t]} |
  {:error, :inet.posix}

Get the addresses for the given host.

for!(host, family)
for!(t, :inet.address_family) :: [t] | no_return

Get the addresses for the given host, raising if an error occurs.

is_in_subnet?(addr, net, netsize)
is_in_subnet?(t, t, Integer) :: boolean

Check if an IP address belong to a network

parse(text)
parse(t) :: :inet.ip_address

Parse a string to an ip address tuple.

to_string(address)
to_string(t) :: String.t

Convert an ip address tuple to a string.

valid?(text)
valid?(t) :: boolean

Check if the passed string is a valid IP address.