Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
mininet
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Olaf Bergmann
mininet
Commits
9da63d4e
Commit
9da63d4e
authored
14 years ago
by
Brandon Heller
Browse files
Options
Downloads
Patches
Plain Diff
Add dpctl command, which runs on all switches
parent
0a9358c9
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
mininet/cli.py
+14
-0
14 additions, 0 deletions
mininet/cli.py
with
14 additions
and
0 deletions
mininet/cli.py
+
14
−
0
View file @
9da63d4e
...
...
@@ -272,6 +272,20 @@ def do_source( self, line ):
error
(
'
error reading file %s
\n
'
%
args
[
0
]
)
self
.
inputFile
=
None
def
do_dpctl
(
self
,
line
):
"
Run dpctl command on all switches.
"
args
=
line
.
split
()
if
len
(
args
)
==
0
:
error
(
'
usage: dpctl command [arg1] [arg2] ...
\n
'
)
return
if
not
self
.
mn
.
listenPort
:
error
(
"
can
'
t run dpctl w/no passive listening port
\n
"
)
return
for
sw
in
self
.
mn
.
switches
:
output
(
'
***
'
+
sw
.
name
+
'
'
+
(
'
-
'
*
72
)
+
'
\n
'
)
output
(
sw
.
cmd
(
'
dpctl
'
+
'
'
.
join
(
args
)
+
'
tcp:127.0.0.1:%i
'
%
sw
.
listenPort
)
)
def
default
(
self
,
line
):
"""
Called on an input line when the command prefix is not recognized.
Overridden to run shell commands when a node is the first CLI argument.
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment