NX_RESUME parser and helpers

This commit is contained in:
Eishun Kondoh 2018-08-22 23:12:52 +09:00
parent cd72830a6e
commit c9df968706
14 changed files with 698 additions and 70 deletions

View file

@ -24,8 +24,8 @@ defmodule Openflow.Hello do
def supported_version?(%Hello{elements: elements}) do
elements
|> Enum.reduce([], fn({:versionbitmap, versions}, acc) -> acc ++ versions end)
|> Enum.any?(fn(version) -> version == 4 end)
|> Enum.reduce([], fn {:versionbitmap, versions}, acc -> acc ++ versions end)
|> Enum.any?(fn version -> version == 4 end)
end
def read(binary), do: %Hello{elements: decode([], binary)}