The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Net::Wireless::802_11::Scan::FreeBSD - A interface to the wireless interface AP scanning built into ifconfig on FreeBSD

VERSION

Version 0.0.0

SYNOPSIS

    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++;
    }

METHODS

new

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();

ifGet

This returns the current interface.

No error checking is needed as this will always succeed.

    my $interface=$scan->ifGet;

ifSet

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');

scan

This runs "ifconfig -v $interface list scan".

    my @APs=$scan->scan;
    use Data::Dumper;
    print Dumper(\@APs);

returned data

The returned data is a array of hashes.

ssid

The SSID of the AP.

This may be blank.

bssid

The BSSID of the AP.

chan

The channel it is on.

rate

The rate of the AP in question.

S:N

The signal noise ratio.

signal

The signal value from S:N.

noise

The noise value from S:N.

int

The beacon interval of the AP.

caps

This is the raw unparsed caps field.

Authorized

The station is permitted to send/receive data frames.

ERP

Extended Rate Phy (ERP). Indicates that the station is operating in an 802.11g network using extended transmit rates.

HT

The station is using HT transmit rates.

PowerSave

The station is operating in power save mode.

QoS

The station is using QoS encapsulation for data frame.

ShortPreamble

The station is doing short preamble to optionally improve throughput performance with 802.11g and 802.11b.

WPS

The station in question allows the use of WPS.

ATH

The AP in question supports Atheros protocol extensions.

WME

Indicates WME support.

WPA

The AP supports WPA, not to be confused with WPA2.

RSN

The AP supports RSN, WPA2.

VEN

The AP supports unknown vendor-specific extensions.

ERROR CODES/FLAGS

For information on error handling and the like, please see the documentation on Error::Helper.

1/notFreeBSD

$^O ne 'freebsd'. This module only works on FreeBSD.

2/ifUndef

Interface not defined.

3/ifconfigError

Ifconfig errored when trying to run "ifconfig -v $interface list scan".

This means it returned a non-0 exist code.

AUTHOR

Zane C. Bowers-Hadley, <vvelox at vvelox.net>

BUGS

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.

SUPPORT

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:

ACKNOWLEDGEMENTS

LICENSE AND COPYRIGHT

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.