Net::Wireless::802_11::Scan::FreeBSD - A interface to the wireless interface AP scanning built into ifconfig on FreeBSD
Version 0.0.0
use Net::Wireless::802_11::Scan::FreeBSD; my $scan = Net::Wireless::802_11::Scan::FreeBSD->new(); #scan for APs my @APs=$scan->scan; if ( $scan->error ){ warn('$scan->scan errored'); } #print some information for each AP my $APs_int=0; while ( defined( $APs[$APs_int] ) ){ print 'SSID: '.$APs[$APs_int]{'ssid'}."\n". 'BSSID: '.$APs[$APs_int]{'bssid'}."\n". 'Chan: '.$APs[$APs_int]{'chan'}."\n". 'Sec: '; my $security=none; if ( $APs[$APs_int]{'WPA'} ){ $security='WPA1' } if ( $APs[$APs_int]{'RSN'} ){ $security='WPA2' } print $security."\n\n"; $APs_int++; }
This initializes the object.
At start the interface will be set to 'wlan0'. If you want to change this, you will need to call ifSet.
No error checking is needed as this will always succeed, as long as it is being ran on FreeBSD. This will throw a permanent error if $^O ne 'freebsd'.
my $scan=Net::Wireless::802_11::Scan::FreeBSD->new();
This returns the current interface.
No error checking is needed as this will always succeed.
my $interface=$scan->ifGet;
This sets the interface that will be scanned.
One argument is required and that is the interface name.
As long as the interface is defined, there is no need to do error checking.
#set the interface to wlan1 $scan->ifSet('wlan1');
This runs "ifconfig -v $interface list scan".
my @APs=$scan->scan; use Data::Dumper; print Dumper(\@APs);
The returned data is a array of hashes.
The SSID of the AP.
This may be blank.
The BSSID of the AP.
The channel it is on.
The rate of the AP in question.
The signal noise ratio.
The signal value from S:N.
The noise value from S:N.
The beacon interval of the AP.
This is the raw unparsed caps field.
The station is permitted to send/receive data frames.
Extended Rate Phy (ERP). Indicates that the station is operating in an 802.11g network using extended transmit rates.
The station is using HT transmit rates.
The station is operating in power save mode.
The station is using QoS encapsulation for data frame.
The station is doing short preamble to optionally improve throughput performance with 802.11g and 802.11b.
The station in question allows the use of WPS.
The AP in question supports Atheros protocol extensions.
Indicates WME support.
The AP supports WPA, not to be confused with WPA2.
The AP supports RSN, WPA2.
The AP supports unknown vendor-specific extensions.
For information on error handling and the like, please see the documentation on Error::Helper.
$^O ne 'freebsd'. This module only works on FreeBSD.
Interface not defined.
Ifconfig errored when trying to run "ifconfig -v $interface list scan".
This means it returned a non-0 exist code.
Zane C. Bowers-Hadley, <vvelox at vvelox.net>
<vvelox at vvelox.net>
Please report any bugs or feature requests to bug-net-wireless-802_11-scan-freebsd at rt.cpan.org, or through the web interface at https://rt.cpan.org/NoAuth/ReportBug.html?Queue=Net-Wireless-802_11-Scan-FreeBSD. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.
bug-net-wireless-802_11-scan-freebsd at rt.cpan.org
You can find documentation for this module with the perldoc command.
perldoc Net::Wireless::802_11::Scan::FreeBSD
You can also look for information at:
RT: CPAN's request tracker (report bugs here)
https://rt.cpan.org/NoAuth/Bugs.html?Dist=Net-Wireless-802_11-Scan-FreeBSD
AnnoCPAN: Annotated CPAN documentation
http://annocpan.org/dist/Net-Wireless-802_11-Scan-FreeBSD
CPAN Ratings
https://cpanratings.perl.org/d/Net-Wireless-802_11-Scan-FreeBSD
Search CPAN
https://metacpan.org/release/Net-Wireless-802_11-Scan-FreeBSD
Copyright 2018 Zane C. Bowers-Hadley.
This program is free software; you can redistribute it and/or modify it under the terms of the the Artistic License (2.0). You may obtain a copy of the full license at:
http://www.perlfoundation.org/artistic_license_2_0
Any use, modification, and distribution of the Standard or Modified Versions is governed by this Artistic License. By using, modifying or distributing the Package, you accept this license. Do not use, modify, or distribute the Package, if you do not accept this license.
If your Modified Version has been derived from a Modified Version made by someone other than you, you are nevertheless required to ensure that your Modified Version complies with the requirements of this license.
This license does not grant you the right to use any trademark, service mark, tradename, or logo of the Copyright Holder.
This license includes the non-exclusive, worldwide, free-of-charge patent license to make, have made, use, offer to sell, sell, import and otherwise transfer the Package with respect to any patent claims licensable by the Copyright Holder that are necessarily infringed by the Package. If you institute patent litigation (including a cross-claim or counterclaim) against any party alleging that the Package constitutes direct or contributory patent infringement, then this Artistic License to you shall terminate on the date that such litigation is filed.
Disclaimer of Warranty: THE PACKAGE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS' AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES. THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT ARE DISCLAIMED TO THE EXTENT PERMITTED BY YOUR LOCAL LAW. UNLESS REQUIRED BY LAW, NO COPYRIGHT HOLDER OR CONTRIBUTOR WILL BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING IN ANY WAY OUT OF THE USE OF THE PACKAGE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
To install Net::Wireless::802_11::Scan::FreeBSD, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Net::Wireless::802_11::Scan::FreeBSD
CPAN shell
perl -MCPAN -e shell install Net::Wireless::802_11::Scan::FreeBSD
For more information on module installation, please visit the detailed CPAN module installation guide.