diff options
author | Olivier Blin <oblin@mandriva.org> | 2005-07-20 06:27:13 +0000 |
---|---|---|
committer | Olivier Blin <oblin@mandriva.org> | 2005-07-20 06:27:13 +0000 |
commit | 5199c4e9d1d1a7b6d22d4c94e664b20318bbdb4b (patch) | |
tree | 20a09c42bbe965e2d1d8b31ba0ab79552334bb8a /perl-install | |
parent | e2f1bfc29c7135d849d2a95c288e2d9f26790ee9 (diff) | |
download | drakx-5199c4e9d1d1a7b6d22d4c94e664b20318bbdb4b.tar drakx-5199c4e9d1d1a7b6d22d4c94e664b20318bbdb4b.tar.gz drakx-5199c4e9d1d1a7b6d22d4c94e664b20318bbdb4b.tar.bz2 drakx-5199c4e9d1d1a7b6d22d4c94e664b20318bbdb4b.tar.xz drakx-5199c4e9d1d1a7b6d22d4c94e664b20318bbdb4b.zip |
get network ids and current network
Diffstat (limited to 'perl-install')
-rw-r--r-- | perl-install/network/monitor.pm | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/perl-install/network/monitor.pm b/perl-install/network/monitor.pm index 1372baa6b..beead7ee5 100644 --- a/perl-install/network/monitor.pm +++ b/perl-install/network/monitor.pm @@ -1,5 +1,6 @@ package network::monitor; +use common; use dbus_object; our @ISA = qw(dbus_object); @@ -16,11 +17,18 @@ sub new { sub list_wireless { my ($o) = @_; my $networks; - eval { $networks = $o->call_method('ListWireless') }; + eval { $networks = $o->call_method('ScanResults') }; my %networks; while ($networks =~ /^((?:[0-9a-f]{2}:){5}[0-9a-f]{2})\t(\d+)\t(\d+)\t(.*?)\t(.*)$/mg) { $networks{$1} = { frequency => $2, signal_level => $3, flags => $4, ssid => $5 }; } + eval { $networks = $o->call_method('ListNetworks') }; + while ($networks =~ /^(\d+)\t(.*?)\t(.*?)\t(.*)$/mg) { + if (my $net = $networks{$3} || find { $_->{ssid} eq $2 } values(%networks)) { + $net->{id} = $1; + $net->{current} = to_bool($4 eq '[CURRENT]'); + } + } \%networks; } |