Class: SetMplsTTLAction

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

Overview

Class to define an OpenFlow action to set the MPLS Time To Live (TTL)

Instance Attribute Summary

Attributes inherited from Action

#order

Instance Method Summary collapse

Constructor Details

#initialize(order: 0, mpls_ttl: nil) ⇒ SetMplsTTLAction

Parameters

  • order

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

  • mpls_ttl

    integer : The Time To Live to set in the MPLS header.

Raises:

  • (ArgumentError)


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

def initialize(order: 0, mpls_ttl: nil)
  super(order: order)
  raise ArgumentError, "MPLS TTL (mpls_ttl) required" unless mpls_ttl
  @mpls_ttl = mpls_ttl
end

Instance Method Details

#to_hashObject

:nodoc:



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

def to_hash #:nodoc:
  {:order => order, 'set-mpls-ttl-action' => {'mpls-ttl' => @mpls_ttl}}
end