Class: PushVlanHeaderAction

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

Overview

Class to define an OpenFlow action to add a VLAN encapsulation.

Instance Attribute Summary

Attributes inherited from Action

#order

Instance Method Summary collapse

Constructor Details

#initialize(order: 0, eth_type: nil, tag: nil, pcp: nil, cfi: nil, vlan_id: nil) ⇒ PushVlanHeaderAction

Parameters

  • order

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

  • eth_type

    integer : The ethernet type of the packet.

  • tag

    integer : Tag protocol identifier.

  • pcp

    integer : Priority code point.

  • cfi

    integer : Drop eligible indicator (formerly cannonical format indicator).

  • vlan_id

    integer : VLAN identifier.



42
43
44
45
46
47
48
49
50
# File 'lib/openflowdev/actions/push_vlan_header_action.rb', line 42

def initialize(order: 0, eth_type: nil, tag: nil, pcp: nil, cfi: nil,
    vlan_id: nil)
  super(order: order)
  @eth_type = eth_type
  @tag = tag
  @pcp = pcp
  @cfi = cfi
  @vlan_id = vlan_id
end

Instance Method Details

#to_hashObject

:nodoc:



52
53
54
55
# File 'lib/openflowdev/actions/push_vlan_header_action.rb', line 52

def to_hash #:nodoc:
  {:order => @order, 'push-vlan-action' => {'ethernet-type' => @eth_type,
    :tag => @tag, :pcp => @pcp, :cfi => @cfi, 'vlan-id' => @vlan_id}}
end