Implement an Open_vSwitch configuration module

This commit is contained in:
Eishun Kondoh 2017-11-27 00:21:36 +09:00
parent 82b24f5411
commit ae00e7b76d
3 changed files with 169 additions and 1 deletions

22
lib/ovsdb.ex Normal file
View file

@ -0,0 +1,22 @@
defmodule OVSDB do
@moduledoc false
@behaviour :supervisor
def start_link do
:supervisor.start_link({:local, __MODULE__}, __MODULE__, [])
end
def init([]) do
child = OVSDB.OpenvSwitch
strategy = :simple_one_for_one
max_r = 1000
intensity = 3600
sup_flags = {strategy, max_r, intensity}
{:ok, {sup_flags, [{child, {child, :start_link, []}, :temporary, 1000, :worker, [child]}]}}
end
def start_child(server) do
:supervisor.start_child(__MODULE__, [server])
end
end