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

NAME

Linux::Ethtool::WOL - Manipulate interface Wake-on-LAN settings

SYNOPSIS

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

DESCRIPTION

This module provides a wrapper around the ethtool_wolinfo structure and associated ioctls, used for configuring Wake-on-LAN options.

All the constants in this module may be imported individually or by using the all import tag.

METHODS

new($dev)

Construct a new instance using the settings of the named interface.

Returns an object instance on success, undef on failure.

apply()

Apply any changed settings to the interface.

Returns true on success, false on failure.

supported()

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

wolopts([ $wolopts ])

Get or set the enabled WOL options, these should be a subset of those returned by supported.

Returns the current/new value.

sopass([ $sopass ])

Get or set the SecureOn(TM) password, only meaningful if the WAKE_MAGICSECURE flag is set, which itself requires WAKE_MAGIC.

The value is a scalar which is 6 BYTES (not characters) long.

SEE ALSO

Linux::Ethtool, Linux::Ethtool::Settings