Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
emulab-devel
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
111
Issues
111
List
Boards
Labels
Milestones
Merge Requests
4
Merge Requests
4
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
emulab
emulab-devel
Commits
714c1e3c
Commit
714c1e3c
authored
Jan 29, 2008
by
Leigh Stoller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Changes for tunnels; Use member attributes instead of tunnels table.
parent
01f70665
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
42 additions
and
8 deletions
+42
-8
tbsetup/assign_wrapper.in
tbsetup/assign_wrapper.in
+42
-8
No files found.
tbsetup/assign_wrapper.in
View file @
714c1e3c
...
@@ -357,6 +357,10 @@ sub virtlanusevirtiface($) {
...
@@ -357,6 +357,10 @@ sub virtlanusevirtiface($) {
my
$encap
=
virtlanencapstyle
(
$_
[
0
]);
my
$encap
=
virtlanencapstyle
(
$_
[
0
]);
return
(
$encap
eq
"
veth
"
||
$encap
eq
"
veth-ne
"
||
$encap
eq
"
vlan
");
return
(
$encap
eq
"
veth
"
||
$encap
eq
"
veth-ne
"
||
$encap
eq
"
vlan
");
}
}
sub
virtlanusetuniface
($)
{
my
$encap
=
virtlanencapstyle
(
$_
[
0
]);
return
(
$encap
eq
"
gre
"
||
$encap
eq
"
egre
"
||
$encap
eq
"
vtun
");
}
# We hardcode (for now) the set of LAN/link "protocols" that are wireless.
# We hardcode (for now) the set of LAN/link "protocols" that are wireless.
# Eventually, this should probably come from the database.
# Eventually, this should probably come from the database.
sub
virtlanwireless
($)
{
sub
virtlanwireless
($)
{
...
@@ -2701,17 +2705,46 @@ foreach $lan (keys(%virt_lans)) {
...
@@ -2701,17 +2705,46 @@ foreach $lan (keys(%virt_lans)) {
next
next
if
(
$impotent
);
if
(
$impotent
);
my
$tunnel
=
Tunnel
->
Create
(
$experiment
,
$lan
,
$secretkey
,
$mask
,
$ipport
);
my
$tunnel
=
Tunnel
->
Create
(
$experiment
,
$lan
,
$secretkey
,
$mask
,
$ipport
);
fatal
("
Could not create tunnel for
$lan
")
fatal
("
Could not create tunnel for
$lan
")
if
(
!
defined
(
$tunnel
));
if
(
!
defined
(
$tunnel
));
$tunnel
->
AddInterface
(
$vvnode0
,
$vnode0
,
$vport0
,
$ip0
,
$peerip1
,
my
$iface0
=
$tunnel
->
AddInterface
(
$vvnode0
,
$vnode0
,
$vport0
)
(
$server
eq
$vnode0
?
1
:
0
))
or
fatal
("
Could not add
$vnode0
:
$vport0
to
$tunnel
");
or
fatal
("
Could not add
$vnode0
:
$vport0
to
$tunnel
");
$tunnel
->
AddInterface
(
$vvnode1
,
$vnode1
,
$vport1
,
$ip1
,
$peerip0
,
my
$iface1
=
$tunnel
->
AddInterface
(
$vvnode1
,
$vnode1
,
$vport1
)
(
$server
eq
$vnode1
?
1
:
0
))
or
fatal
("
Could not add
$vnode1
:
$vport1
to
$tunnel
");
or
fatal
("
Could not add
$vnode1
:
$vport1
to
$tunnel
");
# Need to set a bunch of attributes later returned by tmcd.
if
(
$iface0
->
SetAttribute
("
tunnel_ip
",
$ip0
)
||
$iface0
->
SetAttribute
("
tunnel_peerip
",
$ip1
)
||
$iface0
->
SetAttribute
("
tunnel_srcip
",
$peerip0
)
||
$iface0
->
SetAttribute
("
tunnel_dstip
",
$peerip1
)
||
$iface0
->
SetAttribute
("
tunnel_isserver
",
(
$server
eq
$vnode0
?
1
:
0
))
||
$iface0
->
SetAttribute
("
tunnel_secretkey
",
$secretkey
)
||
$iface0
->
SetAttribute
("
tunnel_ipmask
",
$mask
)
||
$iface0
->
SetAttribute
("
tunnel_serverport
",
$ipport
)
||
$iface0
->
SetAttribute
("
tunnel_lan
",
$lan
)
||
$iface0
->
SetAttribute
("
tunnel_unit
",
$iface0
->
memberid
())
||
$iface0
->
SetAttribute
("
tunnel_style
",
virtlanencapstyle
(
$lan
)))
{
fatal
("
Could not set attributes for
$iface0
in
$tunnel
");
}
if
(
$iface1
->
SetAttribute
("
tunnel_ip
",
$ip1
)
||
$iface1
->
SetAttribute
("
tunnel_peerip
",
$ip0
)
||
$iface1
->
SetAttribute
("
tunnel_srcip
",
$peerip1
)
||
$iface1
->
SetAttribute
("
tunnel_dstip
",
$peerip0
)
||
$iface1
->
SetAttribute
("
tunnel_isserver
",
(
$server
eq
$vnode1
?
1
:
0
))
||
$iface1
->
SetAttribute
("
tunnel_secretkey
",
$secretkey
)
||
$iface1
->
SetAttribute
("
tunnel_ipmask
",
$mask
)
||
$iface1
->
SetAttribute
("
tunnel_serverport
",
$ipport
)
||
$iface1
->
SetAttribute
("
tunnel_lan
",
$lan
)
||
$iface1
->
SetAttribute
("
tunnel_unit
",
$iface1
->
memberid
())
||
$iface1
->
SetAttribute
("
tunnel_style
",
virtlanencapstyle
(
$lan
)))
{
fatal
("
Could not set attributes for
$iface1
in
$tunnel
");
}
}
}
#
#
...
@@ -4264,9 +4297,10 @@ sub LoadVirtLans()
...
@@ -4264,9 +4297,10 @@ sub LoadVirtLans()
if
(
virtnodeisremote
(
$node
));
if
(
virtnodeisremote
(
$node
));
next
;
next
;
}
}
elsif
(
defined
(
$encap
)
&&
$encap
eq
"
tunnel
")
{
elsif
(
defined
(
$encap
)
&&
(
$encap
eq
"
vtun
"
||
$encap
eq
"
gre
"
||
$encap
eq
"
egre
"))
{
# Just for testing.
$virt_lans
{
$vname
}
->
{"
TUNNEL
"}
=
1
;
$virt_lans
{
$vname
}
->
{"
TUNNEL
"}
=
1
;
$virt_lans
{
$vname
}
->
{"
ENCAPSTYLE
"}
=
"
default
";
}
}
# Store this stuff as a unit to make it easier to grab later.
# Store this stuff as a unit to make it easier to grab later.
...
...
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