initial commit of file from CVS for smeserver-bridge-interface on Sat Sep 7 20:11:17 AEST 2024

This commit is contained in:
Trevor Batley
2024-09-07 20:11:17 +10:00
parent 0eb5db4833
commit ed0be2fd72
16 changed files with 530 additions and 2 deletions

View File

@@ -0,0 +1 @@
br0

View File

@@ -0,0 +1 @@
enabled

View File

@@ -0,0 +1 @@
tap0

View File

@@ -0,0 +1 @@
service

View File

@@ -0,0 +1,21 @@
{
my $bridge = $DB->get('bridge') || $DB->new_record('bridge', {type => 'service'});
my $brStatus = $bridge->prop('status') || 'enabled';
# Return nothing if bridge is disabled
return "" if ($brStatus eq 'disabled');
my $br = $bridge->prop('bridgeInterface') || 'br0';
my $IntIfConf = $DB->get('InternalInterface');
my $IntIfName = $IntIfConf->prop('Name');
# If the InternalInterface Name is the same as the bridge, there's nothing to do
return "" if ($IntIfName eq $br);
# else, we store the old InternalInterface Name in ethernetInterface
# and we set the InternalInterface to be the bridge
$bridge->set_prop('ethernetInterface',$IntIfName);
$IntIfConf->set_prop('Name',$br);
}