summaryrefslogtreecommitdiff
path: root/lib/Vyatta/Interface.pm
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Vyatta/Interface.pm')
-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;