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
271013e0
Commit
271013e0
authored
14 years ago
by
Bob Lantz
Browse files
Options
Downloads
Patches
Plain Diff
Minor cleanup.
parent
6c5cc2bf
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
+10
-11
10 additions, 11 deletions
mininet/node.py
with
10 additions
and
11 deletions
mininet/node.py
+
10
−
11
View file @
271013e0
...
...
@@ -383,12 +383,9 @@ def intfIsUp( self, intf ):
# Other methods
def
__str__
(
self
):
result
=
self
.
name
+
'
:
'
result
+=
'
IP=
'
+
str
(
self
.
IP
()
)
result
+=
'
intfs=
'
+
'
,
'
.
join
(
sorted
(
self
.
intfs
.
values
()
)
)
result
+=
'
waiting=
'
+
str
(
self
.
waiting
)
result
+=
'
pid=
'
+
str
(
self
.
pid
)
return
result
intfs
=
sorted
(
self
.
intfs
.
values
()
)
return
'
%s: IP=%s intfs=%s pid=%s
'
%
(
self
.
name
,
self
.
IP
(),
'
,
'
.
join
(
intfs
),
self
.
pid
)
class
Host
(
Node
):
...
...
@@ -490,10 +487,11 @@ def start( self, controllers ):
self
.
cmd
(
'
dpctl adddp
'
+
self
.
dp
)
if
self
.
defaultMAC
:
self
.
cmd
(
'
ifconfig
'
,
self
.
intf
,
'
hw
'
,
'
ether
'
,
self
.
defaultMAC
)
if
len
(
self
.
intfs
)
!=
max
(
self
.
intfs
)
+
1
:
ports
=
sorted
(
self
.
ports
.
values
()
)
if
len
(
ports
)
!=
ports
[
-
1
]
+
1
:
raise
Exception
(
'
only contiguous, zero-indexed port ranges
'
'
supported: %s
'
%
self
.
intf
s
)
intfs
=
[
self
.
intfs
[
port
]
for
port
in
s
ort
ed
(
self
.
intfs
.
keys
()
)
]
'
supported: %s
'
%
port
s
)
intfs
=
[
self
.
intfs
[
port
]
for
port
in
p
ort
s
]
self
.
cmd
(
'
dpctl
'
,
'
addif
'
,
self
.
dp
,
'
'
.
join
(
intfs
)
)
# Run protocol daemon
controller
=
controllers
[
0
]
...
...
@@ -543,10 +541,11 @@ def start( self, controllers ):
if
self
.
defaultMAC
:
mac
=
self
.
defaultMAC
self
.
cmd
(
'
ifconfig
'
,
self
.
intf
,
'
hw
'
,
'
ether
'
,
mac
)
if
len
(
self
.
intfs
)
!=
max
(
self
.
intfs
)
+
1
:
ports
=
sorted
(
self
.
ports
.
values
()
)
if
len
(
ports
)
!=
ports
[
-
1
]
+
1
:
raise
Exception
(
'
only contiguous, zero-indexed port ranges
'
'
supported: %s
'
%
self
.
intfs
)
intfs
=
[
self
.
intfs
[
port
]
for
port
in
s
ort
ed
(
self
.
intfs
.
keys
()
)
]
intfs
=
[
self
.
intfs
[
port
]
for
port
in
p
ort
s
]
self
.
cmd
(
'
ovs-dpctl
'
,
'
add-if
'
,
self
.
dp
,
'
'
.
join
(
intfs
)
)
# Run protocol daemon
controller
=
controllers
[
0
]
...
...
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