Add testcases for Openflow13 standard actions

This commit is contained in:
Eishun Kondoh 2019-03-18 22:22:37 +09:00
parent 2743bf3e0c
commit efae8016f2
4 changed files with 177 additions and 4 deletions

View file

@ -8,13 +8,15 @@ defmodule Openflow.Action.Output do
def ofpat, do: 0
def new(options \\ [])
def new(port) when not is_list(port) do
new(port_number: port)
end
def new(options) when is_list(options) do
port_no = Keyword.get(options, :port_number)
max_len = Keyword.get(options, :max_len, :no_buffer)
port_no = options[:port_number] || raise "port_number must be specified"
max_len = options[:max_len] || :no_buffer
%Output{port_number: port_no, max_len: max_len}
end