Changeset 25


Ignore:
Timestamp:
Feb 4, 2008, 2:56:12 PM (17 years ago)
Author:
g7moreau
Message:
  • Add the switch model on the dot graph. I need to have the switch database data in the exportsw command. So I save this database at the end of the updatesw command. One day, I have to cleanup what I save...
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/klask

    r24 r25  
    2525
    2626my %switch_level = ();
     27my %SWITCH_DB = ();
    2728LEVEL_OF_EACH_SWITCH:
    2829for my $sw (@SWITCH){
    2930   $switch_level{$sw->{hostname}} = $sw->{level} || $DEFAULT{switch_level}  || 2;
     31   $SWITCH_DB{$sw->{hostname}} = $sw;
    3032   }
    3133@SWITCH = sort { $switch_level{$b->{hostname}} <=> $switch_level{$a->{hostname}} } @{$KLASK_CFG->{switch}}; 
     
    960962      connected_on_port => \%db_switch_connected_on_port,
    961963      link_with         => \%db_switch_link_with,
     964      switch_db         => \%SWITCH_DB,
    962965      };
    963966     
     
    10271030   my %db_switch_connected_on_port = %{$switch_connection->{connected_on_port}};
    10281031   my %db_switch_link_with         = %{$switch_connection->{link_with}};
    1029      
     1032   my %db_switch_global            = %{$switch_connection->{switch_db}};
     1033
    10301034   my %db_building= ();
    10311035   for my $sw (@SWITCH) {
     
    10601064            print "\"$sw:$db_switch_output_port{$sw}\" [label = $db_switch_output_port{$sw}, color = black, fillcolor = lightblue,  peripheries = 2, style = filled];\n";
    10611065
    1062             print "\"$sw\" [label = \"$sw\", color = black, fillcolor = palegreen, shape = rect, style = filled];\n";
     1066            my $swname  = $sw;
     1067               $swname .= '\n-\n'."$db_switch_global{$sw}->{model}" if exists $db_switch_global{$sw} and exists $db_switch_global{$sw}->{model};
     1068            print "\"$sw\" [label = \"$swname\", color = black, fillcolor = palegreen, shape = rect, style = filled];\n";
    10631069            print "\"location$b-$l\" -> \"$sw\" [len = 2, color = firebrick, arrowtail = dot]\n";
    10641070            print "\"$sw\" -> \"$sw:$db_switch_output_port{$sw}\" [len=2, style=bold, arrowhead = normal, arrowtail = invdot]\n";
Note: See TracChangeset for help on using the changeset viewer.