@@ -113,7 +113,7 @@ gtkadd($window1->{window}, ) ), 0, gtkpack_(Gtk2::HBox->new(0,5), - 1, gtksignal_connect(my $button_connect = gtkset_sensitive(Gtk2::Button->new(), 0), clicked => \&connection), + 1, gtksignal_connect(my $button_connect = gtkset_sensitive(Gtk2::Button->new, 0), clicked => \&connection), 0, Gtk2::VSeparator->new, 0, gtkpack(Gtk2::VBox->new(0,5), gtksignal_connect(Gtk2::Button->new(N("Logs")), clicked => sub { @@ -132,7 +132,8 @@ gtkadd($window1->{window}, $window1->{rwindow}->show_all; $window1->{rwindow}->realize; $combo1->entry->signal_connect(changed => sub { - network::netconnect::set_profile($netcnx, $combo1->entry->get_text); + $netcnx->{PROFILE} = $combo1->entry->get_text; + network::netconnect::set_profile($netcnx); network::netconnect::load_conf($netcnx, $netc, $intf); network::netconnect::read_net_conf('', $netcnx, $netc); }); @@ -169,7 +170,7 @@ ugtk2->exit(0); my $during_connection; my $first; -sub connection { +sub connection() { $during_connection = 1; my $wasconnected = $isconnected; @@ -187,7 +188,7 @@ sub connection { my $nb_point = 1; $first = 1; - my $tag = Glib::Timeout->add(1000, sub { + my $_tag = Glib::Timeout->add(1000, sub { $statusbar->pop(1); $statusbar->push(1, ($wasconnected == 1 ? N("Disconnecting from Internet ") : N("Connecting to Internet ")) . join('', map { "." } (1..$nb_point))); @@ -229,18 +230,18 @@ sub connection { my $delay = 1000; # keep the message displayed longer if there is a problem. if ($isconnected == $wasconnected) { $delay = 5000 } - my $tag3 = Glib::Timeout->add($delay, sub { + my $_tag3 = Glib::Timeout->add($delay, sub { $button_connect->set_sensitive(1); $button_close->set_sensitive(1); undef $during_connection; update(); return 0; - }); - } # END IF - return $ret }); + }); + } + return $ret; + }); - my $netc = {}; gtkflush(); if ($wasconnected == 1) { @@ -250,7 +251,7 @@ sub connection { } } -sub rescan { +sub rescan() { get_val(); foreach (@interfaces) { my $intf = $_; @@ -306,20 +307,18 @@ sub rescan { 1; } -sub get_val { - my @ret; +sub get_val() { my $a = cat_("/proc/net/dev"); $a =~ s/^.*?\n.*?\n//; $a =~ s/^\s*lo:.*?\n//; my @line = split(/\n/, $a); - foreach (@line) { + map { s/\s*(\w*)://; my $intf = $1; - push @ret, $intf; $monitor->{$intf}{val} = [split()]; $monitor->{$intf}{intf} = $intf; - } - @ret; + $intf; + } @line; } sub change_color { @@ -343,7 +342,7 @@ sub change_color { } my $scale; -sub update { +sub update() { if (!$during_connection) { my $isconnect = test_connected(0); if ($isconnect != -2) { @@ -362,7 +361,7 @@ sub update { $default_intf = $intf; $monitor->{$intf}{initialr} = $monitor->{$intf}{val}[0]; $monitor->{$intf}{initialt} = $monitor->{$intf}{val}[8]; - $darea = Gtk2::DrawingArea->new(); + $darea = Gtk2::DrawingArea->new; $darea->set_events(["pointer_motion_mask"]); $notebook->append_page(gtkshow(my $page = gtkpack_(Gtk2::VBox->new(0,0), 0, gtkpack__(gtkset_border_width(Gtk2::HBox->new(0,0), 5), @@ -370,21 +369,21 @@ sub update { 0, gtkpack_(Gtk2::HBox->new(0,0), 1, gtkpack__(Gtk2::VBox->new(0,0), gtkpack__(gtkset_border_width(Gtk2::HBox->new(0,5), 5), - gtksignal_connect(my $button_t = gtkset_relief(Gtk2::Button->new(), 'none'), clicked => sub { + gtksignal_connect(my $button_t = gtkset_relief(Gtk2::Button->new, 'none'), clicked => sub { $colort = change_color($colort); $gct->set_foreground($colort); $_[0]->queue_draw; }), N("sent: "), $monitor->{$intf}{labelt} = Gtk2::Label->new("0")), gtkpack__(gtkset_border_width(Gtk2::HBox->new(0,5), 5), - gtksignal_connect(my $button_r = gtkset_relief(Gtk2::Button->new(), 'none'), clicked => sub { + gtksignal_connect(my $button_r = gtkset_relief(Gtk2::Button->new, 'none'), clicked => sub { $colorr = change_color($colorr); $gcr->set_foreground($colorr); $_[0]->queue_draw; }), N("received: "), $monitor->{$intf}{labelr} = Gtk2::Label->new("0")), gtkpack__(gtkset_border_width(Gtk2::HBox->new(0,5), 5), - gtksignal_connect(my $button_a = gtkset_relief(Gtk2::Button->new(), 'none'), clicked => sub { + gtksignal_connect(my $button_a = gtkset_relief(Gtk2::Button->new, 'none'), clicked => sub { $colora = change_color($colora); $gca->set_foreground($colora); $_[0]->queue_draw; @@ -409,7 +408,7 @@ sub update { )), Gtk2::Label->new($intf)); foreach my $i ([$button_t, $gct], [$button_r, $gcr], [$button_a, $gca]) { - $i->[0]->add(gtksignal_connect(gtkshow(gtksize(gtkset_size_request(Gtk2::DrawingArea->new(), 10, 10), 10, 10)), expose_event => sub { $_[0]->window->draw_rectangle($i->[1], 1, 0, 0, 10, 10) })); + $i->[0]->add(gtksignal_connect(gtkshow(gtksize(gtkset_size_request(Gtk2::DrawingArea->new, 10, 10), 10, 10)), expose_event => sub { $_[0]->window->draw_rectangle($i->[1], 1, 0, 0, 10, 10) })); } $notebook->set_current_page($notebook->page_num($page)); $monitor->{$intf}{page} = $notebook->page_num($page); @@ -419,7 +418,7 @@ sub update { $monitor->{$intf}{referencet} = $monitor-package network::adsl_consts; # $Id$
# This should probably be splitted out into ldetect-lst as some provider db
use vars qw(@ISA @EXPORT);
use common;
@ISA = qw(Exporter);
@EXPORT = qw(@adsl_data);
# From:
# http://www.eagle-usb.org/article.php3?id_article=23
# http://www.sagem.com/web-modems/download/support-fast1000-fr.htm
# http://perso.wanadoo.fr/michel-m/protocolesfai.htm
our %adsl_data = (
# country|provider => { VPI, VCI_hexa, ... }
# Encapsulation:
# 1=PPPoE LLC, 2=PPPoE VCmux (never used ?)
# 3=RFC1483/2684 Routed IP LLC,
# 4=RFC1483/2684 Routed IP (IPoA VCmux)
# 5 RFC2364 PPPoA LLC,
# 6 RFC2364 PPPoA VCmux
# dns are provided for when !usepeerdns in peers config file
# method : PPPoA, pppoe or static
# please forward updates to http://forum.eagle-usb.org
# order alphabetically by country (in English) / ISP (local language)
N("Austria") . "|Any" =>
{
vpi => 8,
vci => 30,
Encapsulation => 6,
method => 'pppoa',
},
N("Austria") . "|Telstra" =>
{
vpi => 8,
vci => 23,
Encapsulation => 1,
},
N("Belgium") . "|ADSL Office" =>
{
vpi => 8,
vci => 23,
Encapsulation => 3,
},
N("Belgium") . "|Tiscali BE" =>
{
vpi => 8,
vci => 23,
Encapsulation => 6,
method => 'pppoa',
dnsServer2 => '212.35.2.1',
dnsServer3 => '212.35.2.2',
DOMAINNAME2 => 'tiscali.be',
},
N("Belgium") . "|Belgacom" =>
{
vpi => 8,
vci => 23,
Encapsulation => 6,
method => 'pppoa',
},
N("Belgium") . "|Turboline" =>
{
vpi => 8,
vci => 23,
Encapsulation => 5,
},
N("Brazil") . "|Speedy/Telefonica" =>
{
vpi => 8,
vci => 23,
Encapsulation => 1,
method => 'pppoe',
dnsServer2 => '200.204.0.10',
dnsServer3 => '200.204.0.138',
},
N("Brazil") . "|Velox/Telemar" =>
{
vpi => 0,
vci => 33,
Encapsulation => 1,
method => 'pppoe',
},
N("Brazil") . "|Turbo/Brasil Telecom" =>
{
vpi => 0,
vci => 23,
Encapsulation => 1,
method => 'pppoe',
},
N("Brazil") . "|Rio Grande do Sul (RS)" =>
{
vpi => 1,
vci => 20,
Encapsulation => 1,
method => 'pppoe',
},
N("Bulgaria") . "|BTK ISDN" =>
{
vpi => 1,
vci => 20,
Encapsulation => 1,
method => 'pppoe',
},
N("Bulgaria") . "|BTK POTS" =>
{
vpi => 0,
vci => 23,
Encapsulation => 1,
method => 'pppoe',
},
N("Denmark") . "|Any" =>
{
vpi => 0,
vci => 65,
Encapsulation => 3,
},
N("France") . "|Free non dégroupé 512/128 & 1024/128" =>
{
vpi => 8,
vci => 23,
Encapsulation => 6,
dnsServer2 => '213.228.0.23',
dnsServer3 => '212.27.32.176',
method => 'pppoa',
DOMAINNAME2 => 'free.fr',
},
N("France") . "|Free dégroupé 1024/256 (mini)" =>
{
vpi => 8,
vci => 24,
Encapsulation => 4,
dnsServer2 => '213.228.0.23',
dnsServer3 => '212.27.32.176',
DOMAINNAME2 => 'free.fr',
},
N("France") . "|n9uf tel9com 512 & dégroupé 1024" =>
{
vpi => 8,
vci => 23,
Encapsulation => 6,
dnsServer2 => '212.30.93.108',
dnsServer3 => '212.203.124.146',
method => 'pppoa',
},
N("France") . "|Cegetel non dégroupé 512 IP/ADSL et dégroupé" =>
{
vpi => 8,
vci => 23,
Encapsulation => 6,
dnsServer2 => '212.94.174.85',
dnsServer3 => '212.94.174.86',
method => 'pppoa',
},
N("France") . "|Club-Internet" =>
{
vpi => 8,
vci => 23,
Encapsulation => 6,
dnsServer2 => '194.117.200.10',
dnsServer3 => '194.117.200.15',
method => 'pppoa',
DOMAINNAME2 => 'club-internet.fr',
},
N("France") . "|Wanadoo" =>
{
vpi => 8,
vci => 23,
Encapsulation => 6,
dnsServer2 => '80.10.246.2',
dnsServer3 => '80.10.246.129',
method => 'pppoa',
DOMAINNAME2 => 'wanadoo.fr',
},
N("France") . "|Télé2 128k " =>
{
vpi => 8,
vci => 23,
Encapsulation => 6,
dnsServer2 => '212.151.136.242',
dnsServer3 => '130.244.127.162',
method => 'pppoa',
},
N("France") . "|Tiscali.fr 128k" =>
{
vpi => 8,
vci => 23,
Encapsulation => 5,
dnsServer2 => '213.36.80.1',
dnsServer3 => '213.36.80.2',
method => 'pppoa',
},
N("France") . "|Tiscali.fr 512k" =>
{
vpi => 8,
vci => 23,
Encapsulation => 6,
dnsServer2 => '213.36.80.1',
dnsServer3 => '213.36.80.2',
method => 'pppoa',
},
N("Finland") . "|Sonera" =>
{
vpi => 0,
vci => 64,
Encapsulation => 3,
method => 'pppoe',
},
N("Germany") . "|Deutsche Telekom (DT)" =>
{
vpi => 1,
vci => 20,
Encapsulation => 1,
method => 'pppoe',
},
N("Germany") . "|1&1" =>
{
vpi => 1,
vci => 20,
Encapsulation => 1,
dnsServer2 => '195.20.224.234',
dnsServer3 => '194.25.2.129',
method => 'pppoe',
},
N("Greece") . "|Any" =>
{
vpi => 8,
vci => 23,
Encapsulation => 6,
method => 'pppoa',
},
N("Hungary") . "|Matav" =>
{
vpi => 1,
vci => 20,
Encapsulation => 1,
method => 'pppoe',
},
N("Ireland") . "|Any" =>
{
vpi => 8,
vci => 23,
Encapsulation => 1,
method => 'pppoe',
},
N("Italy") . "|Telecom Italia" =>
{
vpi => 8,
vci => 23,
Encapsulation => 6,
dnsServer2 => '195.20.224.234',
dnsServer3 => '194.25.2.129',
method => 'pppoa',
},
N("Italy") . "|Telecom Italia/Office Users (ADSL Smart X)" =>
{
vpi => 8,
vci => 23,
Encapsulation => 3,
},
N("Italy") . "|Tiscali.it" =>
{
vpi => 8,
vci => 23,
Encapsulation => 6,
dnsServer2 => '195.20.224.234',
dnsServer3 => '194.25.2.129',
method => 'pppoa',
},
N("Netherlands") . "|KPN" =>
{
vpi => 8,
vci => 30,
Encapsulation => 6,
method => 'pppoa',
},
N("Poland") . "|Telekomunikacja Polska (TPSA/neostrada)" =>
{
vpi => 0,
vci => 23,
Encapsulation => 6,
dnsServer2 => '194.204.152.34',
dnsServer3 => '217.98.63.164',
method => 'pppoa',
},
N("Portugal") . "|PT" =>
{
vpi => 0,
vci => 23,
Encapsulation => 1,
},
N("Slovenia") . "|SiOL" =>
{
dnsServer2 => '193.189.160.11',
dnsServer3 => '193.189.160.12',
vpi => 1,
vci => 32,
method => 'pppoe',
DOMAINNAME2 => 'siol.net',
Encapsulation => 1,
},
N("Spain") . "|Telefónica IP dinámica" =>
{
vpi => 8,
vci => 20,
Encapsulation => 1,
dnsServer2 => '80.58.32.33',
dnsServer3 => '80.58.0.97',
method => 'pppoe',
},
N("Spain") . "|Telefónica ip fija" =>
{
vpi => 8,
vci => 20,
Encapsulation => 3,
protocol => 'static',
dnsServer2 => '80.58.32.33',
dnsServer3 => '80.58.0.97',
method => 'static',
},
N("Spain") . "|Wanadoo/Eresmas Retevision" =>
{
vpi => 8,
vci => 23,
Encapsulation => 6,
dnsServer2 => '80.58.0.33',
dnsServer3 => '80.58.32.97',
method => 'pppoa',
},
N("Sweden") . "|Telia" =>
{
vpi => 8,
vci => 23,
Encapsulation => 3,
},
N("Switzerland") . "|Any" =>
{
vpi => 8,
vci => 23,
Encapsulation => 3,
},
N("Switzerland") . "|BlueWin / Swisscom" =>
{
vpi => 8,
vci => 23,
Encapsulation => 5,
dnsServer2 => '195.186.4.108',
dnsServer3 => '195.186.4.109',
method => 'pppoa',
},
N("United Kingdom") . "|Tiscali UK " =>
{
vpi => 0,
vci => 26,
Encapsulation => 6,
method => 'pppoa',
},
N("United Kingdom") . "|British Telecom " =>
{
vpi => 0,
vci => 26,
Encapsulation => 6,
method => 'pppoa',
},
);
1;
|