Class: Pio::OpenFlow10::PacketIn
- Inherits:
-
Pio::OpenFlow::Message
- Object
- Pio::OpenFlow::Message
- Pio::OpenFlow10::PacketIn
- Defined in:
- lib/pio/open_flow10/packet_in.rb,
lib/pio/open_flow10/packet_in/reason.rb
Overview
OpenFlow 1.0 Packet-In message
Defined Under Namespace
Classes: Reason
Instance Attribute Summary collapse
-
#datapath_id ⇒ Object
(also: #dpid)
Returns the value of attribute datapath_id.
Attributes inherited from Pio::OpenFlow::Message
Class Method Summary collapse
-
.inspect ⇒ Object
rubocop:disable LineLength.
Instance Method Summary collapse
- #data ⇒ Object
-
#inspect ⇒ Object
rubocop:disable LineLength.
- #lldp? ⇒ Boolean
-
#method_missing(method, *args) ⇒ Object
rubocop:enable LineLength.
- #to_ruby ⇒ Object
Methods inherited from Pio::OpenFlow::Message
#initialize, method_missing, open_flow_header, read, #to_binary
Methods included from Pio::OpenFlow::Flags
#_define_flags, #_flags, #define_flags_32bit, #flags_16bit, #flags_32bit
Constructor Details
This class inherits a constructor from Pio::OpenFlow::Message
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(method, *args) ⇒ Object
rubocop:enable LineLength
51 52 53 54 |
# File 'lib/pio/open_flow10/packet_in.rb', line 51 def method_missing(method, *args) bindata_value = data.__send__(method, *args) bindata_value.try(:snapshot) || bindata_value end |
Instance Attribute Details
#datapath_id ⇒ Object Also known as: dpid
Returns the value of attribute datapath_id.
56 57 58 |
# File 'lib/pio/open_flow10/packet_in.rb', line 56 def datapath_id @datapath_id end |
Class Method Details
.inspect ⇒ Object
rubocop:disable LineLength
35 36 37 |
# File 'lib/pio/open_flow10/packet_in.rb', line 35 def self.inspect 'PacketIn(open_flow_version: uint8, message_type: uint8, message_length: uint16, transaction_id: uint32, buffer_id: uint32, total_length: uint16, in_port: uint16, reason: symbol, raw_data: string)' end |
Instance Method Details
#data ⇒ Object
22 23 24 |
# File 'lib/pio/open_flow10/packet_in.rb', line 22 def data @data ||= Pio::Parser.read(raw_data) end |
#inspect ⇒ Object
rubocop:disable LineLength
41 42 43 44 45 46 47 48 |
# File 'lib/pio/open_flow10/packet_in.rb', line 41 def inspect data_inspection = if raw_data.empty? %(raw_data: "") else %(data: #{data.inspect}) end %(#<PacketIn open_flow_version: #{version}, message_type: #{type}, message_length: #{_length}, transaction_id: #{Kernel.format('0x%x', transaction_id)}, buffer_id: #{Kernel.format('0x%x', buffer_id)}, total_length: #{total_length}, in_port: #{in_port}, reason: :#{reason}, #{data_inspection}>) end |
#lldp? ⇒ Boolean
26 27 28 |
# File 'lib/pio/open_flow10/packet_in.rb', line 26 def lldp? data.is_a? Lldp end |
#to_ruby ⇒ Object
30 31 32 |
# File 'lib/pio/open_flow10/packet_in.rb', line 30 def to_ruby @format.to_ruby end |