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

NAME

Win32::Netsh::Wlan - Provide functions in that correlate to the Microsoft Windows netsh utility's wlan context

VERSION

Version 0.02

SYNOPSIS

  use Win32::Netsh::Wlan qw(wlan_interface_info_all);
  
  my @wireless_if = wlan_interface_info_all();

FUNCTIONS

wlan_debug($level)

Description

Set the debug level for the module

Parameters

$level - Debug level

Return

SCALAR - Current debug level

wlan_interface_info_all()

Description

Return a reference to a list of hashes that describe the wireless interfaces available

Parameters

NONE

Return

ARRAY reference of hash references whose keys are as follows:

name

Name of the interface

description

Description of the interface

guid

GUID associated with the interface

mac_address

IEEE MAC address of the interfaces as a string with the format "xx:xx:xx:xx:xx:xx" where xx is a hexadecimal number between 00 and ff

state

Disconnected, discovering, or connected

ssid

SSID of connected wireless network

bssid

IEEE MAC address of the associated accees point as a string with the format "xx:xx:xx:xx:xx:xx" where xx is a hexadecimal number between 00 and ff

net_type

String indicating "Infrastructure" or "Ad hoc" mode for the connection

radio

String indicating if connection is 802.11b 802.11n etc.

auth

String indicating the type of authentication for the connection

cipher

String indicating the cypher type

mode

String indicating connection mode

channel

RF channel used for connection

rx_rate

Receive rate in Mbps

tx_rate

Receive rate in Mbps

signal

Signal strength as a percentage

wlan_interface_info($name)

Description

Return a reference to a hash that describes the wireless interface

Parameters
$name

Name of the interface such as "Wireless Network Connection"

Return
UNDEF

Indicates the named interface could not be found

HASH reference

Hash reference whose keys are as follows:

name

Name of the interface

description

Description of the interface

guid

GUID associated with the interface

mac_address

IEEE MAC address of the interfaces as a string with the format "xx:xx:xx:xx:xx:xx" where xx is a hexadecimal number between 00 and ff

state

Disconnected, discovering, or connected

ssid

SSID of connected wireless network

bssid

IEEE MAC address of the associated accees point as a string with the format "xx:xx:xx:xx:xx:xx" where xx is a hexadecimal number between 00 and ff

net_type

String indicating "Infrastructure" or "Ad hoc" mode for the connection

radio

String indicating if connection is 802.11b 802.11n etc.

auth

String indicating the type of authentication for the connection

cipher

String indicating the cypher type

mode

String indicating connection mode

channel

RF channel used for connection

rx_rate

Receive rate in Mbps

tx_rate

Receive rate in Mbps

signal

Signal strength as a percentage

wlan_profile_info($name)

Description

Return a hash reference with details of the given profile name

Parameters
$name

Name of the profile

Return
UNDEF

Indicates profile not found

HASH Reference

Hash reference whose keys are as follows:

name

Name of the profile

interface

Name of the interface

ssid

Array reference to the list of SSIDs of the wireless network

net_type

String indicating "Infrastructure" or "Ad hoc" mode for the connection

radio

String indicating if connection is 802.11b 802.11n etc.

auth

String indicating the type of authentication for the connection

cipher String indicating the cypher type
mode String indicating connection mode

wlan_profile_info_all()

Description

Return an array reference of hash references with details of the profiles

Parameters

NONE

Return

ARRAY reference of hash references corresponding to each profile. Each hash reference has the following keys:

name

Name of the profile

interface

Name of the interface

ssid

Array reference to the list of SSIDs of the wireless network

net_type

String indicating "Infrastructure" or "Ad hoc" mode for the connection

radio

String indicating if connection is 802.11b 802.11n etc.

auth

String indicating the type of authentication for the connection

cipher String indicating the cypher type
mode String indicating connection mode

wlan_profile_add($filename, $options)

Description

Add the given profile with the specified options. If no options are provided then the profile will be added for all interfaces and all users

Parameters
$filename

Filename of the XML file containing the wireless profiles

$options

Optional hash reference with the following keys:

interface

Name of the interface for the profile

user

User scope (all or current)

Return

UNDEF on error, or 1 for success

wlan_profile_delete($name)

Description

Delete the specified profile if it exists

Parameters
$name

Name of the profile to delete

Return

UNDEF on error, or 1 for success

wlan_last_error()

Description

Return the error string associated with the last wlan command

Parameters

NONE

Return

SCALAR - error string

wlan_connect($name)

Description

Connect to the wireless network specified in the named profile

Parameters
$name

Name of the profile to use to connect.

Return

UNDEF on error, or 1 for success

wlan_disconnect()

Description

Disconnect any current connection

Parameters
NONE
Return
NONE

SEE ALSO

Win32::Netsh::Interface for examining and controlling the netsh interface context including interface ipv4.

AUTHOR

Paul Durden <alabamapaul AT gmail.com>

COPYRIGHT & LICENSE

Copyright (C) 2015 by Paul Durden.

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.