コード例 #1
0
ファイル: services_ntpd.php プロジェクト: jefersonJim/pfsense
function build_interface_list()
{
    global $pconfig;
    $iflist = array('options' => array(), 'selected' => array());
    $interfaces = get_configured_interface_with_descr();
    $carplist = get_configured_carp_interface_list();
    foreach ($carplist as $cif => $carpip) {
        $interfaces[$cif] = $carpip . " (" . get_vip_descr($carpip) . ")";
    }
    $aliaslist = get_configured_ip_aliases_list();
    foreach ($aliaslist as $aliasip => $aliasif) {
        $interfaces[$aliasip] = $aliasip . " (" . get_vip_descr($aliasip) . ")";
    }
    $size = count($interfaces) < 10 ? count($interfaces) : 10;
    foreach ($interfaces as $iface => $ifacename) {
        if (!is_ipaddr(get_interface_ip($iface)) && !is_ipaddr($iface)) {
            continue;
        }
        $iflist['options'][$iface] = $ifacename;
        if (in_array($iface, $pconfig['interface'])) {
            array_push($iflist['selected'], $iface);
        }
    }
    return $iflist;
}
コード例 #2
0
				<tr>
                  <td width="22%" valign="top" class="vncellreq"><?php 
echo gettext("Parent interface");
?>
</td>
                  <td width="78%" class="vtable">
                    <select name="if" class="formselect">
                      <?php 
$portlist = get_configured_interface_with_descr();
$carplist = get_configured_carp_interface_list();
foreach ($carplist as $cif => $carpip) {
    $portlist[$cif] = $carpip . " (" . get_vip_descr($carpip) . ")";
}
$aliaslist = get_configured_ip_aliases_list();
foreach ($aliaslist as $aliasip => $aliasif) {
    $portlist[$aliasif . '|' . $aliasip] = $aliasip . " (" . get_vip_descr($aliasip) . ")";
}
foreach ($portlist as $ifn => $ifinfo) {
    echo "<option value=\"{$ifn}\"";
    if ($ifn == $pconfig['if']) {
        echo " selected=\"selected\"";
    }
    echo ">" . htmlspecialchars($ifinfo) . "</option>\n";
}
?>
                    </select>
			<br />
			<span class="vexpl"><?php 
echo gettext("The interface here serves as the local address to be used for the gif tunnel.");
?>
</span></td>
コード例 #3
0
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;
}
コード例 #4
0
function build_if_list()
{
    $list = array();
    $interfaces = get_configured_interface_with_descr();
    $carplist = get_configured_carp_interface_list();
    foreach ($carplist as $cif => $carpip) {
        $interfaces[$cif . '|' . $carpip] = $carpip . " (" . get_vip_descr($carpip) . ")";
    }
    $aliaslist = get_configured_ip_aliases_list();
    foreach ($aliaslist as $aliasip => $aliasif) {
        $interfaces[$aliasif . '|' . $aliasip] = $aliasip . " (" . get_vip_descr($aliasip) . ")";
    }
    $grouplist = return_gateway_groups_array();
    foreach ($grouplist as $name => $group) {
        if ($group['ipprotocol'] != inet) {
            continue;
        }
        if ($group[0]['vip'] != "") {
            $vipif = $group[0]['vip'];
        } else {
            $vipif = $group[0]['int'];
        }
        $interfaces[$name] = "GW Group {$name}";
    }
    $interfaces['lo0'] = "Localhost";
    $interfaces['any'] = "any";
    foreach ($interfaces as $iface => $ifacename) {
        $list[$iface] = $ifacename;
    }
    return $list;
}
コード例 #5
0
echo gettext("Other");
?>
				  </td>
				</tr>
				<tr>
				  <td width="22%" valign="top" class="vncellreq"><?php 
echo gettext("Interface");
?>
</td>
				  <td width="78%" class="vtable">
					<select name="interface" class="formselect">
					<?php 
$interfaces = get_configured_interface_with_descr(false, true);
$carplist = get_configured_carp_interface_list();
foreach ($carplist as $cif => $carpip) {
    $interfaces[$cif] = $carpip . ' (' . get_vip_descr($carpip) . ')';
}
$interfaces['lo0'] = 'Localhost';
foreach ($interfaces as $iface => $ifacename) {
    ?>
						<option value="<?php 
    echo $iface;
    ?>
" <?php 
    if ($iface == $pconfig['interface']) {
        echo "selected=\"selected\"";
    }
    ?>
>
						<?php 
    echo htmlspecialchars($ifacename);
コード例 #6
0
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;
}
コード例 #7
0
function build_bridge_list()
{
    $list = array();
    $serverbridge_interface['none'] = "none";
    $serverbridge_interface = array_merge($serverbridge_interface, get_configured_interface_with_descr());
    $carplist = get_configured_carp_interface_list();
    foreach ($carplist as $cif => $carpip) {
        $serverbridge_interface[$cif . '|' . $carpip] = $carpip . " (" . get_vip_descr($carpip) . ")";
    }
    $aliaslist = get_configured_ip_aliases_list();
    foreach ($aliaslist as $aliasip => $aliasif) {
        $serverbridge_interface[$aliasif . '|' . $aliasip] = $aliasip . " (" . get_vip_descr($aliasip) . ")";
    }
    foreach ($serverbridge_interface as $iface => $ifacename) {
        $list[$iface] = htmlspecialchars($ifacename);
    }
    return $list;
}
コード例 #8
0
$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.');
$section->addInput(new Form_Input('ramaxrtradvinterval', 'Maximum RA interval', 'number', $pconfig['ramaxrtradvinterval'], ['min' => 4, 'max' => 1800]))->setHelp('The maximum time allowed between sending unsolicited multicast router advertisements in seconds.');
$section->addInput(new Form_Input('raadvdefaultlifetime', 'Router lifetime', 'number', $pconfig['raadvdefaultlifetime'], ['min' => 1, 'max' => 9000]))->setHelp('The lifetime associated with the default router in seconds.');
$section->addInput(new Form_StaticText('RA Subnets', $subnets_help));
if (empty($pconfig['subnets'])) {
    $pconfig['subnets'] = array('0' => '/128');
}
$counter = 0;
$numrows = count($pconfig['subnets']) - 1;
foreach ($pconfig['subnets'] as $subnet) {
コード例 #9
0
echo gettext("GRE configuration");
?>
</td>
				</tr>
				<tr>
                  <td width="22%" valign="top" class="vncellreq"><?php 
echo gettext("Parent interface");
?>
</td>
                  <td width="78%" class="vtable">
                    <select name="if" class="formselect">
                      <?php 
$portlist = get_configured_interface_with_descr();
$carplist = get_configured_carp_interface_list();
foreach ($carplist as $cif => $carpip) {
    $portlist[$cif] = $carpip . " (" . get_vip_descr($carpip) . ")";
}
foreach ($portlist as $ifn => $ifinfo) {
    echo "<option value=\"{$ifn}\"";
    if ($ifn == $pconfig['if']) {
        echo "selected";
    }
    echo ">{$ifinfo}</option>";
}
?>
                    </select>
			<br/>
			<span class="vexpl"><?php 
echo gettext("The interface here serves as the local address to be used for the GRE tunnel.");
?>
</span></td>
コード例 #10
0
function build_interface_list()
{
    $interfaces = get_configured_interface_with_descr();
    $carplist = get_configured_carp_interface_list();
    foreach ($carplist as $cif => $carpip) {
        $interfaces[$cif] = $carpip . " (" . get_vip_descr($carpip) . ")";
    }
    $aliaslist = get_configured_ip_aliases_list();
    foreach ($aliaslist as $aliasip => $aliasif) {
        $interfaces[$aliasip] = $aliasip . " (" . get_vip_descr($aliasip) . ")";
    }
    $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] = "GW Group {$name}";
    }
    return $interfaces;
}
コード例 #11
0
</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'] != "") {
        ?>
				<tr>
					<td>
<?php 
        if ($vipent['type'] == "single" || $vipent['type'] == "network") {
コード例 #12
0
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;
}
コード例 #13
0
ファイル: vpn_ipsec.php プロジェクト: nwholloway/pfsense
    } elseif ($ph1ent['iketype'] == "ikev2") {
        echo "V2";
    } elseif ($ph1ent['iketype'] == "auto") {
        echo "Auto";
    }
    ?>
						</td>
						<td>
<?php 
    if ($ph1ent['interface']) {
        $iflabels = get_configured_interface_with_descr();
        $viplist = get_configured_vip_list();
        foreach ($viplist as $vip => $address) {
            $iflabels[$vip] = $address;
            if (get_vip_descr($address)) {
                $iflabels[$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'];
            }
            $iflabels[$name] = "GW Group {$name}";
        }
        $if = htmlspecialchars($iflabels[$ph1ent['interface']]);
    } else {
        $if = "WAN";
    }
コード例 #14
0
ファイル: vpn_openvpn_client.php プロジェクト: Anasxrt/core
					<tr>
						<td><i class="fa fa-info-circle text-muted"></i> <?php 
    echo gettext("Interface");
    ?>
</td>
						<td>
							<select name="interface" class="form-control">
<?php 
    $interfaces = get_configured_interface_with_descr();
    $carplist = get_configured_carp_interface_list();
    foreach ($carplist as $cif => $carpip) {
        $interfaces[$cif . '|' . $carpip] = $carpip . " (" . get_vip_descr($carpip) . ")";
    }
    $aliaslist = get_configured_ip_aliases_list();
    foreach ($aliaslist as $aliasip => $aliasif) {
        $interfaces[$aliasif . '|' . $aliasip] = $aliasip . " (" . get_vip_descr($aliasip) . ")";
    }
    $grouplist = return_gateway_groups_array();
    foreach ($grouplist as $name => $group) {
        if ($group['ipprotocol'] != inet) {
            continue;
        }
        if ($group[0]['vip'] != "") {
            $vipif = $group[0]['vip'];
        } else {
            $vipif = $group[0]['int'];
        }
        $interfaces[$name] = "GW Group {$name}";
    }
    $interfaces['lo0'] = "Localhost";
    $interfaces['any'] = "any";
コード例 #15
0
ファイル: firewall_virtual_ip.php プロジェクト: geijt/pfsense
echo gettext("Type");
?>
</th>
					<th><?php 
echo gettext("Description");
?>
</th>
					<th><!--Buttons--></th>
				</tr>
			</thead>
			<tbody>
<?php 
$interfaces = get_configured_interface_with_descr(false, true);
$carplist = get_configured_carp_interface_list();
foreach ($carplist as $cif => $carpip) {
    $interfaces[$cif] = $carpip . " (" . get_vip_descr($carpip) . ")";
}
$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'] != "") {
        ?>
				<tr>
					<td>
<?php 
        if ($vipent['type'] == "single" || $vipent['type'] == "network") {
            if ($vipent['subnet_bits']) {
                print "{$vipent['subnet']}/{$vipent['subnet_bits']}";
            }
        }
        if ($vipent['type'] == "range") {
コード例 #16
0
function build_if_list()
{
    $list = array();
    $interfaces = get_configured_interface_with_descr(false, true);
    $carplist = get_configured_carp_interface_list();
    foreach ($carplist as $cif => $carpip) {
        $interfaces[$cif] = $carpip . ' (' . get_vip_descr($carpip) . ')';
    }
    $interfaces['lo0'] = 'Localhost';
    return $interfaces;
}
コード例 #17
0
ファイル: vpn_ipsec.php プロジェクト: nmccurdy/pfsense
    ?>
)" id="frd<?php 
    echo $i;
    ?>
">
							<?php 
    echo $spans;
    if ($ph1ent['interface']) {
        $iflabels = get_configured_interface_with_descr();
        $carplist = get_configured_carp_interface_list();
        foreach ($carplist as $cif => $carpip) {
            $iflabels[$cif] = $carpip . " (" . get_vip_descr($carpip) . ")";
        }
        $aliaslist = get_configured_ip_aliases_list();
        foreach ($aliaslist as $aliasip => $aliasif) {
            $iflabels[$aliasip] = $aliasip . " (" . get_vip_descr($aliasip) . ")";
        }
        $grouplist = return_gateway_groups_array();
        foreach ($grouplist as $name => $group) {
            if ($group[0]['vip'] != "") {
                $vipif = $group[0]['vip'];
            } else {
                $vipif = $group[0]['int'];
            }
            $iflabels[$name] = "GW Group {$name}";
        }
        $if = htmlspecialchars($iflabels[$ph1ent['interface']]);
    } else {
        $if = "WAN";
    }
    if (!isset($ph1ent['mobile'])) {
コード例 #18
0
ファイル: vpn_openvpn_server.php プロジェクト: aya/core
											<td width="22%" ><a id="help_for_serverbridge_interface" href="#" class="showhelp"><i class="fa fa-info-circle"></i></a> <?php 
    echo gettext("Bridge Interface");
    ?>
</td>
											<td>
												<select name="serverbridge_interface" class="form-control">
													<?php 
    $serverbridge_interface['none'] = "none";
    $serverbridge_interface = array_merge($serverbridge_interface, get_configured_interface_with_descr());
    $carplist = get_configured_carp_interface_list();
    foreach ($carplist as $cif => $carpip) {
        $serverbridge_interface[$cif . '|' . $carpip] = $carpip . " (" . get_vip_descr($carpip) . ")";
    }
    $aliaslist = get_configured_ip_aliases_list();
    foreach ($aliaslist as $aliasip => $aliasif) {
        $serverbridge_interface[$aliasif . '|' . $aliasip] = $aliasip . " (" . get_vip_descr($aliasip) . ")";
    }
    foreach ($serverbridge_interface as $iface => $ifacename) {
        $selected = "";
        if ($iface == $pconfig['serverbridge_interface']) {
            $selected = "selected=\"selected\"";
        }
        ?>
                                                    <option value="<?php 
        echo $iface;
        ?>
" <?php 
        echo $selected;
        ?>
>
                                                        <?php 
コード例 #19
0
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;
}