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,19 @@
defmodule Openflow.Action.PushMpls do
defstruct(ethertype: 0x8847)
alias __MODULE__
def ofpat, do: 19
def new(ethertype) do
%PushMpls{ethertype: ethertype}
end
def to_binary(%PushMpls{ethertype: ethertype}) do
<<19::16, 8::16, ethertype::16, 0::size(2)-unit(8)>>
end
def read(<<19::16, 8::16, ethertype::16, 0::size(2)-unit(8)>>) do
%PushMpls{ethertype: ethertype}
end
end