Class: Trema::HardwareSwitch
- Inherits:
-
Object
- Object
- Trema::HardwareSwitch
- Defined in:
- ruby/trema/hardware-switch.rb
Overview
Hardware switch that supports OpenFlow protocol.
Direct Known Subclasses
Instance Attribute Summary collapse
-
#name ⇒ String
readonly
The name of this switch.
Instance Method Summary collapse
-
#dpid_long ⇒ String
Returns datapath id in long format.
-
#dpid_short ⇒ String
Returns datapath id prefixed with “0x”.
-
#initialize(stanza) ⇒ HardwareSwitch
constructor
Creates a new HardwareSwitch from DSL::Switch.
Constructor Details
#initialize(stanza) ⇒ HardwareSwitch
Creates a new HardwareSwitch from DSL::Switch
46 47 48 49 50 51 |
# File 'ruby/trema/hardware-switch.rb', line 46 def initialize stanza stanza.validate @name = stanza.name @stanza = stanza OpenflowSwitch.add self end |
Instance Attribute Details
#name ⇒ String (readonly)
The name of this switch
35 36 37 |
# File 'ruby/trema/hardware-switch.rb', line 35 def name @name end |
Instance Method Details
#dpid_long ⇒ String
Returns datapath id in long format
62 63 64 |
# File 'ruby/trema/hardware-switch.rb', line 62 def dpid_long @stanza.fetch :dpid_long end |
#dpid_short ⇒ String
Returns datapath id prefixed with “0x”
75 76 77 |
# File 'ruby/trema/hardware-switch.rb', line 75 def dpid_short @stanza.fetch :dpid_short end |