class Pio::OpenFlow13::Hello
Constants
- VERSION_BITMAP
Public Class Methods
new(user_options = {})
click to toggle source
Calls superclass method
Pio::OpenFlow::Message::new
# File lib/pio/open_flow13/hello.rb, line 72 def initialize(user_options = {}) body_options = { elements: [{ element_type: VERSION_BITMAP, element_length: 8, element_value: 0b10000 }] } super user_options.merge(body: body_options) end
Public Instance Methods
elements()
click to toggle source
# File lib/pio/open_flow13/hello.rb, line 49 def elements body.elements end
supported_versions()
click to toggle source
# File lib/pio/open_flow13/hello.rb, line 53 def supported_versions supported_versions_list.map do |each| "open_flow1#{each - 1}".to_sym end end
Private Instance Methods
supported_versions_list()
click to toggle source
# File lib/pio/open_flow13/hello.rb, line 61 def supported_versions_list (1..32).each_with_object([]) do |each, result| result << each if (version_bitmap >> each & 1) == 1 end end
version_bitmap()
click to toggle source
# File lib/pio/open_flow13/hello.rb, line 67 def version_bitmap bitmap = elements.detect(&:version_bitmap?) bitmap ? bitmap.element_value : 0 end