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

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

revision 310 by dpavlin, Thu Aug 27 16:47:42 2009 UTC revision 311 by dpavlin, Thu Aug 27 17:44:03 2009 UTC
# Line 26  sub menu {qq{ Line 26  sub menu {qq{
26  <a href=/server>server</a>  <a href=/server>server</a>
27  <a href=/brctl>brctl</a>  <a href=/brctl>brctl</a>
28  <a href=/ip>ip</a>  <a href=/ip>ip</a>
29    <a href=/nmap>nmap</a>
30  <a href=/client>client</a>  <a href=/client>client</a>
31  </div>  </div>
32    
# Line 54  use network; Line 55  use network;
55  use ip;  use ip;
56  use wireshark;  use wireshark;
57  use syslogd;  use syslogd;
58    use nmap;
59    
60  use CouchDB;  use CouchDB;
61    
# Line 253  warn "XXX pids = ", dump( $daemons::pids Line 255  warn "XXX pids = ", dump( $daemons::pids
255                                  map {                                  map {
256                                          my @c = split(/\s+/,$_);                                          my @c = split(/\s+/,$_);
257                                          if ( $#c == 5 ) {                                          if ( $#c == 5 ) {
258                                                    client::save_ip_mac( $c[0], $c[3] );
259                                                  ( uc $c[3] => [ $c[0] , $c[5] ] )                                                  ( uc $c[3] => [ $c[0] , $c[5] ] )
260                                          } else {                                          } else {
261                                          }                                          }
# Line 270  warn "XXX pids = ", dump( $daemons::pids Line 273  warn "XXX pids = ", dump( $daemons::pids
273                                                  my $conf = client::all_conf( $ip );                                                  my $conf = client::all_conf( $ip );
274                                                  my $mac = delete $conf->{mac} || '';                                                  my $mac = delete $conf->{mac} || '';
275                                                  (                                                  (
276                                                          qq|<a href=/client/$ip>$ip</a>|                                                          qq|<a name=$ip href=/client/$ip>$ip</a>|
277                                                          , format::mac( $mac => 'html' )                                                          , format::mac( $mac => 'html' )
278                                                          , ( $arp->{$mac} ? $arp->{$mac}->[1] : '' )                                                          , ( $arp->{$mac} ? $arp->{$mac}->[1] : '' )
279                                                          , delete $conf->{hostname}                                                          , delete $conf->{hostname}
280                                                          , delete $conf->{deploy}                                                          , delete $conf->{deploy}
281                                                          , html::pre_dump( $conf )                                                          , ( %$conf ? html::pre_dump( $conf ) : qq|<a href=/nmap?scan=$ip>nmap</a>| )
282                                                  );                                                  );
283                                          }                                          }
284                                          sort { ip::to_int($a) cmp ip::to_int($b) }                                          sort { ip::to_int($a) cmp ip::to_int($b) }
# Line 303  warn "XXX pids = ", dump( $daemons::pids Line 306  warn "XXX pids = ", dump( $daemons::pids
306                          , join("\n", map { qq|<a href=/ip/$_>$_</a>| } ( qw/link addr route neigh ntable tunnel maddr mroute xfrm/ ))                          , join("\n", map { qq|<a href=/ip/$_>$_</a>| } ( qw/link addr route neigh ntable tunnel maddr mroute xfrm/ ))
307                          , ip::html( $1 )                          , ip::html( $1 )
308                          ;                          ;
309            } elsif ( $path =~ m{^/nmap} ) {
310                    if ( my $scan = $param->{scan} ) {
311                            nmap::scan( $scan );
312                            print $client redirect("$url/client#$scan");
313                    } else {
314                            print $client ok, qq|
315                                    <form method=get>
316                                    <input type=text name=scan>
317                                    <input type=submit value=scan>
318                                    </form>
319                            |;
320                    }
321          } elsif ( $path =~ m{^/our/(\w+)/(\S+)} ) {          } elsif ( $path =~ m{^/our/(\w+)/(\S+)} ) {
322                  eval 'our $' . $1 . ' = ' . $2;                  eval 'our $' . $1 . ' = ' . $2;
323                  warn $@ if $@;                  warn $@ if $@;

Legend:
Removed from v.310  
changed lines
  Added in v.311

  ViewVC Help
Powered by ViewVC 1.1.26