From 2a079911b5189e8507597200bbd1ef3cd714e455 Mon Sep 17 00:00:00 2001 From: Bob Lantz Date: Mon, 3 Jun 2013 17:10:12 -0700 Subject: [PATCH] Clarify controllers.py and add RemoteController --- examples/controllers.py | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/examples/controllers.py b/examples/controllers.py index c26f436..ac86429 100755 --- a/examples/controllers.py +++ b/examples/controllers.py @@ -6,13 +6,20 @@ different controllers, by creating a custom Switch() subclass. """ from mininet.net import Mininet -from mininet.node import OVSSwitch, Controller +from mininet.node import OVSSwitch, Controller, RemoteController from mininet.topolib import TreeTopo +from mininet.log import setLogLevel from mininet.cli import CLI +setLogLevel( 'info' ) + +# Two local and one "external" controller (which is actually c0) +# Ignore the warning message that the remote isn't (yet) running c0 = Controller( 'c0' ) -c1 = Controller( 'c1', ip='127.0.0.2' ) -cmap = { 's1': c0, 's2': c1, 's3': c1 } +c1 = Controller( 'c1' ) +c2 = RemoteController( 'c2', ip='127.0.0.1' ) + +cmap = { 's1': c0, 's2': c1, 's3': c2 } class MultiSwitch( OVSSwitch ): "Custom Switch() subclass that connects to different controllers"