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
23841d8d
Commit
23841d8d
authored
Jul 26, 2010
by
Martín Ferrari
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
moved internal interface classes to iproute, as they are used mostly for iproute communication
parent
b6d0ee4f
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
252 additions
and
253 deletions
+252
-253
src/netns/interface.py
src/netns/interface.py
+15
-222
src/netns/iproute.py
src/netns/iproute.py
+231
-25
src/netns/protocol.py
src/netns/protocol.py
+6
-6
No files found.
src/netns/interface.py
View file @
23841d8d
This diff is collapsed.
Click to expand it.
src/netns/iproute.py
View file @
23841d8d
This diff is collapsed.
Click to expand it.
src/netns/protocol.py
View file @
23841d8d
...
@@ -8,7 +8,7 @@ except ImportError:
...
@@ -8,7 +8,7 @@ except ImportError:
from
yaml
import
Loader
,
Dumper
from
yaml
import
Loader
,
Dumper
import
base64
,
os
,
passfd
,
re
,
signal
,
sys
,
traceback
,
unshare
,
yaml
import
base64
,
os
,
passfd
,
re
,
signal
,
sys
,
traceback
,
unshare
,
yaml
import
netns.subprocess_
,
netns
.
iproute
,
netns
.
interface
import
netns.subprocess_
,
netns
.
iproute
# ============================================================================
# ============================================================================
# Server-side protocol implementation
# Server-side protocol implementation
...
@@ -339,7 +339,7 @@ class Server(object):
...
@@ -339,7 +339,7 @@ class Server(object):
for
i
in
range
(
len
(
args
)
/
2
):
for
i
in
range
(
len
(
args
)
/
2
):
d
[
str
(
args
[
i
*
2
])]
=
args
[
i
*
2
+
1
]
d
[
str
(
args
[
i
*
2
])]
=
args
[
i
*
2
+
1
]
iface
=
netns
.
i
nterfac
e
.
interface
(
**
d
)
iface
=
netns
.
i
prout
e
.
interface
(
**
d
)
netns
.
iproute
.
set_if
(
iface
)
netns
.
iproute
.
set_if
(
iface
)
self
.
reply
(
200
,
"Done."
)
self
.
reply
(
200
,
"Done."
)
...
@@ -360,17 +360,17 @@ class Server(object):
...
@@ -360,17 +360,17 @@ class Server(object):
def
do_ADDR_ADD
(
self
,
cmdname
,
ifnr
,
address
,
prefixlen
,
broadcast
=
None
):
def
do_ADDR_ADD
(
self
,
cmdname
,
ifnr
,
address
,
prefixlen
,
broadcast
=
None
):
if
address
.
find
(
":"
)
<
0
:
# crude, I know
if
address
.
find
(
":"
)
<
0
:
# crude, I know
a
=
netns
.
i
nterfac
e
.
ipv4address
(
address
,
prefixlen
,
broadcast
)
a
=
netns
.
i
prout
e
.
ipv4address
(
address
,
prefixlen
,
broadcast
)
else
:
else
:
a
=
netns
.
i
nterfac
e
.
ipv6address
(
address
,
prefixlen
)
a
=
netns
.
i
prout
e
.
ipv6address
(
address
,
prefixlen
)
netns
.
iproute
.
add_addr
(
ifnr
,
a
)
netns
.
iproute
.
add_addr
(
ifnr
,
a
)
self
.
reply
(
200
,
"Done."
)
self
.
reply
(
200
,
"Done."
)
def
do_ADDR_DEL
(
self
,
cmdname
,
ifnr
,
address
,
prefixlen
):
def
do_ADDR_DEL
(
self
,
cmdname
,
ifnr
,
address
,
prefixlen
):
if
address
.
find
(
":"
)
<
0
:
# crude, I know
if
address
.
find
(
":"
)
<
0
:
# crude, I know
a
=
netns
.
i
nterfac
e
.
ipv4address
(
address
,
prefixlen
,
None
)
a
=
netns
.
i
prout
e
.
ipv4address
(
address
,
prefixlen
,
None
)
else
:
else
:
a
=
netns
.
i
nterfac
e
.
ipv6address
(
address
,
prefixlen
)
a
=
netns
.
i
prout
e
.
ipv6address
(
address
,
prefixlen
)
netns
.
iproute
.
del_addr
(
ifnr
,
a
)
netns
.
iproute
.
del_addr
(
ifnr
,
a
)
self
.
reply
(
200
,
"Done."
)
self
.
reply
(
200
,
"Done."
)
...
...
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