Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
emulab
emulab-devel
Commits
d9e2ff8d
Commit
d9e2ff8d
authored
Apr 18, 2012
by
Leigh B Stoller
Browse files
Integrate shared vlan support. See protogeni/test/openflow.rspec
parent
b3b91531
Changes
3
Hide whitespace changes
Inline
Side-by-side
protogeni/lib/GeniAggregate.pm.in
View file @
d9e2ff8d
...
...
@@ -1071,6 +1071,10 @@ sub Start($$$)
$msg .= "Failed to setup vlans";
goto bad;
}
if ($experiment->SyncPortLans()) {
$msg .= "Failed to add ports to shared vlans";
goto bad;
}
}
#
...
...
@@ -1301,6 +1305,10 @@ sub Stop($$)
%vnodes = %tmp;
if ($version >= 2) {
if ($experiment->ClearPortLans()) {
$msg .= "Failed to remove ports from shared vlans";
goto bad;
}
system("$SNMPIT -r $pid $eid");
if ($?) {
$msg .= "Failed to remove vlans";
...
...
protogeni/lib/GeniCM.pm.in
View file @
d9e2ff8d
...
...
@@ -1345,8 +1345,10 @@ sub GetTicketAuxAux($$$$$$$$$)
$
ifacemap
{$
node_nickname
}->{$
virtual_id
}
=
{
"rspec"
=>
$
linkref
,
"vport"
=>
$
vport
};
my
$
member
=
"$node_nickname:$vport"
;
#
This
is
used
after
the
mapper
runs
since
it
uses
vname
:
vport
.
$
vportmap
{
"$node_nickname:$vport"
}
=
{
"rspec"
=>
$
linkref
};
$
vportmap
{
$
member
}
=
{
"rspec"
=>
$
linkref
};
}
#
...
...
@@ -1423,6 +1425,7 @@ sub GetTicketAuxAux($$$$$$$$$)
"hoplist"
=>
\@
hoplist
};
}
}
#
#
Now
deal
with
links
for
wildcarded
nodes
.
#
...
...
@@ -1725,7 +1728,7 @@ sub GetTicketAuxAux($$$$$$$$$)
my
$
ip
=
GeniXML
::
GetIp
($
ref
,
$
nodemap
{$
node_nickname
}->{
'rspec'
});
my
$
mask
=
GeniXML
::
GetMask
($
ref
,
$
nodemap
{$
node_nickname
}->{
'rspec'
});
stitch
:
#
XXX
$
ip
=
"10.10.${linknum}.${ifacenum}"
if
(
!defined($ip));
...
...
@@ -1765,7 +1768,23 @@ sub GetTicketAuxAux($$$$$$$$$)
if
(
defined
($
bblob
->{
'latency'
}));
$
bridge_vname
=
$
bblob
->{
'name'
};
}
#
Watch
for
shared
lans
;
we
have
to
add
the
lan
entries
for
them
.
my
$
shared_vlan
=
GeniXML
::
GetSharedLanName
($
linkref
);
if
(
defined
($
shared_vlan
))
{
#
This
is
the
magic
for
libvtop
.
$
virtexperiment
->
NewTableRow
(
"virt_lan_settings"
,
{
"vname"
=>
$
lanname
,
"capkey"
=>
"portvlan"
,
"capval"
=>
$
shared_vlan
});
#
Clear
all
this
.
$
bandwidth
=
0
;
$
latency
=
0.0
;
$
lossrate
=
0.0
;
}
stitch
:
my
$
virtlan
=
$
virtexperiment
->
NewTableRow
(
"virt_lans"
,
{
"vname"
=>
$
lanname
,
...
...
protogeni/lib/GeniXML.pm.in
View file @
d9e2ff8d
#
!/usr/bin/perl -w
#
#
GENIPUBLIC
-
COPYRIGHT
#
Copyright
(
c
)
2010
-
201
1
University
of
Utah
and
the
Flux
Group
.
#
Copyright
(
c
)
2010
-
201
2
University
of
Utah
and
the
Flux
Group
.
#
All
rights
reserved
.
#
package
GeniXML
;
...
...
@@ -31,7 +31,7 @@ use Carp qw(cluck carp);
use
vars
qw
($
RSPEC_0_1
$
RSPEC_0_2
$
RSPEC_2
$
RSPEC_3
$
RSPEC_0_1_NS
$
RSPEC_0_2_NS
$
RSPEC_2_NS
$
EMULAB_NS
$
XSI_NS
$
STITCH_NS
$
EMULAB_NS
$
XSI_NS
$
STITCH_NS
$
SHAREDVLAN_NS
$
REQUEST_2_URL
$
MANIFEST_2_URL
$
REQUEST_3_URL
$
MANIFEST_3_URL
);
$
RSPEC_0_1
=
"0.1"
;
...
...
@@ -46,6 +46,7 @@ our $RSPEC_3_NS = "http://www.geni.net/resources/rspec/3";
our
$
EMULAB_NS
=
"http://www.protogeni.net/resources/rspec/ext/emulab/1"
;
our
$
XSI_NS
=
"http://www.w3.org/2001/XMLSchema-instance"
;
our
$
STITCH_NS
=
"http://hpn.east.isi.edu/rspec/ext/stitch/0.1/"
;
our
$
SHAREDVLAN_NS
=
"http://www.protogeni.net/resources/rspec/ext/emulab/1"
;
$
REQUEST_2_URL
=
"http://www.protogeni.net/resources/rspec/2/request.xsd"
;
$
MANIFEST_2_URL
=
"http://www.protogeni.net/resources/rspec/2/manifest.xsd"
;
...
...
@@ -667,6 +668,24 @@ sub GetDelayPipes($)
return
@
result
;
}
sub
GetSharedLanName
($)
{
my
($
iface
)
=
@
_
;
if
(
! IsVersion0($iface)) {
my
$
interface_name
=
FindNodesNS
(
"vlan:link_shared_vlan"
,
$
iface
,
$
SHAREDVLAN_NS
)->
pop
();
if
(
defined
($
interface_name
))
{
my
$
name
=
GetText
(
"name"
,
$
interface_name
);
if
(
defined
($
name
)
and
$
name
ne
""
)
{
return
$
name
;
}
}
}
return
undef
;
}
#
Takes
an
attribute
/
element
name
,
*
NOT
AN
XPATH
*
and
a
node
and
sets
#
the
text
of
that
node
to
a
particular
value
.
If
the
node
is
an
#
attribute
,
the
value
is
set
.
If
it
is
an
element
with
just
a
text
...
...
Write
Preview
Supports
Markdown
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