From 74ef761529639078806bec69da6f8f7eaba978be Mon Sep 17 00:00:00 2001 From: Brandon Heller <brandonh@stanford.edu> Date: Wed, 6 Jan 2010 08:40:07 -0800 Subject: [PATCH] CLI: add interface dump command --- mininet/net.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/mininet/net.py b/mininet/net.py index a4a8b7bd..f9e8ea52 100755 --- a/mininet/net.py +++ b/mininet/net.py @@ -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') -- GitLab