Sha256: b6ee9e3a0f3601bf49b659d62b7005a9fc61205066836c14e37a0ffac2485734

Contents?: true

Size: 752 Bytes

Versions: 5

Compression:

Stored size: 752 Bytes

Contents

require 'forwardable'

# Base module.
module Pio
  # Resubmit to the table_id
  class GotoTable
    # OpenFlow 1.3.4 OFPIT_GOTO_TABLE instruction format
    class Format < BinData::Record
      endian :big

      uint16 :instruction_type, value: 1
      uint16 :instruction_length, value: 8
      uint8 :table_id
      bit24 :padding
    end

    def self.read(raw_data)
      allocate.tap do |goto_table|
        goto_table.instance_variable_set :@format, Format.read(raw_data)
      end
    end

    extend Forwardable

    def_delegators :@format, :instruction_type
    def_delegators :@format, :instruction_length
    def_delegators :@format, :table_id

    def initialize(table_id)
      @format = Format.new(table_id: table_id)
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
pio-0.23.1 lib/pio/open_flow13/goto_table.rb
pio-0.23.0 lib/pio/open_flow13/goto_table.rb
pio-0.22.0 lib/pio/open_flow13/goto_table.rb
pio-0.21.1 lib/pio/open_flow13/goto_table.rb
pio-0.21.0 lib/pio/open_flow13/goto_table.rb