diff options
author | slioch <slioch@eng-140.vyatta.com> | 2009-07-31 15:08:30 -0700 |
---|---|---|
committer | slioch <slioch@eng-140.vyatta.com> | 2009-07-31 15:08:30 -0700 |
commit | c25cec88d97a4dbb0e04a45d620f7e4c9796e02d (patch) | |
tree | 1f0aad67603e7f461f7550a16a010c8bcd445307 /lib/Vyatta | |
parent | 9c2f8965e28bd4af5f8773b85dbee0511f447ec3 (diff) | |
parent | 362e4280979ad499fc9662023761250ac24e02aa (diff) | |
download | vyatta-cfg-c25cec88d97a4dbb0e04a45d620f7e4c9796e02d.tar.gz vyatta-cfg-c25cec88d97a4dbb0e04a45d620f7e4c9796e02d.zip |
Merge branch 'kenwood' of http://git.vyatta.com/vyatta-cfg into kenwood
Diffstat (limited to 'lib/Vyatta')
-rwxr-xr-x | lib/Vyatta/Interface.pm | 12 |
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; |