Implement Openflow Protocol and Callback system

This commit is contained in:
Eishun Kondoh 2017-11-20 13:38:24 +09:00
parent fc02a678de
commit e52fe31b79
48 changed files with 937 additions and 244 deletions

View file

@ -11,10 +11,9 @@ defmodule Openflow.Action.NxController do
alias __MODULE__
def new(options) do
max_len = Keyword.get(options, :max_len, :no_buffer)
controller_id = Keyword.get(options, :id, 0)
reason = Keyword.get(options, :reason, :action)
%NxController{max_len: max_len, id: controller_id, reason: reason}
%NxController{max_len: options[:max_len] || :no_buffer,
id: options[:id] || 0,
reason: options[:reason] || :action}
end
def to_binary(%NxController{max_len: max_len, id: controller_id, reason: reason}) do