Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
nemu3
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
1
Issues
1
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
nemu3
Commits
47dac15d
Commit
47dac15d
authored
Jul 22, 2010
by
Martín Ferrari
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Massive changes to interface module. Link class
parent
fd099ed9
Changes
5
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
195 additions
and
67 deletions
+195
-67
sample-api.py
sample-api.py
+1
-1
src/netns/__init__.py
src/netns/__init__.py
+0
-4
src/netns/interface.py
src/netns/interface.py
+192
-60
src/netns/node.py
src/netns/node.py
+1
-1
t/test_interfaces.py
t/test_interfaces.py
+1
-1
No files found.
sample-api.py
View file @
47dac15d
...
...
@@ -53,7 +53,7 @@ link0.connect(if1)
# Add and connect a tap device (as if a external router were plugged into a
# switch)
if2
=
netns
.
External
Interface
(
'tap0'
)
if2
=
netns
.
Foreign
Interface
(
'tap0'
)
link0
.
connect
(
if2
)
link0
.
up
=
True
...
...
src/netns/__init__.py
View file @
47dac15d
...
...
@@ -46,8 +46,4 @@ config = __Config()
def
set_cleanup_hooks
(
on_exit
=
False
,
on_signals
=
[]):
pass
class
Link
(
object
):
def
connect
(
self
,
iface
):
pass
src/netns/interface.py
View file @
47dac15d
This diff is collapsed.
Click to expand it.
src/netns/node.py
View file @
47dac15d
...
...
@@ -93,7 +93,7 @@ class Node(object):
ret
=
[]
for
i
in
ifaces
:
if
i
not
in
self
.
_interfaces
:
ret
.
append
(
netns
.
interface
.
External
NodeInterface
(
self
,
i
))
ret
.
append
(
netns
.
interface
.
Foreign
NodeInterface
(
self
,
i
))
else
:
ret
.
append
(
self
.
_interfaces
[
i
])
# by the way, clean up _interfaces
...
...
t/test_interfaces.py
View file @
47dac15d
...
...
@@ -40,7 +40,7 @@ class TestInterfaces(unittest.TestCase):
devs
=
get_devs
()
for
i
in
range
(
5
):
peer_name
=
netns
.
iproute
.
get_if
(
ifaces
[
i
].
control
_
index
).
name
peer_name
=
netns
.
iproute
.
get_if
(
ifaces
[
i
].
control
.
index
).
name
self
.
assertTrue
(
peer_name
in
devs
)
@
test_util
.
skipUnless
(
os
.
getuid
()
==
0
,
"Test requires root privileges"
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment