Added two spaces before in-line # comments.
This commit is contained in:
+3
-3
@@ -47,9 +47,9 @@ def connectToRootNS( network, switch, ip, prefixLen, routes ):
|
||||
|
||||
def sshd( network, cmd='/usr/sbin/sshd', opts='-D' ):
|
||||
"Start a network, connect it to root ns, and run sshd on all hosts."
|
||||
switch = network.switches[ 0 ] # switch to use
|
||||
ip = '10.123.123.1' # our IP address on host network
|
||||
routes = [ '10.0.0.0/8' ] # host networks to route to
|
||||
switch = network.switches[ 0 ] # switch to use
|
||||
ip = '10.123.123.1' # our IP address on host network
|
||||
routes = [ '10.0.0.0/8' ] # host networks to route to
|
||||
connectToRootNS( network, switch, ip, 8, routes )
|
||||
for host in network.hosts:
|
||||
host.cmd( cmd + ' ' + opts + '&' )
|
||||
|
||||
+1
-1
@@ -43,7 +43,7 @@ class CLI( Cmd ):
|
||||
def __init__( self, mininet ):
|
||||
self.mn = mininet
|
||||
self.nodelist = self.mn.controllers + self.mn.switches + self.mn.hosts
|
||||
self.nodemap = {} # map names to Node objects
|
||||
self.nodemap = {} # map names to Node objects
|
||||
for node in self.nodelist:
|
||||
self.nodemap[ node.name ] = node
|
||||
Cmd.__init__( self )
|
||||
|
||||
+2
-2
@@ -40,8 +40,8 @@ class StreamHandlerNoNewline( logging.StreamHandler ):
|
||||
traceback.printException and appended to the stream."""
|
||||
try:
|
||||
msg = self.format( record )
|
||||
fs = '%s' # was '%s\n'
|
||||
if not hasattr( types, 'UnicodeType' ): #if no unicode support...
|
||||
fs = '%s' # was '%s\n'
|
||||
if not hasattr( types, 'UnicodeType' ): # if no unicode support...
|
||||
self.stream.write( fs % msg )
|
||||
else:
|
||||
try:
|
||||
|
||||
+7
-7
@@ -97,7 +97,7 @@ from mininet.util import quietRun, fixLimits
|
||||
from mininet.util import createLink, macColonHex, ipStr, ipParse
|
||||
from mininet.xterm import cleanUpScreens, makeXterms
|
||||
|
||||
DATAPATHS = [ 'kernel' ] #[ 'user', 'kernel' ]
|
||||
DATAPATHS = [ 'kernel' ] # [ 'user', 'kernel' ]
|
||||
|
||||
def init():
|
||||
"Initialize Mininet."
|
||||
@@ -147,10 +147,10 @@ class Mininet( object ):
|
||||
self.hosts = []
|
||||
self.switches = []
|
||||
self.controllers = []
|
||||
self.nameToNode = {} # name to Node (Host/Switch) objects
|
||||
self.idToNode = {} # dpid to Node (Host/Switch) objects
|
||||
self.dps = 0 # number of created kernel datapaths
|
||||
self.terms = [] # list of spawned xterm processes
|
||||
self.nameToNode = {} # name to Node (Host/Switch) objects
|
||||
self.idToNode = {} # dpid to Node (Host/Switch) objects
|
||||
self.dps = 0 # number of created kernel datapaths
|
||||
self.terms = [] # list of spawned xterm processes
|
||||
|
||||
switch.setup()
|
||||
|
||||
@@ -188,7 +188,7 @@ class Mininet( object ):
|
||||
"""Add controller.
|
||||
controller: Controller class"""
|
||||
controller = self.controller( 'c0', self.inNamespace )
|
||||
if controller: # allow controller-less setups
|
||||
if controller: # allow controller-less setups
|
||||
self.controllers.append( controller )
|
||||
self.nameToNode[ 'c0' ] = controller
|
||||
|
||||
@@ -390,7 +390,7 @@ class Mininet( object ):
|
||||
if hosts is None:
|
||||
hosts = self.hosts
|
||||
poller = select.poll()
|
||||
Node = hosts[ 0 ] # so we can call class method fdToNode
|
||||
Node = hosts[ 0 ] # so we can call class method fdToNode
|
||||
for host in hosts:
|
||||
poller.register( host.stdout )
|
||||
while True:
|
||||
|
||||
+7
-7
@@ -56,8 +56,8 @@ class Node( object ):
|
||||
"""A virtual network node is simply a shell in a network namespace.
|
||||
We communicate with it using pipes."""
|
||||
|
||||
inToNode = {} # mapping of input fds to nodes
|
||||
outToNode = {} # mapping of output fds to nodes
|
||||
inToNode = {} # mapping of input fds to nodes
|
||||
outToNode = {} # mapping of output fds to nodes
|
||||
|
||||
def __init__( self, name, inNamespace=True,
|
||||
defaultMAC=None, defaultIP=None ):
|
||||
@@ -84,11 +84,11 @@ class Node( object ):
|
||||
self.outToNode[ self.stdout.fileno() ] = self
|
||||
self.inToNode[ self.stdin.fileno() ] = self
|
||||
self.pid = self.shell.pid
|
||||
self.intfs = {} # dict of port numbers to interface names
|
||||
self.ports = {} # dict of interface names to port numbers
|
||||
# replace with Port objects, eventually ?
|
||||
self.ips = {} # dict of interfaces to ip addresses as strings
|
||||
self.connection = {} # remote node connected to each interface
|
||||
self.intfs = {} # dict of port numbers to interface names
|
||||
self.ports = {} # dict of interface names to port numbers
|
||||
# replace with Port objects, eventually ?
|
||||
self.ips = {} # dict of interfaces to ip addresses as strings
|
||||
self.connection = {} # remote node connected to each interface
|
||||
self.execed = False
|
||||
self.defaultIP = defaultIP
|
||||
self.defaultMAC = defaultMAC
|
||||
|
||||
+1
-1
@@ -25,7 +25,7 @@ class TreeTopo( Topo ):
|
||||
for i in range( 0, fanout ):
|
||||
child = n + 1
|
||||
self.add_edge( me, child )
|
||||
n = self.addTree( child, depth-1, fanout )
|
||||
n = self.addTree( child, depth - 1, fanout )
|
||||
return n
|
||||
|
||||
# pylint: enable-msg=W0612
|
||||
|
||||
Reference in New Issue
Block a user