本文整理汇总了PHP中convert_friendly_interface_to_real_interface_name函数的典型用法代码示例。如果您正苦于以下问题:PHP convert_friendly_interface_to_real_interface_name函数的具体用法?PHP convert_friendly_interface_to_real_interface_name怎么用?PHP convert_friendly_interface_to_real_interface_name使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了convert_friendly_interface_to_real_interface_name函数的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: get_ipsec_tunnel_src
function get_ipsec_tunnel_src($tunnel)
{
global $g, $config, $sad;
$if = "WAN";
if ($tunnel['interface']) {
$if = $tunnel['interface'];
$realinterface = convert_friendly_interface_to_real_interface_name($if);
$interfaceip = find_interface_ip($realinterface);
}
return $interfaceip;
}
示例2: remove_duplicate
$pools = remove_duplicate($pools, "name");
asort($pools);
}
// Put this in an easy to use form
$dhcpmac = array();
$dhcpip = array();
foreach ($leases as $value) {
$dhcpmac[$value['mac']] = $value['hostname'];
$dhcpip[$value['ip']] = $value['hostname'];
}
exec("/usr/sbin/arp -an", $rawdata);
$i = 0;
/* if list */
$ifdescrs = get_configured_interface_with_descr();
foreach ($ifdescrs as $key => $interface) {
$thisif = convert_friendly_interface_to_real_interface_name($key);
if (!empty($thisif)) {
$hwif[$thisif] = $interface;
}
}
$data = array();
foreach ($rawdata as $line) {
$elements = explode(' ', $line);
if ($elements[3] != "(incomplete)") {
$arpent = array();
$arpent['ip'] = trim(str_replace(array('(', ')'), '', $elements[1]));
$arpent['mac'] = trim($elements[3]);
$arpent['interface'] = trim($elements[5]);
$data[] = $arpent;
}
}
示例3: foreach
foreach ($hosts as $h) {
$h = fixup_host($h, $hostcount++);
if (!empty($h)) {
$hostmatch .= " " . $h;
}
}
if (!empty($hostmatch)) {
$matches[] = "({$hostmatch})";
}
}
if ($count != "0") {
$searchcount = "-c " . $count;
} else {
$searchcount = "";
}
$selectedif = convert_friendly_interface_to_real_interface_name($selectedif);
if ($action == gettext("Start")) {
$matchstr = implode($matches, " and ");
print_info_box(gettext('Packet Capture is running'), 'info');
$cmd = "/usr/sbin/tcpdump -i {$selectedif} {$disablepromiscuous} {$searchcount} -s {$snaplen} -w {$fp}{$fn} " . escapeshellarg($matchstr);
// Debug
//echo $cmd;
mwexec_bg($cmd);
} else {
?>
<div class="panel panel-default">
<div class="panel-heading"><h2 class="panel-title"><?php
echo gettext('Packets Captured');
?>
</h2></div>
示例4: convert_friendly_interface_to_real_interface_name
echo $ifinfo['bridge'];
?>
</td>
</tr>
<?php
}
?>
<?php
if (file_exists("/usr/bin/vmstat")) {
?>
<?php
$real_interface = "";
$interrupt_total = "";
$interrupt_sec = "";
$real_interface = convert_friendly_interface_to_real_interface_name($ifname);
$interrupt_total = `vmstat -i | grep {$real_interface} | awk '{ print \$3 }'`;
$interrupt_sec = `vmstat -i | grep {$real_interface} | awk '{ print \$4 }'`;
if (strstr($interrupt_total, "hci")) {
$interrupt_total = `vmstat -i | grep {$real_interface} | awk '{ print \$4 }'`;
$interrupt_sec = `vmstat -i | grep {$real_interface} | awk '{ print \$5 }'`;
}
$interrupt_total = "";
?>
<?php
if ($interrupt_total) {
?>
<tr>
<td width="22%" class="vncellt">Kesmeler/Saniye</td>
<td width="78%" class="listr">
<?php
示例5: find_interface_ip
?>
)" id="frd<?php
echo $nnats;
?>
" ondblclick="document.location='firewall_nat_edit.php?id=<?php
echo $nnats;
?>
';">
<?php
echo $natent['target'];
?>
<?php
if ($natent['external-address']) {
echo "<br>(ext.: " . $natent['external-address'] . ")";
} else {
echo "<br>(ext.: " . find_interface_ip(convert_friendly_interface_to_real_interface_name($natent['interface'])) . ")";
}
?>
</td>
<td class="listr" onClick="fr_toggle(<?php
echo $nnats;
?>
)" id="frd<?php
echo $nnats;
?>
" ondblclick="document.location='firewall_nat_edit.php?id=<?php
echo $nnats;
?>
';">
<?php
if (!$endport || $beginport == $endport) {
示例6: foreach
<?php
foreach ($periods as $period => $interval) {
/* check which databases are valid for our category */
foreach ($databases as $curdatabase) {
if (!stristr($curdatabase, $curcat)) {
continue;
}
$optionc = split("-", $curdatabase);
$search = array("-", ".rrd", $optionc);
$replace = array(" :: ", "", $friendly);
switch ($curoption) {
case "outbound":
/* only show interfaces with a gateway */
$optionc = "{$optionc['0']}";
$friendly = convert_friendly_interface_to_friendly_descr(strtolower($optionc));
$realif = convert_friendly_interface_to_real_interface_name(strtolower($optionc));
$monitorip = get_interface_gateway(strtolower($optionc));
if ($monitorip == "") {
continue 2;
}
if (!stristr($curdatabase, $optionc)) {
continue 2;
}
break;
case "allgraphs":
/* make sure we do not show the placeholder databases in the all view */
if (stristr($curdatabase, "outbound") || stristr($curdatabase, "allgraphs")) {
continue 2;
}
break;
default:
示例7: sqstat_get_real_interface_address
function sqstat_get_real_interface_address($iface)
{
global $config;
$iface = convert_friendly_interface_to_real_interface_name($iface);
$line = trim(shell_exec("ifconfig {$iface} | grep inet | grep -v inet6"));
list($dummy, $ip, $dummy2, $netmask) = explode(" ", $line);
return array($ip, long2ip(hexdec($netmask)));
}