From 81d41423748fff4a65acd4d8a4275e437cf9a8c2 Mon Sep 17 00:00:00 2001 From: Stig Thormodsrud Date: Mon, 2 Mar 2009 15:52:04 -0800 Subject: Add loopback as a type for getInterfacesIPadresses(). --- lib/Vyatta/Misc.pm | 5 +++-- tests/interface.pl | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/Vyatta/Misc.pm b/lib/Vyatta/Misc.pm index 0c00b7e..fad3eb2 100755 --- a/lib/Vyatta/Misc.pm +++ b/lib/Vyatta/Misc.pm @@ -127,11 +127,12 @@ my %type_hash = ( 'broadcast' => 'is_broadcast', 'multicast' => 'is_multicast', 'pointtopoint' => 'is_pointtopoint', + 'loopback' => 'is_loopback', ); # getInterfacesIPadresses() returns IPv4 addresses for the interface type -# possible type of interfaces : 'broadcast', 'pointopoint', 'multicast', 'all' -# the loopback IP address is never returned with any of the above parameters +# possible type of interfaces : 'broadcast', 'pointtopoint', 'multicast', 'all' +# and 'loopback' sub getInterfacesIPadresses { my $type = shift; my $type_func; diff --git a/tests/interface.pl b/tests/interface.pl index 86ec96e..9ebeb60 100644 --- a/tests/interface.pl +++ b/tests/interface.pl @@ -13,7 +13,7 @@ my @interfaces = getInterfaces(); print "Interfaces: ", join(' ',@interfaces),"\n"; print "IP\n"; -foreach my $type (qw/all broadcast multicast pointtopoint/) { +foreach my $type (qw/all broadcast multicast pointtopoint loopback/) { print "\t$type = "; foreach my $addr (Vyatta::Misc::getInterfacesIPadresses($type)) { print $addr, '(', is_ip_v4_or_v6($addr), ') '; -- cgit v1.2.3