Class: Pio::OpenFlow10::StatsType

Inherits:
BinData::Primitive
  • Object
show all
Defined in:
lib/pio/open_flow10/stats_type.rb

Overview

enum ofp_stats_types

Constant Summary collapse

STATS_TYPES =
{
  description: 0,
  flow: 1,
  aggregate: 2,
  table: 3,
  port: 4,
  queue: 5,
  vendor: 0xffff
}.freeze

Instance Method Summary collapse

Instance Method Details

#getObject



20
21
22
# File 'lib/pio/open_flow10/stats_type.rb', line 20

def get
  STATS_TYPES.invert.fetch(command)
end

#set(value) ⇒ Object



24
25
26
# File 'lib/pio/open_flow10/stats_type.rb', line 24

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