本文整理汇总了PHP中Asset_host::is_ip_in_nets方法的典型用法代码示例。如果您正苦于以下问题:PHP Asset_host::is_ip_in_nets方法的具体用法?PHP Asset_host::is_ip_in_nets怎么用?PHP Asset_host::is_ip_in_nets使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Asset_host
的用法示例。
在下文中一共展示了Asset_host::is_ip_in_nets方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: host_get_network_data
function host_get_network_data($ip, $groups, $networks)
{
// search in groups
$groups_belong['groups'] = array();
$groups_belong['nets'] = array();
foreach ($groups as $group_name => $g_data) {
foreach ($g_data['nets'] as $net_name => $n_data) {
$address = $n_data['address'];
if (!strpos($address, "/")) {
// tvvcox: i've detected some wrong network addresses, catch them with that
//echo "<font color='red'>"._("Invalid network address for")." $net_name: $address</font><br>";
continue;
}
if (Asset_host::is_ip_in_nets($ip, $address)) {
if (!$n_data['has_perms'] && !check_sensor_perms($ip, 'host')) {
continue;
}
$groups_belong['groups'][$group_name]++;
$groups_belong['nets'][$net_name] = $n_data;
}
}
}
// search in nets
foreach ($networks as $net_name => $n_data) {
$address = $n_data['address'];
if ($address != "" && Asset_host::is_ip_in_nets($ip, $address)) {
if (!$n_data['has_perms'] && !check_sensor_perms($ip, 'host')) {
continue;
}
$groups_belong['nets'][$net_name] = $n_data;
}
}
return $groups_belong;
}
示例2: foreach
<?php
/*
* Hosts
*/
/*
* If click on a net, only show hosts of this net
*/
if (GET('net')) {
$_net_aux = Asset_net::get_object($conn, $net_id);
if (is_object($_net_aux)) {
$ips = $_net_aux->get_ips();
print "<h1>{$ips}</h1>";
if ($ip_list = Asset_host_qualification::get_list($conn)) {
foreach ($ip_list as $host_qualification) {
if (Asset_host::is_ip_in_nets($host_qualification->get_host_ip(), $ips)) {
$ip_stats[] = new Asset_host_qualification($host_qualification->get_host_ip(), $host_qualification->get_compromise(), $host_qualification->get_attack());
}
}
}
}
} else {
$ip_stats = Asset_host_qualification::get_list($conn, '', 'ORDER BY compromise + attack DESC');
}
//if (count($ip_stats) > 0) {
$max_level = max(Ossim_db::max_val($conn, 'compromise', 'host_qualification'), Ossim_db::max_val($conn, 'attack', 'host_qualification'));
?>
<tr><td colspan="3"><br/></td></tr>
<tr>
<th align="center" colspan="3">