Formatted

This commit is contained in:
Eishun Kondoh 2018-01-30 22:47:31 +09:00
parent 5fc01a9bec
commit 7635272fbd
150 changed files with 5055 additions and 4032 deletions

View file

@ -5,15 +5,17 @@ defmodule Openflow.Multipart.Reply do
codec = Openflow.Enums.to_atom(type_int, :multipart_reply_codec)
flags = Openflow.Enums.int_to_flags(flags_int, :multipart_reply_flags)
reply = codec.read(reply_bin)
%{reply|flags: flags}
%{reply | flags: flags}
end
def to_binary(%{__struct__: codec, flags: flags} = msg) do
flags_int = Openflow.Enums.flags_to_int(flags, :multipart_reply_flags)
type_int = Openflow.Enums.to_int(codec, :multipart_reply_codec)
case codec.to_binary(msg) do
reply_bin when is_binary(reply_bin) ->
<<type_int::16, flags_int::16, 0::size(4)-unit(8), reply_bin::bytes>>
{:error, reason} ->
{:error, reason}
end