|
IO::Interface::Simple - Perl extension for access to network card configuration information |
IO::Interface::Simple - Perl extension for access to network card configuration information
use IO::Interface::Simple;
my $if1 = IO::Interface::Simple->new('eth0');
my $if2 = IO::Interface::Simple->new_from_address('127.0.0.1');
my $if3 = IO::Interface::Simple->new_from_index(1);
my @interfaces = IO::Interface::Simple->interfaces;
for my $if (@interfaces) {
print "interface = $if\n";
print "addr = ",$if->address,"\n",
"broadcast = ",$if->broadcast,"\n",
"netmask = ",$if->netmask,"\n",
"dstaddr = ",$if->dstaddr,"\n",
"hwaddr = ",$if->hwaddr,"\n",
"mtu = ",$if->mtu,"\n",
"metric = ",$if->metric,"\n",
"index = ",$if->index,"\n";
print "is running\n" if $if->is_running;
print "is broadcast\n" if $if->is_broadcast;
print "is p-to-p\n" if $if->is_pt2pt;
print "is loopback\n" if $if->is_loopback;
print "is promiscuous\n" if $if->is_promiscuous;
print "is multicast\n" if $if->is_multicast;
print "is notrailers\n" if $if->is_notrailers;
print "is noarp\n" if $if->is_noarp;
}
IO::Interface::Simple allows you to interrogate and change network interfaces. It has overlapping functionality with Net::Interface, but might compile and run on more platforms.
new('eth0')new() creates an interface object.
new_from_address('192.168.0.1')new_from_index(2)
address([$newaddr])broadcast([$newaddr])netmask([$newmask])hwaddr([$newaddr])mtu([$newmtu])metric([$newmetric])flags([$newflags])is_running([$newflag])is_broadcast([$newflag])is_pt2pt([$newflag])is_loopback([$newflag])is_promiscuous([$newflag])is_multicast([$newflag])is_notrailers([$newflag])is_noarp([$newflag])
Lincoln Stein <lstein@cshl.org>
This module is distributed under the same license as Perl itself.
the perl manpage, the IO::Socket manpage, the IO::Multicast manpage), the IO::Interface manpage, the Net::Interface manpage
|
IO::Interface::Simple - Perl extension for access to network card configuration information |