quality: Add test cases for group_desc and group_features messages

This commit is contained in:
Eishun Kondoh 2019-05-05 22:56:16 +09:00
parent 87ff193b63
commit b5d0a5654a
9 changed files with 1073 additions and 463 deletions

View file

@ -4,22 +4,28 @@ defmodule Openflow.Multipart.GroupFeatures.Request do
xid: 0,
# virtual field
datapath_id: nil,
aux_id: nil,
flags: []
)
alias __MODULE__
@type t :: %Request{
version: 4,
datapath_id: String.t(),
aux_id: 0..0xFF | nil,
xid: 0..0xFFFFFFFF
}
@spec ofp_type() :: 18
def ofp_type, do: 18
def new(xid \\ 0) do
%Request{xid: xid}
end
@spec new(xid :: 0..0xFFFFFFFF) :: t()
def new(xid \\ 0), do: %Request{xid: xid}
def read("") do
%Request{}
end
@spec read(<<>>) :: t()
def read(""), do: %Request{}
def to_binary(%Request{} = msg) do
Openflow.Multipart.Request.header(msg)
end
@spec to_binary(t()) :: binary()
def to_binary(%Request{} = msg), do: Openflow.Multipart.Request.header(msg)
end