defmodule Openflow.TableMod do defstruct( version: 4, xid: 0, datapath_id: "", aux_id: 0, table_id: 0, config: 0 ) alias __MODULE__ def ofp_type, do: 17 def new(options) when is_list(options) do %TableMod{ xid: Keyword.get(options, :xid, 0), table_id: Keyword.get(options, :table_id, 0) } end def read(<>) do table_id = Openflow.Utils.get_enum(table_id_int, :table_id) %TableMod{table_id: table_id, config: config} end def to_binary(%TableMod{table_id: table_id, config: config}) do table_id_int = Openflow.Utils.get_enum(table_id, :table_id) <> end end