docs: Add documents for openflow actions

This commit is contained in:
Eishun Kondoh 2019-03-20 11:02:26 +09:00
parent 6136280b5e
commit 22e62d32ae
11 changed files with 214 additions and 9 deletions

View file

@ -1,18 +1,38 @@
defmodule Openflow.Action.CopyTtlOut do
@moduledoc """
Copy the TTL from outermost to next-to-outermost header with TTL.\\
Copy can be IP-to-IP, MPLS-to-MPLS, or MPLS-to-IP.
"""
defstruct([])
alias __MODULE__
@type t :: %CopyTtlOut{}
@spec ofpat() :: 11
def ofpat, do: 11
@doc """
Create a copy_ttl_out action structure
## Example
```elixir
iex> %CopyTtlOut{} = Openflow.Action.CopyTtlOut.new()
```
"""
@spec new() :: CopyTtlOut.t()
def new do
%CopyTtlOut{}
end
@spec to_binary(CopyTtlIn.t()) :: <<_::16, _::_*8>>
def to_binary(%CopyTtlOut{}) do
<<11::16, 8::16, 0::size(4)-unit(8)>>
end
@spec read(<<_::16, _::_*8>>) :: CopyTtlOut.t()
def read(<<11::16, 8::16, _::size(4)-unit(8)>>) do
%CopyTtlOut{}
end