Add support meter_id property in nx_controller2
This commit is contained in:
parent
135bf9cafb
commit
7295fa00c9
2 changed files with 15 additions and 2 deletions
BIN
bin/enum_gen
BIN
bin/enum_gen
Binary file not shown.
|
|
@ -4,7 +4,8 @@ defmodule Openflow.Action.NxController2 do
|
||||||
id: 0,
|
id: 0,
|
||||||
reason: :action,
|
reason: :action,
|
||||||
userdata: "",
|
userdata: "",
|
||||||
pause: false
|
pause: false,
|
||||||
|
meter_id: 0
|
||||||
)
|
)
|
||||||
|
|
||||||
@experimenter 0x00002320
|
@experimenter 0x00002320
|
||||||
|
|
@ -17,6 +18,9 @@ defmodule Openflow.Action.NxController2 do
|
||||||
@prop_reason 2
|
@prop_reason 2
|
||||||
@prop_userdata 3
|
@prop_userdata 3
|
||||||
@prop_pause 4
|
@prop_pause 4
|
||||||
|
@prop_meter_id 5
|
||||||
|
|
||||||
|
@nx_ctlr_no_meter 0
|
||||||
|
|
||||||
alias __MODULE__
|
alias __MODULE__
|
||||||
|
|
||||||
|
|
@ -26,7 +30,8 @@ defmodule Openflow.Action.NxController2 do
|
||||||
id: options[:id] || 0,
|
id: options[:id] || 0,
|
||||||
reason: options[:reason] || :action,
|
reason: options[:reason] || :action,
|
||||||
userdata: options[:userdata],
|
userdata: options[:userdata],
|
||||||
pause: options[:pause] || false
|
pause: options[:pause] || false,
|
||||||
|
meter_id: options[:meter_id] || @nx_ctlr_no_meter
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
@ -89,6 +94,10 @@ defmodule Openflow.Action.NxController2 do
|
||||||
prop_length = @prop_header_size + padding_length
|
prop_length = @prop_header_size + padding_length
|
||||||
<<@prop_pause::16, prop_length::16, 0::size(padding_length)-unit(8)>>
|
<<@prop_pause::16, prop_length::16, 0::size(padding_length)-unit(8)>>
|
||||||
|
|
||||||
|
prop == :meter_id and value != @nx_ctlr_no_meter ->
|
||||||
|
prop_length = @prop_header_size + 4
|
||||||
|
<<@prop_meter_id::16, prop_length::16, value::32>>
|
||||||
|
|
||||||
true ->
|
true ->
|
||||||
""
|
""
|
||||||
end
|
end
|
||||||
|
|
@ -135,6 +144,10 @@ defmodule Openflow.Action.NxController2 do
|
||||||
:pause ->
|
:pause ->
|
||||||
<<@prop_pause::16, _::16, 0::size(4)-unit(8), rest::bytes>> = bin
|
<<@prop_pause::16, _::16, 0::size(4)-unit(8), rest::bytes>> = bin
|
||||||
decode_prop(struct(ctl, %{pause: true}), rest)
|
decode_prop(struct(ctl, %{pause: true}), rest)
|
||||||
|
|
||||||
|
:meter_id ->
|
||||||
|
<<@prop_meter_id::16, _::16, meter_id::32, rest::bytes>> = bin
|
||||||
|
decode_prop(struct(ctl, %{meter_id: meter_id}), rest)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue