/[pxelator]/lib/PXElator/nmap.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 /lib/PXElator/nmap.pm

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

revision 337 by dpavlin, Sat Aug 29 12:55:34 2009 UTC revision 349 by dpavlin, Sat Aug 29 20:41:17 2009 UTC
# Line 32  sub scan { Line 32  sub scan {
32    
33          my $count = 0;          my $count = 0;
34    
35            my $port_name = {
36                    16992 => 'amt',
37                    4445  => 'asterisk',
38                    7777  => 'pxelator',
39            };
40    
41          while ( my $host = shift @{ $nmap->{host} } ) {          while ( my $host = shift @{ $nmap->{host} } ) {
42    
43                  warn '# host ',dump( $host );                  warn '# host ',dump( $host );
# Line 47  sub scan { Line 53  sub scan {
53                          client::conf( $ip, 'os' => $os );                          client::conf( $ip, 'os' => $os );
54                  }                  }
55    
56                  my @ports = map { [ $_->{portid}, $_->{protocol}, $_->{service}->{name} ] } @{ $host->{ports}->{port} };                  my @ports = map { [ $_->{portid}, $_->{protocol}, $port_name->{$_->{portid}} || $_->{service}->{name} ] } @{ $host->{ports}->{port} };
57                  client::conf( $ip, 'ports' => join("\n", map { join("\t", @$_) } @ports) ) if @ports;                  client::conf( $ip, 'ports' => join("\n", map { join("\t", @$_) } @ports) ) if @ports;
58    
59                  $count++;                  $count++;

Legend:
Removed from v.337  
changed lines
  Added in v.349

  ViewVC Help
Powered by ViewVC 1.1.26