View Source VintageNet.Interface.RawConfig (vintage_net v0.13.3)

Raw configuration for an interface

This struct contains the low-level instructions for how to configure and deconfigure an interface.

Fields:

  • :ifname - the name of the interface (e.g., "eth0")
  • :type - the type of network interface (aka the module that created the config)
  • :source_config - the configuration that generated this one
  • :required_ifnames - a list of ifnames that need to exist before starting this configuration. (e.g. ["eth0"])
  • :retry_millis - if bringing the interface up fails, wait this amount of time before retrying
  • :files - a list of file path, content tuples
  • :restart_strategy - the restart strategy for the list of child_specs. I.e., :one_for_one | :one_for_all | :rest_for_one

  • :child_specs - a set of child_specs for GenServers to start up and supervise
  • :up_cmd_millis - the maximum amount of time to allow the up command list to take
  • :up_cmds - a list of commands to run to configure the interface
  • :down_cmd_millis - the maximum amount of time to allow the down command list to take
  • :down_cmds - a list of commands to run to bring the interface down
  • :cleanup_files - additional files to delete (the files listed in files are deleted too)

Link to this section Summary

Types

A command to run for RawConfig.up_cmds or RawConfig.down_cmds

t()

Link to this section Types

@type command() ::
  {:run, String.t(), [String.t()]}
  | {:run_ignore_errors, String.t(), [String.t()]}
  | {:fun, (-> :ok | {:error, any()})}
  | {:fun, module(), atom(), list()}

A command to run for RawConfig.up_cmds or RawConfig.down_cmds

@type file_contents() :: {Path.t(), String.t()}
@type t() :: %VintageNet.Interface.RawConfig{
  child_specs: [Supervisor.child_spec() | {module(), term()} | module()],
  cleanup_files: [Path.t()],
  down_cmd_millis: non_neg_integer(),
  down_cmds: [command()],
  files: [file_contents()],
  ifname: VintageNet.ifname(),
  required_ifnames: [VintageNet.ifname()],
  restart_strategy: Supervisor.strategy(),
  retry_millis: non_neg_integer(),
  source_config: map(),
  type: atom(),
  up_cmd_millis: non_neg_integer(),
  up_cmds: [command()]
}