NAME

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

VERSION

Version 0.01

SYNOPSIS

use Win32::Netsh::Interface qw(interface_ipv4_info);

my @ip_addresses = interface_ipv4_info(qq{Local Area Network});

FUNCTIONS

interface_debug($level)

Description

Set the debug level for the module

Parameters
$level

Debug level

Return
SCALAR

Current debug level

interface_ipv4_info($name)

Description

Return a hash reference with the IPV4 information for the given interface

Parameters
$name

Name of the interface

Return
HASH reference

HASH reference whose keys are as follows:

name

Name of the interface

dhcp

Indicates if DHCP is enabled

ip

Array reference containing IP addresses for the interface

netmask

Array reference containing netmasks for the interface

gateway

IP address of the default gateway for the interface

gw_metric

Gateway metric

if_metric

Interface metric

interface_ipv4_info_all()

Description

Return an array reference that contains hash reference with the IPV4 information for each interface

Parameters

NONE

Return
ARRAY reference

Array reference to array of hash references whose keys are as follows:

name

Name of the interface

dhcp

Indicates if DHCP is enabled

ip

Array reference containing IP addresses for the interface

netmask

Array reference containing netmasks for the interface

gateway

IP address of the default gateway for the interface

gw_metric

Gateway metric

if_metric

Interface metric

interface_last_error()

Description

Return the error string associated with the last command

Parameters
NONE
Return
SCALAR

Error string

interface_info_all()

Description

Return an reference to an array of hash references with interface information

Parameters
NONE
Return
ARRAY REFERENCE

ARRAY reference of hash references whose keys are as follows:

name

Name of the interface

enabled

Boolean indicating if the administrative state is enabled

state

Indicates the connections state as Connected or Disconnected

type

Indicates the type of interface

interface_info($name)

Description

Return a hash references with interface information

Parameters
$name

Name of the interface such as "Local Area 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

enabled

Boolean indicating if the administrative state is enabled

state

Indicates the connections state as Connected or Disconnected

type

Indicates the type of interface

interface_enable($name, $enable)

Description

Enable / disable the specified interface

NOTE: The script must be running with Administrator privileges for to be able to enable or disable an interface

Parameters
$name

Name of the interface to control

$enaable

Boolean value indicating if the interface should be enabled

Return
SCALAR
SCALAR

A "true" value indicates success

UNDEF

UNDEF or a "false" vale indicates an error. The error message can be retrieved using interface_last_error()

SEE ALSO

Win32::Netsh::Wlan for examining and controlling the netsh wlan context for wireless interfaces.

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.