summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorslioch <slioch@eng-140.vyatta.com>2009-07-31 15:08:30 -0700
committerslioch <slioch@eng-140.vyatta.com>2009-07-31 15:08:30 -0700
commitc25cec88d97a4dbb0e04a45d620f7e4c9796e02d (patch)
tree1f0aad67603e7f461f7550a16a010c8bcd445307 /lib
parent9c2f8965e28bd4af5f8773b85dbee0511f447ec3 (diff)
parent362e4280979ad499fc9662023761250ac24e02aa (diff)
downloadvyatta-cfg-c25cec88d97a4dbb0e04a45d620f7e4c9796e02d.tar.gz
vyatta-cfg-c25cec88d97a4dbb0e04a45d620f7e4c9796e02d.zip
Merge branch 'kenwood' of http://git.vyatta.com/vyatta-cfg into kenwood
Diffstat (limited to 'lib')
-rwxr-xr-xlib/Vyatta/Interface.pm12
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/Vyatta/Interface.pm b/lib/Vyatta/Interface.pm
index 96429c0..97ef7f7 100755
--- a/lib/Vyatta/Interface.pm
+++ b/lib/Vyatta/Interface.pm
@@ -222,6 +222,18 @@ sub flags {
return hex($val);
}
+sub hw_address {
+ my $self = shift;
+
+ open my $addrf, '<', "/sys/class/net/$self->{name}/address"
+ or return;
+ my $address = <$addrf>;
+ close $addrf;
+
+ chomp $address if $address;
+ return $address;
+}
+
sub is_broadcast {
my $self = shift;
return $self->flags() & IFF_BROADCAST;