Class: Pio::OpenFlow13::Match::Oxm::MatchField

Inherits:
BinData::Record show all
Defined in:
lib/pio/open_flow13/match.rb

Overview

OXM match field.

Instance Method Summary collapse

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

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



1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
# File 'lib/pio/open_flow13/match.rb', line 1198

def method_missing(method, *args, &block)
  case oxm_class
  when OpenFlowBasicValue::OXM_CLASS
    class_payload.tlv_value.__send__(method, *args, &block)
  when ExperimenterValue::OXM_CLASS
    class_payload.__send__(method, *args, &block)
  when PacketRegistersValue::OXM_CLASS
    class_payload.__send__(method, *args, &block)
  else
    raise NoMethodError, method.to_s
  end
end

Instance Method Details

#lengthObject



1194
1195
1196
# File 'lib/pio/open_flow13/match.rb', line 1194

def length
  class_payload.length + 2
end

#masked?Boolean

Returns:

  • (Boolean)


1186
1187
1188
# File 'lib/pio/open_flow13/match.rb', line 1186

def masked?
  class_payload.oxm_hasmask == 1
end

#oxm_fieldObject



1182
1183
1184
# File 'lib/pio/open_flow13/match.rb', line 1182

def oxm_field
  class_payload.oxm_field
end

#oxm_lengthObject



1190
1191
1192
# File 'lib/pio/open_flow13/match.rb', line 1190

def oxm_length
  class_payload.oxm_length
end