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
2f40c856
Commit
2f40c856
authored
14 years ago
by
Bob Lantz
Browse files
Options
Downloads
Patches
Plain Diff
Added additional sanity checks for when OF/OVS isn't installed.
parent
ab312967
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/node.py
+8
-4
8 additions, 4 deletions
mininet/node.py
with
8 additions
and
4 deletions
mininet/node.py
+
8
−
4
View file @
2f40c856
...
...
@@ -50,7 +50,7 @@
from
mininet.log
import
info
,
error
,
debug
from
mininet.util
import
quietRun
,
makeIntfPair
,
moveIntf
,
isShellBuiltin
from
mininet.moduledeps
import
moduleDeps
,
OVS_KMOD
,
OF_KMOD
,
TUN
from
mininet.moduledeps
import
moduleDeps
,
pathCheck
,
OVS_KMOD
,
OF_KMOD
,
TUN
SWITCH_PORT_BASE
=
1
# For OF > 0.9, switch ports start at 1 rather than zero
...
...
@@ -455,11 +455,12 @@ def __init__( self, name, **kwargs ):
"""
Init.
name: name for the switch
"""
Switch
.
__init__
(
self
,
name
,
**
kwargs
)
pathCheck
(
'
ofdatapath
'
,
'
ofprotocol
'
)
@staticmethod
def
setup
():
"
Ensure any dependencies are loaded; if not, try to load them.
"
moduleDeps
(
add
=
TUN
)
moduleDeps
(
add
=
TUN
)
def
start
(
self
,
controllers
):
"""
Start OpenFlow reference user datapath.
...
...
@@ -511,6 +512,7 @@ def __init__( self, name, dp=None, **kwargs ):
def
setup
():
"
Ensure any dependencies are loaded; if not, try to load them.
"
moduleDeps
(
subtract
=
OVS_KMOD
,
add
=
OF_KMOD
)
pathCheck
(
'
ofprotocol
'
)
def
start
(
self
,
controllers
):
"
Start up reference kernel datapath.
"
...
...
@@ -523,7 +525,7 @@ def start( self, controllers ):
if
self
.
defaultMAC
:
self
.
cmd
(
'
ifconfig
'
,
self
.
intf
,
'
hw
'
,
'
ether
'
,
self
.
defaultMAC
)
ports
=
sorted
(
self
.
ports
.
values
()
)
if
len
(
ports
)
!=
ports
[
-
1
]
+
1
:
if
len
(
ports
)
!=
ports
[
-
1
]
+
1
-
self
.
portBase
:
raise
Exception
(
'
only contiguous, zero-indexed port ranges
'
'
supported: %s
'
%
ports
)
intfs
=
[
self
.
intfs
[
port
]
for
port
in
ports
]
...
...
@@ -564,6 +566,7 @@ def __init__( self, name, dp=None, **kwargs ):
def
setup
():
"
Ensure any dependencies are loaded; if not, try to load them.
"
moduleDeps
(
subtract
=
OF_KMOD
,
add
=
OVS_KMOD
)
pathCheck
(
'
ovs-dpctl
'
,
'
ovs-openflowd
'
)
def
start
(
self
,
controllers
):
"
Start up kernel datapath.
"
...
...
@@ -580,7 +583,7 @@ def start( self, controllers ):
mac_str
=
'
--datapath-id=0000
'
+
\
''
.
join
(
self
.
defaultMAC
.
split
(
'
:
'
)
)
+
'
'
ports
=
sorted
(
self
.
ports
.
values
()
)
if
len
(
ports
)
!=
ports
[
-
1
]:
if
len
(
ports
)
!=
ports
[
-
1
]
+
1
-
self
.
portBase
:
raise
Exception
(
'
only contiguous, one-indexed port ranges
'
'
supported: %s
'
%
self
.
intfs
)
intfs
=
[
self
.
intfs
[
port
]
for
port
in
ports
]
...
...
@@ -617,6 +620,7 @@ def __init__( self, name, inNamespace=False, controller='controller',
def
start
(
self
):
"""
Start <controller> <args> on controller.
Log to /tmp/cN.log
"""
pathCheck
(
self
.
controller
)
cout
=
'
/tmp/
'
+
self
.
name
+
'
.log
'
if
self
.
cdir
is
not
None
:
self
.
cmd
(
'
cd
'
+
self
.
cdir
)
...
...
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