Openflow parser

This commit is contained in:
Eishun Kondoh 2017-11-13 22:52:53 +09:00
parent 70b0d8919e
commit fc02a678de
338 changed files with 9081 additions and 0 deletions

View file

@ -0,0 +1,26 @@
defmodule Openflow.GetConfig.Reply do
defstruct(
version: 4,
xid: 0,
datapath_id: "",
aux_id: 0,
flags: [], # default = "normal" is no special handling
miss_send_len: 128
)
alias __MODULE__
def ofp_type, do: 8
def read(<<flags_int::16, miss_send_len0::16>>) do
flags = Openflow.Enums.int_to_flags(flags_int, :config_flags)
miss_send_len = Openflow.Utils.get_enum(miss_send_len0, :controller_max_len)
%Reply{flags: flags, miss_send_len: miss_send_len}
end
def to_binary(%Reply{flags: flags, miss_send_len: miss_send_len0}) do
flags_int = Openflow.Enums.flags_to_int(flags, :config_flags)
miss_send_len = Openflow.Utils.get_enum(miss_send_len0, :controller_max_len)
<<flags_int::16, miss_send_len::16>>
end
end