Commit 4f2d3b19 authored by Leigh B Stoller's avatar Leigh B Stoller

Initial support for MLEs.

parent 95717591
......@@ -1054,6 +1054,7 @@ sub LoadVirtLans($)
my $encap = $vlanmember->encap_style();
my $mask = $vlanmember->mask();
my $ip = $vlanmember->ip();
my $layer = $vlanmember->layer();
my $fixed_iface = $vlanmember->fixed_iface();
my ($vname,$vport) = split(":", $vlanmember->member());
......@@ -1090,6 +1091,7 @@ sub LoadVirtLans($)
# Whether all member nodes are simulated
$virtlan->_allsim(0);
$virtlan->_protocol($protocol);
$virtlan->_layer($layer);
$virtlan->_accesspoint($vlanmember)
if ($vlanmember->is_accesspoint());
$virtlan->_sharednodes(0);
......@@ -1565,6 +1567,7 @@ sub GenVirtLans($)
my $nobwshaping = $vlan->_nobwshaping();
my $protocol = $vlan->_protocol();
my $encap = $vlan->_encapstyle();
my $layer = $vlan->_layer();
#
# Count the types of nodes (simulated, virtual, real, etc.) in this
......@@ -1692,6 +1695,17 @@ sub GenVirtLans($)
if ($osdoeslinkdelays{$osid});
}
#
# Layer 1 links cannot be any of these things right now.
# Just a wire.
#
if ($layer == 1 &&
($trivial_ok || $emulated || $uselinkdelay ||
$mustdelay || $nobwshaping || $sharednodes || $simnodes)) {
tberror("$vname is a layer 1 link, no optons please.\n");
return -1;
}
$self->printdb("$vname: members = ".
scalar(@members) .
" real/virt/sim = ".
......@@ -2065,7 +2079,9 @@ sub GenVirtLans($)
# Link must be shaped for other reasons (q_red).
$mustdelay ||
# Global force, or per-link force.
$self->option('forcelinkdelays') || $uselinkdelay)) {
$self->option('forcelinkdelays') || $uselinkdelay) &&
# Only layer 2 is shaped.
$layer == 2) {
# Need a delay node and its really a shaped link.
$shaped = 1;
# Mark the links as shaped for later.
......@@ -2229,6 +2245,9 @@ sub GenVirtLans($)
# Let assign choose bw if top_bw is zero.
$spec .= ($top_bw == 0 ? "*" : $top_bw);
}
if ($layer == 1) {
$protocol = "wire";
}
$spec .= " 0 0 $protocol";
$spec .= " emulated" if ($emulated);
......@@ -4331,6 +4350,7 @@ sub InterpLinks($)
# trivial links do not have physical links, but could be using
# virtual interfaces on the same node.
#
#
if (! $trivial) {
$nodeB = $member1->_pnode();
$portB = $member1->_pport();
......@@ -4338,7 +4358,18 @@ sub InterpLinks($)
$self->printdb("LINK simple: $virtA,$virtB - ".
"$nodeA:$portA,$nodeB:$portB\n");
if ($virtlan->usevirtiface()) {
if ($virtlan->_layer() == 1) {
#
# Just a wire.
#
$protolink = ProtoLan->Create($experiment, $lan,
$self->impotent());
$protolink->SetType("wire");
$protolink->SetRole("link");
$protolink->AddInterface($nodeA, $vnodeA, $vportA, $portA);
$protolink->AddInterface($nodeB, $vnodeB, $vportB, $portB);
}
elsif ($virtlan->usevirtiface()) {
my $protovlan;
#
......@@ -5766,7 +5797,7 @@ sub UploadVlans($)
# "veth" implemented vlans, we have to merge the overlapping vlans
# into "supervlans". Must be done iteratively of course.
#
$self->printdb("Dumping vlans before merging.\n");
$self->printdb("Dumping protolans before merging.\n");
ProtoLan->DumpAll()
if ($self->verbose());
......@@ -5817,7 +5848,7 @@ sub UploadVlans($)
}
if (!$self->impotent()) {
$self->printdb("Uploading vlans table.\n");
$self->printdb("Uploading protolans table.\n");
ProtoLan->DumpAll()
if ($self->verbose());
if (ProtoLan->InstantiateAll($self->regression()) != 0) {
......@@ -5862,7 +5893,7 @@ sub UploadVlans($)
}
}
else {
$self->printdb("Dumping final vlans table.\n");
$self->printdb("Dumping final protolans table.\n");
ProtoLan->DumpAll()
if ($self->verbose());
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment