From cb7d3147e0f39f1addb1247a50318bc2b4d93193 Mon Sep 17 00:00:00 2001 From: Olivier Blin Date: Mon, 6 Sep 2004 13:54:27 +0000 Subject: (adsl_conf_backend) explode sagem specific stuff to sagem_set_parameters() --- perl-install/network/adsl.pm | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) (limited to 'perl-install/network') diff --git a/perl-install/network/adsl.pm b/perl-install/network/adsl.pm index 97f5127c8..97bd57d96 100644 --- a/perl-install/network/adsl.pm +++ b/perl-install/network/adsl.pm @@ -93,6 +93,18 @@ sub adsl_detect() { return $adsl; } +sub sagem_set_parameters { + my ($netc) = @_; + my %l = map { $_ => sprintf("%08s", $netc->{$_}) } qw(vci vpi Encapsulation); + foreach my $cfg_file (qw(/etc/analog/adiusbadsl.conf /etc/eagle-usb/eagle-usb.conf)) { + substInFile { + s/VCI=.*\n/VCI=$l{vci}\n/; + s/VPI=.*\n/VPI=$l{vpi}\n/; + s/Encapsulation=.*\n/Encapsulation=$l{Encapsulation}\n/; + } "$::prefix$cfg_file"; + } +} + sub adsl_conf_backend { my ($in, $modules_conf, $adsl, $netc, $intf, $adsl_device, $adsl_type, $o_netcnx) = @_; # FIXME: should not be needed: @@ -310,19 +322,9 @@ TYPE=$kind METRIC=$metric )); - # sagem specific stuff - if ($adsl_device eq 'sagem') { - my %l = map { $_ => sprintf("%08s", $netc->{$_}) } qw(vci vpi Encapsulation); - # set vpi and vci parameters for sagem - foreach my $cfg_file (qw(/etc/analog/adiusbadsl.conf /etc/eagle-usb/eagle-usb.conf)) { - substInFile { - s/VCI=.*\n/VCI=$l{vci}\n/; - s/VPI=.*\n/VPI=$l{vpi}\n/; - s/Encapsulation=.*\n/Encapsulation=$l{Encapsulation}\n/; - } "$::prefix$cfg_file"; - } - } - + #- set vpi, vci and encapsulation parameters for sagem + sagem_set_parameters($netc) if $adsl_device eq 'sagem'; + # set aliases: if (exists $modems{$adsl_device}{aliases}) { $modules_conf->set_alias($_->[0], $_->[1]) foreach @{$modems{$adsl_device}{aliases}}; -- cgit v1.2.1