$tabscounter++; } if ($tabscounter == 0) { include "foot.inc"; 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 />' . ' <strong>Router Only</strong> to only advertise this router' . '<br />' . ' <strong>Unmanaged</strong> for Router Advertising with Stateless Autoconfig' . '<br />' . ' <strong>Managed</strong> for assignment through a DHCPv6 Server' . '<br />' . ' <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.');
function build_interface_list() { $interfaces = get_configured_interface_with_descr(); $viplist = get_configured_vip_list(); foreach ($viplist as $vip => $address) { $interfaces[$vip] = $address; if (get_vip_descr($address)) { $interfaces[$vip] .= " (" . get_vip_descr($address) . ")"; } } $grouplist = return_gateway_groups_array(); foreach ($grouplist as $name => $group) { if ($group[0]['vip'] != "") { $vipif = $group[0]['vip']; } else { $vipif = $group[0]['int']; } $interfaces[$name] = sprintf(gettext("GW Group %s"), $name); } return $interfaces; }
function build_vip_list($family = 'all') { $list = array('address' => gettext('Interface Address')); $viplist = get_configured_vip_list($family); foreach ($viplist as $vip => $address) { $list[$vip] = "{$address}"; if (get_vip_descr($address)) { $list[$vip] .= " (" . get_vip_descr($address) . ")"; } } return $list; }
?> </th> <th><?php echo gettext("Description"); ?> </th> <th><?php echo gettext("Actions"); ?> </th> </tr> </thead> <tbody> <?php $interfaces = get_configured_interface_with_descr(false, true); $viplist = get_configured_vip_list(); foreach ($viplist as $vipname => $address) { $interfaces[$vipname] = $address; $interfaces[$vipname] .= " ("; if (get_vip_descr($address)) { $interfaces[$vipname] .= get_vip_descr($address); } else { $vip = get_configured_vip($vipname); $interfaces[$vipname] .= "vhid: {$vip['vhid']}"; } $interfaces[$vipname] .= ")"; } $interfaces['lo0'] = "Localhost"; $i = 0; foreach ($a_vip as $vipent) { if ($vipent['subnet'] != "" or $vipent['range'] != "" or $vipent['subnet_bits'] != "" or isset($vipent['range']['from']) && $vipent['range']['from'] != "") {
function build_if_list() { $list = array(); $interfaces = get_configured_interface_with_descr(false, true); $carplist = get_configured_vip_list(); foreach ($carplist as $vipname => $address) { $vip = get_configured_vip($vipname); if ($vip['mode'] != 'carp') { continue; } $interfaces[$vipname] = $address; $interfaces[$vipname] .= " ("; if (get_vip_descr($address)) { $interfaces[$vipname] .= get_vip_descr($address); } else { $interfaces[$vipname] .= "vhid: {$vip['vhid']}"; } $interfaces[$vipname] .= ")"; } $interfaces['lo0'] = 'Localhost'; return $interfaces; }
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; }