Revision a802d8b1 mininet/net.py

View differences:

mininet/net.py
181 181
            self.nextCore = ( self.nextCore + 1 ) % self.numCores
182 182
        self.nextIP += 1
183 183
        defaults.update( params )
184
        # TODO: clean this up
185
        if params.get( 'isNAT', False ):
186
            print "***** &&&&&& !!!! nat nat nat"
187
            cls = NAT
188 184
        if not cls:
189 185
            cls = self.host
190 186
        h = cls( name, **defaults )
......
319 315
            host.cmd( 'ifconfig lo up' )
320 316
        info( '\n' )
321 317

  
322
    ''' TODO: remove this!
323
    def configGateway( self ):
324
        """Add gateway routes to all hosts if the networks has a gateway."""
325
        if self.gateway:
326
            gatewayIP = self.gateway.defaultIntf().IP()
327
            for host in self.hosts:
328
                if host.inNamespace and self.gateway:
329
                    host.cmd( 'ip route flush root 0/0' )
330
                    host.cmd( 'route add -net', self.ipBase, 'dev', host.defaultIntf() )
331
                    host.cmd( 'route add default gw', gatewayIP )
332
                else:
333
                    # Don't mess with hosts in the root namespace
334
                    pass
335
    '''
336

  
337 318
    def buildFromTopo( self, topo=None ):
338 319
        """Build mininet from a topology object
339 320
           At the end of this function, everything should be connected
......
392 373
            self.startTerms()
393 374
        if self.autoStaticArp:
394 375
            self.staticArp()
395
        # TODO: remove this
396
        #self.configGateway()
397 376
        self.built = True
398 377

  
399 378
    def startTerms( self ):

Also available in: Unified diff