summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorEugeni Dodonov <eugeni@mandriva.org>2009-05-08 16:16:53 +0000
committerEugeni Dodonov <eugeni@mandriva.org>2009-05-08 16:16:53 +0000
commitb17765962c8a3c380f8266801c1e85f054ce5a12 (patch)
treed24d468e103fc4cbafc05e114253d90b8ab5d05f /lib
parent93e8e085e25a6fb601de9df6dfb891c6ad7392ef (diff)
downloaddrakx-net-b17765962c8a3c380f8266801c1e85f054ce5a12.tar
drakx-net-b17765962c8a3c380f8266801c1e85f054ce5a12.tar.gz
drakx-net-b17765962c8a3c380f8266801c1e85f054ce5a12.tar.bz2
drakx-net-b17765962c8a3c380f8266801c1e85f054ce5a12.tar.xz
drakx-net-b17765962c8a3c380f8266801c1e85f054ce5a12.zip
Support for network accounting configuration.
Diffstat (limited to 'lib')
-rw-r--r--lib/network/connection.pm3
-rw-r--r--lib/network/network.pm1
2 files changed, 4 insertions, 0 deletions
diff --git a/lib/network/connection.pm b/lib/network/connection.pm
index 98e94da..4a70779 100644
--- a/lib/network/connection.pm
+++ b/lib/network/connection.pm
@@ -149,6 +149,7 @@ sub load_interface_settings {
$self->{control}{userctl} = $self->get_ifcfg_bool('USERCTL');
$self->{control}{metric} = $self->{ifcfg}{METRIC};
$self->{control}{mtu} = $self->{ifcfg}{MTU};
+ $self->{control}{accounting} = $self->{ifcfg}{ACCOUNTING};
}
#- override to return 1 if the connection network scan is slow
@@ -241,6 +242,7 @@ sub get_control_settings {
[
{ text => N("Allow users to manage the connection"), val => \$self->{control}{userctl}, type => "bool" },
{ text => N("Start the connection at boot"), val => \$self->{control}{onboot}, type => "bool" },
+ { text => N("Account network traffic"), val => \$self->{control}{accounting}, type => "bool" },
{ label => N("Metric"), val => \$self->{control}{metric}, advanced => 1 },
{ label => N("MTU"), val => \$self->{control}{mtu}, advanced => 1,
help => N("Maximum size of network message (MTU). If unsure, left blank.") },
@@ -252,6 +254,7 @@ sub build_ifcfg_settings {
put_in_hash($o_options, {
DEVICE => $self->get_interface,
ONBOOT => bool2yesno($self->{control}{onboot}),
+ ACCOUNTING => bool2yesno($self->{control}{accounting}),
USERCTL => bool2yesno($self->{control}{userctl}),
METRIC => $self->{control}{metric},
MTU => $self->{control}{mtu},
diff --git a/lib/network/network.pm b/lib/network/network.pm
index fdce396..d500dca 100644
--- a/lib/network/network.pm
+++ b/lib/network/network.pm
@@ -191,6 +191,7 @@ sub write_interface_settings {
qw(MRU REMIP PPPOPTIONS HARDFLOWCTL DEFABORT RETRYTIMEOUT PAPNAME LINESPEED MODEMPORT DEBUG ESCAPECHARS INITSTRING),
qw(DISCONNECTTIMEOUT PERSIST DEFROUTE),
qw(VPN_NAME VPN_TYPE),
+ qw(ACCOUNTING),
qw(CELLULAR_CID),
if_($intf->{BOOTPROTO} eq "dhcp", qw(DHCP_CLIENT DHCP_HOSTNAME NEEDHOSTNAME PEERDNS PEERYP PEERNTPD DHCP_TIMEOUT)),
if_($intf->{DEVICE} =~ /^ippp\d+$/, qw(DIAL_ON_IFUP))