Linux-Ethtool
view release on metacpan or search on metacpan
use Module::Build;
if($^O ne "linux")
{
die("No support for OS");
}
my %module_build_args = (
dist_name => "Linux-Ethtool",
dist_version => "0.11",
dist_abstract => "Linux SIOCETHTOOL ioctl interface",
dist_author => [ "Daniel Collins <solemnwarning\@solemnwarning.net>" ],
module_name => "Linux::Ethtool",
license => "perl",
build_requires => {
"Module::Build" => "0.2806",
"ExtUtils::H2PM" => "0.03",
},
{
"abstract" : "Linux SIOCETHTOOL ioctl interface",
"author" : [
"Daniel Collins <solemnwarning@solemnwarning.net>"
],
"dynamic_config" : 1,
"generated_by" : "Module::Build version 0.4001, CPAN::Meta::Converter version 2.110440",
"license" : [
"perl_5"
],
"meta-spec" : {
"url" : "http://search.cpan.org/perldoc?CPAN::Meta::Spec",
---
abstract: 'Linux SIOCETHTOOL ioctl interface'
author:
- 'Daniel Collins <solemnwarning@solemnwarning.net>'
build_requires:
ExtUtils::CBuilder: 0
ExtUtils::H2PM: 0.03
Module::Build: 0.2806
configure_requires:
Module::Build: 0.40
dynamic_config: 1
generated_by: 'Module::Build version 0.4001, CPAN::Meta::Converter version 2.110440'
int sock = socket(AF_INET, SOCK_DGRAM, 0);
if(sock == -1)
{
return 0;
}
struct ifreq ifr;
strcpy(ifr.ifr_name, dev);
ifr.ifr_data = data;
if(ioctl(sock, SIOCETHTOOL, &ifr) == -1)
{
close(sock);
return 0;
}
close(sock);
return 1;
}
lib/Linux/Ethtool.pm view on Meta::CPAN
=head1 NAME
Linux::Ethtool - Interface to the Linux SIOCETHTOOL ioctl
=head1 SYNOPSIS
use Linux::Ethtool qw(:all);
my $link = get_link("eth0") // die($!);
my $rx_csum = get_rx_csum("eth0") // die($!);
my $tx_csum = get_tx_csum("eth0") // die($!);
print "Link detected: ".($link ? "yes" : "no")."\n";
print "RX checksum offloading: ".($rx_csum ? "yes" : "no")."\n";
print "TX checksum offloading: ".($tx_csum ? "yes" : "no")."\n";
=head1 DESCRIPTION
This module provides a procedural interface to the basic operations provided by
the Linux SIOCETHTOOL ioctl. The more complex operations that involve getting or
setting whole structures at a time are implemented in OO fashion by packages
under this namespace.
=head1 SUBROUTINES
=cut
package Linux::Ethtool;
use strict;
( run in 1.676 second using v1.01-cache-2.11-cpan-49f99fa48dc )