# `VintageNet.Interface.NameUtilities`
[🔗](https://github.com/nerves-networking/vintage_net/blob/v0.13.9/lib/vintage_net/interface/name_utilities.ex#L5)

Module for classifying network interfaces

# `get_instance`

```elixir
@spec get_instance(VintageNet.ifname()) :: non_neg_integer()
```

Extract a number out of an interface name

The result is the interface index for most interfaces seen
on Nerves (eth0, eth1, ...), and something quite imperfect when using predictable
interface naming (enp6s0, enp6s1).

This is currently used to order priorities when there are two
interfaces available of the same type that cannot be differentiated
by other means. It has the one property of being easy to explain.

# `to_type`

```elixir
@spec to_type(VintageNet.ifname()) :: VintageNet.interface_type()
```

Classify a network type based on its name

Examples

    iex> NameUtilities.to_type("eth0")
    :ethernet

    iex> NameUtilities.to_type("wlp5s0")
    :wifi

    iex> NameUtilities.to_type("wwan0")
    :mobile

---

*Consult [api-reference.md](api-reference.md) for complete listing*
