Class: SDN::Message::SetNodeLabel
- Inherits:
-
Message
- Object
- Message
- SDN::Message::SetNodeLabel
- Defined in:
- lib/sdn/message/set.rb
Overview
Command that writes a node's user-visible label.
Direct Known Subclasses
Constant Summary collapse
- MSG =
Protocol message number
0x55- MAX_LENGTH =
Maximum label length, in bytes
16
Instance Attribute Summary collapse
Instance Method Summary collapse
-
#initialize(dest = nil, label = "", **kwargs) ⇒ SetNodeLabel
constructor
Creates a node label write command.
-
#params ⇒ <Integer>
Returns the protocol-specific payload bytes for this message.
-
#parse(params) ⇒ void
Parses protocol-specific parameter bytes into this message instance.
Constructor Details
#initialize(dest = nil, label = "", **kwargs) ⇒ SetNodeLabel
Creates a node label write command.
412 413 414 415 416 |
# File 'lib/sdn/message/set.rb', line 412 def initialize(dest = nil, label = "", **kwargs) kwargs[:dest] ||= dest super(**kwargs) self.label = label end |
Instance Attribute Details
#label ⇒ String
405 406 407 |
# File 'lib/sdn/message/set.rb', line 405 def label @label end |
Instance Method Details
#params ⇒ <Integer>
Returns the protocol-specific payload bytes for this message.
424 425 426 |
# File 'lib/sdn/message/set.rb', line 424 def params from_string(label, self.class::MAX_LENGTH) end |
#parse(params) ⇒ void
This method returns an undefined value.
Parses protocol-specific parameter bytes into this message instance.
419 420 421 |
# File 'lib/sdn/message/set.rb', line 419 def parse(params) self.label = to_string(params) end |