Sha256: 8d53276f02afa2904f7ed3aec13f64cfaf19236c34efecd26b323edda29825f8

Contents?: true

Size: 474 Bytes

Versions: 9

Compression:

Stored size: 474 Bytes

Contents

module Pio
  module OpenFlow10
    # enum ofp_stats_types
    class StatsType < BinData::Primitive
      STATS_TYPES = {
        description: 0,
        flow: 1,
        aggregate: 2,
        table: 3,
        port: 4,
        queue: 5,
        vendor: 0xffff
      }

      endian :big
      uint16 :command

      def get
        STATS_TYPES.invert.fetch(command)
      end

      def set(value)
        self.command = STATS_TYPES.fetch(value)
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

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