summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOlivier Blin <oblin@mandriva.com>2008-11-26 16:44:29 +0000
committerOlivier Blin <oblin@mandriva.com>2008-11-26 16:44:29 +0000
commitc782fd3475126127875ef4390f53a91108eee840 (patch)
treeb4edd4ebd6fc7f705adc741c218dd26f9db25181
parentac28ca16f7530d60e67c7b7e7dd56cd2f2d2e514 (diff)
downloaddrakx-net-c782fd3475126127875ef4390f53a91108eee840.tar
drakx-net-c782fd3475126127875ef4390f53a91108eee840.tar.gz
drakx-net-c782fd3475126127875ef4390f53a91108eee840.tar.bz2
drakx-net-c782fd3475126127875ef4390f53a91108eee840.tar.xz
drakx-net-c782fd3475126127875ef4390f53a91108eee840.zip
add support for ATM bridging (for pppoe over USB modems, #35797)
-rw-r--r--lib/network/connection/xdsl.pm36
-rw-r--r--lib/network/network.pm2
2 files changed, 29 insertions, 9 deletions
diff --git a/lib/network/connection/xdsl.pm b/lib/network/connection/xdsl.pm
index cf7e74e..56cd294 100644
--- a/lib/network/connection/xdsl.pm
+++ b/lib/network/connection/xdsl.pm
@@ -30,6 +30,18 @@ sub uses_ppp {
!member($self->{protocol}, @non_ppp_protocols);
}
+sub uses_atm_arp {
+ my ($self) = @_;
+ $self->{device}{xdsl_type} eq 'usb' && !$self->uses_ppp;
+}
+sub get_atm_arp_interface { "atm0" }
+
+sub uses_atm_bridging {
+ my ($self) = @_;
+ $self->{device}{xdsl_type} eq 'usb' && member($self->{protocol}, qw(pppoe));
+}
+sub get_atm_bridging_interface { "nas0" }
+
my %protocol_settings = (
pppoa => {
plugin => sub {
@@ -303,13 +315,19 @@ sub build_ifcfg_settings {
my $settings = {
if_($self->uses_ppp, TYPE => 'ADSL'),
};
- if ($self->{device}{xdsl_type} eq 'usb' && !$self->uses_ppp) {
+ if ($self->uses_atm_arp) {
#- use ATMARP with the atm0 interface
- put_in_hash({
- DEVICE => "atm0",
+ put_in_hash($settings, {
+ DEVICE => $self->get_atm_arp_interface,
ATM_ADDR => join('.', @{$self->{access}{peer}}{qw(vpi vci)}),
MII_NOT_SUPPORTED => "yes",
- }, $settings);
+ });
+ }
+ if ($self->uses_atm_bridging) {
+ put_in_hash($settings, {
+ ATM_DEVICE => $self->get_atm_bridging_interface,
+ ATM_ADDR => join('.', @{$self->{access}{peer}}{qw(vpi vci)}),
+ });
}
$self->network::connection::build_ifcfg_settings($settings);
}
@@ -322,14 +340,16 @@ sub unload_connection {
sub install_packages {
my ($self, $in) = @_;
- my $packages = {
+ my $per_type_packages = {
pppoa => [ qw(ppp-pppoatm) ],
pppoe => [ qw(rp-pppoe) ],
pptp => [ qw(pptp-linux) ],
capi => [ qw(ppp) ],
- }->{$self->{protocol}};
- if ($packages && !$in->do_pkgs->install(@$packages)) {
- $in->ask_warn(N("Error"), N("Could not install the packages (%s)!", @$packages));
+ };
+ my @packages = @{$per_type_packages->{$self->{protocol}} || []};
+ push @packages, 'linux-atm' if $self->uses_atm_arp || $self->uses_atm_bridging;
+ if (@packages && !$in->do_pkgs->install(@packages)) {
+ $in->ask_warn(N("Error"), N("Could not install the packages (%s)!", @packages));
return;
}
if ($self->{protocol} eq 'capi') {
diff --git a/lib/network/network.pm b/lib/network/network.pm
index 5f6df53..587efeb 100644
--- a/lib/network/network.pm
+++ b/lib/network/network.pm
@@ -181,7 +181,7 @@ sub update_broadcast_and_network {
sub write_interface_settings {
my ($intf, $file) = @_;
- setVarsInSh($file, $intf, qw(DEVICE BOOTPROTO IPADDR NETMASK NETWORK BROADCAST GATEWAY ONBOOT HWADDR METRIC MII_NOT_SUPPORTED TYPE USERCTL ATM_ADDR ETHTOOL_OPTS VLAN MTU DNS1 DNS2 DOMAIN RESOLV_MODS LINK_DETECTION_DELAY),
+ setVarsInSh($file, $intf, qw(DEVICE BOOTPROTO IPADDR NETMASK NETWORK BROADCAST GATEWAY ONBOOT HWADDR METRIC MII_NOT_SUPPORTED TYPE USERCTL ATM_ADDR ATM_DEVICE ETHTOOL_OPTS VLAN MTU DNS1 DNS2 DOMAIN RESOLV_MODS LINK_DETECTION_DELAY),
qw(WIRELESS_MODE WIRELESS_ESSID WIRELESS_NWID WIRELESS_FREQ WIRELESS_SENS WIRELESS_RATE WIRELESS_ENC_KEY WIRELESS_ENC_MODE WIRELESS_RTS WIRELESS_FRAG WIRELESS_IWCONFIG WIRELESS_IWSPY WIRELESS_IWPRIV WIRELESS_WPA_DRIVER WIRELESS_WPA_REASSOCIATE),
qw(DVB_ADAPTER_ID DVB_NETWORK_DEMUX DVB_NETWORK_PID),
qw(IPV6INIT IPV6TO4INIT),