Commit cc22200f authored by Leigh B. Stoller's avatar Leigh B. Stoller
Browse files

Out with the vlans table, in with lans, lan_attributes, lan_members,

lan_member_attributes, and ifaces. Making the world safe for protogenis.
parent 96af2532
...@@ -25,7 +25,7 @@ WEB_BIN_SCRIPTS = webnfree ...@@ -25,7 +25,7 @@ WEB_BIN_SCRIPTS = webnfree
LIBEXEC_SCRIPTS = $(WEB_BIN_SCRIPTS) $(WEB_SBIN_SCRIPTS) xmlconvert LIBEXEC_SCRIPTS = $(WEB_BIN_SCRIPTS) $(WEB_SBIN_SCRIPTS) xmlconvert
LIB_SCRIPTS = libdb.pm Node.pm libdb.py libadminctrl.pm Experiment.pm \ LIB_SCRIPTS = libdb.pm Node.pm libdb.py libadminctrl.pm Experiment.pm \
NodeType.pm Interface.pm User.pm Group.pm Project.pm \ NodeType.pm Interface.pm User.pm Group.pm Project.pm \
Image.pm OSinfo.pm Archive.pm Logfile.pm Image.pm OSinfo.pm Archive.pm Logfile.pm Lan.pm
# Stuff installed on plastic. # Stuff installed on plastic.
USERSBINS = genelists.proxy dumperrorlog.proxy USERSBINS = genelists.proxy dumperrorlog.proxy
......
This diff is collapsed.
#!/usr/bin/perl #!/usr/bin/perl
# #
# EMULAB-COPYRIGHT # EMULAB-COPYRIGHT
# Copyright (c) 2000-2002 University of Utah and the Flux Group. # Copyright (c) 2000-2007 University of Utah and the Flux Group.
# All rights reserved. # All rights reserved.
# #
use strict;
use English;
#
# Turn off line buffering on output
#
$| = 1;
# #
# Configure variables # Set umask for start/swap. We want other members in the project to be
# able to swap/end experiments, so the log and intermediate files need
# to be 664 since some are opened for append.
# #
umask(0002);
#
# Untaint the path
#
# un-taint path
$ENV{'PATH'} = '/bin:/usr/bin:/usr/local/bin';
delete @ENV{'IFS', 'CDPATH', 'ENV', 'BASH_ENV'};
# Testbed Libraries.
use lib '@prefix@/lib'; use lib '@prefix@/lib';
use libdb; use libdb;
use English; use User;
use Lan;
if (!TBAdmin($UID)) { #
# Verify user and get his DB uid and other info for later.
#
my $this_user = User->ThisUser();
if (! defined($this_user)) {
die("*** $0:\n".
" You ($UID) do not exist!\n");
}
if (!$this_user->IsAdmin()) {
die("*** $0:\n". die("*** $0:\n".
" You must be a TB administrator to use this program\n"); " You must be a TB administrator to use this program\n");
} }
my ($virtual,$id,$pideid,$members); my ($pid,$eid,$virtual,$id,$pideid,$members);
print << "END"; print << "END";
ID Project/Experiment Link/LAN Switches (number of members in parens) ID Project/Experiment Link/LAN Switches (number of members in parens)
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------
...@@ -35,34 +62,52 @@ $FORMAT_NAME = 'vlanlist'; ...@@ -35,34 +62,52 @@ $FORMAT_NAME = 'vlanlist';
# #
# Get a list of all VLANs for swapped-in experiments # Get a list of all VLANs for swapped-in experiments
# #
my $result = DBQueryFatal("SELECT eid, pid, virtual, members, id FROM vlans " . my @vlans;
"ORDER BY eid,pid,virtual"); if (VLan->AllVLans(\@vlans) != 0) {
my $eid,$pid; die("*** $0:\n".
while (($eid, $pid, $virtual, $members, $id) = $result->fetchrow()) { " Unable to load VLANs for all experiments\n");
}
# foreach my $vlan (@vlans) {
# Split apart the space-separated list of members
#
my @members = split /\s+/, $members;
my %switches = (); my %switches = ();
my @members;
my $pid = $vlan->pid();
my $eid = $vlan->eid();
$id = $vlan->lanid();
$virtual = $vlan->vname();
if ($vlan->MemberList(\@members) != 0) {
die("*** $0:\n".
" Unable to load members for $vlan\n");
}
foreach my $member (@members) { foreach my $member (@members) {
my ($node,$if) = split /:/, $member; my $node;
my $iface;
if ($member->GetNodeIface(\$node, \$iface) != 0) {
die("*** $0:\n".
" Missing attributes for $member in $vlan\n");
}
my $nodeid = $node->node_id();
# #
# Find out which switch this interface is connected to # Find out which switch this interface is connected to
# #
my $result2 = DBQueryFatal("SELECT node_id2 FROM wires AS w LEFT JOIN ". my $result2 =
"interfaces AS i ON w.node_id1=i.node_id AND w.card1=i.card " . DBQueryFatal("select node_id2 from wires as w ".
"WHERE node_id='$node' and iface='$if'"); "left join interfaces as i on ".
" w.node_id1=i.node_id AND w.card1=i.card " .
"where node_id='$nodeid' and iface='$iface'");
# We assume only one response here! # We assume only one response here!
my ($switch) = ($result2->fetchrow()); my ($switch) = $result2->fetchrow_array();
$switches{$switch}++; $switches{$switch}++;
} }
# #
# Report if more than one switch was found # Report if more than one switch was found
# #
if ((keys %switches) > 1) { if (scalar(keys(%switches)) > 1) {
$pideid = "$pid/$eid"; $pideid = "$pid/$eid";
$members = join(" ", map { "$_ ($switches{$_})" } sort keys %switches); $members = join(" ", map { "$_ ($switches{$_})" } sort keys %switches);
write; write;
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
# #
# EMULAB-COPYRIGHT # EMULAB-COPYRIGHT
# Copyright (c) 2000-2007 University of Utah and the Flux Group. # Copyright (c) 2000-2008 University of Utah and the Flux Group.
# All rights reserved. # All rights reserved.
# #
...@@ -247,6 +247,7 @@ require Group; ...@@ -247,6 +247,7 @@ require Group;
require Node; require Node;
require NodeType; require NodeType;
require Mysql; require Mysql;
require Lan;
use vars qw($DBQUERY_MAXTRIES $DBCONN_MAXTRIES use vars qw($DBQUERY_MAXTRIES $DBCONN_MAXTRIES
$DBCONN_EXITONERR $DBQUERY_RECONNECT $DBQUERY_DEBUG $DBCONN_EXITONERR $DBQUERY_RECONNECT $DBQUERY_DEBUG
@EXPORT_OK @virtualTables @physicalTables); @EXPORT_OK @virtualTables @physicalTables);
...@@ -2449,7 +2450,6 @@ sub TBExptContainsNodeCT($$$) ...@@ -2449,7 +2450,6 @@ sub TBExptContainsNodeCT($$$)
"ipsubnets"); "ipsubnets");
@physicalTables = ("delays", @physicalTables = ("delays",
"vlans",
"tunnels", "tunnels",
"ipport_ranges", "ipport_ranges",
"v2pmap", "v2pmap",
...@@ -2647,6 +2647,13 @@ sub TBExptRemovePhysicalState($$) ...@@ -2647,6 +2647,13 @@ sub TBExptRemovePhysicalState($$)
my ($pid, $eid) = @_; my ($pid, $eid) = @_;
my $errors = 0; my $errors = 0;
my $experiment = Experiment->Lookup($pid, $eid);
return 1
if (!defined($experiment));
return 1
if (Lan->DestroyExperimentLans($experiment) != 0);
foreach my $table (@physicalTables) { foreach my $table (@physicalTables) {
DBQueryWarn("DELETE FROM $table WHERE pid='$pid' AND eid='$eid'") DBQueryWarn("DELETE FROM $table WHERE pid='$pid' AND eid='$eid'")
or $errors++; or $errors++;
...@@ -2697,6 +2704,13 @@ sub TBExptBackupPhysicalState($$) ...@@ -2697,6 +2704,13 @@ sub TBExptBackupPhysicalState($$)
or return 1; or return 1;
} }
my $experiment = Experiment->Lookup($pid, $eid);
return 1
if (!defined($experiment));
return 1
if (Lan->BackupExperimentLans($experiment, $pstateDir) != 0);
foreach my $table (@physicalTables) { foreach my $table (@physicalTables) {
DBQueryWarn("SELECT * FROM $table WHERE pid='$pid' AND eid='$eid' ". DBQueryWarn("SELECT * FROM $table WHERE pid='$pid' AND eid='$eid' ".
"INTO OUTFILE '$pstateDir/$table' ") "INTO OUTFILE '$pstateDir/$table' ")
......
...@@ -521,7 +521,7 @@ CREATE TABLE `experiment_input_data` ( ...@@ -521,7 +521,7 @@ CREATE TABLE `experiment_input_data` (
) ENGINE=MyISAM DEFAULT CHARSET=latin1; ) ENGINE=MyISAM DEFAULT CHARSET=latin1;
-- --
-- Table structure for table `experiment_template_inputs` -- Table structure for table `experiment_inputs`
-- --
DROP TABLE IF EXISTS `experiment_inputs`; DROP TABLE IF EXISTS `experiment_inputs`;
...@@ -1098,9 +1098,9 @@ CREATE TABLE `firewalls` ( ...@@ -1098,9 +1098,9 @@ CREATE TABLE `firewalls` (
`fwname` varchar(32) NOT NULL default '', `fwname` varchar(32) NOT NULL default '',
`vlan` int(11) default NULL, `vlan` int(11) default NULL,
`vlanid` int(11) default NULL, `vlanid` int(11) default NULL,
PRIMARY KEY (`exptidx`,`fwname`), PRIMARY KEY (`exptidx`,`fwname`),
KEY `pideid` (`pid`,`eid`,`fwname`), KEY `vlan` (`vlan`),
KEY `vlan` (`vlan`) KEY `pideid` (`pid`,`eid`,`fwname`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1; ) ENGINE=MyISAM DEFAULT CHARSET=latin1;
-- --
...@@ -1292,6 +1292,28 @@ CREATE TABLE `iface_counters` ( ...@@ -1292,6 +1292,28 @@ CREATE TABLE `iface_counters` (
KEY `node_idindex` (`node_id`) KEY `node_idindex` (`node_id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1; ) ENGINE=MyISAM DEFAULT CHARSET=latin1;
--
-- Table structure for table `ifaces`
--
DROP TABLE IF EXISTS `ifaces`;
CREATE TABLE `ifaces` (
`lanid` int(11) NOT NULL default '0',
`ifaceid` int(11) NOT NULL default '0',
`exptidx` int(11) NOT NULL default '0',
`pid` varchar(12) NOT NULL default '',
`eid` varchar(32) NOT NULL default '',
`node_id` varchar(32) NOT NULL default '',
`vnode` varchar(32) NOT NULL default '',
`vname` varchar(32) NOT NULL default '',
`vidx` int(11) NOT NULL default '0',
`vport` tinyint(3) NOT NULL default '0',
PRIMARY KEY (`lanid`,`ifaceid`),
KEY `pideid` (`pid`,`eid`),
KEY `exptidx` (`exptidx`),
KEY `lanid` (`lanid`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
-- --
-- Table structure for table `images` -- Table structure for table `images`
-- --
...@@ -1458,6 +1480,64 @@ CREATE TABLE `knowledge_base_entries` ( ...@@ -1458,6 +1480,64 @@ CREATE TABLE `knowledge_base_entries` (
PRIMARY KEY (`idx`) PRIMARY KEY (`idx`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1; ) ENGINE=MyISAM DEFAULT CHARSET=latin1;
--
-- Table structure for table `lan_attributes`
--
DROP TABLE IF EXISTS `lan_attributes`;
CREATE TABLE `lan_attributes` (
`lanid` int(11) NOT NULL default '0',
`attrkey` varchar(32) NOT NULL default '',
`attrvalue` tinytext NOT NULL,
`attrtype` enum('integer','float','boolean','string') default 'string',
PRIMARY KEY (`lanid`,`attrkey`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
--
-- Table structure for table `lan_member_attributes`
--
DROP TABLE IF EXISTS `lan_member_attributes`;
CREATE TABLE `lan_member_attributes` (
`lanid` int(11) NOT NULL default '0',
`memberid` int(11) NOT NULL default '0',
`attrkey` varchar(32) NOT NULL default '',
`attrvalue` tinytext NOT NULL,
`attrtype` enum('integer','float','boolean','string') default 'string',
PRIMARY KEY (`lanid`,`memberid`,`attrkey`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
--
-- Table structure for table `lan_members`
--
DROP TABLE IF EXISTS `lan_members`;
CREATE TABLE `lan_members` (
`lanid` int(11) NOT NULL default '0',
`memberid` int(11) NOT NULL auto_increment,
PRIMARY KEY (`lanid`,`memberid`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
--
-- Table structure for table `lans`
--
DROP TABLE IF EXISTS `lans`;
CREATE TABLE `lans` (
`lanid` int(11) NOT NULL auto_increment,
`exptidx` int(11) NOT NULL default '0',
`pid` varchar(12) NOT NULL default '',
`eid` varchar(32) NOT NULL default '',
`vname` varchar(64) NOT NULL default '',
`vidx` int(11) NOT NULL default '0',
`type` varchar(32) NOT NULL default '',
`link` int(11) default NULL,
`ready` tinyint(1) default '0',
PRIMARY KEY (`lanid`),
KEY `pideid` (`pid`,`eid`),
KEY `exptidx` (`exptidx`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
-- --
-- Table structure for table `last_reservation` -- Table structure for table `last_reservation`
-- --
...@@ -3200,7 +3280,7 @@ CREATE TABLE `vinterfaces` ( ...@@ -3200,7 +3280,7 @@ CREATE TABLE `vinterfaces` (
`iface` varchar(10) default NULL, `iface` varchar(10) default NULL,
`rtabid` smallint(5) unsigned NOT NULL default '0', `rtabid` smallint(5) unsigned NOT NULL default '0',
`vnode_id` varchar(32) default NULL, `vnode_id` varchar(32) default NULL,
`exptidx` int(11) NOT NULL default '0', `exptidx` int(10) NOT NULL default '0',
`virtlanidx` int(11) NOT NULL default '0', `virtlanidx` int(11) NOT NULL default '0',
`vlanid` int(11) NOT NULL default '0', `vlanid` int(11) NOT NULL default '0',
PRIMARY KEY (`node_id`,`unit`), PRIMARY KEY (`node_id`,`unit`),
...@@ -3333,7 +3413,7 @@ CREATE TABLE `virt_lans` ( ...@@ -3333,7 +3413,7 @@ CREATE TABLE `virt_lans` (
`nobwshaping` tinyint(4) default '0', `nobwshaping` tinyint(4) default '0',
`mustdelay` tinyint(1) default '0', `mustdelay` tinyint(1) default '0',
`usevethiface` tinyint(4) default '0', `usevethiface` tinyint(4) default '0',
`encap_style` enum('alias','veth','veth-ne','vlan','default') NOT NULL default 'default', `encap_style` enum('alias','veth','veth-ne','vlan','tunnel','default') NOT NULL default 'default',
`trivial_ok` tinyint(4) default '1', `trivial_ok` tinyint(4) default '1',
`protocol` varchar(30) NOT NULL default 'ethernet', `protocol` varchar(30) NOT NULL default 'ethernet',
`is_accesspoint` tinyint(4) default '0', `is_accesspoint` tinyint(4) default '0',
......
...@@ -731,7 +731,7 @@ REPLACE INTO table_regex VALUES ('projects','num_pcs','int','redirect','default: ...@@ -731,7 +731,7 @@ REPLACE INTO table_regex VALUES ('projects','num_pcs','int','redirect','default:
REPLACE INTO table_regex VALUES ('projects','num_pcplab','int','redirect','default:int',0,2048,NULL); REPLACE INTO table_regex VALUES ('projects','num_pcplab','int','redirect','default:int',0,2048,NULL);
REPLACE INTO table_regex VALUES ('projects','num_ron','int','redirect','default:int',0,1024,NULL); REPLACE INTO table_regex VALUES ('projects','num_ron','int','redirect','default:int',0,1024,NULL);
REPLACE INTO table_regex VALUES ('experiments','encap_style','text','regex','^(alias|veth|veth-ne|vlan|default)$',0,0,NULL); REPLACE INTO table_regex VALUES ('experiments','encap_style','text','regex','^(alias|veth|veth-ne|vlan|tunnel|default)$',0,0,NULL);
REPLACE INTO table_regex VALUES ('experiments','veth_encapsulate','int','redirect','default:boolean',0,0,NULL); REPLACE INTO table_regex VALUES ('experiments','veth_encapsulate','int','redirect','default:boolean',0,0,NULL);
REPLACE INTO table_regex VALUES ('experiments','allowfixnode','int','redirect','default:boolean',0,0,NULL); REPLACE INTO table_regex VALUES ('experiments','allowfixnode','int','redirect','default:boolean',0,0,NULL);
REPLACE INTO table_regex VALUES ('experiments','jail_osname','text','redirect','os_info:osname',0,0,NULL); REPLACE INTO table_regex VALUES ('experiments','jail_osname','text','redirect','os_info:osname',0,0,NULL);
......
...@@ -4228,3 +4228,66 @@ last_net_act,last_cpu_act,last_ext_act); ...@@ -4228,3 +4228,66 @@ last_net_act,last_cpu_act,last_ext_act);
4.139: Change to previous revision; Skip to next entry. 4.139: Change to previous revision; Skip to next entry.
4.140: Big changes to vlans table. That table is deprecated in favor of
these new tables. You want to make these changes while the
system is quiet (disable web interface to prevent swapping).
CREATE TABLE `lans` (
`lanid` int(11) NOT NULL auto_increment,
`exptidx` int(11) NOT NULL default '0',
`pid` varchar(12) NOT NULL default '',
`eid` varchar(32) NOT NULL default '',
`vname` varchar(64) NOT NULL default '',
`vidx` int(11) NOT NULL default 0,
`type` varchar(32) NOT NULL default '',
`link` int(11) default NULL,
`ready` tinyint(1) default '0',
PRIMARY KEY (`lanid`),
KEY `pideid` (`pid`,`eid`),
KEY `exptidx` (`exptidx`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
CREATE TABLE `lan_attributes` (
`lanid` int(11) NOT NULL default '0',
`attrkey` varchar(32) NOT NULL default '',
`attrvalue` tinytext NOT NULL,
`attrtype` enum('integer','float','boolean','string') default 'string',
PRIMARY KEY (`lanid`,`attrkey`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
CREATE TABLE `lan_members` (
`lanid` int(11) NOT NULL default '0',
`memberid` int(11) NOT NULL auto_increment,
PRIMARY KEY (`lanid`,`memberid`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
CREATE TABLE `lan_member_attributes` (
`lanid` int(11) NOT NULL default '0',
`memberid` int(11) NOT NULL default '0',
`attrkey` varchar(32) NOT NULL default '',
`attrvalue` tinytext NOT NULL,
`attrtype` enum('integer','float','boolean','string') default 'string',
PRIMARY KEY (`lanid`,`memberid`,`attrkey`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
CREATE TABLE `ifaces` (
`lanid` int(11) NOT NULL default '0',
`ifaceid` int(11) NOT NULL default '0',
`exptidx` int(11) NOT NULL default '0',
`pid` varchar(12) NOT NULL default '',
`eid` varchar(32) NOT NULL default '',
`node_id` varchar(32) NOT NULL default '',
`vnode` varchar(32) NOT NULL default '',
`vname` varchar(32) NOT NULL default '',
`vidx` int(11) NOT NULL default 0,
`vport` tinyint(3) NOT NULL default '0',
PRIMARY KEY (`lanid`,`ifaceid`),
KEY `pideid` (`pid`,`eid`),
KEY `exptidx` (`exptidx`),
KEY `lanid` (`lanid`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
Run the following script. The testbed should be quiet (no swaps).
./newlans.pl
#!/usr/bin/perl -w
#
# EMULAB-COPYRIGHT
# Copyright (c) 2008 University of Utah and the Flux Group.
# All rights reserved.
#
use English;
use lib "/usr/testbed/lib";
use libdb;
use libtestbed;
use Lan;
#
# Untaint the path
#
$ENV{'PATH'} = '/bin:/usr/bin:/usr/sbin';
delete @ENV{'IFS', 'CDPATH', 'ENV', 'BASH_ENV'};
exit(VLan->Initialize());
...@@ -113,6 +113,7 @@ use libtestbed; ...@@ -113,6 +113,7 @@ use libtestbed;
use Experiment; use Experiment;
use Node; use Node;
use NodeType; use NodeType;
use Lan;
use libadminctrl; use libadminctrl;
use libtblog; use libtblog;
use libtblog qw(*SOUT *SERR); use libtblog qw(*SOUT *SERR);
...@@ -490,6 +491,10 @@ my %plinks = (); ...@@ -490,6 +491,10 @@ my %plinks = ();
my %virtnodes = (); my %virtnodes = ();
my %v2vmap = (); my %v2vmap = ();
# for consing up vlan names.
my $vlanid = 0;
my %protovlans = ();
# Admission control counts # Admission control counts
my %admission_control = (); my %admission_control = ();
...@@ -1813,13 +1818,27 @@ foreach $plink (keys(%plinks)) { ...@@ -1813,13 +1818,27 @@ foreach $plink (keys(%plinks)) {
@{$plinks{"linksdelaydst/$lan/$virtC,$virtA"}}; @{$plinks{"linksdelaydst/$lan/$virtC,$virtA"}};
($nodeC,$portC) = split(":",$nodeportC); ($nodeC,$portC) = split(":",$nodeportC);
($nodeD,$portD) = split(":",$nodeportD); ($nodeD,$portD) = split(":",$nodeportD);
($vnodeC,$vportC) = split(":",$virtC);
($vnodeA,$vportA) = split(":",$virtA);
printdb "LINK delay: other end = $nodeportC $nodeportD\n"; printdb "LINK delay: other end = $nodeportC $nodeportD\n";
# assert nodeB == nodeD # assert nodeB == nodeD
my $protolan = ProtoLan->Create($experiment, "$lan");
printdb " VLANS:\n"; my $protolansrc = ProtoLan->Create($experiment,
AddVlan("link", "$lan" . "-delaysrc", $nodeportA, $nodeportB); "$lan" . "-delaysrc", $protolan);
AddVlan("link", "$lan" . "-delaydst", $nodeportC, $nodeportD); my $protolandst = ProtoLan->Create($experiment,
"$lan" . "-delaydst", $protolan);
$protolansrc->SetType("vlan");
$protolandst->SetType("vlan");
$protolansrc->SetRole("delay");
$protolandst->SetRole("delay");
$protolan->SetRole("link/lan");
$protolan->AddInterface($nodeC, $vnodeC, $vportC, $portC);
$protolan->AddInterface($nodeA, $vnodeA, $vportA, $portA);
$protolansrc->AddMember($nodeA, $portA);
$protolansrc->AddMember($nodeB, $portB);
$protolandst->AddMember($nodeC, $portC);
$protolandst->AddMember($nodeD, $portD);
my ($member0,$delay,$bandwidth,$lossrate, my ($member0,$delay,$bandwidth,$lossrate,
$member1,$rdelay,$rbandwidth,$rlossrate) = @{$delaylinks{$plink}}; $member1,$rdelay,$rbandwidth,$rlossrate) = @{$delaylinks{$plink}};
...@@ -1860,6 +1879,7 @@ foreach $plink (keys(%plinks)) { ...@@ -1860,6 +1879,7 @@ foreach $plink (keys(%plinks)) {
($nodeportC,$nodeportD) = @{$plinks{"linkdelaydst/$lan/$virtA"}}; ($nodeportC,$nodeportD) = @{$plinks{"linkdelaydst/$lan/$virtA"}};
($nodeC,$portC) = split(":",$nodeportC); ($nodeC,$portC) = split(":",$nodeportC);
($nodeD,$portD) = split(":",$nodeportD); ($nodeD,$portD) = split(":",$nodeportD);
($vnodeA,$vportA) = split(":",$virtA);
printdb "LAN delay src: other end = $nodeportC $nodeportD\n"; printdb "LAN delay src: other end = $nodeportC $nodeportD\n";
# #
...@@ -1870,10 +1890,28 @@ foreach $plink (keys(%plinks)) { ...@@ -1870,10 +1890,28 @@ foreach $plink (keys(%plinks)) {
# #
my $dlink = $lan . "/dlink/" . (split(":", $virtA))[0]; my $dlink = $lan . "/dlink/" . (split(":", $virtA))[0];
printdb " VLANS:\n"; my $protolan = ProtoLan->Lookup($experiment, $lan);
AddVlan("link", $dlink, $nodeportA, $nodeportB); if (!defined($protolan)) {
AddVlan("lan", $lan, $nodeportD); $protolan = ProtoLan->Create($experiment, "$lan");
$protolan->SetRole("link/lan");
}
$protolan->AddInterface($nodeA, $vnodeA, $vportA, $portA);
my $protolanlan = ProtoLan->Lookup($experiment, $lan . "-delaylan");
if (!defined($protolanlan)) {
$protolanlan = ProtoLan->Create($experiment, $lan . "-delaylan",
$protolan);
$protolanlan->SetType("vlan");
$protolanlan->SetRole("delay");
}
$protolanlan->AddMember($nodeD, $portD);