Openflow parser
This commit is contained in:
parent
70b0d8919e
commit
fc02a678de
338 changed files with 9081 additions and 0 deletions
20
lib/openflow/port_status.ex
Normal file
20
lib/openflow/port_status.ex
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
defmodule Openflow.PortStatus do
|
||||
defstruct(
|
||||
version: 4,
|
||||
xid: 0,
|
||||
datapath_id: "",
|
||||
aux_id: 0,
|
||||
reason: :add,
|
||||
port: nil
|
||||
)
|
||||
|
||||
alias __MODULE__
|
||||
|
||||
def ofp_type, do: 12
|
||||
|
||||
def read(<<reason_int::8, _pad::size(7)-unit(8), port_bin::64-bytes>>) do
|
||||
reason = Openflow.Enums.to_atom(reason_int, :port_reason)
|
||||
port = Openflow.Port.read(port_bin)
|
||||
%PortStatus{reason: reason, port: port}
|
||||
end
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue