.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is turned on, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{ . if \nF \{ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). .\" Fear. Run. Save yourself. No user-serviceable parts. . \" fudge factors for nroff and troff .if n \{\ . ds #H 0 . ds #V .8m . ds #F .3m . ds #[ \f1 . ds #] \fP .\} .if t \{\ . ds #H ((1u-(\\\\n(.fu%2u))*.13m) . ds #V .6m . ds #F 0 . ds #[ \& . ds #] \& .\} . \" simple accents for nroff and troff .if n \{\ . ds ' \& . ds ` \& . ds ^ \& . ds , \& . ds ~ ~ . ds / .\} .if t \{\ . ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" . ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' . ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' . ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' . ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' . ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' .\} . \" troff and (daisy-wheel) nroff accents .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' .ds 8 \h'\*(#H'\(*b\h'-\*(#H' .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] .ds ae a\h'-(\w'a'u*4/10)'e .ds Ae A\h'-(\w'A'u*4/10)'E . \" corrections for vroff .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' . \" for low resolution devices (crt and lpr) .if \n(.H>23 .if \n(.V>19 \ \{\ . ds : e . ds 8 ss . ds o a . ds d- d\h'-1'\(ga . ds D- D\h'-1'\(hy . ds th \o'bp' . ds Th \o'LP' . ds ae ae . ds Ae AE .\} .rm #[ #] #H #V #F C .\" ======================================================================== .\" .IX Title "Interface::Simple 3pm" .TH Interface::Simple 3pm "2007-01-22" "perl v5.20.0" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" IO::Interface::Simple \- Perl extension for access to network card configuration information .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 1 \& use IO::Interface::Simple; \& \& my $if1 = IO::Interface::Simple\->new(\*(Aqeth0\*(Aq); \& my $if2 = IO::Interface::Simple\->new_from_address(\*(Aq127.0.0.1\*(Aq); \& my $if3 = IO::Interface::Simple\->new_from_index(1); \& \& my @interfaces = IO::Interface::Simple\->interfaces; \& \& for my $if (@interfaces) { \& print "interface = $if\en"; \& print "addr = ",$if\->address,"\en", \& "broadcast = ",$if\->broadcast,"\en", \& "netmask = ",$if\->netmask,"\en", \& "dstaddr = ",$if\->dstaddr,"\en", \& "hwaddr = ",$if\->hwaddr,"\en", \& "mtu = ",$if\->mtu,"\en", \& "metric = ",$if\->metric,"\en", \& "index = ",$if\->index,"\en"; \& \& print "is running\en" if $if\->is_running; \& print "is broadcast\en" if $if\->is_broadcast; \& print "is p\-to\-p\en" if $if\->is_pt2pt; \& print "is loopback\en" if $if\->is_loopback; \& print "is promiscuous\en" if $if\->is_promiscuous; \& print "is multicast\en" if $if\->is_multicast; \& print "is notrailers\en" if $if\->is_notrailers; \& print "is noarp\en" if $if\->is_noarp; \& } .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" 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. .SS "Class Methods" .IX Subsection "Class Methods" .ie n .IP "$interface = IO::Interface::Simple\->new('eth0')" 4 .el .IP "\f(CW$interface\fR = IO::Interface::Simple\->new('eth0')" 4 .IX Item "$interface = IO::Interface::Simple->new('eth0')" Given an interface name, \fInew()\fR creates an interface object. .ie n .IP "@iflist = IO::Interface::Simple\->interfaces;" 4 .el .IP "\f(CW@iflist\fR = IO::Interface::Simple\->interfaces;" 4 .IX Item "@iflist = IO::Interface::Simple->interfaces;" Returns a list of active interface objects. .ie n .IP "$interface = IO::Interface::Simple\->new_from_address('192.168.0.1')" 4 .el .IP "\f(CW$interface\fR = IO::Interface::Simple\->new_from_address('192.168.0.1')" 4 .IX Item "$interface = IO::Interface::Simple->new_from_address('192.168.0.1')" Returns the interface object corresponding to the given address. .ie n .IP "$interface = IO::Interface::Simple\->\fInew_from_index\fR\|(2)" 4 .el .IP "\f(CW$interface\fR = IO::Interface::Simple\->\fInew_from_index\fR\|(2)" 4 .IX Item "$interface = IO::Interface::Simple->new_from_index" Returns the interface object corresponding to the given numeric index. This is only supported on BSD-ish platforms. .SS "Object Methods" .IX Subsection "Object Methods" .ie n .IP "$name = $interface\->name" 4 .el .IP "\f(CW$name\fR = \f(CW$interface\fR\->name" 4 .IX Item "$name = $interface->name" Get the name of the interface. The interface object is also overloaded so that if you use it in a string context it is the same as calling \&\fIname()\fR. .ie n .IP "$index = $interface\->index" 4 .el .IP "\f(CW$index\fR = \f(CW$interface\fR\->index" 4 .IX Item "$index = $interface->index" Get the index of the interface. This is only supported on BSD-like platforms. .ie n .IP "$addr = $interface\->address([$newaddr])" 4 .el .IP "\f(CW$addr\fR = \f(CW$interface\fR\->address([$newaddr])" 4 .IX Item "$addr = $interface->address([$newaddr])" Get or set the interface's address. .ie n .IP "$addr = $interface\->broadcast([$newaddr])" 4 .el .IP "\f(CW$addr\fR = \f(CW$interface\fR\->broadcast([$newaddr])" 4 .IX Item "$addr = $interface->broadcast([$newaddr])" Get or set the interface's broadcast address. .ie n .IP "$addr = $interface\->netmask([$newmask])" 4 .el .IP "\f(CW$addr\fR = \f(CW$interface\fR\->netmask([$newmask])" 4 .IX Item "$addr = $interface->netmask([$newmask])" Get or set the interface's netmask. .ie n .IP "$addr = $interface\->hwaddr([$newaddr])" 4 .el .IP "\f(CW$addr\fR = \f(CW$interface\fR\->hwaddr([$newaddr])" 4 .IX Item "$addr = $interface->hwaddr([$newaddr])" Get or set the interface's hardware address. .ie n .IP "$addr = $interface\->mtu([$newmtu])" 4 .el .IP "\f(CW$addr\fR = \f(CW$interface\fR\->mtu([$newmtu])" 4 .IX Item "$addr = $interface->mtu([$newmtu])" Get or set the interface's \s-1MTU.\s0 .ie n .IP "$addr = $interface\->metric([$newmetric])" 4 .el .IP "\f(CW$addr\fR = \f(CW$interface\fR\->metric([$newmetric])" 4 .IX Item "$addr = $interface->metric([$newmetric])" Get or set the interface's metric. .ie n .IP "$flags = $interface\->flags([$newflags])" 4 .el .IP "\f(CW$flags\fR = \f(CW$interface\fR\->flags([$newflags])" 4 .IX Item "$flags = $interface->flags([$newflags])" Get or set the interface's flags. These can be ANDed with the \s-1IFF\s0 constants exported by IO::Interface or Net::Interface in order to interrogate the state and capabilities of the interface. However, it is probably more convenient to use the broken-out methods listed below. .ie n .IP "$flag = $interface\->is_running([$newflag])" 4 .el .IP "\f(CW$flag\fR = \f(CW$interface\fR\->is_running([$newflag])" 4 .IX Item "$flag = $interface->is_running([$newflag])" .PD 0 .ie n .IP "$flag = $interface\->is_broadcast([$newflag])" 4 .el .IP "\f(CW$flag\fR = \f(CW$interface\fR\->is_broadcast([$newflag])" 4 .IX Item "$flag = $interface->is_broadcast([$newflag])" .ie n .IP "$flag = $interface\->is_pt2pt([$newflag])" 4 .el .IP "\f(CW$flag\fR = \f(CW$interface\fR\->is_pt2pt([$newflag])" 4 .IX Item "$flag = $interface->is_pt2pt([$newflag])" .ie n .IP "$flag = $interface\->is_loopback([$newflag])" 4 .el .IP "\f(CW$flag\fR = \f(CW$interface\fR\->is_loopback([$newflag])" 4 .IX Item "$flag = $interface->is_loopback([$newflag])" .ie n .IP "$flag = $interface\->is_promiscuous([$newflag])" 4 .el .IP "\f(CW$flag\fR = \f(CW$interface\fR\->is_promiscuous([$newflag])" 4 .IX Item "$flag = $interface->is_promiscuous([$newflag])" .ie n .IP "$flag = $interface\->is_multicast([$newflag])" 4 .el .IP "\f(CW$flag\fR = \f(CW$interface\fR\->is_multicast([$newflag])" 4 .IX Item "$flag = $interface->is_multicast([$newflag])" .ie n .IP "$flag = $interface\->is_notrailers([$newflag])" 4 .el .IP "\f(CW$flag\fR = \f(CW$interface\fR\->is_notrailers([$newflag])" 4 .IX Item "$flag = $interface->is_notrailers([$newflag])" .ie n .IP "$flag = $interface\->is_noarp([$newflag])" 4 .el .IP "\f(CW$flag\fR = \f(CW$interface\fR\->is_noarp([$newflag])" 4 .IX Item "$flag = $interface->is_noarp([$newflag])" .PD Get or set the corresponding configuration parameters. Note that the operating system may not let you set some of these. .SH "AUTHOR" .IX Header "AUTHOR" Lincoln Stein .PP This module is distributed under the same license as Perl itself. .SH "SEE ALSO" .IX Header "SEE ALSO" perl, IO::Socket, IO::Multicast), IO::Interface, Net::Interface