VintageNet.Interface.NameUtilities (vintage_net v0.11.3) View Source
Module for classifying network interfaces
Link to this section Summary
Link to this section Functions
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.
Classify a network type based on its name
iex> NameUtilities.to_type("eth0") :ethernet iex> NameUtilities.to_type("wlp5s0") :wifi iex> NameUtilities.to_type("wwan0") :mobile