From c368665647b9ac72efc161c6e291cba8c3674628 Mon Sep 17 00:00:00 2001 From: Stephen Hemminger Date: Mon, 12 Jan 2009 18:16:37 -0800 Subject: Better version of getIPadresses and getInterfaces Use new Vyatta::Interface and sysfs to avoid using ifconfig and ip command unnecessarily. --- tests/interface.pl | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'tests') diff --git a/tests/interface.pl b/tests/interface.pl index 989d6c5..eaa295f 100644 --- a/tests/interface.pl +++ b/tests/interface.pl @@ -7,8 +7,12 @@ use strict; use warnings; use Vyatta::Interface; +use Vyatta::Misc qw(getInterfaces getInterfacesIPadresses); -foreach my $arg (@ARGV) { +my @ips = getInterfacesIPadresses('all'); +print "IP addresses = ",join(' ',@ips), "\n"; + +foreach my $arg (getInterfaces()) { print "$arg : "; my $intf = new Vyatta::Interface($arg); -- cgit v1.2.3