Openflow parser
This commit is contained in:
parent
70b0d8919e
commit
fc02a678de
338 changed files with 9081 additions and 0 deletions
19
lib/openflow/actions/set_nw_ttl.ex
Normal file
19
lib/openflow/actions/set_nw_ttl.ex
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
defmodule Openflow.Action.SetNwTtl do
|
||||
defstruct(ttl: 0)
|
||||
|
||||
alias __MODULE__
|
||||
|
||||
def ofpat, do: 23
|
||||
|
||||
def new(ttl) do
|
||||
%SetNwTtl{ttl: ttl}
|
||||
end
|
||||
|
||||
def to_binary(%SetNwTtl{ttl: ttl}) do
|
||||
<<23::16, 8::16, ttl::8, 0::size(3)-unit(8)>>
|
||||
end
|
||||
|
||||
def read(<<23::16, 8::16, ttl::8, _::size(3)-unit(8)>>) do
|
||||
%SetNwTtl{ttl: ttl}
|
||||
end
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue