Class: Trema::SwitchManager

Inherits:
NetworkComponent show all
Includes:
Daemon
Defined in:
ruby/trema/switch-manager.rb

Overview

The controller class of switch_manager

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Daemon

#pid_file, #restart!, #run, #run!, #running?, #shutdown, #shutdown!

Methods inherited from NetworkComponent

[], add, clear, each, inherited, size

Constructor Details

#initialize(rule, port = nil) ⇒ SwitchManager

Creates a switch manager controller

Examples:

rule = { :port_status => "topology manager", :packet_in => "controller", :state_notify => "topology manager", :vendor => "controller" }
switch_manager = Trema::SwitchManager.new( rule )


68
69
70
71
72
73
# File 'ruby/trema/switch-manager.rb', line 68

def initialize rule, port = nil
  @rule = rule
  @port = port
  @no_flow_cleanup = false
  SwitchManager.add self
end

Instance Attribute Details

#no_flow_cleanupBool

Do not cleanup the flow table of switches on startup

Examples:

switch_manager.no_flow_cleanup = true

Returns:

  • (Bool)


56
57
58
# File 'ruby/trema/switch-manager.rb', line 56

def no_flow_cleanup
  @no_flow_cleanup
end

#ruleHash

Event forwarding rule

Examples:

switch_manager.rule => { :port_status => "topology manager", :packet_in => "controller", :state_notify => "topology manager" }

Returns:

  • (Hash)


45
46
47
# File 'ruby/trema/switch-manager.rb', line 45

def rule
  @rule
end

Instance Method Details

#nameString

Returns the name of switch manager

Examples:

switch_maanger.name => "switch manager"

Returns:



84
85
86
# File 'ruby/trema/switch-manager.rb', line 84

def name
  "switch manager"
end