Class: Pio::OpenFlow13::Match

Inherits:
Pio::OpenFlow::FlowMatch show all
Defined in:
lib/pio/open_flow13/match.rb

Overview

OpenFlow eXtensible Match (OXM)

Defined Under Namespace

Classes: ArpOperation, ArpSenderHardwareAddress, ArpSenderProtocolAddress, ArpTargetHardwareAddress, ArpTargetProtocolAddress, DestinationMacAddress, EtherType, ExperimenterValue, Icmpv4Code, Icmpv4Type, InPort, IpDscp, IpEcn, IpProtocol, Ipv4DestinationAddress, Ipv4SourceAddress, Ipv6DestinationAddress, Ipv6SourceAddress, MaskedArpSenderHardwareAddress, MaskedArpSenderProtocolAddress, MaskedArpTargetHardwareAddress, MaskedArpTargetProtocolAddress, MaskedDestinationMacAddress, MaskedIpv4DestinationAddress, MaskedIpv4SourceAddress, MaskedIpv6DestinationAddress, MaskedIpv6SourceAddress, MaskedMetadata, MaskedPacketReg0, MaskedPacketReg1, MaskedPacketReg2, MaskedPacketReg3, MaskedReg0, MaskedReg1, MaskedReg2, MaskedReg3, MaskedReg4, MaskedReg5, MaskedReg6, MaskedReg7, MaskedSourceMacAddress, MaskedTunnelId, Metadata, NiciraMatchExtensionValue, OpenFlowBasicValue, Options, Oxm, PacketReg0, PacketReg1, PacketReg2, PacketReg3, PacketRegistersValue, Reg0, Reg1, Reg2, Reg3, Reg4, Reg5, Reg6, Reg7, SctpDestinationPort, SctpSourcePort, SourceMacAddress, TcpDestinationPort, TcpSourcePort, TunnelId, UdpDestinationPort, UdpSourcePort, VlanPcp, VlanVid

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(user_attrs = {}) ⇒ Match

Returns a new instance of Match.



1316
1317
1318
1319
1320
1321
1322
# File 'lib/pio/open_flow13/match.rb', line 1316

def initialize(user_attrs = {})
  @format = if user_attrs.empty?
              Oxm.new
            else
              Oxm.new(Options.new(user_attrs).to_hash)
            end
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(method, *args, &block) ⇒ Object



1328
1329
1330
# File 'lib/pio/open_flow13/match.rb', line 1328

def method_missing(method, *args, &block)
  @format.__send__ method, *args, &block
end

Class Method Details

.read(raw_data) ⇒ Object



1310
1311
1312
1313
1314
# File 'lib/pio/open_flow13/match.rb', line 1310

def self.read(raw_data)
  allocate.tap do |message|
    message.instance_variable_set(:@format, Oxm.read(raw_data))
  end
end

Instance Method Details

#lengthObject



1324
1325
1326
# File 'lib/pio/open_flow13/match.rb', line 1324

def length
  @format.to_binary_s.length
end