quality: Add testcases for table_mod, set_controller_id and resume message handlers
This commit is contained in:
parent
27cfce26b3
commit
db8aa3561b
4 changed files with 40 additions and 14 deletions
|
|
@ -14,15 +14,11 @@ defmodule Openflow.TableMod do
|
|||
|
||||
def new(options) when is_list(options) do
|
||||
%TableMod{
|
||||
xid: options[:xid] || 0,
|
||||
table_id: options[:table_id] || 0
|
||||
xid: Keyword.get(options, :xid, 0),
|
||||
table_id: Keyword.get(options, :table_id, 0)
|
||||
}
|
||||
end
|
||||
|
||||
def new(table_id) when is_integer(table_id) or is_atom(table_id) do
|
||||
%TableMod{table_id: table_id}
|
||||
end
|
||||
|
||||
def read(<<table_id_int::8, _::size(3)-unit(8), config::32>>) do
|
||||
table_id = Openflow.Utils.get_enum(table_id_int, :table_id)
|
||||
%TableMod{table_id: table_id, config: config}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue