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)

Constant Summary collapse

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

Instance Method Summary collapse

Instance Method Details

#getObject



16
17
18
# File 'lib/pio/open_flow13/packet_in.rb', line 16

def get
  REASONS.invert.fetch(reason)
end

#set(value) ⇒ Object



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

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