View Source MNDP.Options (mndp v0.1.1)

MNDP options

MNDP is usually configured in a project's application environment (config.ex). If you don't set any configuration, this is the default:

config :mndp,
  identity: :hostname,
  interval: :timer.seconds(30),
  ttl: :timer.minutes(1),
  port: 5678,
  excluded_ifnames: ["lo0", "lo", "bridge0", "ppp0", "wwan0", "__unknown"],
  if_monitor: MNDP.VintageNetMonitor #if vintage_net is available, will fall back to `MNDP.InetMonitor`

The configurable keys are:

  • :identity - A name set in the discovery packet. Per default this is set to :hostname
  • :ttl - The default MNDP record time-to-live for discovered devices. The default of 60 seconds is probably fine for most use.
  • :excluded_ifnames - A list of network interfaces names to ignore. By default, MNDP will ignore loopback and cellular network interfaces.
  • :if_monitor - Set to MNDP.VintageNetMonitor when using Nerves or MNDP.InetMonitor elsewhere. The default is MNDP.VintageNetMonitor.

Some options are modifiable at runtime. Functions for modifying these are in the MNDP module.