Class: Pio::PacketIn::Reason

Inherits:
BinData::Primitive
  • Object
show all
Defined in:
lib/pio/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 }

Instance Method Summary collapse

Instance Method Details

#getObject



18
19
20
# File 'lib/pio/packet_in.rb', line 18

def get
  REASONS.invert.fetch(reason)
end

#set(value) ⇒ Object



22
23
24
# File 'lib/pio/packet_in.rb', line 22

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