Class: Pio::OpenFlow13::NiciraSendOutPort

Inherits:
Pio::OpenFlow::Action show all
Defined in:
lib/pio/open_flow13/nicira_send_out_port.rb

Overview

NXAST_OUTPUT_REG action

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Pio::OpenFlow::Action

action_header, inherited, method_missing, read, #to_binary

Constructor Details

#initialize(source) ⇒ NiciraSendOutPort

rubocop:disable AbcSize rubocop:disable LineLength



20
21
22
23
24
25
# File 'lib/pio/open_flow13/nicira_send_out_port.rb', line 20

def initialize(source)
  @source = source
  oxm_klass = Match.const_get(source.to_s.split('_').map(&:capitalize).join)
  super(n_bits_internal: oxm_klass.new.length * 8 - 1,
        source_internal: ((oxm_klass.superclass.const_get(:OXM_CLASS) << 16) | (oxm_klass.const_get(:OXM_FIELD) << 9) | oxm_klass.new.length))
end

Instance Attribute Details

#sourceObject (readonly)

Returns the value of attribute source.



16
17
18
# File 'lib/pio/open_flow13/nicira_send_out_port.rb', line 16

def source
  @source
end

Instance Method Details

#n_bitsObject



33
34
35
# File 'lib/pio/open_flow13/nicira_send_out_port.rb', line 33

def n_bits
  n_bits_internal + 1
end

#offsetObject

rubocop:enable AbcSize rubocop:enable LineLength



29
30
31
# File 'lib/pio/open_flow13/nicira_send_out_port.rb', line 29

def offset
  offset_internal
end