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

@ -3,7 +3,7 @@ defmodule Openflow.GroupMod do
version: 4,
xid: 0,
datapath_id: "",
aux_id: 0,
aux_id: 0,
command: :add,
type: :all,
group_id: 0,
@ -19,10 +19,7 @@ defmodule Openflow.GroupMod do
type = Keyword.get(options, :type, :all)
group_id = Keyword.get(options, :group_id, 0)
buckets = Keyword.get(options, :buckets, [])
%GroupMod{command: command,
type: type,
group_id: group_id,
buckets: buckets}
%GroupMod{command: command, type: type, group_id: group_id, buckets: buckets}
end
def read(<<command_int::16, type_int::8, _::8, group_id_int::32, buckets_bin::bytes>>) do
@ -30,16 +27,10 @@ defmodule Openflow.GroupMod do
type = Openflow.Utils.get_enum(type_int, :group_type)
group_id = Openflow.Utils.get_enum(group_id_int, :group_id)
buckets = Openflow.Bucket.read(buckets_bin)
%GroupMod{command: command,
type: type,
group_id: group_id,
buckets: buckets}
%GroupMod{command: command, type: type, group_id: group_id, buckets: buckets}
end
def to_binary(%GroupMod{command: command,
type: type,
group_id: group_id,
buckets: buckets}) do
def to_binary(%GroupMod{command: command, type: type, group_id: group_id, buckets: buckets}) do
command_int = Openflow.Utils.get_enum(command, :group_mod_command)
type_int = Openflow.Utils.get_enum(type, :group_type)
group_id_int = Openflow.Utils.get_enum(group_id, :group_id)