Commit 8089b484 authored by Dan Williams's avatar Dan Williams
Browse files

2004-11-05 Dan Williams <dcbw@redhat.com>

	* info-daemon/NetworkManagerInfoDbus.c
	  src/NetworkManagerDbus.[ch]
	  src/NetworkManagerDevice.c
		- Keep track of the # of attempts to get the WEP key
			from the user and pass that along to the info daemon


git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@297 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
parent ae64d4de
2004-11-05 Dan Williams <dcbw@redhat.com>
* info-daemon/NetworkManagerInfoDbus.c
src/NetworkManagerDbus.[ch]
src/NetworkManagerDevice.c
- Keep track of the # of attempts to get the WEP key
from the user and pass that along to the info daemon
2004-11-05 Dan Williams <dcbw@redhat.com>
* src/NetworkManagerUtils.c
......
......@@ -103,11 +103,13 @@ static void nmi_dbus_get_key_for_network (NMIAppInfo *info, DBusMessage *message
DBusError error;
char *device = NULL;
char *network = NULL;
int attempt = 0;
dbus_error_init (&error);
if (dbus_message_get_args (message, &error,
DBUS_TYPE_STRING, &device,
DBUS_TYPE_STRING, &network,
DBUS_TYPE_INT32, &attempt,
DBUS_TYPE_INVALID))
{
nmi_passphrase_dialog_show (device, network, info);
......
......@@ -617,7 +617,7 @@ void nm_dbus_signal_wireless_network_change (DBusConnection *connection, NMDevic
* Asks NetworkManagerInfo for a user-entered WEP key.
*
*/
void nm_dbus_get_user_key_for_network (DBusConnection *connection, NMDevice *dev, NMAccessPoint *ap)
void nm_dbus_get_user_key_for_network (DBusConnection *connection, NMDevice *dev, NMAccessPoint *ap, int attempt)
{
DBusMessage *message;
......@@ -625,6 +625,7 @@ void nm_dbus_get_user_key_for_network (DBusConnection *connection, NMDevice *dev
g_return_if_fail (dev != NULL);
g_return_if_fail (ap != NULL);
g_return_if_fail (nm_ap_get_essid (ap) != NULL);
g_return_if_fail (attempt > 0);
message = dbus_message_new_method_call (NMI_DBUS_SERVICE, NMI_DBUS_PATH,
NMI_DBUS_INTERFACE, "getKeyForNetwork");
......@@ -636,6 +637,7 @@ void nm_dbus_get_user_key_for_network (DBusConnection *connection, NMDevice *dev
dbus_message_append_args (message, DBUS_TYPE_STRING, nm_device_get_iface (dev),
DBUS_TYPE_STRING, nm_ap_get_essid (ap),
DBUS_TYPE_INT32, attempt,
DBUS_TYPE_INVALID);
if (!dbus_connection_send (connection, message, NULL))
......
......@@ -53,7 +53,7 @@ void nm_dbus_signal_device_ip4_address_change(DBusConnection *connection, NMDe
void nm_dbus_signal_wireless_network_change (DBusConnection *connection, NMDevice *dev, NMAccessPoint *ap, gboolean gone);
void nm_dbus_get_user_key_for_network (DBusConnection *connection, NMDevice *dev, NMAccessPoint *ap);
void nm_dbus_get_user_key_for_network (DBusConnection *connection, NMDevice *dev, NMAccessPoint *ap, int attempt);
void nm_dbus_cancel_get_user_key_for_network (DBusConnection *connection);
......
......@@ -1392,6 +1392,7 @@ void nm_device_activate_wireless_wait_for_link (NMDevice *dev)
{
NMAccessPoint *best_ap;
guint32 bad_crypt_packets = 0;
int attempt = 1;
g_return_if_fail (dev != NULL);
......@@ -1459,7 +1460,8 @@ void nm_device_activate_wireless_wait_for_link (NMDevice *dev)
if (nm_ap_get_encrypted (best_ap))
{
dev->options.wireless.user_key_received = FALSE;
nm_dbus_get_user_key_for_network (dev->app_data->dbus_connection, dev, best_ap);
nm_dbus_get_user_key_for_network (dev->app_data->dbus_connection, dev, best_ap, attempt);
attempt++;
/* Wait for the key to come back */
syslog (LOG_DEBUG, "nm_device_activation_worker(%s): asking for user key.", nm_device_get_iface (dev));
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment