Class: Pio::OpenFlow13::PacketIn::Reason

Inherits:
BinData::Primitive
  • Object
show all
Defined in:
lib/pio/open_flow13/packet_in.rb

Overview

Why is this packet being sent to the controller? (enum ofp_packet_in_reason) rubocop:disable LineLength

Constant Summary collapse

REASONS =
{ no_match: 0, action: 1, invalid_ttl: 2 }.freeze

Instance Method Summary collapse

Instance Method Details

#getObject



20
21
22
# File 'lib/pio/open_flow13/packet_in.rb', line 20

def get
  REASONS.invert.fetch(reason)
end

#set(value) ⇒ Object



24
25
26
# File 'lib/pio/open_flow13/packet_in.rb', line 24

def set(value)
  self.reason = REASONS.fetch(value)
end