/[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 251 by dpavlin, Tue Aug 18 12:46:41 2009 UTC revision 309 by dpavlin, Thu Aug 27 16:47:42 2009 UTC
# Line 213  warn "XXX pids = ", dump( $daemons::pids Line 213  warn "XXX pids = ", dump( $daemons::pids
213                          $ip = $new_ip;                          $ip = $new_ip;
214                  }                  }
215    
216                  if ( $ip ne $server::ip ) {                  my $ip_short = (split(/\./, $ip, 4))[3];
217    
218                    # if ( $ip ne $server::ip ) -- not flexible enough for tunnel endpoints
219                    if ( $ip_short >= $server::ip_from && $ip_short <= $server::ip_to ) {
220                          my $hostname = client::conf( $ip, 'hostname' => $param->{hostname} );                          my $hostname = client::conf( $ip, 'hostname' => $param->{hostname} );
221    
222                          my @table = (                          my @table = (
# Line 229  warn "XXX pids = ", dump( $daemons::pids Line 232  warn "XXX pids = ", dump( $daemons::pids
232                                          'mac' => format::mac( $mac => 'html' ),                                          'mac' => format::mac( $mac => 'html' ),
233                                          'deploy' => html::select( 'deploy', $deploy, config::available )                                          'deploy' => html::select( 'deploy', $deploy, config::available )
234                                  );                                  );
235                                  $deploy = qq|<h2>PXElinux</h2>| . html::pre( config::for_ip( $ip ) );                                  if ( my $pxelinux = config::for_ip( $ip ) ) {
236                                            $deploy = qq|<h2>PXElinux</h2>| . html::pre( $pxelinux );
237                                    }
238                          }                          }
239    
240                          print $client ok                          print $client ok
# Line 240  warn "XXX pids = ", dump( $daemons::pids Line 245  warn "XXX pids = ", dump( $daemons::pids
245                                  ;                                  ;
246    
247                          if ( my $amt = client::conf( $ip, 'amt' ) ) {                          if ( my $amt = client::conf( $ip, 'amt' ) ) {
248                                  print $client qq|<h2>AMT</h2>|, amt::info( $amt );                                  print $client qq|<h2>AMT</h2>|, amt::info( $amt, $ip );
249                          }                          }
250                  } else {                  } else {
251    
# Line 258  warn "XXX pids = ", dump( $daemons::pids Line 263  warn "XXX pids = ", dump( $daemons::pids
263    
264                          print $client ok                          print $client ok
265                                  , qq|<h2>Clients on $server::ip</h2>|                                  , qq|<h2>Clients on $server::ip</h2>|
266                                  , html::table( -5,                                  , html::table( -6,
267                                          'ip', 'hostname', 'mac', 'deploy', 'arp',                                          'ip', 'mac', 'arp', 'hostname', 'deploy', 'conf',
268                                          map {                                          map {
269                                                  my $ip = $_;                                                  my $ip = $_;
270                                                  $ip =~ s{^.+/ip/}{};                                                  my $conf = client::all_conf( $ip );
271                                                  my $mac = client::mac_from_ip $ip;                                                  my $mac = delete $conf->{mac} || '';
                                                 my $arp = $arp->{ $mac };  
                                                 $arp = $arp ? $arp->[1] : '';  
                                                 $arp =~ s{$ip}{};  
272                                                  (                                                  (
273                                                          qq|<a href=/client/$ip>$ip</a>|                                                          qq|<a href=/client/$ip>$ip</a>|
                                                         , client::conf( $ip, 'hostname' )  
274                                                          , format::mac( $mac => 'html' )                                                          , format::mac( $mac => 'html' )
275                                                          , html::tt( client::conf( $ip, 'deploy' ) )                                                          , ( $arp->{$mac} ? $arp->{$mac}->[1] : '' )
276                                                          , $arp                                                          , delete $conf->{hostname}
277                                                            , delete $conf->{deploy}
278                                                            , html::pre_dump( $conf )
279                                                  );                                                  );
280                                          }                                          }
281                                          glob("$server::conf/ip/*")                                          sort { ip::to_int($a) cmp ip::to_int($b) }
282                                            map {
283                                                    my $ip = $_;
284                                                    $ip =~ s{^.+/ip/}{};
285                                                    $ip;
286                                            } glob("$server::conf/ip/*")
287                                  )                                  )
288                                  , qq|<h2>ARP</h2>|                                  , qq|<h2>ARP</h2>|
289                                  , html::table( -3, 'mac', 'dev', 'ip',                                  , html::table( -3, 'ip', 'mac', 'dev',
290                                          map {                                          map {
291                                                  my $c = $arp->{$_};                                                  my $c = $arp->{$_};
292                                                  ( format::mac( $_ => 'html' ), $c->[1], $c->[0] )                                                  ( $c->[0], format::mac( $_ => 'html' ), $c->[1] )
293                                          } sort keys %$arp                                          } sort keys %$arp
294                                  )                                  )
295                                  ;                                  ;

Legend:
Removed from v.251  
changed lines
  Added in v.309

  ViewVC Help
Powered by ViewVC 1.1.26