VintageNet.IP.subnet_mask_to_prefix_length

You're seeing just the function subnet_mask_to_prefix_length, go back to VintageNet.IP module for more information.
Link to this function

subnet_mask_to_prefix_length(subnet_mask)

View Source

Specs

subnet_mask_to_prefix_length(:inet.ip_address()) ::
  {:ok, VintageNet.prefix_length()} | {:error, String.t()}

Convert an IPv4 subnet mask to a prefix length.

Examples:

iex> VintageNet.IP.subnet_mask_to_prefix_length({255, 255, 255, 0})
{:ok, 24}

iex> VintageNet.IP.subnet_mask_to_prefix_length({192, 168, 1, 1})
{:error, "{192, 168, 1, 1} is not a valid IPv4 subnet mask"}