Add OFP_ERROR codes that related to NX_RESUME
This commit is contained in:
parent
a3ec836e42
commit
2186642d58
5 changed files with 46 additions and 5 deletions
BIN
bin/enum_gen
BIN
bin/enum_gen
Binary file not shown.
|
|
@ -148,7 +148,15 @@ defmodule Openflow.EnumGen do
|
|||
is_slave: 10,
|
||||
bad_port: 11,
|
||||
bad_packet: 12,
|
||||
multipart_buffer_overflow: 13
|
||||
multipart_buffer_overflow: 13,
|
||||
nxm_invalid: 256,
|
||||
nxm_bad_type: 257,
|
||||
must_be_zero: 515,
|
||||
bad_reason: 516,
|
||||
flow_monitor_bad_event: 520,
|
||||
undecodable_error: 521,
|
||||
resume_not_supported: 533,
|
||||
resume_stale: 534
|
||||
],
|
||||
bad_action: [
|
||||
bad_type: 0,
|
||||
|
|
@ -166,7 +174,10 @@ defmodule Openflow.EnumGen do
|
|||
bad_tag: 12,
|
||||
bad_set_type: 13,
|
||||
bad_set_len: 14,
|
||||
bad_set_argument: 15
|
||||
bad_set_argument: 15,
|
||||
must_be_zero: 256,
|
||||
conntrack_not_supported: 265,
|
||||
bad_conjunction: 526
|
||||
],
|
||||
bad_instruction: [
|
||||
unknown_instruction: 0,
|
||||
|
|
|
|||
|
|
@ -727,6 +727,18 @@ defmodule Openflow.Enums do
|
|||
_class, _reason -> :multipart_buffer_overflow
|
||||
end
|
||||
|
||||
def to_int(:resume_not_supported, :bad_request) do
|
||||
bad_request_to_int(:resume_not_supported)
|
||||
catch
|
||||
_class, _reason -> :resume_not_supported
|
||||
end
|
||||
|
||||
def to_int(:resume_stale, :bad_request) do
|
||||
bad_request_to_int(:resume_stale)
|
||||
catch
|
||||
_class, _reason -> :resume_stale
|
||||
end
|
||||
|
||||
def to_int(_int, :bad_request) do
|
||||
throw(:bad_enum)
|
||||
end
|
||||
|
|
@ -5761,6 +5773,18 @@ defmodule Openflow.Enums do
|
|||
_class, _reason -> 13
|
||||
end
|
||||
|
||||
def to_atom(0x215, :bad_request) do
|
||||
bad_request_to_atom(0x215)
|
||||
catch
|
||||
_class, _reason -> 533
|
||||
end
|
||||
|
||||
def to_atom(0x216, :bad_request) do
|
||||
bad_request_to_atom(0x216)
|
||||
catch
|
||||
_class, _reason -> 534
|
||||
end
|
||||
|
||||
def to_atom(_, :bad_request) do
|
||||
throw(:bad_enum)
|
||||
end
|
||||
|
|
@ -10305,6 +10329,8 @@ defmodule Openflow.Enums do
|
|||
def bad_request_to_int(:bad_port), do: 0xB
|
||||
def bad_request_to_int(:bad_packet), do: 0xC
|
||||
def bad_request_to_int(:multipart_buffer_overflow), do: 0xD
|
||||
def bad_request_to_int(:resume_not_supported), do: 0x215
|
||||
def bad_request_to_int(:resume_stale), do: 0x216
|
||||
def bad_request_to_int(_), do: throw(:bad_enum)
|
||||
def bad_request_to_atom(0x0), do: :bad_version
|
||||
def bad_request_to_atom(0x1), do: :bad_type
|
||||
|
|
@ -10320,6 +10346,8 @@ defmodule Openflow.Enums do
|
|||
def bad_request_to_atom(0xB), do: :bad_port
|
||||
def bad_request_to_atom(0xC), do: :bad_packet
|
||||
def bad_request_to_atom(0xD), do: :multipart_buffer_overflow
|
||||
def bad_request_to_atom(0x215), do: :resume_not_supported
|
||||
def bad_request_to_atom(0x216), do: :resume_stale
|
||||
def bad_request_to_atom(_), do: throw(:bad_enum)
|
||||
def bad_action_to_int(:bad_type), do: 0x0
|
||||
def bad_action_to_int(:bad_len), do: 0x1
|
||||
|
|
@ -12669,7 +12697,9 @@ defmodule Openflow.Enums do
|
|||
is_slave: 10,
|
||||
bad_port: 11,
|
||||
bad_packet: 12,
|
||||
multipart_buffer_overflow: 13
|
||||
multipart_buffer_overflow: 13,
|
||||
resume_not_supported: 533,
|
||||
resume_stale: 534
|
||||
]
|
||||
|
||||
defp enum_of(:bad_action),
|
||||
|
|
|
|||
|
|
@ -192,7 +192,7 @@ defmodule Openflow.NxResume do
|
|||
[:continuation_bridge | rest]
|
||||
)
|
||||
when not is_nil(br) do
|
||||
length = byte_size(br) + @prop_header_length
|
||||
length = byte_size(br) + @prop_header_length
|
||||
pad_length = Openflow.Utils.pad_length(length, 8)
|
||||
br_bin = <<br::16-bytes, 0::size(pad_length)-unit(8)>>
|
||||
binary = <<@nxcpt_bridge::16, length::16, br_bin::bytes, acc::bytes>>
|
||||
|
|
|
|||
|
|
@ -153,7 +153,7 @@ defmodule Tres.MessageHelper do
|
|||
send_message(meter_mod, datapath_id, options[:blocking] || false)
|
||||
end
|
||||
|
||||
defp send_resume(datapath_id, options) do
|
||||
defp send_nx_resume(datapath_id, options) do
|
||||
resume = Openflow.NxResume.new(options)
|
||||
send_message(resume, datapath_id, options[:blocking] || false)
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue