Changeset 135
- Timestamp:
- Nov 5, 2013, 11:07:36 AM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/klask
r134 r135 1549 1549 for my $ip (@ip_list) { 1550 1550 1551 next LOOP_ON_IP_ADDRESS if 1552 exists $computerdb->{$ip} 1553 && $computerdb->{$ip}{timestamp} > $timestamp_barrier; 1551 if (exists $computerdb->{$ip}) { 1552 next LOOP_ON_IP_ADDRESS if $computerdb->{$ip}{timestamp} > $timestamp_barrier; 1553 1554 my $mac_address = $computerdb->{$ip}{mac_address}; 1555 LOOP_ON_DATABASE: 1556 foreach my $ip_db (keys %{$computerdb}) { 1557 next LOOP_ON_DATABASE if $computerdb->{$ip_db}{mac_address} ne $mac_address; 1558 next LOOP_ON_IP_ADDRESS if $computerdb->{$ip_db}{timestamp} > $timestamp_barrier; 1559 } 1560 } 1554 1561 1555 1562 my $ip_date_last_detection = ''; … … 1561 1568 } 1562 1569 1563 $result_ip{$ip} ||= {};1564 $result_ip{$ip}->{date_last_detection} = $ip_date_last_detection;1565 1566 1570 my $packed_ip = scalar gethostbyname($ip); 1567 1571 my $hostname_fq = 'unknown'; 1568 1572 $hostname_fq = scalar gethostbyaddr($packed_ip, AF_INET) || 'unknown' if defined $packed_ip; 1573 1574 next LOOP_ON_IP_ADDRESS if $hostname_fq =~ m/$RE_FLOAT_HOSTNAME/; 1575 1576 $result_ip{$ip} ||= {}; 1577 $result_ip{$ip}->{date_last_detection} = $ip_date_last_detection; 1569 1578 $result_ip{$ip}->{hostname_fq} = $hostname_fq; 1570 1571 1579 $result_ip{$ip}->{vlan} = $vlan; 1572 1580
Note: See TracChangeset
for help on using the changeset viewer.