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
2db4268b
Commit
2db4268b
authored
13 years ago
by
Bob Lantz
Browse files
Options
Downloads
Patches
Plain Diff
Fix NOX controller so that mn --controller nox,pyswitch,... works.
parent
0dbfd3a6
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
bin/mn
+13
-7
13 additions, 7 deletions
bin/mn
mininet/node.py
+6
-4
6 additions, 4 deletions
mininet/node.py
with
19 additions
and
11 deletions
bin/mn
+
13
−
7
View file @
2db4268b
...
...
@@ -18,7 +18,7 @@ import time
from
mininet.clean
import
cleanup
from
mininet.cli
import
CLI
from
mininet.log
import
lg
,
LEVELS
,
info
from
mininet.log
import
lg
,
LEVELS
,
info
,
warn
from
mininet.net
import
Mininet
,
init
from
mininet.node
import
Host
,
CPULimitedHost
,
Controller
,
NOX
from
mininet.node
import
RemoteController
,
UserSwitch
,
OVSKernelSwitch
...
...
@@ -29,19 +29,25 @@ from mininet.util import makeNumeric, custom
def
customNode
(
constructors
,
argStr
):
"
Return custom Node constructor based on argStr
"
cname
,
n
o
args
,
kwargs
=
splitArgs
(
argStr
)
cname
,
n
ew
args
,
kwargs
=
splitArgs
(
argStr
)
constructor
=
constructors
.
get
(
cname
,
None
)
if
no
args
:
raise
Exception
(
"
please specify keyword arguments for
"
+
cname
)
#
if args:
#
raise Exception( "please specify keyword arguments for " + cname )
if
not
constructor
:
raise
Exception
(
"
error: %s is unknown - please specify one of %s
"
%
(
cname
,
constructors
.
keys
()
)
)
def
custom
(
*
args
,
**
params
):
def
custom
(
name
,
*
args
,
**
params
):
params
.
update
(
kwargs
)
# print 'CONSTRUCTOR', constructor, 'ARGS', args, 'PARAMS', params
return
constructor
(
*
args
,
**
params
)
if
not
newargs
:
return
constructor
(
name
,
*
args
,
**
params
)
if
args
:
warn
(
'
warning: %s replacing %s with %s
\n
'
,
constructor
,
args
,
newargs
)
return
constructor
(
name
,
*
newargs
,
**
params
)
return
custom
# built in topologies, created only when run
TOPODEF
=
'
minimal
'
TOPOS
=
{
'
minimal
'
:
lambda
:
SingleSwitchTopo
(
k
=
2
),
...
...
This diff is collapsed.
Click to expand it.
mininet/node.py
+
6
−
4
View file @
2db4268b
...
...
@@ -50,7 +50,7 @@
import
select
from
subprocess
import
Popen
,
PIPE
,
STDOUT
from
mininet.log
import
info
,
error
,
debug
from
mininet.log
import
info
,
error
,
warn
,
debug
from
mininet.util
import
quietRun
,
errRun
,
errFail
,
moveIntf
,
isShellBuiltin
from
mininet.util
import
numCores
from
mininet.moduledeps
import
moduleDeps
,
pathCheck
,
OVS_KMOD
,
OF_KMOD
,
TUN
...
...
@@ -864,13 +864,15 @@ def __init__( self, ip, prefixLen ):
class
NOX
(
Controller
):
"
Controller to run a NOX application.
"
def
__init__
(
self
,
name
,
noxArgs
=
[]
,
**
kwargs
):
def
__init__
(
self
,
name
,
*
noxArgs
,
**
kwargs
):
"""
Init.
name: name to give controller
noxArgs:
list of args, or single arg,
to pass to NOX
"""
noxArgs:
arguments (strings)
to pass to NOX
"""
if
not
noxArgs
:
warn
(
'
warning: no NOX modules specified;
'
'
running packetdump only
\n
'
)
noxArgs
=
[
'
packetdump
'
]
elif
type
(
noxArgs
)
!=
list
:
elif
type
(
noxArgs
)
not
in
(
list
,
tuple
)
:
noxArgs
=
[
noxArgs
]
if
'
NOX_CORE_DIR
'
not
in
os
.
environ
:
...
...
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