From 17930c693d449784e7d6d5aa12748de921664527 Mon Sep 17 00:00:00 2001 From: An-Cheng Huang Date: Thu, 12 Aug 2010 15:56:01 -0700 Subject: add required special cases for adsl/pppo* interfaces. --- lib/Vyatta/Interface.pm | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) (limited to 'lib') diff --git a/lib/Vyatta/Interface.pm b/lib/Vyatta/Interface.pm index 4c7244a..ff9e067 100755 --- a/lib/Vyatta/Interface.pm +++ b/lib/Vyatta/Interface.pm @@ -108,6 +108,34 @@ sub get_all_cfg_interfaces { } } } + + # now special cases for pppo*/adsl + for my $eth ($cfg->$vfunc('interfaces ethernet')) { + for my $ep ($cfg->$vfunc("interfaces ethernet $eth pppoe")) { + push @ret_ifs, { 'name' => "pppoe$ep", + 'path' => "interfaces ethernet $eth pppoe $ep" }; + } + } + for my $a ($cfg->$vfunc('interfaces adsl')) { + for my $p ($cfg->$vfunc("interfaces adsl $a pvc")) { + for my $t ($cfg->$vfunc("interfaces adsl $a pvc $p")) { + if ($t eq 'classical-ipoa' or $t eq 'bridged-ethernet') { + # classical-ipoa or bridged-ethernet + push @ret_ifs, + { 'name' => $a, + 'path' => "interfaces adsl $a pvc $p $t" }; + next; + } + # pppo[ea] + for my $i ($cfg->$vfunc("interfaces adsl $a pvc $p $t")) { + push @ret_ifs, + { 'name' => "$t$i", + 'path' => "interfaces adsl $a pvc $p $t $i" }; + } + } + } + } + return @ret_ifs; } -- cgit v1.2.3