All new accounts created on Gitlab now require administrator approval. If you invite any collaborators, please let Flux staff know so they can approve the accounts.

Commit ef409c9f authored by Leigh B Stoller's avatar Leigh B Stoller

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

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