diff options
author | Michael Larson <mike@ft1.vyatta.com> | 2009-09-09 16:26:01 -0700 |
---|---|---|
committer | Michael Larson <mike@ft1.vyatta.com> | 2009-09-09 16:26:01 -0700 |
commit | 5f1a33134d463fa565ee9dd43237252bd27d5fb3 (patch) | |
tree | 70f1ac5b1e76a0ae875c71ca15089ecdbc45c122 /lib/Vyatta/Interface.pm | |
parent | 028e8e12c5e15efc0a316641f2b02e46d5c77210 (diff) | |
parent | 42abfac6f11077dbfc3b0eaf845597e38f7cd685 (diff) | |
download | vyatta-cfg-5f1a33134d463fa565ee9dd43237252bd27d5fb3.tar.gz vyatta-cfg-5f1a33134d463fa565ee9dd43237252bd27d5fb3.zip |
Merge branch 'kenwood' of http://git.vyatta.com/vyatta-cfg into kenwood
Diffstat (limited to 'lib/Vyatta/Interface.pm')
-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; |