Commit 051eab3d authored by Ad Schellevis's avatar Ad Schellevis Committed by Franco Fichtner

(legacy) move is_radvd_enabled to services.inc (single use)

parent a49c15d4
...@@ -418,57 +418,6 @@ function reload_ttys() ...@@ -418,57 +418,6 @@ function reload_ttys()
exec('/bin/kill -HUP 1'); exec('/bin/kill -HUP 1');
} }
/* radvd enabled on any interfaces? */
function is_radvd_enabled() {
global $config;
if (!isset($config['dhcpdv6']) || !is_array($config['dhcpdv6'])) {
$config['dhcpdv6'] = array();
}
$dhcpdv6cfg = $config['dhcpdv6'];
$Iflist = get_configured_interface_list();
/* handle manually configured DHCP6 server settings first */
foreach ($dhcpdv6cfg as $dhcpv6if => $dhcpv6ifconf) {
if(!isset($config['interfaces'][$dhcpv6if]['enable']))
continue;
if(!isset($dhcpv6ifconf['ramode']))
$dhcpv6ifconf['ramode'] = $dhcpv6ifconf['mode'];
if($dhcpv6ifconf['ramode'] == "disabled")
continue;
$ifcfgipv6 = get_interface_ipv6($dhcpv6if);
if(!is_ipaddrv6($ifcfgipv6))
continue;
return true;
}
/* handle DHCP-PD prefixes and 6RD dynamic interfaces */
foreach ($Iflist as $if => $ifdescr) {
if(!isset($config['interfaces'][$if]['track6-interface']))
continue;
if(!isset($config['interfaces'][$if]['enable']))
continue;
$ifcfgipv6 = get_interface_ipv6($if);
if(!is_ipaddrv6($ifcfgipv6))
continue;
$ifcfgsnv6 = get_interface_subnetv6($if);
$subnetv6 = gen_subnetv6($ifcfgipv6, $ifcfgsnv6);
if(!is_ipaddrv6($subnetv6))
continue;
return true;
}
return false;
}
/* Any PPPoE servers enabled? */ /* Any PPPoE servers enabled? */
function is_pppoe_server_enabled() { function is_pppoe_server_enabled() {
......
...@@ -2696,3 +2696,55 @@ function get_service_control_links($service, $addname = false) { ...@@ -2696,3 +2696,55 @@ function get_service_control_links($service, $addname = false) {
} }
return $output; return $output;
} }
/* radvd enabled on any interfaces? */
function is_radvd_enabled() {
global $config;
if (!isset($config['dhcpdv6']) || !is_array($config['dhcpdv6'])) {
$config['dhcpdv6'] = array();
}
$dhcpdv6cfg = $config['dhcpdv6'];
$Iflist = get_configured_interface_list();
/* handle manually configured DHCP6 server settings first */
foreach ($dhcpdv6cfg as $dhcpv6if => $dhcpv6ifconf) {
if(!isset($config['interfaces'][$dhcpv6if]['enable']))
continue;
if(!isset($dhcpv6ifconf['ramode']))
$dhcpv6ifconf['ramode'] = $dhcpv6ifconf['mode'];
if($dhcpv6ifconf['ramode'] == "disabled")
continue;
$ifcfgipv6 = get_interface_ipv6($dhcpv6if);
if(!is_ipaddrv6($ifcfgipv6))
continue;
return true;
}
/* handle DHCP-PD prefixes and 6RD dynamic interfaces */
foreach ($Iflist as $if => $ifdescr) {
if(!isset($config['interfaces'][$if]['track6-interface']))
continue;
if(!isset($config['interfaces'][$if]['enable']))
continue;
$ifcfgipv6 = get_interface_ipv6($if);
if(!is_ipaddrv6($ifcfgipv6))
continue;
$ifcfgsnv6 = get_interface_subnetv6($if);
$subnetv6 = gen_subnetv6($ifcfgipv6, $ifcfgsnv6);
if(!is_ipaddrv6($subnetv6))
continue;
return true;
}
return false;
}
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