vintage_net v0.8.0 VintageNet.PredictableInterfaceName View Source

Handles predictable interface names by subscribing to the property table and renaming matching interface names based on the configuration in application env

Link to this section Summary

Types

Configuration for mapping a hw_path to a user supplied ifname

Functions

Returns a specification to start this module under a supervisor.

Called before interface configuration. First checks if vintage_net is configured to use predictable interface names, if so checks the given ifname for "common" naming schemes.

Link to this section Types

Specs

hw_path_config() :: %{hw_path: Path.t(), ifname: VintageNet.ifname()}

Configuration for mapping a hw_path to a user supplied ifname

Specs

state() :: %{ifnames: [hw_path_config()]}

Link to this section Functions

Returns a specification to start this module under a supervisor.

See Supervisor.

Specs

precheck(VintageNet.ifname()) :: :ok | {:error, :not_predictable_interface_name}

Called before interface configuration. First checks if vintage_net is configured to use predictable interface names, if so checks the given ifname for "common" naming schemes.

Instead of a boolean this function returns :ok on success, and {:error, not_predictable_interface_name} on failure. This is done to allow usage in with chains.

Specs

start_link([hw_path_config()]) :: GenServer.on_start()