Fix to accept transaction_id to all message structs
This commit is contained in:
parent
bb74f3d8c4
commit
4803c61061
29 changed files with 118 additions and 34 deletions
|
|
@ -12,10 +12,17 @@ defmodule Openflow.Multipart.PortStats.Request do
|
|||
|
||||
def ofp_type, do: 18
|
||||
|
||||
def new(port_no \\ :any) do
|
||||
def new(port_no) when is_integer(port_no) or is_atom(port_no) do
|
||||
%Request{port_number: port_no}
|
||||
end
|
||||
|
||||
def new(options) when is_list(options) do
|
||||
%Request{
|
||||
xid: options[:xid] || 0,
|
||||
port_number: options[:port_no] || :any
|
||||
}
|
||||
end
|
||||
|
||||
def read(<<port_no_int::32, _::size(4)-unit(8)>>) do
|
||||
port_no = Openflow.Utils.get_enum(port_no_int, :openflow13_port_no)
|
||||
%Request{port_number: port_no}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue