Re-added TreeNet convenience function.

This commit is contained in:
Bob Lantz
2010-04-10 21:29:11 -07:00
parent 5fb3d5426c
commit cd7457480b
+6
View File
@@ -1,6 +1,7 @@
"Library of potentially useful topologies for Mininet" "Library of potentially useful topologies for Mininet"
from mininet.topo import Topo, Node from mininet.topo import Topo, Node
from mininet.net import Mininet
class TreeTopo( Topo ): class TreeTopo( Topo ):
"Topology for a tree network with a given depth and fanout." "Topology for a tree network with a given depth and fanout."
@@ -37,3 +38,8 @@ class TreeTopo( Topo ):
return num return num
# pylint: enable-msg=W0612 # pylint: enable-msg=W0612
def TreeNet( depth=1, fanout=2, **kwargs ):
"Convenience function for creating tree networks."
topo = TreeTopo( depth, fanout )
return Mininet( topo, **kwargs )