Revision 9c4b7343
mininet/topo.py | ||
---|---|---|
255 | 255 |
switch = self.addSwitch('s%s' % i) |
256 | 256 |
# Add hosts to switch |
257 | 257 |
for j in irange(1, n): |
258 |
hostNum = (i-1)*n + j |
|
259 |
host = self.addHost('h%s' % hostNum) |
|
260 |
self.addLink(host, switch) |
|
258 |
hostNum = (i-1)*n + j
|
|
259 |
host = self.addHost('h%s' % hostNum)
|
|
260 |
self.addLink(host, switch)
|
|
261 | 261 |
# Connect switch to previous |
262 | 262 |
if lastSwitch: |
263 | 263 |
self.addLink(switch, lastSwitch) |
Also available in: Unified diff