Skip to content
Snippets Groups Projects
Commit 74ef7615 authored by Brandon Heller's avatar Brandon Heller
Browse files

CLI: add interface dump command

parent ee007363
No related branches found
No related tags found
No related merge requests found
......@@ -522,7 +522,7 @@ def interact(self):
class MininetCLI(object):
'''Simple command-line interface to talk to nodes.'''
cmds = ['?', 'help', 'nodes', 'net', 'sh', 'ping_all', 'exit', \
'ping_pair', 'iperf', 'iperf_udp']
'ping_pair', 'iperf', 'iperf_udp', 'intfs']
def __init__(self, mininet):
self.mn = mininet
......@@ -561,7 +561,7 @@ def nodes(self, args):
' '.join([node.name for node in sorted(self.nodelist)]))
def net(self, args):
'''List network connection.'''
'''List network connections.'''
for switch_dpid in self.mn.topo.switches():
switch = self.mn.nodes[switch_dpid]
lg.info('%s <->', switch.name)
......@@ -591,6 +591,11 @@ def iperf_udp(self, args):
udp_bw = args[0] if len(args) else '10M'
self.mn.iperf_udp(udp_bw)
def intfs(self, args):
'''List interfaces.'''
for dpid, node in self.mn.nodes.iteritems():
lg.info('%s: %s\n' % (node.name, ' '.join(node.intfs)))
def run(self):
'''Read and execute commands.'''
lg.warn('*** Starting CLI:\n')
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment