Ejemplo n.º 1
0
function build_if_list($selectedifs)
{
    $interface_addresses = get_possible_listen_ips(true);
    $iflist = array('options' => array(), 'selected' => array());
    $iflist['options']['all'] = gettext("All");
    if (empty($selectedifs) || empty($selectedifs[0]) || in_array("all", $selectedifs)) {
        array_push($iflist['selected'], "all");
    }
    foreach ($interface_addresses as $laddr => $ldescr) {
        $iflist['options'][$laddr] = htmlspecialchars($ldescr);
        if ($selectedifs && in_array($laddr, $selectedifs)) {
            array_push($iflist['selected'], $laddr);
        }
    }
    unset($interface_addresses);
    return $iflist;
}
Ejemplo n.º 2
0
function build_parent_list()
{
    global $g;
    $parentlist = array();
    $portlist = get_possible_listen_ips();
    $count = 0;
    foreach ($portlist as $ifn => $ifinfo) {
        if (preg_match($g['wireless_regex'], $ifn)) {
            $parentlist[$ifn] = htmlspecialchars($ifn . '(' . $ifinfo['mac'] . ')');
            $count++;
        }
    }
    if ($count > 0) {
        return $parentlist;
    } else {
        return array('0' => gettext('None available'));
    }
}
Ejemplo n.º 3
0
echo gettext("Interface Binding");
?>
</strong></td>
				<td align="right" class="optsect_s">&nbsp;</td></tr>
			</table></td>
		</tr>
		<tr>
			<td width="22%" valign="top" class="vncellreq"><?php 
echo gettext("Bind Interface");
?>
</td>
			<td width="78%" class="vtable">
				<select name="bindip" class="formselect">
					<option value="">All</option>
				<?php 
$listenips = get_possible_listen_ips();
foreach ($listenips as $lip) {
    $selected = "";
    if ($lip['value'] == $pconfig['bindip']) {
        $selected = "selected=\"selected\"";
    }
    ?>
					<option value="<?php 
    echo $lip['value'];
    ?>
" <?php 
    echo $selected;
    ?>
>
						<?php 
    echo htmlspecialchars($lip['name']);
Ejemplo n.º 4
0
function build_parent_list()
{
    $parentlist = array();
    $portlist = get_possible_listen_ips();
    foreach ($portlist as $ifn => $ifinfo) {
        $parentlist[$ifn] = $ifinfo;
    }
    return $parentlist;
}
Ejemplo n.º 5
0
function build_iplist()
{
    $listenips = get_possible_listen_ips();
    $iplist = array();
    $iplist[''] = 'All';
    foreach ($listenips as $lip => $ldescr) {
        $iplist[$lip] = $ldescr;
    }
    unset($listenips);
    return $iplist;
}
Ejemplo n.º 6
0
function build_if_list()
{
    $interface_addresses = get_possible_listen_ips(true);
    $iflist = array('options' => array(), 'selected' => array());
    $iflist['options'][""] = "All";
    if (empty($pconfig['interface']) || empty($pconfig['interface'][0])) {
        array_push($iflist['selected'], "");
    }
    foreach ($interface_addresses as $laddr => $ldescr) {
        $iflist['options'][$laddr] = htmlspecialchars($ldescr);
        if ($pconfig['interface'] && in_array($laddr, $pconfig['interface'])) {
            array_push($iflist['selected'], $laddr);
        }
    }
    unset($interface_addresses);
    return $iflist;
}
Ejemplo n.º 7
0
														</option>
														<?php 
}
?>
													</select>
													<br /><br />
												</td>
											</tr>
											<tr>
												<td width="22%" valign="top" class="vncellreq"><?php 
echo gettext("Outgoing Network Interfaces");
?>
</td>
												<td width="78%" class="vtable">
													<?php 
$interface_addresses = get_possible_listen_ips(true);
$size = count($interface_addresses) + 1;
?>
													<?php 
echo gettext("Utilize different network interface(s) that the DNS Resolver will use to send queries to authoritative servers and receive their replies. By default all interfaces are used.");
?>
													<br /><br />
													<select id="outgoing_interface" name="outgoing_interface[]" multiple="multiple" size="3" class="selectpicker" data-live-search="true">
														<option value="" <?php 
if (empty($pconfig['outgoing_interface']) || empty($pconfig['outgoing_interface'][0])) {
    echo 'selected="selected"';
}
?>
>All</option>
														<?php 
foreach ($interface_addresses as $laddr) {
Ejemplo n.º 8
0
	<table width="100%" border="0" cellpadding="6" cellspacing="0" summary="interfaces gif edit">
		<tr>
			<td colspan="2" valign="top" class="listtopic"><?php 
echo gettext("GIF 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_possible_listen_ips();
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>