VintageNet.ToElixir.UdhcpcHandler behaviour (vintage_net v0.9.3) View Source

A behaviour for handling notifications from udhcpc

Example

defmodule MyApp.UdhcpcHandler do
  @behaviour VintageNet.ToElixir.UdhcpcHandler

  @impl VintageNet.ToElixir.UdhcpcHandler
  def deconfig(ifname, data) do
    ...
  end
end

To have VintageNet invoke it, add the following to your config.exs:

config :vintage_net, udhcpc_handler: MyApp.UdhcpcHandler

Link to this section Summary

Functions

Called internally by vintage_net to dispatch calls

Callbacks

Handle an assignment from the DHCP server

Deconfigure the specified interface

Handle a failure to get a lease

Handle a DHCP NAK

Handle the renewal of a DHCP lease

Link to this section Types

Specs

update_data() :: map()

Link to this section Functions

Link to this function

dispatch(function, ifname, update_data)

View Source

Specs

dispatch(atom(), VintageNet.ifname(), update_data()) :: :ok

Called internally by vintage_net to dispatch calls

Link to this section Callbacks

Link to this callback

bound(arg1, update_data)

View Source

Specs

bound(VintageNet.ifname(), update_data()) :: :ok

Handle an assignment from the DHCP server

Link to this callback

deconfig(arg1, update_data)

View Source

Specs

deconfig(VintageNet.ifname(), update_data()) :: :ok

Deconfigure the specified interface

Link to this callback

leasefail(arg1, update_data)

View Source

Specs

leasefail(VintageNet.ifname(), update_data()) :: :ok

Handle a failure to get a lease

Specs

nak(VintageNet.ifname(), update_data()) :: :ok

Handle a DHCP NAK

Link to this callback

renew(arg1, update_data)

View Source

Specs

renew(VintageNet.ifname(), update_data()) :: :ok

Handle the renewal of a DHCP lease