quality: Add test case for nx_set_packet_in_format message

This commit is contained in:
Eishun Kondoh 2019-05-06 03:10:57 +09:00
parent ad1a441239
commit 1f5d3cbab2
4 changed files with 33 additions and 214 deletions

View file

@ -14,8 +14,15 @@ defmodule Openflow.NxSetPacketInFormat do
def ofp_type, do: 4
def new(format \\ :standard) do
%NxSetPacketInFormat{format: format}
def new(format) when is_atom(format) do
new(format: format)
end
def new(options) when is_list(options) do
%NxSetPacketInFormat{
format: options[:format] || :standard,
xid: options[:xid] || 0
}
end
def read(<<@experimenter::32, @nx_type::32, format_int::32>>) do