--- lib/PXElator/httpd.pm 2009/08/19 11:02:15 262
+++ lib/PXElator/httpd.pm 2009/08/27 12:52:23 304
@@ -213,7 +213,10 @@
$ip = $new_ip;
}
- if ( $ip ne $server::ip ) {
+ my $ip_short = (split(/\./, $ip, 4))[3];
+
+ # if ( $ip ne $server::ip ) -- not flexible enough for tunnel endpoints
+ if ( $ip_short >= $server::ip_from && $ip_short <= $server::ip_to ) {
my $hostname = client::conf( $ip, 'hostname' => $param->{hostname} );
my @table = (
@@ -259,29 +262,33 @@
print $client ok
, qq|
Clients on $server::ip
|
, html::table( -5,
- 'ip', 'hostname', 'mac', 'deploy', 'arp',
+ 'ip', 'mac', 'hostname', 'deploy', 'arp',
map {
my $ip = $_;
- $ip =~ s{^.+/ip/}{};
my $mac = client::mac_from_ip $ip;
my $arp = $arp->{ $mac };
$arp = $arp ? $arp->[1] : '';
$arp =~ s{$ip}{};
(
qq|$ip|
- , client::conf( $ip, 'hostname' )
, format::mac( $mac => 'html' )
+ , client::conf( $ip, 'hostname' )
, html::tt( client::conf( $ip, 'deploy' ) )
, $arp
);
}
- glob("$server::conf/ip/*")
+ sort { ip::to_int($a) cmp ip::to_int($b) }
+ map {
+ my $ip = $_;
+ $ip =~ s{^.+/ip/}{};
+ $ip;
+ } glob("$server::conf/ip/*")
)
, qq|ARP
|
- , html::table( -3, 'mac', 'dev', 'ip',
+ , html::table( -3, 'ip', 'mac', 'dev',
map {
my $c = $arp->{$_};
- ( format::mac( $_ => 'html' ), $c->[1], $c->[0] )
+ ( $c->[0], format::mac( $_ => 'html' ), $c->[1] )
} sort keys %$arp
)
;