/[gedafe]/trunk/network_topology/mypearls/vpn_map.pm
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /trunk/network_topology/mypearls/vpn_map.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 12 by dpavlin, Wed Feb 16 14:11:02 2005 UTC revision 13 by dpavlin, Wed Feb 16 22:49:57 2005 UTC
# Line 27  use GraphViz; Line 27  use GraphViz;
27  # Information about what this pearl will do  # Information about what this pearl will do
28  sub info($){  sub info($){
29      #my $self = shift;      #my $self = shift;
30      return "VPN map","Map of all VPN links and connecitons";      return "VPN connections"," clustered by countries";
31  }  }
32    
33  # what information do I need to go into action  # what information do I need to go into action
# Line 44  sub run ($$){ Line 44  sub run ($$){
44      # run the parent ( this will set the params)      # run the parent ( this will set the params)
45      my $p = $self->{param};      my $p = $self->{param};
46    
47      my $g = GraphViz->new();      my $g = GraphViz->new(
48            width => 8, height => 5,
49            pagewidth => 8, pageheight => 5
50        );
51    
52      my $rep = DBIx::PearlReports::new      my $rep = DBIx::PearlReports::new
53         (         (
# Line 76  SQL Line 79  SQL
79                  -head => sub {                  -head => sub {
80                          $g->add_node(                          $g->add_node(
81                                  'l'.$field{vpn_from_location_id},                                  'l'.$field{vpn_from_location_id},
82                                  label => "$field{from_location}\n$field{from_country}\n$field{vpn_local_gw}"                                  label => "$field{from_location}\n$field{vpn_local_gw}",
83                                    cluster => {
84                                            name => $field{from_country},
85                                            color => '#e0e0e0',
86                                    },
87                                    color => '#e0e0ff',
88                                    style => 'filled',
89                          );                          );
90                  },                  },
91          );          );
# Line 86  SQL Line 95  SQL
95                  -head => sub {                  -head => sub {
96                          $g->add_node(                          $g->add_node(
97                                  'l'.$field{vpn_to_location_id},                                  'l'.$field{vpn_to_location_id},
98                                  label => "$field{to_location}\n$field{to_country}\n$field{vpn_remote_gw}"                                  label => "$field{to_location}\n$field{vpn_remote_gw}",
99                                    cluster => {
100                                            name => $field{to_country},
101                                            color => '#e0e0e0',
102                                    },
103                                    color => '#e0ffe0',
104                                    style => 'filled',
105                          );                          );
106                  },                  },
107          );          );
# Line 94  SQL Line 109  SQL
109          $rep->body(-contents => sub {          $rep->body(-contents => sub {
110                          $g->add_edge(                          $g->add_edge(
111                                  'l'.$field{vpn_from_location_id} => 'l'.$field{vpn_to_location_id}, label => $field{link_name},                                  'l'.$field{vpn_from_location_id} => 'l'.$field{vpn_to_location_id}, label => $field{link_name},
112                                    color => '#c0c0c0',
113                          );                          );
114                  }                  }
115          );          );

Legend:
Removed from v.12  
changed lines
  Added in v.13

  ViewVC Help
Powered by ViewVC 1.1.26