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
f0f9907b
Commit
f0f9907b
authored
10 years ago
by
Bob Lantz
Browse files
Options
Downloads
Patches
Plain Diff
Add setup() and dpctl() methods for LinuxBridge
Also adds docstrings. Fixes #422
parent
c4fc6304
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/nodelib.py
+14
-0
14 additions, 0 deletions
mininet/nodelib.py
with
14 additions
and
0 deletions
mininet/nodelib.py
+
14
−
0
View file @
f0f9907b
...
...
@@ -6,6 +6,8 @@
from
mininet.node
import
Node
,
Switch
from
mininet.log
import
setLogLevel
,
info
from
mininet.moduledeps
import
pathCheck
class
LinuxBridge
(
Switch
):
"
Linux Bridge (with optional spanning tree)
"
...
...
@@ -31,6 +33,7 @@ def connected( self ):
return
True
def
start
(
self
,
controllers
):
"
Start Linux bridge
"
self
.
cmd
(
'
ifconfig
'
,
self
,
'
down
'
)
self
.
cmd
(
'
brctl delbr
'
,
self
)
self
.
cmd
(
'
brctl addbr
'
,
self
)
...
...
@@ -43,9 +46,20 @@ def start( self, controllers ):
self
.
cmd
(
'
ifconfig
'
,
self
,
'
up
'
)
def
stop
(
self
):
"
Stop Linux bridge
"
self
.
cmd
(
'
ifconfig
'
,
self
,
'
down
'
)
self
.
cmd
(
'
brctl delbr
'
,
self
)
def
dpctl
(
self
,
*
args
):
"
Run brctl command
"
return
self
.
cmd
(
'
brctl
'
,
*
args
)
@classmethod
def
setup
(
cls
):
"
Make sure our class dependencies are available
"
pathCheck
(
'
brctl
'
,
moduleName
=
'
bridge-utils
'
)
class
NAT
(
Node
):
"""
NAT: Provides connectivity to external network
"""
...
...
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