2005-05-03 Dan Williams <dcbw@redhat.com>
* Kill dhcpcd. We now use "dhcdbd", a dbus daemon that controls dhclient.
This means that NetworkManager shouldn't have DHCP issues anymore. It also
means you need dhcdbd, which you can get here (get the latest one):
http://people.redhat.com/jvdias/dhcdbd/
Technically NetworkManager can use any DHCP daemon that uses the same DBUS
interface as dhcdbd.
* Rewrite device activation to facilitate the new DHCP infrastructure and
future improvements. Its now "activation request" based, ie there is a single
activation request composed of the device, access point, and other info which
follows the entire activation process. There are 5 stages of the activation
process which correspond to:
1) Device preparation
2) Device configuration (bring it up, set ESSID/Key/etc)
3) IP Config Start (fire off DHCP if we're using it)
4) IP Config Get (grab config from DHCP or static config files)
5) IP Config Commit (set device's IP address, DNS, etc)
Note that there is no longer a "scanning" step, since the access point must
be known _before_ activation starts. If the access point drops out or does
not exist for some reason, the entire activation process fails and must be
restarted for a different access point or device.
Patch from Bill Moss:
* gnome/applet/applet.c
- Fix type of vpn_failure dialog -> vpn_banner dialog
git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@597 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2005-05-03 20:41:36 +00:00
|
|
|
/* NetworkManager -- Network link manager
|
|
|
|
|
*
|
|
|
|
|
* Dan Williams <dcbw@redhat.com>
|
|
|
|
|
*
|
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
|
|
|
* (at your option) any later version.
|
|
|
|
|
*
|
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
|
*
|
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
|
* along with this program; if not, write to the Free Software
|
|
|
|
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
|
|
|
*
|
|
|
|
|
* (C) Copyright 2005 Red Hat, Inc.
|
|
|
|
|
*/
|
|
|
|
|
|
2007-09-20 12:03:30 +00:00
|
|
|
#include <string.h>
|
2007-10-01 15:38:39 +00:00
|
|
|
#include <dbus/dbus-glib.h>
|
2008-03-17 19:37:23 +00:00
|
|
|
|
2005-05-03 Dan Williams <dcbw@redhat.com>
* Kill dhcpcd. We now use "dhcdbd", a dbus daemon that controls dhclient.
This means that NetworkManager shouldn't have DHCP issues anymore. It also
means you need dhcdbd, which you can get here (get the latest one):
http://people.redhat.com/jvdias/dhcdbd/
Technically NetworkManager can use any DHCP daemon that uses the same DBUS
interface as dhcdbd.
* Rewrite device activation to facilitate the new DHCP infrastructure and
future improvements. Its now "activation request" based, ie there is a single
activation request composed of the device, access point, and other info which
follows the entire activation process. There are 5 stages of the activation
process which correspond to:
1) Device preparation
2) Device configuration (bring it up, set ESSID/Key/etc)
3) IP Config Start (fire off DHCP if we're using it)
4) IP Config Get (grab config from DHCP or static config files)
5) IP Config Commit (set device's IP address, DNS, etc)
Note that there is no longer a "scanning" step, since the access point must
be known _before_ activation starts. If the access point drops out or does
not exist for some reason, the entire activation process fails and must be
restarted for a different access point or device.
Patch from Bill Moss:
* gnome/applet/applet.c
- Fix type of vpn_failure dialog -> vpn_banner dialog
git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@597 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2005-05-03 20:41:36 +00:00
|
|
|
#include "nm-activation-request.h"
|
2007-09-11 18:02:27 +00:00
|
|
|
#include "nm-marshal.h"
|
2007-09-14 19:43:28 +00:00
|
|
|
#include "nm-utils.h"
|
2008-03-17 19:37:23 +00:00
|
|
|
#include "nm-setting-wireless-security.h"
|
|
|
|
|
#include "nm-setting-8021x.h"
|
2008-03-20 19:56:12 +00:00
|
|
|
#include "nm-dbus-manager.h"
|
|
|
|
|
#include "nm-device.h"
|
|
|
|
|
#include "nm-properties-changed-signal.h"
|
2008-03-26 13:43:01 +00:00
|
|
|
#include "nm-active-connection.h"
|
2008-03-29 21:35:41 +00:00
|
|
|
#include "nm-dbus-glib-types.h"
|
2005-05-03 Dan Williams <dcbw@redhat.com>
* Kill dhcpcd. We now use "dhcdbd", a dbus daemon that controls dhclient.
This means that NetworkManager shouldn't have DHCP issues anymore. It also
means you need dhcdbd, which you can get here (get the latest one):
http://people.redhat.com/jvdias/dhcdbd/
Technically NetworkManager can use any DHCP daemon that uses the same DBUS
interface as dhcdbd.
* Rewrite device activation to facilitate the new DHCP infrastructure and
future improvements. Its now "activation request" based, ie there is a single
activation request composed of the device, access point, and other info which
follows the entire activation process. There are 5 stages of the activation
process which correspond to:
1) Device preparation
2) Device configuration (bring it up, set ESSID/Key/etc)
3) IP Config Start (fire off DHCP if we're using it)
4) IP Config Get (grab config from DHCP or static config files)
5) IP Config Commit (set device's IP address, DNS, etc)
Note that there is no longer a "scanning" step, since the access point must
be known _before_ activation starts. If the access point drops out or does
not exist for some reason, the entire activation process fails and must be
restarted for a different access point or device.
Patch from Bill Moss:
* gnome/applet/applet.c
- Fix type of vpn_failure dialog -> vpn_banner dialog
git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@597 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2005-05-03 20:41:36 +00:00
|
|
|
|
2007-10-01 15:38:39 +00:00
|
|
|
#include "nm-manager.h" /* FIXME! */
|
|
|
|
|
|
2007-09-27 04:52:03 +00:00
|
|
|
#define CONNECTION_GET_SECRETS_CALL_TAG "get-secrets-call"
|
|
|
|
|
|
2007-06-11 13:36:34 +00:00
|
|
|
G_DEFINE_TYPE (NMActRequest, nm_act_request, G_TYPE_OBJECT)
|
2005-05-03 Dan Williams <dcbw@redhat.com>
* Kill dhcpcd. We now use "dhcdbd", a dbus daemon that controls dhclient.
This means that NetworkManager shouldn't have DHCP issues anymore. It also
means you need dhcdbd, which you can get here (get the latest one):
http://people.redhat.com/jvdias/dhcdbd/
Technically NetworkManager can use any DHCP daemon that uses the same DBUS
interface as dhcdbd.
* Rewrite device activation to facilitate the new DHCP infrastructure and
future improvements. Its now "activation request" based, ie there is a single
activation request composed of the device, access point, and other info which
follows the entire activation process. There are 5 stages of the activation
process which correspond to:
1) Device preparation
2) Device configuration (bring it up, set ESSID/Key/etc)
3) IP Config Start (fire off DHCP if we're using it)
4) IP Config Get (grab config from DHCP or static config files)
5) IP Config Commit (set device's IP address, DNS, etc)
Note that there is no longer a "scanning" step, since the access point must
be known _before_ activation starts. If the access point drops out or does
not exist for some reason, the entire activation process fails and must be
restarted for a different access point or device.
Patch from Bill Moss:
* gnome/applet/applet.c
- Fix type of vpn_failure dialog -> vpn_banner dialog
git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@597 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2005-05-03 20:41:36 +00:00
|
|
|
|
2007-06-11 13:36:34 +00:00
|
|
|
#define NM_ACT_REQUEST_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_ACT_REQUEST, NMActRequestPrivate))
|
2005-05-03 Dan Williams <dcbw@redhat.com>
* Kill dhcpcd. We now use "dhcdbd", a dbus daemon that controls dhclient.
This means that NetworkManager shouldn't have DHCP issues anymore. It also
means you need dhcdbd, which you can get here (get the latest one):
http://people.redhat.com/jvdias/dhcdbd/
Technically NetworkManager can use any DHCP daemon that uses the same DBUS
interface as dhcdbd.
* Rewrite device activation to facilitate the new DHCP infrastructure and
future improvements. Its now "activation request" based, ie there is a single
activation request composed of the device, access point, and other info which
follows the entire activation process. There are 5 stages of the activation
process which correspond to:
1) Device preparation
2) Device configuration (bring it up, set ESSID/Key/etc)
3) IP Config Start (fire off DHCP if we're using it)
4) IP Config Get (grab config from DHCP or static config files)
5) IP Config Commit (set device's IP address, DNS, etc)
Note that there is no longer a "scanning" step, since the access point must
be known _before_ activation starts. If the access point drops out or does
not exist for some reason, the entire activation process fails and must be
restarted for a different access point or device.
Patch from Bill Moss:
* gnome/applet/applet.c
- Fix type of vpn_failure dialog -> vpn_banner dialog
git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@597 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2005-05-03 20:41:36 +00:00
|
|
|
|
2007-09-11 18:02:27 +00:00
|
|
|
enum {
|
|
|
|
|
CONNECTION_SECRETS_UPDATED,
|
2007-09-27 04:52:03 +00:00
|
|
|
CONNECTION_SECRETS_FAILED,
|
2008-03-20 19:56:12 +00:00
|
|
|
PROPERTIES_CHANGED,
|
2007-09-11 18:02:27 +00:00
|
|
|
|
|
|
|
|
LAST_SIGNAL
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
static guint signals[LAST_SIGNAL] = { 0 };
|
|
|
|
|
|
|
|
|
|
|
2007-06-11 13:36:34 +00:00
|
|
|
typedef struct {
|
|
|
|
|
NMConnection *connection;
|
2007-08-28 14:47:31 +00:00
|
|
|
char *specific_object;
|
2008-03-20 19:56:12 +00:00
|
|
|
NMConnection *shared;
|
|
|
|
|
NMDevice *device;
|
2007-06-11 13:36:34 +00:00
|
|
|
gboolean user_requested;
|
2008-03-20 19:56:12 +00:00
|
|
|
|
|
|
|
|
char *ac_path;
|
2007-06-11 13:36:34 +00:00
|
|
|
} NMActRequestPrivate;
|
2005-05-03 Dan Williams <dcbw@redhat.com>
* Kill dhcpcd. We now use "dhcdbd", a dbus daemon that controls dhclient.
This means that NetworkManager shouldn't have DHCP issues anymore. It also
means you need dhcdbd, which you can get here (get the latest one):
http://people.redhat.com/jvdias/dhcdbd/
Technically NetworkManager can use any DHCP daemon that uses the same DBUS
interface as dhcdbd.
* Rewrite device activation to facilitate the new DHCP infrastructure and
future improvements. Its now "activation request" based, ie there is a single
activation request composed of the device, access point, and other info which
follows the entire activation process. There are 5 stages of the activation
process which correspond to:
1) Device preparation
2) Device configuration (bring it up, set ESSID/Key/etc)
3) IP Config Start (fire off DHCP if we're using it)
4) IP Config Get (grab config from DHCP or static config files)
5) IP Config Commit (set device's IP address, DNS, etc)
Note that there is no longer a "scanning" step, since the access point must
be known _before_ activation starts. If the access point drops out or does
not exist for some reason, the entire activation process fails and must be
restarted for a different access point or device.
Patch from Bill Moss:
* gnome/applet/applet.c
- Fix type of vpn_failure dialog -> vpn_banner dialog
git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@597 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2005-05-03 20:41:36 +00:00
|
|
|
|
2008-03-20 19:56:12 +00:00
|
|
|
enum {
|
|
|
|
|
PROP_0,
|
|
|
|
|
PROP_SERVICE_NAME,
|
|
|
|
|
PROP_CONNECTION,
|
|
|
|
|
PROP_SPECIFIC_OBJECT,
|
|
|
|
|
PROP_SHARED_SERVICE_NAME,
|
|
|
|
|
PROP_SHARED_CONNECTION,
|
|
|
|
|
PROP_DEVICES,
|
2008-03-26 13:43:01 +00:00
|
|
|
PROP_VPN,
|
2008-03-20 19:56:12 +00:00
|
|
|
|
|
|
|
|
LAST_PROP
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
NMActRequest *
|
|
|
|
|
nm_act_request_new (NMConnection *connection,
|
|
|
|
|
const char *specific_object,
|
|
|
|
|
gboolean user_requested,
|
|
|
|
|
gpointer *device)
|
|
|
|
|
{
|
|
|
|
|
GObject *object;
|
|
|
|
|
NMActRequestPrivate *priv;
|
|
|
|
|
|
|
|
|
|
g_return_val_if_fail (NM_IS_CONNECTION (connection), NULL);
|
|
|
|
|
g_return_val_if_fail (NM_DEVICE (device), NULL);
|
|
|
|
|
|
|
|
|
|
object = g_object_new (NM_TYPE_ACT_REQUEST, NULL);
|
|
|
|
|
if (!object)
|
|
|
|
|
return NULL;
|
|
|
|
|
|
|
|
|
|
priv = NM_ACT_REQUEST_GET_PRIVATE (object);
|
|
|
|
|
|
|
|
|
|
priv->connection = g_object_ref (connection);
|
|
|
|
|
if (specific_object)
|
|
|
|
|
priv->specific_object = g_strdup (specific_object);
|
|
|
|
|
priv->device = NM_DEVICE (device);
|
|
|
|
|
priv->user_requested = user_requested;
|
|
|
|
|
|
|
|
|
|
return NM_ACT_REQUEST (object);
|
|
|
|
|
}
|
|
|
|
|
|
2007-06-11 13:36:34 +00:00
|
|
|
static void
|
|
|
|
|
nm_act_request_init (NMActRequest *req)
|
2005-05-03 Dan Williams <dcbw@redhat.com>
* Kill dhcpcd. We now use "dhcdbd", a dbus daemon that controls dhclient.
This means that NetworkManager shouldn't have DHCP issues anymore. It also
means you need dhcdbd, which you can get here (get the latest one):
http://people.redhat.com/jvdias/dhcdbd/
Technically NetworkManager can use any DHCP daemon that uses the same DBUS
interface as dhcdbd.
* Rewrite device activation to facilitate the new DHCP infrastructure and
future improvements. Its now "activation request" based, ie there is a single
activation request composed of the device, access point, and other info which
follows the entire activation process. There are 5 stages of the activation
process which correspond to:
1) Device preparation
2) Device configuration (bring it up, set ESSID/Key/etc)
3) IP Config Start (fire off DHCP if we're using it)
4) IP Config Get (grab config from DHCP or static config files)
5) IP Config Commit (set device's IP address, DNS, etc)
Note that there is no longer a "scanning" step, since the access point must
be known _before_ activation starts. If the access point drops out or does
not exist for some reason, the entire activation process fails and must be
restarted for a different access point or device.
Patch from Bill Moss:
* gnome/applet/applet.c
- Fix type of vpn_failure dialog -> vpn_banner dialog
git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@597 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2005-05-03 20:41:36 +00:00
|
|
|
{
|
2008-03-26 13:43:01 +00:00
|
|
|
NMActRequestPrivate *priv = NM_ACT_REQUEST_GET_PRIVATE (req);
|
|
|
|
|
NMDBusManager *dbus_mgr;
|
|
|
|
|
|
|
|
|
|
priv->ac_path = nm_active_connection_get_next_object_path ();
|
|
|
|
|
|
|
|
|
|
dbus_mgr = nm_dbus_manager_get ();
|
|
|
|
|
dbus_g_connection_register_g_object (nm_dbus_manager_get_connection (dbus_mgr),
|
|
|
|
|
priv->ac_path,
|
|
|
|
|
G_OBJECT (req));
|
|
|
|
|
g_object_unref (dbus_mgr);
|
2005-05-03 Dan Williams <dcbw@redhat.com>
* Kill dhcpcd. We now use "dhcdbd", a dbus daemon that controls dhclient.
This means that NetworkManager shouldn't have DHCP issues anymore. It also
means you need dhcdbd, which you can get here (get the latest one):
http://people.redhat.com/jvdias/dhcdbd/
Technically NetworkManager can use any DHCP daemon that uses the same DBUS
interface as dhcdbd.
* Rewrite device activation to facilitate the new DHCP infrastructure and
future improvements. Its now "activation request" based, ie there is a single
activation request composed of the device, access point, and other info which
follows the entire activation process. There are 5 stages of the activation
process which correspond to:
1) Device preparation
2) Device configuration (bring it up, set ESSID/Key/etc)
3) IP Config Start (fire off DHCP if we're using it)
4) IP Config Get (grab config from DHCP or static config files)
5) IP Config Commit (set device's IP address, DNS, etc)
Note that there is no longer a "scanning" step, since the access point must
be known _before_ activation starts. If the access point drops out or does
not exist for some reason, the entire activation process fails and must be
restarted for a different access point or device.
Patch from Bill Moss:
* gnome/applet/applet.c
- Fix type of vpn_failure dialog -> vpn_banner dialog
git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@597 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2005-05-03 20:41:36 +00:00
|
|
|
}
|
|
|
|
|
|
2007-09-14 19:43:28 +00:00
|
|
|
static void
|
|
|
|
|
dispose (GObject *object)
|
2005-05-03 Dan Williams <dcbw@redhat.com>
* Kill dhcpcd. We now use "dhcdbd", a dbus daemon that controls dhclient.
This means that NetworkManager shouldn't have DHCP issues anymore. It also
means you need dhcdbd, which you can get here (get the latest one):
http://people.redhat.com/jvdias/dhcdbd/
Technically NetworkManager can use any DHCP daemon that uses the same DBUS
interface as dhcdbd.
* Rewrite device activation to facilitate the new DHCP infrastructure and
future improvements. Its now "activation request" based, ie there is a single
activation request composed of the device, access point, and other info which
follows the entire activation process. There are 5 stages of the activation
process which correspond to:
1) Device preparation
2) Device configuration (bring it up, set ESSID/Key/etc)
3) IP Config Start (fire off DHCP if we're using it)
4) IP Config Get (grab config from DHCP or static config files)
5) IP Config Commit (set device's IP address, DNS, etc)
Note that there is no longer a "scanning" step, since the access point must
be known _before_ activation starts. If the access point drops out or does
not exist for some reason, the entire activation process fails and must be
restarted for a different access point or device.
Patch from Bill Moss:
* gnome/applet/applet.c
- Fix type of vpn_failure dialog -> vpn_banner dialog
git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@597 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2005-05-03 20:41:36 +00:00
|
|
|
{
|
2007-06-11 13:36:34 +00:00
|
|
|
NMActRequestPrivate *priv = NM_ACT_REQUEST_GET_PRIVATE (object);
|
2007-10-27 02:09:27 +00:00
|
|
|
DBusGProxy *proxy;
|
|
|
|
|
DBusGProxyCall *call;
|
2005-05-03 Dan Williams <dcbw@redhat.com>
* Kill dhcpcd. We now use "dhcdbd", a dbus daemon that controls dhclient.
This means that NetworkManager shouldn't have DHCP issues anymore. It also
means you need dhcdbd, which you can get here (get the latest one):
http://people.redhat.com/jvdias/dhcdbd/
Technically NetworkManager can use any DHCP daemon that uses the same DBUS
interface as dhcdbd.
* Rewrite device activation to facilitate the new DHCP infrastructure and
future improvements. Its now "activation request" based, ie there is a single
activation request composed of the device, access point, and other info which
follows the entire activation process. There are 5 stages of the activation
process which correspond to:
1) Device preparation
2) Device configuration (bring it up, set ESSID/Key/etc)
3) IP Config Start (fire off DHCP if we're using it)
4) IP Config Get (grab config from DHCP or static config files)
5) IP Config Commit (set device's IP address, DNS, etc)
Note that there is no longer a "scanning" step, since the access point must
be known _before_ activation starts. If the access point drops out or does
not exist for some reason, the entire activation process fails and must be
restarted for a different access point or device.
Patch from Bill Moss:
* gnome/applet/applet.c
- Fix type of vpn_failure dialog -> vpn_banner dialog
git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@597 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2005-05-03 20:41:36 +00:00
|
|
|
|
2007-10-27 02:09:27 +00:00
|
|
|
if (!priv->connection)
|
|
|
|
|
goto out;
|
2007-09-14 19:43:28 +00:00
|
|
|
|
2007-10-27 02:09:27 +00:00
|
|
|
proxy = g_object_get_data (G_OBJECT (priv->connection),
|
|
|
|
|
NM_MANAGER_CONNECTION_SECRETS_PROXY_TAG);
|
|
|
|
|
call = g_object_get_data (G_OBJECT (priv->connection),
|
|
|
|
|
CONNECTION_GET_SECRETS_CALL_TAG);
|
2007-09-25 07:06:28 +00:00
|
|
|
|
2007-10-27 02:09:27 +00:00
|
|
|
if (proxy && call)
|
|
|
|
|
dbus_g_proxy_cancel_call (proxy, call);
|
2007-09-27 04:52:03 +00:00
|
|
|
|
2007-10-27 02:09:27 +00:00
|
|
|
g_object_set_data (G_OBJECT (priv->connection),
|
|
|
|
|
CONNECTION_GET_SECRETS_CALL_TAG, NULL);
|
|
|
|
|
g_object_unref (priv->connection);
|
2007-09-25 07:06:28 +00:00
|
|
|
|
2008-03-20 19:56:12 +00:00
|
|
|
if (priv->shared)
|
|
|
|
|
g_object_unref (priv->shared);
|
|
|
|
|
|
2007-10-27 02:09:27 +00:00
|
|
|
out:
|
|
|
|
|
G_OBJECT_CLASS (nm_act_request_parent_class)->dispose (object);
|
2007-09-14 19:43:28 +00:00
|
|
|
}
|
2005-05-03 Dan Williams <dcbw@redhat.com>
* Kill dhcpcd. We now use "dhcdbd", a dbus daemon that controls dhclient.
This means that NetworkManager shouldn't have DHCP issues anymore. It also
means you need dhcdbd, which you can get here (get the latest one):
http://people.redhat.com/jvdias/dhcdbd/
Technically NetworkManager can use any DHCP daemon that uses the same DBUS
interface as dhcdbd.
* Rewrite device activation to facilitate the new DHCP infrastructure and
future improvements. Its now "activation request" based, ie there is a single
activation request composed of the device, access point, and other info which
follows the entire activation process. There are 5 stages of the activation
process which correspond to:
1) Device preparation
2) Device configuration (bring it up, set ESSID/Key/etc)
3) IP Config Start (fire off DHCP if we're using it)
4) IP Config Get (grab config from DHCP or static config files)
5) IP Config Commit (set device's IP address, DNS, etc)
Note that there is no longer a "scanning" step, since the access point must
be known _before_ activation starts. If the access point drops out or does
not exist for some reason, the entire activation process fails and must be
restarted for a different access point or device.
Patch from Bill Moss:
* gnome/applet/applet.c
- Fix type of vpn_failure dialog -> vpn_banner dialog
git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@597 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2005-05-03 20:41:36 +00:00
|
|
|
|
2007-09-14 19:43:28 +00:00
|
|
|
static void
|
|
|
|
|
finalize (GObject *object)
|
|
|
|
|
{
|
|
|
|
|
NMActRequestPrivate *priv = NM_ACT_REQUEST_GET_PRIVATE (object);
|
|
|
|
|
|
2007-08-28 14:47:31 +00:00
|
|
|
g_free (priv->specific_object);
|
2008-03-20 19:56:12 +00:00
|
|
|
g_free (priv->ac_path);
|
2007-08-28 14:47:31 +00:00
|
|
|
|
2007-06-11 13:36:34 +00:00
|
|
|
G_OBJECT_CLASS (nm_act_request_parent_class)->finalize (object);
|
2005-05-03 Dan Williams <dcbw@redhat.com>
* Kill dhcpcd. We now use "dhcdbd", a dbus daemon that controls dhclient.
This means that NetworkManager shouldn't have DHCP issues anymore. It also
means you need dhcdbd, which you can get here (get the latest one):
http://people.redhat.com/jvdias/dhcdbd/
Technically NetworkManager can use any DHCP daemon that uses the same DBUS
interface as dhcdbd.
* Rewrite device activation to facilitate the new DHCP infrastructure and
future improvements. Its now "activation request" based, ie there is a single
activation request composed of the device, access point, and other info which
follows the entire activation process. There are 5 stages of the activation
process which correspond to:
1) Device preparation
2) Device configuration (bring it up, set ESSID/Key/etc)
3) IP Config Start (fire off DHCP if we're using it)
4) IP Config Get (grab config from DHCP or static config files)
5) IP Config Commit (set device's IP address, DNS, etc)
Note that there is no longer a "scanning" step, since the access point must
be known _before_ activation starts. If the access point drops out or does
not exist for some reason, the entire activation process fails and must be
restarted for a different access point or device.
Patch from Bill Moss:
* gnome/applet/applet.c
- Fix type of vpn_failure dialog -> vpn_banner dialog
git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@597 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2005-05-03 20:41:36 +00:00
|
|
|
}
|
|
|
|
|
|
2008-03-20 19:56:12 +00:00
|
|
|
static void
|
|
|
|
|
get_property (GObject *object, guint prop_id,
|
|
|
|
|
GValue *value, GParamSpec *pspec)
|
|
|
|
|
{
|
|
|
|
|
NMActRequestPrivate *priv = NM_ACT_REQUEST_GET_PRIVATE (object);
|
|
|
|
|
GPtrArray *devices;
|
|
|
|
|
|
|
|
|
|
switch (prop_id) {
|
|
|
|
|
case PROP_SERVICE_NAME:
|
2008-03-26 13:43:01 +00:00
|
|
|
nm_active_connection_scope_to_value (priv->connection, value);
|
2008-03-20 19:56:12 +00:00
|
|
|
break;
|
|
|
|
|
case PROP_CONNECTION:
|
|
|
|
|
g_value_set_boxed (value, nm_connection_get_path (priv->connection));
|
|
|
|
|
break;
|
|
|
|
|
case PROP_SPECIFIC_OBJECT:
|
|
|
|
|
if (priv->specific_object)
|
|
|
|
|
g_value_set_boxed (value, priv->specific_object);
|
|
|
|
|
else
|
|
|
|
|
g_value_set_boxed (value, "/");
|
|
|
|
|
break;
|
|
|
|
|
case PROP_SHARED_SERVICE_NAME:
|
2008-03-26 13:43:01 +00:00
|
|
|
nm_active_connection_scope_to_value (priv->shared, value);
|
2008-03-20 19:56:12 +00:00
|
|
|
break;
|
|
|
|
|
case PROP_SHARED_CONNECTION:
|
|
|
|
|
if (!priv->shared) {
|
|
|
|
|
g_value_set_boxed (value, "/");
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
g_value_set_boxed (value, nm_connection_get_path (priv->shared));
|
|
|
|
|
break;
|
|
|
|
|
case PROP_DEVICES:
|
|
|
|
|
devices = g_ptr_array_sized_new (1);
|
|
|
|
|
g_ptr_array_add (devices, g_strdup (nm_device_get_udi (priv->device)));
|
|
|
|
|
g_value_take_boxed (value, devices);
|
|
|
|
|
break;
|
2008-03-26 13:43:01 +00:00
|
|
|
case PROP_VPN:
|
|
|
|
|
g_value_set_boolean (value, FALSE);
|
|
|
|
|
break;
|
2008-03-20 19:56:12 +00:00
|
|
|
default:
|
|
|
|
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2007-06-11 13:36:34 +00:00
|
|
|
static void
|
|
|
|
|
nm_act_request_class_init (NMActRequestClass *req_class)
|
2005-05-03 Dan Williams <dcbw@redhat.com>
* Kill dhcpcd. We now use "dhcdbd", a dbus daemon that controls dhclient.
This means that NetworkManager shouldn't have DHCP issues anymore. It also
means you need dhcdbd, which you can get here (get the latest one):
http://people.redhat.com/jvdias/dhcdbd/
Technically NetworkManager can use any DHCP daemon that uses the same DBUS
interface as dhcdbd.
* Rewrite device activation to facilitate the new DHCP infrastructure and
future improvements. Its now "activation request" based, ie there is a single
activation request composed of the device, access point, and other info which
follows the entire activation process. There are 5 stages of the activation
process which correspond to:
1) Device preparation
2) Device configuration (bring it up, set ESSID/Key/etc)
3) IP Config Start (fire off DHCP if we're using it)
4) IP Config Get (grab config from DHCP or static config files)
5) IP Config Commit (set device's IP address, DNS, etc)
Note that there is no longer a "scanning" step, since the access point must
be known _before_ activation starts. If the access point drops out or does
not exist for some reason, the entire activation process fails and must be
restarted for a different access point or device.
Patch from Bill Moss:
* gnome/applet/applet.c
- Fix type of vpn_failure dialog -> vpn_banner dialog
git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@597 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2005-05-03 20:41:36 +00:00
|
|
|
{
|
2007-06-11 13:36:34 +00:00
|
|
|
GObjectClass *object_class = G_OBJECT_CLASS (req_class);
|
2005-05-03 Dan Williams <dcbw@redhat.com>
* Kill dhcpcd. We now use "dhcdbd", a dbus daemon that controls dhclient.
This means that NetworkManager shouldn't have DHCP issues anymore. It also
means you need dhcdbd, which you can get here (get the latest one):
http://people.redhat.com/jvdias/dhcdbd/
Technically NetworkManager can use any DHCP daemon that uses the same DBUS
interface as dhcdbd.
* Rewrite device activation to facilitate the new DHCP infrastructure and
future improvements. Its now "activation request" based, ie there is a single
activation request composed of the device, access point, and other info which
follows the entire activation process. There are 5 stages of the activation
process which correspond to:
1) Device preparation
2) Device configuration (bring it up, set ESSID/Key/etc)
3) IP Config Start (fire off DHCP if we're using it)
4) IP Config Get (grab config from DHCP or static config files)
5) IP Config Commit (set device's IP address, DNS, etc)
Note that there is no longer a "scanning" step, since the access point must
be known _before_ activation starts. If the access point drops out or does
not exist for some reason, the entire activation process fails and must be
restarted for a different access point or device.
Patch from Bill Moss:
* gnome/applet/applet.c
- Fix type of vpn_failure dialog -> vpn_banner dialog
git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@597 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2005-05-03 20:41:36 +00:00
|
|
|
|
2007-06-11 13:36:34 +00:00
|
|
|
g_type_class_add_private (req_class, sizeof (NMActRequestPrivate));
|
2005-05-03 Dan Williams <dcbw@redhat.com>
* Kill dhcpcd. We now use "dhcdbd", a dbus daemon that controls dhclient.
This means that NetworkManager shouldn't have DHCP issues anymore. It also
means you need dhcdbd, which you can get here (get the latest one):
http://people.redhat.com/jvdias/dhcdbd/
Technically NetworkManager can use any DHCP daemon that uses the same DBUS
interface as dhcdbd.
* Rewrite device activation to facilitate the new DHCP infrastructure and
future improvements. Its now "activation request" based, ie there is a single
activation request composed of the device, access point, and other info which
follows the entire activation process. There are 5 stages of the activation
process which correspond to:
1) Device preparation
2) Device configuration (bring it up, set ESSID/Key/etc)
3) IP Config Start (fire off DHCP if we're using it)
4) IP Config Get (grab config from DHCP or static config files)
5) IP Config Commit (set device's IP address, DNS, etc)
Note that there is no longer a "scanning" step, since the access point must
be known _before_ activation starts. If the access point drops out or does
not exist for some reason, the entire activation process fails and must be
restarted for a different access point or device.
Patch from Bill Moss:
* gnome/applet/applet.c
- Fix type of vpn_failure dialog -> vpn_banner dialog
git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@597 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2005-05-03 20:41:36 +00:00
|
|
|
|
2008-03-20 19:56:12 +00:00
|
|
|
/* virtual methods */
|
|
|
|
|
object_class->get_property = get_property;
|
2007-09-14 19:43:28 +00:00
|
|
|
object_class->dispose = dispose;
|
2007-06-11 13:36:34 +00:00
|
|
|
object_class->finalize = finalize;
|
2007-09-11 18:02:27 +00:00
|
|
|
|
2008-03-20 19:56:12 +00:00
|
|
|
/* properties */
|
|
|
|
|
g_object_class_install_property
|
|
|
|
|
(object_class, PROP_SERVICE_NAME,
|
|
|
|
|
g_param_spec_string (NM_ACTIVE_CONNECTION_SERVICE_NAME,
|
|
|
|
|
"Service name",
|
|
|
|
|
"Service name",
|
|
|
|
|
NULL,
|
|
|
|
|
G_PARAM_READABLE));
|
|
|
|
|
g_object_class_install_property
|
|
|
|
|
(object_class, PROP_CONNECTION,
|
|
|
|
|
g_param_spec_boxed (NM_ACTIVE_CONNECTION_CONNECTION,
|
|
|
|
|
"Connection",
|
|
|
|
|
"Connection",
|
|
|
|
|
DBUS_TYPE_G_OBJECT_PATH,
|
|
|
|
|
G_PARAM_READABLE));
|
|
|
|
|
g_object_class_install_property
|
|
|
|
|
(object_class, PROP_SPECIFIC_OBJECT,
|
2008-03-29 20:53:03 +00:00
|
|
|
g_param_spec_boxed (NM_ACTIVE_CONNECTION_SPECIFIC_OBJECT,
|
2008-03-20 19:56:12 +00:00
|
|
|
"Specific object",
|
|
|
|
|
"Specific object",
|
2008-03-29 20:53:03 +00:00
|
|
|
DBUS_TYPE_G_OBJECT_PATH,
|
2008-03-20 19:56:12 +00:00
|
|
|
G_PARAM_READABLE));
|
|
|
|
|
g_object_class_install_property
|
|
|
|
|
(object_class, PROP_SHARED_SERVICE_NAME,
|
|
|
|
|
g_param_spec_string (NM_ACTIVE_CONNECTION_SHARED_SERVICE_NAME,
|
|
|
|
|
"Shared service name",
|
|
|
|
|
"Shared service name",
|
|
|
|
|
NULL,
|
|
|
|
|
G_PARAM_READABLE));
|
|
|
|
|
g_object_class_install_property
|
|
|
|
|
(object_class, PROP_SHARED_CONNECTION,
|
|
|
|
|
g_param_spec_boxed (NM_ACTIVE_CONNECTION_SHARED_CONNECTION,
|
|
|
|
|
"Shared connection",
|
|
|
|
|
"Shared connection",
|
|
|
|
|
DBUS_TYPE_G_OBJECT_PATH,
|
|
|
|
|
G_PARAM_READABLE));
|
|
|
|
|
g_object_class_install_property
|
|
|
|
|
(object_class, PROP_DEVICES,
|
|
|
|
|
g_param_spec_boxed (NM_ACTIVE_CONNECTION_DEVICES,
|
|
|
|
|
"Devices",
|
|
|
|
|
"Devices",
|
2008-03-29 21:35:41 +00:00
|
|
|
DBUS_TYPE_G_ARRAY_OF_OBJECT_PATH,
|
2008-03-20 19:56:12 +00:00
|
|
|
G_PARAM_READABLE));
|
2008-03-26 13:43:01 +00:00
|
|
|
g_object_class_install_property
|
|
|
|
|
(object_class, PROP_VPN,
|
|
|
|
|
g_param_spec_boolean (NM_ACTIVE_CONNECTION_VPN,
|
|
|
|
|
"VPN",
|
|
|
|
|
"Is a VPN connection",
|
|
|
|
|
FALSE,
|
|
|
|
|
G_PARAM_READABLE));
|
2008-03-20 19:56:12 +00:00
|
|
|
|
2007-09-11 18:02:27 +00:00
|
|
|
/* Signals */
|
|
|
|
|
signals[CONNECTION_SECRETS_UPDATED] =
|
|
|
|
|
g_signal_new ("connection-secrets-updated",
|
|
|
|
|
G_OBJECT_CLASS_TYPE (object_class),
|
|
|
|
|
G_SIGNAL_RUN_FIRST,
|
2007-09-14 19:43:28 +00:00
|
|
|
G_STRUCT_OFFSET (NMActRequestClass, connection_secrets_updated),
|
2007-09-11 18:02:27 +00:00
|
|
|
NULL, NULL,
|
2008-03-17 19:37:23 +00:00
|
|
|
nm_marshal_VOID__OBJECT_POINTER,
|
2007-09-11 18:02:27 +00:00
|
|
|
G_TYPE_NONE, 2,
|
2008-03-17 19:37:23 +00:00
|
|
|
G_TYPE_OBJECT, G_TYPE_POINTER);
|
2007-09-14 19:43:28 +00:00
|
|
|
|
2007-09-27 04:52:03 +00:00
|
|
|
signals[CONNECTION_SECRETS_FAILED] =
|
|
|
|
|
g_signal_new ("connection-secrets-failed",
|
|
|
|
|
G_OBJECT_CLASS_TYPE (object_class),
|
|
|
|
|
G_SIGNAL_RUN_FIRST,
|
|
|
|
|
G_STRUCT_OFFSET (NMActRequestClass, connection_secrets_failed),
|
|
|
|
|
NULL, NULL,
|
|
|
|
|
nm_marshal_VOID__OBJECT_STRING,
|
|
|
|
|
G_TYPE_NONE, 2,
|
|
|
|
|
G_TYPE_OBJECT, G_TYPE_STRING);
|
2005-05-03 Dan Williams <dcbw@redhat.com>
* Kill dhcpcd. We now use "dhcdbd", a dbus daemon that controls dhclient.
This means that NetworkManager shouldn't have DHCP issues anymore. It also
means you need dhcdbd, which you can get here (get the latest one):
http://people.redhat.com/jvdias/dhcdbd/
Technically NetworkManager can use any DHCP daemon that uses the same DBUS
interface as dhcdbd.
* Rewrite device activation to facilitate the new DHCP infrastructure and
future improvements. Its now "activation request" based, ie there is a single
activation request composed of the device, access point, and other info which
follows the entire activation process. There are 5 stages of the activation
process which correspond to:
1) Device preparation
2) Device configuration (bring it up, set ESSID/Key/etc)
3) IP Config Start (fire off DHCP if we're using it)
4) IP Config Get (grab config from DHCP or static config files)
5) IP Config Commit (set device's IP address, DNS, etc)
Note that there is no longer a "scanning" step, since the access point must
be known _before_ activation starts. If the access point drops out or does
not exist for some reason, the entire activation process fails and must be
restarted for a different access point or device.
Patch from Bill Moss:
* gnome/applet/applet.c
- Fix type of vpn_failure dialog -> vpn_banner dialog
git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@597 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2005-05-03 20:41:36 +00:00
|
|
|
|
2008-03-20 19:56:12 +00:00
|
|
|
signals[PROPERTIES_CHANGED] =
|
|
|
|
|
nm_properties_changed_signal_new (object_class,
|
|
|
|
|
G_STRUCT_OFFSET (NMActRequestClass, properties_changed));
|
2007-02-16 11:23:49 +00:00
|
|
|
|
2008-03-26 13:43:01 +00:00
|
|
|
nm_active_connection_install_type_info (object_class);
|
2005-05-03 Dan Williams <dcbw@redhat.com>
* Kill dhcpcd. We now use "dhcdbd", a dbus daemon that controls dhclient.
This means that NetworkManager shouldn't have DHCP issues anymore. It also
means you need dhcdbd, which you can get here (get the latest one):
http://people.redhat.com/jvdias/dhcdbd/
Technically NetworkManager can use any DHCP daemon that uses the same DBUS
interface as dhcdbd.
* Rewrite device activation to facilitate the new DHCP infrastructure and
future improvements. Its now "activation request" based, ie there is a single
activation request composed of the device, access point, and other info which
follows the entire activation process. There are 5 stages of the activation
process which correspond to:
1) Device preparation
2) Device configuration (bring it up, set ESSID/Key/etc)
3) IP Config Start (fire off DHCP if we're using it)
4) IP Config Get (grab config from DHCP or static config files)
5) IP Config Commit (set device's IP address, DNS, etc)
Note that there is no longer a "scanning" step, since the access point must
be known _before_ activation starts. If the access point drops out or does
not exist for some reason, the entire activation process fails and must be
restarted for a different access point or device.
Patch from Bill Moss:
* gnome/applet/applet.c
- Fix type of vpn_failure dialog -> vpn_banner dialog
git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@597 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2005-05-03 20:41:36 +00:00
|
|
|
}
|
|
|
|
|
|
2007-09-27 04:52:03 +00:00
|
|
|
typedef struct GetSecretsInfo {
|
|
|
|
|
NMActRequest *req;
|
|
|
|
|
char *setting_name;
|
|
|
|
|
} GetSecretsInfo;
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
|
free_get_secrets_info (gpointer data)
|
|
|
|
|
{
|
|
|
|
|
GetSecretsInfo *info = (GetSecretsInfo *) data;
|
|
|
|
|
|
|
|
|
|
g_free (info->setting_name);
|
2008-03-17 19:37:23 +00:00
|
|
|
g_free (info);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
|
update_one_setting (const char* key,
|
|
|
|
|
GHashTable *setting_hash,
|
|
|
|
|
NMConnection *connection,
|
|
|
|
|
GSList **updated)
|
|
|
|
|
{
|
|
|
|
|
GType type;
|
|
|
|
|
NMSetting *setting = NULL;
|
|
|
|
|
|
|
|
|
|
/* Check whether a complete & valid NMSetting object was returned. If
|
|
|
|
|
* yes, replace the setting object in the connection. If not, just try
|
|
|
|
|
* updating the secrets.
|
|
|
|
|
*/
|
|
|
|
|
type = nm_connection_lookup_setting_type (key);
|
|
|
|
|
if (type == 0)
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
setting = nm_setting_from_hash (type, setting_hash);
|
|
|
|
|
if (setting) {
|
|
|
|
|
NMSetting *s_8021x = NULL;
|
|
|
|
|
GSList *all_settings = NULL;
|
|
|
|
|
|
|
|
|
|
/* The wireless-security setting might need the 802.1x setting in
|
|
|
|
|
* the all_settings argument of the verify function. Ugh.
|
|
|
|
|
*/
|
|
|
|
|
s_8021x = nm_connection_get_setting (connection, NM_TYPE_SETTING_802_1X);
|
|
|
|
|
if (s_8021x)
|
|
|
|
|
all_settings = g_slist_append (all_settings, s_8021x);
|
|
|
|
|
|
|
|
|
|
if (!nm_setting_verify (setting, all_settings)) {
|
|
|
|
|
/* Just try updating secrets */
|
|
|
|
|
g_object_unref (setting);
|
|
|
|
|
setting = NULL;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
g_slist_free (all_settings);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (setting)
|
|
|
|
|
nm_connection_add_setting (connection, setting);
|
|
|
|
|
else
|
|
|
|
|
nm_connection_update_secrets (connection, key, setting_hash);
|
|
|
|
|
|
|
|
|
|
*updated = g_slist_append (*updated, (gpointer) key);
|
2007-09-27 04:52:03 +00:00
|
|
|
}
|
|
|
|
|
|
2008-03-17 19:37:23 +00:00
|
|
|
static void
|
|
|
|
|
add_one_key_to_list (gpointer key, gpointer data, gpointer user_data)
|
|
|
|
|
{
|
|
|
|
|
GSList **list = (GSList **) user_data;
|
|
|
|
|
|
|
|
|
|
*list = g_slist_append (*list, key);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static gint
|
|
|
|
|
settings_order_func (gconstpointer a, gconstpointer b)
|
|
|
|
|
{
|
|
|
|
|
/* Just ensure the 802.1x setting gets processed _before_ the
|
|
|
|
|
* wireless-security one.
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
if ( !strcmp (a, NM_SETTING_802_1X_SETTING_NAME)
|
|
|
|
|
&& !strcmp (b, NM_SETTING_WIRELESS_SECURITY_SETTING_NAME))
|
|
|
|
|
return -1;
|
|
|
|
|
|
|
|
|
|
if ( !strcmp (a, NM_SETTING_WIRELESS_SECURITY_SETTING_NAME)
|
|
|
|
|
&& !strcmp (b, NM_SETTING_802_1X_SETTING_NAME))
|
|
|
|
|
return 1;
|
|
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
2007-09-11 18:02:27 +00:00
|
|
|
static void
|
2007-09-27 04:52:03 +00:00
|
|
|
get_secrets_cb (DBusGProxy *proxy, DBusGProxyCall *call, gpointer user_data)
|
|
|
|
|
{
|
|
|
|
|
GetSecretsInfo *info = (GetSecretsInfo *) user_data;
|
|
|
|
|
GError *err = NULL;
|
2008-03-17 19:37:23 +00:00
|
|
|
GHashTable *settings = NULL;
|
2007-09-27 04:52:03 +00:00
|
|
|
NMActRequestPrivate *priv = NULL;
|
2008-03-17 19:37:23 +00:00
|
|
|
GSList *keys = NULL, *iter;
|
|
|
|
|
GSList *updated = NULL;
|
2007-09-27 04:52:03 +00:00
|
|
|
|
|
|
|
|
g_return_if_fail (info != NULL);
|
|
|
|
|
g_return_if_fail (info->req);
|
|
|
|
|
g_return_if_fail (info->setting_name);
|
|
|
|
|
|
|
|
|
|
priv = NM_ACT_REQUEST_GET_PRIVATE (info->req);
|
|
|
|
|
g_object_set_data (G_OBJECT (priv->connection), CONNECTION_GET_SECRETS_CALL_TAG, NULL);
|
|
|
|
|
|
|
|
|
|
if (!dbus_g_proxy_end_call (proxy, call, &err,
|
2008-03-29 21:35:41 +00:00
|
|
|
DBUS_TYPE_G_MAP_OF_MAP_OF_VARIANT, &settings,
|
2007-09-27 04:52:03 +00:00
|
|
|
G_TYPE_INVALID)) {
|
|
|
|
|
nm_warning ("Couldn't get connection secrets: %s.", err->message);
|
|
|
|
|
g_error_free (err);
|
|
|
|
|
g_signal_emit (info->req,
|
|
|
|
|
signals[CONNECTION_SECRETS_FAILED],
|
|
|
|
|
0,
|
|
|
|
|
priv->connection,
|
|
|
|
|
info->setting_name);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
2008-03-17 19:37:23 +00:00
|
|
|
if (g_hash_table_size (settings) == 0) {
|
2007-09-27 04:52:03 +00:00
|
|
|
// FIXME: some better way to handle invalid message?
|
|
|
|
|
nm_warning ("GetSecrets call returned but no secrets were found.");
|
2007-11-15 16:57:33 +00:00
|
|
|
goto out;
|
2007-09-27 04:52:03 +00:00
|
|
|
}
|
|
|
|
|
|
2008-03-17 19:37:23 +00:00
|
|
|
g_hash_table_foreach (settings, add_one_key_to_list, &keys);
|
|
|
|
|
keys = g_slist_sort (keys, settings_order_func);
|
|
|
|
|
for (iter = keys; iter; iter = g_slist_next (iter)) {
|
|
|
|
|
GHashTable *setting_hash;
|
|
|
|
|
|
|
|
|
|
setting_hash = g_hash_table_lookup (settings, iter->data);
|
|
|
|
|
if (setting_hash) {
|
|
|
|
|
update_one_setting ((const char *) iter->data,
|
|
|
|
|
setting_hash,
|
|
|
|
|
priv->connection,
|
|
|
|
|
&updated);
|
|
|
|
|
} else
|
|
|
|
|
nm_warning ("Couldn't get setting secrets for '%s'", (const char *) iter->data);
|
2007-11-15 16:57:33 +00:00
|
|
|
}
|
2008-03-17 19:37:23 +00:00
|
|
|
g_slist_free (keys);
|
2007-11-15 16:57:33 +00:00
|
|
|
|
2008-03-17 19:37:23 +00:00
|
|
|
if (g_slist_length (updated)) {
|
|
|
|
|
g_signal_emit (info->req,
|
|
|
|
|
signals[CONNECTION_SECRETS_UPDATED],
|
|
|
|
|
0,
|
|
|
|
|
priv->connection,
|
|
|
|
|
updated);
|
|
|
|
|
} else {
|
|
|
|
|
nm_warning ("No secrets updated because not valid settings were received!");
|
|
|
|
|
}
|
2007-11-15 16:57:33 +00:00
|
|
|
|
|
|
|
|
out:
|
2008-03-17 19:37:23 +00:00
|
|
|
g_slist_free (updated);
|
|
|
|
|
g_hash_table_destroy (settings);
|
2007-09-27 04:52:03 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
gboolean
|
|
|
|
|
nm_act_request_request_connection_secrets (NMActRequest *req,
|
|
|
|
|
const char *setting_name,
|
|
|
|
|
gboolean request_new)
|
2007-09-11 18:02:27 +00:00
|
|
|
{
|
2007-09-27 04:52:03 +00:00
|
|
|
DBusGProxy *proxy;
|
|
|
|
|
DBusGProxyCall *call;
|
|
|
|
|
GetSecretsInfo *info = NULL;
|
|
|
|
|
NMActRequestPrivate *priv = NULL;
|
2007-10-19 04:55:05 +00:00
|
|
|
GPtrArray *hints = NULL;
|
2007-09-27 04:52:03 +00:00
|
|
|
|
|
|
|
|
g_return_val_if_fail (NM_IS_ACT_REQUEST (req), FALSE);
|
|
|
|
|
g_return_val_if_fail (setting_name != NULL, FALSE);
|
|
|
|
|
|
|
|
|
|
priv = NM_ACT_REQUEST_GET_PRIVATE (req);
|
2007-10-19 04:55:05 +00:00
|
|
|
proxy = g_object_get_data (G_OBJECT (priv->connection), NM_MANAGER_CONNECTION_SECRETS_PROXY_TAG);
|
2007-09-27 04:52:03 +00:00
|
|
|
if (!DBUS_IS_G_PROXY (proxy)) {
|
|
|
|
|
nm_warning ("Couldn't get dbus proxy for connection.");
|
|
|
|
|
goto error;
|
|
|
|
|
}
|
|
|
|
|
|
2008-03-17 19:37:23 +00:00
|
|
|
info = g_malloc0 (sizeof (GetSecretsInfo));
|
2007-09-27 04:52:03 +00:00
|
|
|
if (!info) {
|
|
|
|
|
nm_warning ("Not enough memory to get secrets");
|
|
|
|
|
goto error;
|
|
|
|
|
}
|
2007-09-11 18:02:27 +00:00
|
|
|
|
2007-09-27 04:52:03 +00:00
|
|
|
info->setting_name = g_strdup (setting_name);
|
|
|
|
|
if (!info->setting_name) {
|
|
|
|
|
nm_warning ("Not enough memory to get secrets");
|
|
|
|
|
goto error;
|
|
|
|
|
}
|
|
|
|
|
|
2007-10-19 04:55:05 +00:00
|
|
|
/* Empty for now */
|
|
|
|
|
hints = g_ptr_array_new ();
|
|
|
|
|
|
2007-09-27 04:52:03 +00:00
|
|
|
info->req = req;
|
|
|
|
|
call = dbus_g_proxy_begin_call_with_timeout (proxy, "GetSecrets",
|
|
|
|
|
get_secrets_cb,
|
|
|
|
|
info,
|
|
|
|
|
free_get_secrets_info,
|
|
|
|
|
G_MAXINT32,
|
|
|
|
|
G_TYPE_STRING, setting_name,
|
2008-03-29 21:35:41 +00:00
|
|
|
DBUS_TYPE_G_ARRAY_OF_STRING, hints,
|
2007-09-27 04:52:03 +00:00
|
|
|
G_TYPE_BOOLEAN, request_new,
|
|
|
|
|
G_TYPE_INVALID);
|
2007-10-19 04:55:05 +00:00
|
|
|
g_ptr_array_free (hints, TRUE);
|
2007-09-27 04:52:03 +00:00
|
|
|
if (!call) {
|
|
|
|
|
nm_warning ("Could not call GetSecrets");
|
|
|
|
|
goto error;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
g_object_set_data (G_OBJECT (priv->connection), CONNECTION_GET_SECRETS_CALL_TAG, call);
|
|
|
|
|
return TRUE;
|
|
|
|
|
|
|
|
|
|
error:
|
|
|
|
|
if (info)
|
|
|
|
|
free_get_secrets_info (info);
|
|
|
|
|
return FALSE;
|
2007-09-11 18:02:27 +00:00
|
|
|
}
|
|
|
|
|
|
2007-06-11 13:36:34 +00:00
|
|
|
NMConnection *
|
|
|
|
|
nm_act_request_get_connection (NMActRequest *req)
|
2005-05-03 Dan Williams <dcbw@redhat.com>
* Kill dhcpcd. We now use "dhcdbd", a dbus daemon that controls dhclient.
This means that NetworkManager shouldn't have DHCP issues anymore. It also
means you need dhcdbd, which you can get here (get the latest one):
http://people.redhat.com/jvdias/dhcdbd/
Technically NetworkManager can use any DHCP daemon that uses the same DBUS
interface as dhcdbd.
* Rewrite device activation to facilitate the new DHCP infrastructure and
future improvements. Its now "activation request" based, ie there is a single
activation request composed of the device, access point, and other info which
follows the entire activation process. There are 5 stages of the activation
process which correspond to:
1) Device preparation
2) Device configuration (bring it up, set ESSID/Key/etc)
3) IP Config Start (fire off DHCP if we're using it)
4) IP Config Get (grab config from DHCP or static config files)
5) IP Config Commit (set device's IP address, DNS, etc)
Note that there is no longer a "scanning" step, since the access point must
be known _before_ activation starts. If the access point drops out or does
not exist for some reason, the entire activation process fails and must be
restarted for a different access point or device.
Patch from Bill Moss:
* gnome/applet/applet.c
- Fix type of vpn_failure dialog -> vpn_banner dialog
git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@597 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2005-05-03 20:41:36 +00:00
|
|
|
{
|
2007-06-11 13:36:34 +00:00
|
|
|
g_return_val_if_fail (NM_IS_ACT_REQUEST (req), NULL);
|
2005-05-03 Dan Williams <dcbw@redhat.com>
* Kill dhcpcd. We now use "dhcdbd", a dbus daemon that controls dhclient.
This means that NetworkManager shouldn't have DHCP issues anymore. It also
means you need dhcdbd, which you can get here (get the latest one):
http://people.redhat.com/jvdias/dhcdbd/
Technically NetworkManager can use any DHCP daemon that uses the same DBUS
interface as dhcdbd.
* Rewrite device activation to facilitate the new DHCP infrastructure and
future improvements. Its now "activation request" based, ie there is a single
activation request composed of the device, access point, and other info which
follows the entire activation process. There are 5 stages of the activation
process which correspond to:
1) Device preparation
2) Device configuration (bring it up, set ESSID/Key/etc)
3) IP Config Start (fire off DHCP if we're using it)
4) IP Config Get (grab config from DHCP or static config files)
5) IP Config Commit (set device's IP address, DNS, etc)
Note that there is no longer a "scanning" step, since the access point must
be known _before_ activation starts. If the access point drops out or does
not exist for some reason, the entire activation process fails and must be
restarted for a different access point or device.
Patch from Bill Moss:
* gnome/applet/applet.c
- Fix type of vpn_failure dialog -> vpn_banner dialog
git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@597 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2005-05-03 20:41:36 +00:00
|
|
|
|
2007-06-11 13:36:34 +00:00
|
|
|
return NM_ACT_REQUEST_GET_PRIVATE (req)->connection;
|
2005-05-03 Dan Williams <dcbw@redhat.com>
* Kill dhcpcd. We now use "dhcdbd", a dbus daemon that controls dhclient.
This means that NetworkManager shouldn't have DHCP issues anymore. It also
means you need dhcdbd, which you can get here (get the latest one):
http://people.redhat.com/jvdias/dhcdbd/
Technically NetworkManager can use any DHCP daemon that uses the same DBUS
interface as dhcdbd.
* Rewrite device activation to facilitate the new DHCP infrastructure and
future improvements. Its now "activation request" based, ie there is a single
activation request composed of the device, access point, and other info which
follows the entire activation process. There are 5 stages of the activation
process which correspond to:
1) Device preparation
2) Device configuration (bring it up, set ESSID/Key/etc)
3) IP Config Start (fire off DHCP if we're using it)
4) IP Config Get (grab config from DHCP or static config files)
5) IP Config Commit (set device's IP address, DNS, etc)
Note that there is no longer a "scanning" step, since the access point must
be known _before_ activation starts. If the access point drops out or does
not exist for some reason, the entire activation process fails and must be
restarted for a different access point or device.
Patch from Bill Moss:
* gnome/applet/applet.c
- Fix type of vpn_failure dialog -> vpn_banner dialog
git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@597 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2005-05-03 20:41:36 +00:00
|
|
|
}
|
|
|
|
|
|
2007-08-28 14:47:31 +00:00
|
|
|
const char *
|
|
|
|
|
nm_act_request_get_specific_object (NMActRequest *req)
|
|
|
|
|
{
|
|
|
|
|
g_return_val_if_fail (NM_IS_ACT_REQUEST (req), NULL);
|
|
|
|
|
|
|
|
|
|
return NM_ACT_REQUEST_GET_PRIVATE (req)->specific_object;
|
|
|
|
|
}
|
|
|
|
|
|
2007-10-22 01:51:41 +00:00
|
|
|
void
|
|
|
|
|
nm_act_request_set_specific_object (NMActRequest *req,
|
|
|
|
|
const char *specific_object)
|
|
|
|
|
{
|
|
|
|
|
NMActRequestPrivate *priv;
|
|
|
|
|
|
|
|
|
|
g_return_if_fail (NM_IS_ACT_REQUEST (req));
|
2007-10-22 03:11:25 +00:00
|
|
|
g_return_if_fail (specific_object != NULL);
|
2007-10-22 01:51:41 +00:00
|
|
|
|
|
|
|
|
priv = NM_ACT_REQUEST_GET_PRIVATE (req);
|
|
|
|
|
|
2007-10-22 03:11:25 +00:00
|
|
|
if (priv->specific_object)
|
|
|
|
|
g_free (priv->specific_object);
|
2007-10-22 01:51:41 +00:00
|
|
|
priv->specific_object = g_strdup (specific_object);
|
|
|
|
|
}
|
|
|
|
|
|
2007-06-11 13:36:34 +00:00
|
|
|
gboolean
|
|
|
|
|
nm_act_request_get_user_requested (NMActRequest *req)
|
2005-05-03 Dan Williams <dcbw@redhat.com>
* Kill dhcpcd. We now use "dhcdbd", a dbus daemon that controls dhclient.
This means that NetworkManager shouldn't have DHCP issues anymore. It also
means you need dhcdbd, which you can get here (get the latest one):
http://people.redhat.com/jvdias/dhcdbd/
Technically NetworkManager can use any DHCP daemon that uses the same DBUS
interface as dhcdbd.
* Rewrite device activation to facilitate the new DHCP infrastructure and
future improvements. Its now "activation request" based, ie there is a single
activation request composed of the device, access point, and other info which
follows the entire activation process. There are 5 stages of the activation
process which correspond to:
1) Device preparation
2) Device configuration (bring it up, set ESSID/Key/etc)
3) IP Config Start (fire off DHCP if we're using it)
4) IP Config Get (grab config from DHCP or static config files)
5) IP Config Commit (set device's IP address, DNS, etc)
Note that there is no longer a "scanning" step, since the access point must
be known _before_ activation starts. If the access point drops out or does
not exist for some reason, the entire activation process fails and must be
restarted for a different access point or device.
Patch from Bill Moss:
* gnome/applet/applet.c
- Fix type of vpn_failure dialog -> vpn_banner dialog
git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@597 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2005-05-03 20:41:36 +00:00
|
|
|
{
|
2007-06-11 13:36:34 +00:00
|
|
|
g_return_val_if_fail (NM_IS_ACT_REQUEST (req), FALSE);
|
2005-05-03 Dan Williams <dcbw@redhat.com>
* Kill dhcpcd. We now use "dhcdbd", a dbus daemon that controls dhclient.
This means that NetworkManager shouldn't have DHCP issues anymore. It also
means you need dhcdbd, which you can get here (get the latest one):
http://people.redhat.com/jvdias/dhcdbd/
Technically NetworkManager can use any DHCP daemon that uses the same DBUS
interface as dhcdbd.
* Rewrite device activation to facilitate the new DHCP infrastructure and
future improvements. Its now "activation request" based, ie there is a single
activation request composed of the device, access point, and other info which
follows the entire activation process. There are 5 stages of the activation
process which correspond to:
1) Device preparation
2) Device configuration (bring it up, set ESSID/Key/etc)
3) IP Config Start (fire off DHCP if we're using it)
4) IP Config Get (grab config from DHCP or static config files)
5) IP Config Commit (set device's IP address, DNS, etc)
Note that there is no longer a "scanning" step, since the access point must
be known _before_ activation starts. If the access point drops out or does
not exist for some reason, the entire activation process fails and must be
restarted for a different access point or device.
Patch from Bill Moss:
* gnome/applet/applet.c
- Fix type of vpn_failure dialog -> vpn_banner dialog
git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@597 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2005-05-03 20:41:36 +00:00
|
|
|
|
2007-06-11 13:36:34 +00:00
|
|
|
return NM_ACT_REQUEST_GET_PRIVATE (req)->user_requested;
|
2005-05-03 Dan Williams <dcbw@redhat.com>
* Kill dhcpcd. We now use "dhcdbd", a dbus daemon that controls dhclient.
This means that NetworkManager shouldn't have DHCP issues anymore. It also
means you need dhcdbd, which you can get here (get the latest one):
http://people.redhat.com/jvdias/dhcdbd/
Technically NetworkManager can use any DHCP daemon that uses the same DBUS
interface as dhcdbd.
* Rewrite device activation to facilitate the new DHCP infrastructure and
future improvements. Its now "activation request" based, ie there is a single
activation request composed of the device, access point, and other info which
follows the entire activation process. There are 5 stages of the activation
process which correspond to:
1) Device preparation
2) Device configuration (bring it up, set ESSID/Key/etc)
3) IP Config Start (fire off DHCP if we're using it)
4) IP Config Get (grab config from DHCP or static config files)
5) IP Config Commit (set device's IP address, DNS, etc)
Note that there is no longer a "scanning" step, since the access point must
be known _before_ activation starts. If the access point drops out or does
not exist for some reason, the entire activation process fails and must be
restarted for a different access point or device.
Patch from Bill Moss:
* gnome/applet/applet.c
- Fix type of vpn_failure dialog -> vpn_banner dialog
git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@597 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2005-05-03 20:41:36 +00:00
|
|
|
}
|
2008-03-20 19:56:12 +00:00
|
|
|
|
|
|
|
|
const char *
|
|
|
|
|
nm_act_request_get_active_connection_path (NMActRequest *req)
|
|
|
|
|
{
|
|
|
|
|
g_return_val_if_fail (NM_IS_ACT_REQUEST (req), FALSE);
|
|
|
|
|
|
|
|
|
|
return NM_ACT_REQUEST_GET_PRIVATE (req)->ac_path;
|
|
|
|
|
}
|
|
|
|
|
|