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
eab4ea3f
Commit
eab4ea3f
authored
10 years ago
by
Bob Lantz
Browse files
Options
Downloads
Patches
Plain Diff
Minor fixes
parent
06d9e4bb
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/topo.py
+5
-6
5 additions, 6 deletions
mininet/topo.py
with
5 additions
and
6 deletions
mininet/topo.py
+
5
−
6
View file @
eab4ea3f
...
...
@@ -126,7 +126,7 @@ def addHost( self, name, **opts ):
returns: host name
"""
if
not
opts
and
self
.
hopts
:
opts
=
self
.
hopts
return
self
.
addNode
(
name
,
**
opts
)
return
self
.
addNode
(
name
,
**
opts
)
def
addSwitch
(
self
,
name
,
**
opts
):
"""
Convenience method: Add switch to graph.
...
...
@@ -135,7 +135,7 @@ def addSwitch( self, name, **opts ):
returns: switch name
"""
if
not
opts
and
self
.
sopts
:
opts
=
self
.
sopts
result
=
self
.
addNode
(
name
,
isSwitch
=
True
,
**
opts
)
result
=
self
.
addNode
(
name
,
isSwitch
=
True
,
**
opts
)
return
result
def
addLink
(
self
,
node1
,
node2
,
port1
=
None
,
port2
=
None
,
...
...
@@ -146,9 +146,8 @@ def addLink( self, node1, node2, port1=None, port2=None,
returns: link info key
"""
if
not
opts
and
self
.
lopts
:
opts
=
self
.
lopts
port1
,
port2
=
self
.
addPort
(
node1
,
node2
,
port1
,
port2
)
port1
,
port2
=
self
.
addPort
(
node1
,
node2
,
port1
,
port2
)
opts
.
update
(
node1
=
node1
,
node2
=
node2
,
port1
=
port1
,
port2
=
port2
)
assert
'
node1
'
in
opts
self
.
g
.
add_edge
(
node1
,
node2
,
key
,
opts
)
return
key
...
...
@@ -179,7 +178,7 @@ def links( self, sort=True, withInfo=False, withKeys=False ):
"""
Return links.
sort: sort links alphabetically
withKeys: return key in tuple
@
return links list of ( src, dst [,key ] )
"""
return
s:
links list of ( src, dst [,key ] )
"""
if
not
sort
:
return
self
.
g
.
edges
(
data
=
withInfo
,
key
=
withKeys
)
else
:
...
...
@@ -246,7 +245,7 @@ def linkInfo( self, src, dst, key=None ):
def
setlinkInfo
(
self
,
src
,
dst
,
info
,
key
=
None
):
"
Set link metadata dict
"
entry
,
key
=
self
.
_linkEntry
(
src
,
dst
,
key
)
entry
[
key
]
=
info
entry
[
key
]
=
info
def
nodeInfo
(
self
,
name
):
"
Return metadata (dict) for node
"
...
...
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