Class: Trema::SetVlanPriority
- Inherits:
-
Action
- Object
- Action
- Trema::SetVlanPriority
- Defined in:
- ruby/trema/set-vlan-priority.rb
Overview
An action to modify the VLAN priority of a packet.
Instance Attribute Summary (collapse)
-
- (Fixnum) vlan_priority
readonly
The value of attribute #vlan_priority.
Instance Method Summary (collapse)
-
- (SetVlanPriority) initialize(vlan_priority)
constructor
Creates an action to modify the VLAN priority of a packet.
Constructor Details
- (SetVlanPriority) initialize(vlan_priority)
Creates an action to modify the VLAN priority of a packet. Priority bits can be used to prioritize different classes of traffic. Valid values are between 0 (lowest) and 7 (highest).
46 47 48 49 50 51 52 53 54 |
# File 'ruby/trema/set-vlan-priority.rb', line 46 def initialize vlan_priority unless vlan_priority.is_a?( Integer ) raise TypeError, "VLAN priority must be an unsigned 8-bit Integer" end unless ( vlan_priority >= 0 and vlan_priority <= 7 ) raise ArgumentError, "Valid VLAN priority values are 0 to 7 inclusive" end @vlan_priority = vlan_priority end |
Instance Attribute Details
- (Fixnum) vlan_priority (readonly)
The value of attribute #vlan_priority
28 29 30 |
# File 'ruby/trema/set-vlan-priority.rb', line 28 def vlan_priority @vlan_priority end |