Linux::Ethtool::WOL - Manipulate interface Wake-on-LAN settings
use Linux::Ethtool::WOL qw(:all); my $wol = Linux::Ethtool::WOL->new("eth0") or die($!); unless($wol->supported & WAKE_MAGIC) { die("Network card does not support WOL using Magic Packet"); } $wol->wolopts(WAKE_MAGIC); $wol->apply() or die($!);
This module provides a wrapper around the ethtool_wolinfo structure and associated ioctls, used for configuring Wake-on-LAN options.
ethtool_wolinfo
All the constants in this module may be imported individually or by using the all import tag.
all
Construct a new instance using the settings of the named interface.
Returns an object instance on success, undef on failure.
Apply any changed settings to the interface.
Returns true on success, false on failure.
Return the supported WOL flags which is any of the following constants bitwise OR'd together:
WAKE_PHY WAKE_UCAST WAKE_MCAST WAKE_BCAST WAKE_ARP WAKE_MAGIC WAKE_MAGICSECURE
Get or set the enabled WOL options, these should be a subset of those returned by supported.
supported
Returns the current/new value.
Get or set the SecureOn(TM) password, only meaningful if the WAKE_MAGICSECURE flag is set, which itself requires WAKE_MAGIC.
WAKE_MAGICSECURE
WAKE_MAGIC
The value is a scalar which is 6 BYTES (not characters) long.
Linux::Ethtool, Linux::Ethtool::Settings
To install Linux::Ethtool, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Linux::Ethtool
CPAN shell
perl -MCPAN -e shell install Linux::Ethtool
For more information on module installation, please visit the detailed CPAN module installation guide.