Commit 71820415 authored by Leigh Stoller's avatar Leigh Stoller

Add FindLanByInterface() function to map interface to the lan

it is in.
parent aea29c15
......@@ -1059,6 +1059,29 @@ sub ExperimentLans($$$)
return 0;
}
#
# Find a lan by looking an interface in the member list
#
sub FindLanByInterface($$$)
{
my ($class, $experiment, $interface) = @_;
my $exptidx = $experiment->idx();
my $iface = $interface->iface();
my @lans = ();
#
# We do not do this often, so worry about optimizing later.
#
return undef
if (Lan->ExperimentLans($experiment, \@lans) != 0);
foreach my $lan (@lans) {
return $lan
if ($lan->IsMember($interface->node_id(), $interface->iface()));
}
return undef;
}
#
# Initialize from vlans table. Used when converting from old vlans table.
#
......
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