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
ff568819
Commit
ff568819
authored
13 years ago
by
Bob Lantz
Browse files
Options
Downloads
Patches
Plain Diff
Add TCLink for simplified tc-limited link creation.
parent
5a8bb489
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
+7
-7
7 additions, 7 deletions
bin/mn
mininet/link.py
+11
-0
11 additions, 0 deletions
mininet/link.py
with
18 additions
and
7 deletions
bin/mn
+
7
−
7
View file @
ff568819
...
...
@@ -22,7 +22,7 @@ from mininet.log import lg, LEVELS, info, warn
from
mininet.net
import
Mininet
,
MininetWithControlNet
from
mininet.node
import
Host
,
CPULimitedHost
,
Controller
,
OVSController
,
NOX
from
mininet.node
import
RemoteController
,
UserSwitch
,
OVSKernelSwitch
from
mininet.link
import
Intf
,
TCIntf
from
mininet.link
import
Link
,
TCLink
from
mininet.topo
import
SingleSwitchTopo
,
LinearTopo
,
SingleSwitchReversedTopo
from
mininet.topolib
import
TreeTopo
from
mininet.util
import
makeNumeric
,
custom
...
...
@@ -74,9 +74,9 @@ CONTROLLERS = { 'ref': Controller,
'
remote
'
:
RemoteController
,
'
none
'
:
lambda
name
:
None
}
IN
TF
DEF
=
'
default
'
IN
TF
S
=
{
'
default
'
:
Intf
,
'
tc
'
:
TC
Intf
}
L
IN
K
DEF
=
'
default
'
L
IN
K
S
=
{
'
default
'
:
Link
,
'
tc
'
:
TC
Link
}
# optional tests to run
...
...
@@ -182,7 +182,7 @@ class MininetRunner( object ):
addDictOption
(
opts
,
SWITCHES
,
SWITCHDEF
,
'
switch
'
)
addDictOption
(
opts
,
HOSTS
,
HOSTDEF
,
'
host
'
)
addDictOption
(
opts
,
CONTROLLERS
,
CONTROLLERDEF
,
'
controller
'
)
addDictOption
(
opts
,
IN
TF
S
,
IN
TF
DEF
,
'
in
tf
'
)
addDictOption
(
opts
,
L
IN
K
S
,
L
IN
K
DEF
,
'
l
in
k
'
)
addDictOption
(
opts
,
TOPOS
,
TOPODEF
,
'
topo
'
)
opts
.
add_option
(
'
--clean
'
,
'
-c
'
,
action
=
'
store_true
'
,
...
...
@@ -246,7 +246,7 @@ class MininetRunner( object ):
switch
=
customNode
(
SWITCHES
,
self
.
options
.
switch
)
host
=
customNode
(
HOSTS
,
self
.
options
.
host
)
controller
=
customNode
(
CONTROLLERS
,
self
.
options
.
controller
)
in
tf
=
customNode
(
IN
TF
S
,
self
.
options
.
in
tf
)
l
in
k
=
customNode
(
L
IN
K
S
,
self
.
options
.
l
in
k
)
if
self
.
validate
:
self
.
validate
(
self
.
options
)
...
...
@@ -262,7 +262,7 @@ class MininetRunner( object ):
listenPort
=
self
.
options
.
listenport
mn
=
Net
(
topo
=
topo
,
switch
=
switch
,
host
=
host
,
controller
=
controller
,
in
tf
=
intf
,
l
in
k
=
link
,
ipBase
=
ipBase
,
inNamespace
=
inNamespace
,
xterms
=
xterms
,
autoSetMacs
=
mac
,
...
...
This diff is collapsed.
Click to expand it.
mininet/link.py
+
11
−
0
View file @
ff568819
...
...
@@ -371,3 +371,14 @@ def delete( self ):
def
__str__
(
self
):
return
'
%s<->%s
'
%
(
self
.
intf1
,
self
.
intf2
)
class
TCLink
(
Link
):
"
Link with symmetric TC interfaces configured via opts
"
def
__init__
(
self
,
node1
,
node2
,
port1
=
None
,
port2
=
None
,
intfName1
=
None
,
intfName2
=
None
,
**
params
):
Link
.
__init__
(
self
,
node1
,
node2
,
port1
=
None
,
port2
=
None
,
intfName1
=
None
,
intfName2
=
None
,
cls1
=
TCIntf
,
cls2
=
TCIntf
,
params1
=
params
,
params2
=
params
)
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