Changeset 9


Ignore:
Timestamp:
Jan 30, 2008, 6:15:15 PM (17 years ago)
Author:
g7moreau
Message:
  • Do not hardcode any more the router IP address Need to be test now before closing the ticket
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/klask

    r8 r9  
    404404   }
    405405
     406# liste l'ensemble des routeurs du réseau
     407sub get_list_main_router {
     408   my @network = @_;
     409
     410   my @res = ();
     411
     412   for my $net (@network) {
     413      push @res, $switchdb->{network}{$net}{'main-router'};
     414      }
     415
     416   return @res;
     417   }
     418
    406419sub get_human_readable_port {
    407420   my $sw = shift;
     
    512525   my %router_mac_ip = ();
    513526   DETECT_ALL_ROUTER:
    514    for my $one_router ('194.254.66.254') {
     527#   for my $one_router ('194.254.66.254') {
     528   for my $one_router ( get_list_main_router(@network) ) {
    515529      my %resol_arp = resolve_ip_arp_host($one_router);
    516530      $router_mac_ip{ $resol_arp{mac_address} } = $resol_arp{ipv4_address};
     
    547561         my %resol_arp = resolve_ip_arp_host($one_computer,$current_interface);
    548562         
    549          # do not search router connection
     563         # do not search on router connection (why ?)
    550564         if ( exists $router_mac_ip{$resol_arp{mac_address}}) {
    551565            $computer_not_detected{$one_computer} = $current_interface;
     
    553567            }
    554568
    555          # do not search switch connection
     569         # do not search on switch inter-connection
    556570         if (exists $switch_level{$resol_arp{hostname_fq}}) {
    557571            $computer_not_detected{$one_computer} = $current_interface;
     
    752766
    753767   DETECT_ALL_ROUTER:
    754    for my $one_computer ('194.254.66.254') {
     768#   for my $one_computer ('194.254.66.254') {
     769   for my $one_computer ( get_list_main_router(get_list_network()) ) {
    755770      my %resol_arp = resolve_ip_arp_host($one_computer,'*','low');            #resolution arp
    756771      next DETECT_ALL_ROUTER if $resol_arp{mac_address} eq 'unknow';
Note: See TracChangeset for help on using the changeset viewer.