exit;
}
display_top_tabs($tab_array);
$tab_array = array();
$tab_array[] = array(gettext("DHCPv6 Server"), false, "services_dhcpv6.php?if={$if}");
$tab_array[] = array(gettext("Router Advertisements"), true, "services_router_advertisements.php?if={$if}");
display_top_tabs($tab_array, false, 'nav nav-tabs');
$form = new Form();
$section = new Form_Section('Advertisements');
$section->addInput(new Form_Select('ramode', 'Router mode', $pconfig['ramode'], $advertise_modes))->setHelp('Select the Operating Mode for the Router Advertisement (RA) Daemon. Use:' . '<br />' . '&nbsp;<strong>Router Only</strong> to only advertise this router' . '<br />' . '&nbsp;<strong>Unmanaged</strong> for Router Advertising with Stateless Autoconfig' . '<br />' . '&nbsp;<strong>Managed</strong> for assignment through a DHCPv6 Server' . '<br />' . '&nbsp;<strong>Assisted</strong> for DHCPv6 Server assignment combined with Stateless Autoconfig. ' . 'It is not required to activate this DHCPv6 server when set to "Managed", this can be another host on the network');
$section->addInput(new Form_Select('rapriority', 'Router priority', $pconfig['rapriority'], $priority_modes))->setHelp('Select the Priority for the Router Advertisement (RA) Daemon.');
$carplist = get_configured_vip_list("inet6", VIP_CARP);
$carplistif = array();
if (count($carplist) > 0) {
    foreach ($carplist as $ifname => $vip) {
        if (get_configured_vip_interface($ifname) == $if) {
            $carplistif[$ifname] = $vip;
        }
    }
}
if (count($carplistif) > 0) {
    $iflist = array();
    $iflist['interface'] = strtoupper($if);
    foreach ($carplistif as $ifname => $vip) {
        $iflist[$ifname] = get_vip_descr($vip) . " - " . $vip;
    }
    $section->addInput(new Form_Select('rainterface', 'RA Interface', $pconfig['rainterface'], $iflist))->setHelp('Select the Interface for the Router Advertisement (RA) Daemon.');
}
$section->addInput(new Form_Input('ravalidlifetime', 'Default valid lifetime', 'number', $pconfig['ravalidlifetime'], ['min' => 1, 'max' => 655350]))->setHelp('The length of time in seconds (relative to the time the packet is sent) that the prefix is valid for the purpose of on-link determination.' . ' <br />' . 'The default is 86400 seconds.');
$section->addInput(new Form_Input('rapreferredlifetime', 'Default preferred lifetime', 'text', $pconfig['rapreferredlifetime']))->setHelp('Seconds. The length of time in seconds (relative to the time the packet is sent) that addresses generated from the prefix via stateless address autoconfiguration remain preferred.' . ' <br />' . 'The default is 14400 seconds.');
$section->addInput(new Form_Input('raminrtradvinterval', 'Minimum RA interval', 'number', $pconfig['raminrtradvinterval'], ['min' => 3, 'max' => 1350]))->setHelp('The minimum time allowed between sending unsolicited multicast router advertisements in seconds.');
function build_vip_list($family = 'all')
{
    global $gateway;
    $list = array('address' => gettext('Interface Address'));
    $viplist = get_configured_vip_list($family);
    foreach ($viplist as $vip => $address) {
        if ($gateway['friendlyiface'] == get_configured_vip_interface($vip)) {
            $list[$vip] = "{$address}";
            if (get_vip_descr($address)) {
                $list[$vip] .= " (" . get_vip_descr($address) . ")";
            }
        }
    }
    return $list;
}