Sha256: 4e04687890bec9be361dc8602e94d38da55992e177079b0a0ff8507d8e5c1379

Contents?: true

Size: 506 Bytes

Versions: 12

Compression:

Stored size: 506 Bytes

Contents

require 'pio/open_flow10/set_vlan'

module Pio
  # An action to modify the VLAN priority of a packet.
  class SetVlanPriority < SetVlan
    def_format :vlan_priority, 2

    def initialize(number)
      priority = number.to_i
      if priority < 0 || priority > 7
        fail ArgumentError, 'VLAN priority must be between 0 and 7 inclusive'
      end
      @format = Format.new(vlan_priority: priority)
    rescue NoMethodError
      raise TypeError, 'VLAN priority must be an Integer.'
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
pio-0.27.2 lib/pio/open_flow10/set_vlan_priority.rb
pio-0.27.1 lib/pio/open_flow10/set_vlan_priority.rb
pio-0.27.0 lib/pio/open_flow10/set_vlan_priority.rb
pio-0.26.0 lib/pio/open_flow10/set_vlan_priority.rb
pio-0.25.0 lib/pio/open_flow10/set_vlan_priority.rb
pio-0.24.2 lib/pio/open_flow10/set_vlan_priority.rb
pio-0.24.1 lib/pio/open_flow10/set_vlan_priority.rb
pio-0.24.0 lib/pio/open_flow10/set_vlan_priority.rb
pio-0.23.1 lib/pio/open_flow10/set_vlan_priority.rb
pio-0.23.0 lib/pio/open_flow10/set_vlan_priority.rb
pio-0.22.0 lib/pio/open_flow10/set_vlan_priority.rb
pio-0.21.1 lib/pio/open_flow10/set_vlan_priority.rb