Sha256: 4891522d45594c1872044b8352102edd40f228a1443da5a89c2482141eda02f4

Contents?: true

Size: 761 Bytes

Versions: 8

Compression:

Stored size: 761 Bytes

Contents

require 'bindata'
require 'forwardable'

module Pio
  # Vendor defined action
  class VendorAction
    # OpenFlow 1.0 OFPAT_VENDOR action format.
    class Format < BinData::Record
      endian :big

      uint16 :action_type, value: 0xffff
      uint16 :action_length, value: 8
      uint32 :vendor
    end

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

    extend Forwardable

    def_delegators :@format, :action_type
    def_delegator :@format, :action_length, :length
    def_delegators :@format, :vendor
    def_delegator :@format, :to_binary_s, :to_binary

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

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
pio-0.30.0 lib/pio/open_flow10/vendor_action.rb
pio-0.29.0 lib/pio/open_flow10/vendor_action.rb
pio-0.28.1 lib/pio/open_flow10/vendor_action.rb
pio-0.28.0 lib/pio/open_flow10/vendor_action.rb
pio-0.27.2 lib/pio/open_flow10/vendor_action.rb
pio-0.27.1 lib/pio/open_flow10/vendor_action.rb
pio-0.27.0 lib/pio/open_flow10/vendor_action.rb
pio-0.26.0 lib/pio/open_flow10/vendor_action.rb