Revision 60d9ead6 bin/mn_run.py

View differences:

bin/mn_run.py
16 16
from mininet.logging_mod import lg, set_loglevel, LEVELS
17 17
from mininet.net import Mininet, init
18 18
from mininet.node import KernelSwitch, Host, Controller, ControllerParams, NOX
19
from mininet.node import RemoteController
19 20
from mininet.topo import SingleSwitchTopo, LinearTopo
20 21

  
21 22
# built in topologies, created only when run
......
46 47
CONTROLLERS = {'ref' : Controller,
47 48
               'nox_dump' : lambda a, b: NOX(a, b, 'packetdump'),
48 49
               'nox_pysw' : lambda a, b: NOX(a, b, 'pyswitch'),
50
               'remote' : lambda a, b: None,
49 51
               'none' :     lambda a, b: None}
50 52

  
51 53
# optional tests to run
......
106 108
        opts.add_option('--verbosity', '-v', type = 'choice',
107 109
                        choices = LEVELS.keys(), default = 'info',
108 110
                        help = '[' + ' '.join(LEVELS.keys()) + ']')
111
        opts.add_option('--ip', type = 'string',
112
                        help = '[ip address as a dotted decimal string for a'
113
                        'remote controller]')
114
        opts.add_option('--port', type = 'string',
115
                        help = '[port integer for a listening remote'
116
                        ' controller]')
109 117
        self.options = opts.parse_args()[0]
110 118

  
111 119
    def setup(self):
......
132 140
        switch = SWITCHES[self.options.switch]
133 141
        host = HOSTS[self.options.host]
134 142
        controller = CONTROLLERS[self.options.controller]
143
        if self.options.controller == 'remote':
144
            controller = lambda a, b: RemoteController(a, b,
145
                             ip_address = self.options.ip,
146
                             port = self.options.port)
135 147

  
136 148
        controller_params = ControllerParams(0x0a000000, 8) # 10.0.0.0/8
137 149
        xterms = self.options.xterms

Also available in: Unified diff