Misc points about network manager

2009-05-04 Thread Robert Rehammar
Hi all,

Just joined the list to discuss a few things about Network Managers
performance.

First, I have been working some with MacOS X, and the network detection
in MacOS X is some 10-100 times faster than what Network Manager
performs. I believe it should be possible also for a GNU/Linux system to
detect and sign in to a network with that speed. Is this something that
has been discussed previously?

Next, I run Ubuntu (now 9.04, used to be 8.10 and back) with NM
0.7.1~rc4.1.cf199a964-0ubuntu2 (from apt). At leas in this (and previous
Ubuntu versions) the manager looses memory of what connection to select.
That is, when I move my laptop from work to home often NM does not
understand that it should connect to my home wireless instead of my
office Ethernet. Also the opposite is true. Also for wireless networks
that I use seldom (e.g. at my brothers place) the WEP key is lost
between sessions, so I have to re-enter it.

Are these issues that are being worked on or is it new things in
connection to NM?

Regards,
Robert Rehammar

-- 
Robert Rehammar
rehammar.se/robert
0738-32 88 34

___
NetworkManager-list mailing list
NetworkManager-list@gnome.org
http://mail.gnome.org/mailman/listinfo/networkmanager-list


Mobile Broadband -> Disconnect option broken?

2009-05-04 Thread Raul Gutierrez Segales
Hi,

I am running Network Manager version 0.7.1~rc4.1.cf199a964-0ubuntu2 on
Ubuntu 9.04.

For some reason that I haven't been able to debug yet, the
network-manager-applet completely ignores the disconnect command for 3G
GSM connection. 

My 3G modem is a (output from lsusb) :

Bus 005 Device 002: ID 12d1:1003 Huawei Technologies Co., Ltd. E220
HSDPA Modem / E270 HSDPA/HSUPA Modem

Is this known to be broken? Seems like a matter of capturing the event
and killing pppd (I have to do it by hand now..). 



___
NetworkManager-list mailing list
NetworkManager-list@gnome.org
http://mail.gnome.org/mailman/listinfo/networkmanager-list


[PATCH] tun-mtu and fragment support for openvpn

2009-05-04 Thread James R. Leu
Hello all,

Here is my attempt at adding support for tun-mtu and fragment to
NetworkManager-openvpn.  "it works for me"

The diff is against SVN HOL this afternoon.  I'm not subscribed
to the list, so if there are any questions please CC me.

-- 
James R. Leu
j...@mindspring.com
diff -uNr --exclude=.svn --exclude=po 
network-manager-openvpn/properties/auth-helpers.c 
NetworkManager-openvpn-0.7.0.99/properties/auth-helpers.c
--- network-manager-openvpn/properties/auth-helpers.c   2009-05-01 
14:19:21.0 -0500
+++ NetworkManager-openvpn-0.7.0.99/properties/auth-helpers.c   2009-05-01 
13:53:47.0 -0500
@@ -802,6 +765,26 @@
gtk_widget_set_sensitive (widget, gtk_toggle_button_get_active 
(GTK_TOGGLE_BUTTON (check)));
 }
 
+static void
+mtu_toggled_cb (GtkWidget *check, gpointer user_data)
+{
+   GladeXML *xml = (GladeXML *) user_data;
+   GtkWidget *widget;
+
+   widget = glade_xml_get_widget (xml, "mtu_spinbutton");
+   gtk_widget_set_sensitive (widget, gtk_toggle_button_get_active 
(GTK_TOGGLE_BUTTON (check)));
+}
+
+static void
+frag_toggled_cb (GtkWidget *check, gpointer user_data)
+{
+   GladeXML *xml = (GladeXML *) user_data;
+   GtkWidget *widget;
+
+   widget = glade_xml_get_widget (xml, "frag_spinbutton");
+   gtk_widget_set_sensitive (widget, gtk_toggle_button_get_active 
(GTK_TOGGLE_BUTTON (check)));
+}
+
 static const char *
 nm_find_openvpn (void)
 {
@@ -1036,6 +1019,56 @@
gtk_widget_set_sensitive (widget, FALSE);
}
 
