Commit ef409c9f authored by Leigh Stoller's avatar Leigh Stoller

Add IsShared() predicate; is lan a shared vlan.

parent ae15b83d
......@@ -1278,6 +1278,23 @@ sub LookupSharedVLanByToken($$)
return $query_result->fetchrow_hashref();
}
#
# Is this lan shared?
#
sub IsShared($)
{
my ($self) = @_;
my $lanid = $self->lanid();
my $query_result =
DBQueryWarn("select * from shared_vlans ".
"where lanid='$lanid'");
return undef
if (!$query_result);
return $query_result->numrows();
}
#
# Try to lock this lan. Optional timeout in seconds.
#
......@@ -3602,6 +3619,16 @@ sub Unlock($)
return $self->GetLan()->Unlock();
}
#
# Is this vlan shared?
#
sub IsShared($)
{
my ($self) = @_;
return $self->GetLan()->IsShared();
}
############################################################################
#
# Another convenience package, for tunnels.
......
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