Class: PopMplsHeaderAction

Inherits:
Action
  • Object
show all
Defined in:
lib/openflowdev/actions/pop_mpls_header_action.rb

Overview

Class that defines an OpenFlow Pop MPLS action ( remove the tunnel encapsulation )

Instance Attribute Summary

Attributes inherited from Action

#order

Instance Method Summary collapse

Constructor Details

#initialize(order: 0, eth_type: nil) ⇒ PopMplsHeaderAction

Parameters

  • order

    integer : The order of the action relative to other actions in Instruction.

  • eth_type

    integer : The ethernet type of the packet.

Raises:

  • (ArgumentError)


37
38
39
40
41
# File 'lib/openflowdev/actions/pop_mpls_header_action.rb', line 37

def initialize(order: 0, eth_type: nil)
  super(order: order)
  raise ArgumentError, 'Ethernet Type (eth_type) required' unless eth_type
  @eth_type = eth_type
end

Instance Method Details

#to_hashObject

:nodoc:



43
44
45
# File 'lib/openflowdev/actions/pop_mpls_header_action.rb', line 43

def to_hash #:nodoc:
  {:order => @order, 'pop-mpls-action' => {'ethernet-type' => @eth_type}}
end