+   widget = glade_xml_get_widget (xml, "mtu_checkbutton");
+   g_signal_connect (G_OBJECT (widget), "toggled", G_CALLBACK 
(mtu_toggled_cb), xml);
+
+   value = g_hash_table_lookup (hash, NM_OPENVPN_KEY_MTU);
+   if (value && strlen (value)) {
+   long int tmp;
+
+   errno = 0;
+   tmp = strtol (value, NULL, 10);
+   if (errno == 0 && tmp > 0 && tmp < 65536 && tmp != 1500) {
+   gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON 
(widget), TRUE);
+
+   widget = glade_xml_get_widget (xml, "mtu_spinbutton");
+   gtk_spin_button_set_value (GTK_SPIN_BUTTON (widget),
+  (gdouble) tmp);
+   }
+   gtk_widget_set_sensitive (widget, TRUE);
+   } else {
+   gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (widget), 
FALSE);
+
+   widget = glade_xml_get_widget (xml, "mtu_spinbutton");
+   gtk_spin_button_set_value (GTK_SPIN_BUTTON (widget), 1500.0);
+   gtk_widget_set_sensitive (widget, FALSE);
+   }
+
+   widget = glade_xml_get_widget (xml, "frag_checkbutton");
+   g_signal_connect (G_OBJECT (widget), "toggled", G_CALLBACK 
(frag_toggled_cb), xml);
+
+   value = g_hash_table_lookup (hash, NM_OPENVPN_KEY_FRAG);
+   if (value && strlen (value)) {
+   long int tmp;
+
+   errno = 0;
+   tmp = strtol (value, NULL, 10);
+   if (errno == 0 && tmp > 0 && tmp < 65536 && tmp != 1430) {
+   gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON 
(widget), TRUE);
+
+   widget = glade_xml_get_widget (xml, "frag_spinbutton");
+   gtk_spin_button_set_value (GTK_SPIN_BUTTON (widget),
+  (gdouble) tmp);
+   }
+   gtk_widget_set_sensitive (widget, TRUE);
+   } else {
+   gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (widget), 
FALSE);
+
+   widget = glade_xml_get_widget (xml, "frag_spinbutton");
+   gtk_spin_button_set_value (GTK_SPIN_BUTTON (widget), 1430.0);
+   gtk_widget_set_sensitive (widget, FALSE);
+   }
+
value = g_hash_table_lookup (hash, NM_OPENVPN_KEY_COMP_LZO);
if (value && !strcmp (value, "yes")) {
widget = glade_xml_get_widget (xml, "lzo_checkbutton");
@@ -1145,6 +1178,24 @@
g_hash_table_insert (hash, g_strdup (NM_OPENVPN_KEY_PORT), 
g_strdup_printf ("%d", port));
}
 
+   widget = glade_xml_get_widget (xml, "mtu_checkbutton");
+   if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (widget))) {
+   int mtu;
+
+   widget = glade_xml_get_widget (xml, "mtu_spinbutton");
+   mtu = gtk_spin_button_get_value_as_int (GTK_SPIN_BUTTON 
(widget));
+   g_hash_table_insert (hash, g_strdup (NM_OPENVPN_KEY_MTU), 
g_strdup_printf ("%d", mtu));
+   }
+
+   widget = glade_xml_get_widget (xml, "frag_checkbutton");
+   if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (widget))) {
+   int frag;
+
+   widget = glade_xml_get_widget (xml, "frag_spinbutton");
+   frag = gtk_spin_button_get_value_as_int (GTK_SPIN_BUTTON 
(widget));
+   g_hash_table_insert (hash, g_strdup (NM_OPENVPN_KEY_