Changeset 165
- Timestamp:
- Jun 10, 2016, 5:52:27 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/klask
r164 r165 264 264 if ($ret{mac_address} ne 'unknow') { 265 265 my @paquets = (); 266 for each( split m/ : /xms, $ret{mac_address} ) {266 for ( split m/ : /xms, $ret{mac_address} ) { 267 267 my @chars = split m//xms, uc "00$_"; 268 268 push @paquets, "$chars[-2]$chars[-1]"; … … 374 374 my @paquets = split m/ : /xms, $mac_address; 375 375 my $return = q{}; 376 for each(@paquets) {376 for (@paquets) { 377 377 $return .= q{.} . digit_hex_to_dec($_); 378 378 } … … 437 437 # 21->24 45->48 438 438 SWITCH_PORT_IGNORE: 439 for eachmy $p (@{$sw->{portignore}}) {439 for my $p (@{$sw->{portignore}}) { 440 440 next SWITCH_PORT_IGNORE if $swport ne get_numerical_port($sw->{model},$p); 441 441 next LOOP_ON_SWITCH; … … 1189 1189 1190 1190 LOOP_ON_IP_ADDRESS: 1191 for eachmy $ip (Net::Netmask::sort_by_ip_address(keys %{$computerdb})) {1191 for my $ip (Net::Netmask::sort_by_ip_address(keys %{$computerdb})) { 1192 1192 1193 1193 # next LOOP_ON_IP_ADDRESS if $computerdb->{$ip}{hostname_fq} eq 'unknow'; … … 1256 1256 my %mac_count = (); 1257 1257 LOOP_ON_IP_ADDRESS: 1258 for eachmy $ip (keys %{$computerdb}) {1258 for my $ip (keys %{$computerdb}) { 1259 1259 1260 1260 # to be improve in the future … … 1267 1267 1268 1268 LOOP_ON_IP_ADDRESS: 1269 for eachmy $ip (Net::Netmask::sort_by_ip_address(keys %{$computerdb})) {1269 for my $ip (Net::Netmask::sort_by_ip_address(keys %{$computerdb})) { 1270 1270 1271 1271 # to be improve in the future … … 1445 1445 my %swithportdb = (); 1446 1446 LOOP_ON_IP_ADDRESS: 1447 for eachmy $ip (keys %{$computerdb}) {1447 for my $ip (keys %{$computerdb}) { 1448 1448 # to be improve in the future 1449 1449 next LOOP_ON_IP_ADDRESS if $computerdb->{$ip}{hostname_fq} eq ($computerdb->{$ip}{switch_hostname} || $computerdb->{$ip}{switch_description}); # switch on himself ! … … 1484 1484 1485 1485 LOOP_ON_RECENT_COMPUTER: 1486 for eachmy $swpt (keys %swithportdb) {1486 for my $swpt (keys %swithportdb) { 1487 1487 next LOOP_ON_RECENT_COMPUTER if $swpt =~ m/^\s*0$/; 1488 1488 next LOOP_ON_RECENT_COMPUTER if $swithportdb{$swpt}->{hostname_fq} !~ m/$RE_FLOAT_HOSTNAME/; … … 1491 1491 my $src_timestamp = 0; 1492 1492 LOOP_ON_IP_ADDRESS: 1493 for eachmy $ip (keys %{$computerdb}) {1493 for my $ip (keys %{$computerdb}) { 1494 1494 next LOOP_ON_IP_ADDRESS if $computerdb->{$ip}{mac_address} ne $swithportdb{$swpt}->{mac_address}; 1495 1495 next LOOP_ON_IP_ADDRESS if $computerdb->{$ip}{hostname_fq} =~ m/$RE_FLOAT_HOSTNAME/; … … 1731 1731 1732 1732 LOOP_ON_IP_ADDRESS: 1733 for eachmy $ip (Net::Netmask::sort_by_ip_address(keys %{$computerdb})) {1733 for my $ip (Net::Netmask::sort_by_ip_address(keys %{$computerdb})) { 1734 1734 1735 1735 next LOOP_ON_IP_ADDRESS if $computerdb->{$ip}{hostname_fq} eq ($computerdb->{$ip}{switch_hostname} || $computerdb->{$ip}{switch_description}); # switch on himself ! … … 1795 1795 my $mac_address = $computerdb->{$ip}{mac_address}; 1796 1796 LOOP_ON_DATABASE: 1797 for eachmy $ip_db (keys %{$computerdb}) {1797 for my $ip_db (keys %{$computerdb}) { 1798 1798 next LOOP_ON_DATABASE if $computerdb->{$ip_db}{mac_address} ne $mac_address; 1799 1799 next LOOP_ON_IP_ADDRESS if $computerdb->{$ip_db}{timestamp} > $timestamp_barrier; … … 1833 1833 print "-------------------------------------------------------------------------------\n"; 1834 1834 LOOP_ON_IP_ADDRESS: 1835 for eachmy $ip (Net::Netmask::sort_by_ip_address(keys %result_ip)) {1835 for my $ip (Net::Netmask::sort_by_ip_address(keys %result_ip)) { 1836 1836 printf "%-15s %-40s %-16s %s\n", $ip, $result_ip{$ip}->{hostname_fq}, $result_ip{$ip}->{date_last_detection}, $result_ip{$ip}->{vlan}; 1837 1837 } … … 1866 1866 1867 1867 LOOP_ON_IP_ADDRESS: 1868 for eachmy $ip (Net::Netmask::sort_by_ip_address(keys %result_ip)) {1868 for my $ip (Net::Netmask::sort_by_ip_address(keys %result_ip)) { 1869 1869 1870 1870 $typerow = $typerow eq 'even' ? 'odd' : 'even';
Note: See TracChangeset
for help on using the changeset viewer.