2008-11-03 04:13:42 +00:00
|
|
|
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */
|
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
|
|
|
|
|
*
|
|
|
|
|
* 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.
|
|
|
|
|
*
|
2008-06-26 18:31:52 +00:00
|
|
|
* 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.,
|
|
|
|
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
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
|
|
|
*
|
2012-02-03 14:53:09 -06:00
|
|
|
* Copyright (C) 2005 - 2012 Red Hat, Inc.
|
2008-11-03 04:13:42 +00:00
|
|
|
* Copyright (C) 2007 - 2008 Novell, Inc.
|
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
|
|
|
*/
|
|
|
|
|
|
2011-03-14 01:00:56 -05:00
|
|
|
#include "config.h"
|
|
|
|
|
|
2007-09-20 12:03:30 +00:00
|
|
|
#include <string.h>
|
2008-08-15 15:34:28 +00:00
|
|
|
#include <stdlib.h>
|
|
|
|
|
#include <sys/wait.h>
|
|
|
|
|
#include <unistd.h>
|
2007-10-01 15:38:39 +00:00
|
|
|
#include <dbus/dbus-glib.h>
|
2008-03-17 19:37:23 +00:00
|
|
|
|
2013-08-29 14:56:59 -04:00
|
|
|
#include "libgsystem.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
|
|
|
#include "nm-activation-request.h"
|
2010-04-07 11:36:38 -07:00
|
|
|
#include "nm-logging.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-device.h"
|
2008-03-26 13:43:01 +00:00
|
|
|
#include "nm-active-connection.h"
|
2011-01-27 10:41:02 -06:00
|
|
|
#include "nm-settings-connection.h"
|
2012-05-21 14:10:05 +02:00
|
|
|
#include "nm-posix-signals.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
|
|
|
|
2012-02-03 14:53:09 -06:00
|
|
|
G_DEFINE_TYPE (NMActRequest, nm_act_request, NM_TYPE_ACTIVE_CONNECTION)
|
2009-06-11 00:39:12 -04:00
|
|
|
|
2010-12-13 13:11:51 -06: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
|
|
|
|
2008-08-15 15:34:28 +00:00
|
|
|
typedef struct {
|
|
|
|
|
char *table;
|
|
|
|
|
char *rule;
|
|
|
|
|
} ShareRule;
|
2007-09-11 18:02:27 +00:00
|
|
|
|
2007-06-11 13:36:34 +00:00
|
|
|
typedef struct {
|
2012-08-22 09:38:01 -05:00
|
|
|
GSList *secrets_calls;
|
2008-06-10 02:02:21 +00:00
|
|
|
gboolean shared;
|
2008-08-15 15:34:28 +00:00
|
|
|
GSList *share_rules;
|
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
|
|
|
|
2013-12-18 08:46:43 -05:00
|
|
|
enum {
|
|
|
|
|
PROP_0,
|
|
|
|
|
PROP_IP4_CONFIG,
|
|
|
|
|
PROP_DHCP4_CONFIG,
|
|
|
|
|
PROP_IP6_CONFIG,
|
|
|
|
|
PROP_DHCP6_CONFIG,
|
|
|
|
|
|
|
|
|
|
LAST_PROP
|
|
|
|
|
};
|
|
|
|
|
|
2012-08-22 09:38:01 -05:00
|
|
|
/*******************************************************************/
|
|
|
|
|
|
|
|
|
|
NMConnection *
|
|
|
|
|
nm_act_request_get_connection (NMActRequest *req)
|
|
|
|
|
{
|
|
|
|
|
g_return_val_if_fail (NM_IS_ACT_REQUEST (req), NULL);
|
|
|
|
|
|
|
|
|
|
return nm_active_connection_get_connection (NM_ACTIVE_CONNECTION (req));
|
|
|
|
|
}
|
|
|
|
|
|
2010-12-13 13:11:51 -06:00
|
|
|
/*******************************************************************/
|
|
|
|
|
|
2011-01-27 10:41:02 -06:00
|
|
|
typedef struct {
|
|
|
|
|
NMActRequest *self;
|
|
|
|
|
guint32 call_id;
|
|
|
|
|
NMActRequestSecretsFunc callback;
|
|
|
|
|
gpointer callback_data;
|
|
|
|
|
} GetSecretsInfo;
|
|
|
|
|
|
2008-07-11 10:28:53 +00:00
|
|
|
static void
|
2011-01-27 10:41:02 -06:00
|
|
|
get_secrets_cb (NMSettingsConnection *connection,
|
2010-12-13 13:11:51 -06:00
|
|
|
guint32 call_id,
|
2011-03-31 18:39:09 -05:00
|
|
|
const char *agent_username,
|
2011-01-26 13:32:25 -06:00
|
|
|
const char *setting_name,
|
2010-12-13 13:11:51 -06:00
|
|
|
GError *error,
|
2011-01-27 10:41:02 -06:00
|
|
|
gpointer user_data)
|
2008-07-11 10:28:53 +00:00
|
|
|
{
|
2011-01-27 10:41:02 -06:00
|
|
|
GetSecretsInfo *info = user_data;
|
|
|
|
|
NMActRequestPrivate *priv = NM_ACT_REQUEST_GET_PRIVATE (info->self);
|
2010-12-13 13:11:51 -06:00
|
|
|
|
2011-01-27 10:41:02 -06:00
|
|
|
g_return_if_fail (info->call_id == call_id);
|
|
|
|
|
priv->secrets_calls = g_slist_remove (priv->secrets_calls, info);
|
2010-12-13 13:11:51 -06:00
|
|
|
|
2011-01-27 10:41:02 -06:00
|
|
|
info->callback (info->self, call_id, NM_CONNECTION (connection), error, info->callback_data);
|
|
|
|
|
g_free (info);
|
2010-12-13 13:11:51 -06:00
|
|
|
}
|
|
|
|
|
|
2011-01-26 18:36:08 -06:00
|
|
|
guint32
|
|
|
|
|
nm_act_request_get_secrets (NMActRequest *self,
|
|
|
|
|
const char *setting_name,
|
2011-03-29 22:53:22 -05:00
|
|
|
NMSettingsGetSecretsFlags flags,
|
2011-01-26 18:36:08 -06:00
|
|
|
const char *hint,
|
|
|
|
|
NMActRequestSecretsFunc callback,
|
|
|
|
|
gpointer callback_data)
|
|
|
|
|
{
|
2011-01-27 10:41:02 -06:00
|
|
|
NMActRequestPrivate *priv;
|
|
|
|
|
GetSecretsInfo *info;
|
|
|
|
|
guint32 call_id;
|
2012-08-22 09:38:01 -05:00
|
|
|
NMConnection *connection;
|
2013-06-19 17:51:09 -05:00
|
|
|
const char *hints[2] = { hint, NULL };
|
2011-01-26 18:36:08 -06:00
|
|
|
|
2011-01-27 10:41:02 -06:00
|
|
|
g_return_val_if_fail (self, 0);
|
|
|
|
|
g_return_val_if_fail (NM_IS_ACT_REQUEST (self), 0);
|
2011-01-26 18:36:08 -06:00
|
|
|
|
2011-01-27 10:41:02 -06:00
|
|
|
priv = NM_ACT_REQUEST_GET_PRIVATE (self);
|
|
|
|
|
|
|
|
|
|
info = g_malloc0 (sizeof (GetSecretsInfo));
|
|
|
|
|
info->self = self;
|
|
|
|
|
info->callback = callback;
|
|
|
|
|
info->callback_data = callback_data;
|
|
|
|
|
|
2013-11-05 14:36:38 -05:00
|
|
|
if (nm_active_connection_get_user_requested (NM_ACTIVE_CONNECTION (self)))
|
2012-06-27 09:42:47 -05:00
|
|
|
flags |= NM_SETTINGS_GET_SECRETS_FLAG_USER_REQUESTED;
|
|
|
|
|
|
2012-08-22 09:38:01 -05:00
|
|
|
connection = nm_active_connection_get_connection (NM_ACTIVE_CONNECTION (self));
|
|
|
|
|
call_id = nm_settings_connection_get_secrets (NM_SETTINGS_CONNECTION (connection),
|
2013-11-05 14:36:38 -05:00
|
|
|
nm_active_connection_get_subject (NM_ACTIVE_CONNECTION (self)),
|
2011-01-27 10:41:02 -06:00
|
|
|
setting_name,
|
|
|
|
|
flags,
|
2013-06-19 17:51:09 -05:00
|
|
|
hints,
|
2011-01-27 10:41:02 -06:00
|
|
|
get_secrets_cb,
|
|
|
|
|
info,
|
|
|
|
|
NULL);
|
|
|
|
|
if (call_id > 0) {
|
|
|
|
|
info->call_id = call_id;
|
|
|
|
|
priv->secrets_calls = g_slist_append (priv->secrets_calls, info);
|
|
|
|
|
} else
|
|
|
|
|
g_free (info);
|
2011-01-26 18:36:08 -06:00
|
|
|
|
2011-01-27 10:41:02 -06:00
|
|
|
return call_id;
|
2011-01-26 18:36:08 -06:00
|
|
|
}
|
|
|
|
|
|
2010-12-13 13:11:51 -06:00
|
|
|
void
|
|
|
|
|
nm_act_request_cancel_secrets (NMActRequest *self, guint32 call_id)
|
|
|
|
|
{
|
|
|
|
|
NMActRequestPrivate *priv;
|
2012-09-17 10:59:03 -05:00
|
|
|
NMConnection *connection;
|
2011-01-27 10:41:02 -06:00
|
|
|
GSList *iter;
|
2010-12-13 13:11:51 -06:00
|
|
|
|
|
|
|
|
g_return_if_fail (self);
|
|
|
|
|
g_return_if_fail (NM_IS_ACT_REQUEST (self));
|
|
|
|
|
g_return_if_fail (call_id > 0);
|
|
|
|
|
|
|
|
|
|
priv = NM_ACT_REQUEST_GET_PRIVATE (self);
|
|
|
|
|
|
2012-09-17 10:59:03 -05:00
|
|
|
connection = nm_active_connection_get_connection (NM_ACTIVE_CONNECTION (self));
|
2011-01-27 10:41:02 -06:00
|
|
|
for (iter = priv->secrets_calls; iter; iter = g_slist_next (iter)) {
|
|
|
|
|
GetSecretsInfo *info = iter->data;
|
|
|
|
|
|
|
|
|
|
/* Remove the matching info */
|
|
|
|
|
if (info->call_id == call_id) {
|
|
|
|
|
priv->secrets_calls = g_slist_remove_link (priv->secrets_calls, iter);
|
|
|
|
|
g_slist_free (iter);
|
|
|
|
|
|
2012-09-17 10:59:03 -05:00
|
|
|
nm_settings_connection_cancel_secrets (NM_SETTINGS_CONNECTION (connection), call_id);
|
2011-01-27 10:41:02 -06:00
|
|
|
g_free (info);
|
|
|
|
|
break;
|
|
|
|
|
}
|
2010-04-15 15:26:11 -07:00
|
|
|
}
|
2008-07-11 10:28:53 +00:00
|
|
|
}
|
2008-03-20 19:56:12 +00:00
|
|
|
|
2010-12-13 13:11:51 -06:00
|
|
|
/********************************************************************/
|
|
|
|
|
|
2008-08-15 15:34:28 +00:00
|
|
|
static void
|
|
|
|
|
clear_share_rules (NMActRequest *req)
|
|
|
|
|
{
|
|
|
|
|
NMActRequestPrivate *priv = NM_ACT_REQUEST_GET_PRIVATE (req);
|
|
|
|
|
GSList *iter;
|
|
|
|
|
|
|
|
|
|
for (iter = priv->share_rules; iter; iter = g_slist_next (iter)) {
|
|
|
|
|
ShareRule *rule = (ShareRule *) iter->data;
|
|
|
|
|
|
|
|
|
|
g_free (rule->table);
|
|
|
|
|
g_free (rule->rule);
|
|
|
|
|
g_free (rule);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
g_slist_free (priv->share_rules);
|
|
|
|
|
priv->share_rules = NULL;
|
|
|
|
|
}
|
|
|
|
|
|
2007-09-14 19:43:28 +00:00
|
|
|
static void
|
2010-12-13 13:11:51 -06:00
|
|
|
share_child_setup (gpointer user_data G_GNUC_UNUSED)
|
2007-09-14 19:43:28 +00:00
|
|
|
{
|
2010-12-13 13:11:51 -06:00
|
|
|
/* We are in the child process at this point */
|
|
|
|
|
pid_t pid = getpid ();
|
|
|
|
|
setpgid (pid, pid);
|
2012-05-21 14:10:05 +02:00
|
|
|
|
|
|
|
|
nm_unblock_posix_signals (NULL);
|
2010-12-13 13:11:51 -06:00
|
|
|
}
|
2007-08-28 14:47:31 +00:00
|
|
|
|
2010-12-13 13:11:51 -06:00
|
|
|
void
|
|
|
|
|
nm_act_request_set_shared (NMActRequest *req, gboolean shared)
|
|
|
|
|
{
|
|
|
|
|
NMActRequestPrivate *priv = NM_ACT_REQUEST_GET_PRIVATE (req);
|
|
|
|
|
GSList *list, *iter;
|
2008-08-15 15:34:28 +00:00
|
|
|
|
2010-12-13 13:11:51 -06:00
|
|
|
g_return_if_fail (NM_IS_ACT_REQUEST (req));
|
|
|
|
|
|
|
|
|
|
NM_ACT_REQUEST_GET_PRIVATE (req)->shared = shared;
|
|
|
|
|
|
|
|
|
|
/* Tear the rules down in reverse order when sharing is stopped */
|
|
|
|
|
list = g_slist_copy (priv->share_rules);
|
|
|
|
|
if (!shared)
|
|
|
|
|
list = g_slist_reverse (list);
|
|
|
|
|
|
|
|
|
|
/* Send the rules to iptables */
|
|
|
|
|
for (iter = list; iter; iter = g_slist_next (iter)) {
|
|
|
|
|
ShareRule *rule = (ShareRule *) iter->data;
|
|
|
|
|
char *envp[1] = { NULL };
|
2013-08-29 14:56:59 -04:00
|
|
|
gs_strfreev char **argv = NULL;
|
|
|
|
|
gs_free char *cmd = NULL;
|
2010-12-13 13:11:51 -06:00
|
|
|
|
|
|
|
|
cmd = g_strdup_printf ("%s --table %s %s %s",
|
|
|
|
|
IPTABLES_PATH,
|
|
|
|
|
rule->table,
|
|
|
|
|
shared ? "--insert" : "--delete",
|
|
|
|
|
rule->rule);
|
|
|
|
|
if (!cmd)
|
|
|
|
|
continue;
|
|
|
|
|
|
|
|
|
|
argv = g_strsplit (cmd, " ", 0);
|
|
|
|
|
if (argv && argv[0]) {
|
|
|
|
|
int status;
|
|
|
|
|
GError *error = NULL;
|
|
|
|
|
|
|
|
|
|
nm_log_info (LOGD_SHARING, "Executing: %s", cmd);
|
|
|
|
|
if (!g_spawn_sync ("/", argv, envp, G_SPAWN_STDOUT_TO_DEV_NULL | G_SPAWN_STDERR_TO_DEV_NULL,
|
|
|
|
|
share_child_setup, NULL, NULL, NULL, &status, &error)) {
|
|
|
|
|
nm_log_warn (LOGD_SHARING, "Error executing command: (%d) %s",
|
|
|
|
|
error ? error->code : -1,
|
|
|
|
|
(error && error->message) ? error->message : "(unknown)");
|
|
|
|
|
g_clear_error (&error);
|
|
|
|
|
} else if (WEXITSTATUS (status)) {
|
|
|
|
|
nm_log_warn (LOGD_SHARING, "** Command returned exit status %d.",
|
|
|
|
|
WEXITSTATUS (status));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
g_slist_free (list);
|
|
|
|
|
|
|
|
|
|
/* Clear the share rule list when sharing is stopped */
|
|
|
|
|
if (!shared)
|
|
|
|
|
clear_share_rules (req);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
gboolean
|
|
|
|
|
nm_act_request_get_shared (NMActRequest *req)
|
|
|
|
|
{
|
|
|
|
|
g_return_val_if_fail (NM_IS_ACT_REQUEST (req), FALSE);
|
|
|
|
|
|
|
|
|
|
return NM_ACT_REQUEST_GET_PRIVATE (req)->shared;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
|
nm_act_request_add_share_rule (NMActRequest *req,
|
|
|
|
|
const char *table,
|
|
|
|
|
const char *table_rule)
|
|
|
|
|
{
|
|
|
|
|
NMActRequestPrivate *priv = NM_ACT_REQUEST_GET_PRIVATE (req);
|
|
|
|
|
ShareRule *rule;
|
|
|
|
|
|
|
|
|
|
g_return_if_fail (NM_IS_ACT_REQUEST (req));
|
|
|
|
|
g_return_if_fail (table != NULL);
|
|
|
|
|
g_return_if_fail (table_rule != NULL);
|
|
|
|
|
|
|
|
|
|
rule = g_malloc0 (sizeof (ShareRule));
|
|
|
|
|
rule->table = g_strdup (table);
|
|
|
|
|
rule->rule = g_strdup (table_rule);
|
|
|
|
|
priv->share_rules = g_slist_append (priv->share_rules, rule);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/********************************************************************/
|
|
|
|
|
|
2013-12-18 08:46:43 -05:00
|
|
|
static void
|
|
|
|
|
device_notify (GObject *object,
|
|
|
|
|
GParamSpec *pspec,
|
|
|
|
|
gpointer self)
|
|
|
|
|
{
|
|
|
|
|
g_object_notify (self, pspec->name);
|
|
|
|
|
}
|
|
|
|
|
|
2010-12-13 13:11:51 -06:00
|
|
|
static void
|
2013-09-27 14:40:18 -05:00
|
|
|
device_state_changed (NMActiveConnection *active,
|
|
|
|
|
NMDevice *device,
|
|
|
|
|
NMDeviceState new_state,
|
|
|
|
|
NMDeviceState old_state)
|
2010-12-13 13:11:51 -06:00
|
|
|
{
|
2014-02-27 09:09:43 -06:00
|
|
|
NMActiveConnectionState cur_ac_state = nm_active_connection_get_state (active);
|
2012-08-22 16:59:11 -05:00
|
|
|
NMActiveConnectionState ac_state = NM_ACTIVE_CONNECTION_STATE_UNKNOWN;
|
2010-12-13 13:11:51 -06:00
|
|
|
|
2014-02-27 09:09:43 -06:00
|
|
|
/* Ignore state changes when this activation request is not yet active, but
|
|
|
|
|
* handle the DISCONNECTED state correctly. The device clears the
|
|
|
|
|
* activation request before sending the state change signal so this
|
|
|
|
|
* must be special-cased to ensure the activation request is deactivated.
|
|
|
|
|
*/
|
|
|
|
|
if (NM_ACTIVE_CONNECTION (nm_device_get_act_request (device)) != active) {
|
|
|
|
|
if (new_state != NM_DEVICE_STATE_DISCONNECTED)
|
|
|
|
|
return;
|
|
|
|
|
if (cur_ac_state < NM_ACTIVE_CONNECTION_STATE_ACTIVATING)
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
/* Catch device disconnections after this request has been active */
|
|
|
|
|
}
|
2014-02-19 13:09:17 -06:00
|
|
|
|
2010-12-13 13:11:51 -06:00
|
|
|
/* Set NMActiveConnection state based on the device's state */
|
2013-09-27 14:40:18 -05:00
|
|
|
switch (new_state) {
|
2010-12-13 13:11:51 -06:00
|
|
|
case NM_DEVICE_STATE_PREPARE:
|
|
|
|
|
case NM_DEVICE_STATE_CONFIG:
|
|
|
|
|
case NM_DEVICE_STATE_NEED_AUTH:
|
|
|
|
|
case NM_DEVICE_STATE_IP_CONFIG:
|
2011-03-17 12:42:38 -05:00
|
|
|
case NM_DEVICE_STATE_IP_CHECK:
|
|
|
|
|
case NM_DEVICE_STATE_SECONDARIES:
|
2012-08-22 16:59:11 -05:00
|
|
|
ac_state = NM_ACTIVE_CONNECTION_STATE_ACTIVATING;
|
2010-12-13 13:11:51 -06:00
|
|
|
break;
|
|
|
|
|
case NM_DEVICE_STATE_ACTIVATED:
|
2012-08-22 16:59:11 -05:00
|
|
|
ac_state = NM_ACTIVE_CONNECTION_STATE_ACTIVATED;
|
2013-12-18 08:46:43 -05:00
|
|
|
|
|
|
|
|
g_signal_connect (device, "notify::" NM_DEVICE_IP4_CONFIG,
|
|
|
|
|
G_CALLBACK (device_notify), active);
|
|
|
|
|
g_signal_connect (device, "notify::" NM_DEVICE_DHCP4_CONFIG,
|
|
|
|
|
G_CALLBACK (device_notify), active);
|
|
|
|
|
g_signal_connect (device, "notify::" NM_DEVICE_IP6_CONFIG,
|
|
|
|
|
G_CALLBACK (device_notify), active);
|
|
|
|
|
g_signal_connect (device, "notify::" NM_DEVICE_DHCP6_CONFIG,
|
|
|
|
|
G_CALLBACK (device_notify), active);
|
2010-12-13 13:11:51 -06:00
|
|
|
break;
|
2011-03-17 14:23:21 -05:00
|
|
|
case NM_DEVICE_STATE_DEACTIVATING:
|
2012-08-22 16:59:11 -05:00
|
|
|
ac_state = NM_ACTIVE_CONNECTION_STATE_DEACTIVATING;
|
|
|
|
|
break;
|
|
|
|
|
case NM_DEVICE_STATE_FAILED:
|
|
|
|
|
case NM_DEVICE_STATE_DISCONNECTED:
|
2013-05-02 14:39:51 -05:00
|
|
|
case NM_DEVICE_STATE_UNMANAGED:
|
|
|
|
|
case NM_DEVICE_STATE_UNAVAILABLE:
|
2012-08-22 16:59:11 -05:00
|
|
|
ac_state = NM_ACTIVE_CONNECTION_STATE_DEACTIVATED;
|
2013-12-18 08:46:43 -05:00
|
|
|
|
|
|
|
|
g_signal_handlers_disconnect_by_func (device, G_CALLBACK (device_notify), active);
|
2011-03-17 14:23:21 -05:00
|
|
|
break;
|
2010-12-13 13:11:51 -06:00
|
|
|
default:
|
2012-08-22 16:59:11 -05:00
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if ( ac_state == NM_ACTIVE_CONNECTION_STATE_DEACTIVATED
|
|
|
|
|
|| ac_state == NM_ACTIVE_CONNECTION_STATE_UNKNOWN) {
|
2013-09-27 14:40:18 -05:00
|
|
|
nm_active_connection_set_default (active, FALSE);
|
|
|
|
|
nm_active_connection_set_default6 (active, FALSE);
|
2010-12-13 13:11:51 -06:00
|
|
|
}
|
|
|
|
|
|
2013-09-27 14:40:18 -05:00
|
|
|
nm_active_connection_set_state (active, ac_state);
|
2010-12-13 13:11:51 -06:00
|
|
|
}
|
|
|
|
|
|
2013-08-28 09:08:43 -05:00
|
|
|
static void
|
|
|
|
|
master_failed (NMActiveConnection *self)
|
|
|
|
|
{
|
|
|
|
|
NMDevice *device;
|
|
|
|
|
NMDeviceState device_state;
|
|
|
|
|
|
|
|
|
|
/* If the connection has an active device, fail it */
|
|
|
|
|
device = nm_active_connection_get_device (self);
|
|
|
|
|
if (device) {
|
|
|
|
|
device_state = nm_device_get_state (device);
|
|
|
|
|
if (nm_device_is_activating (device) || (device_state == NM_DEVICE_STATE_ACTIVATED)) {
|
|
|
|
|
nm_device_state_changed (device,
|
|
|
|
|
NM_DEVICE_STATE_FAILED,
|
|
|
|
|
NM_DEVICE_STATE_REASON_DEPENDENCY_FAILED);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* If no device, or the device wasn't active, just move to deactivated state */
|
|
|
|
|
nm_active_connection_set_state (self, NM_ACTIVE_CONNECTION_STATE_DEACTIVATED);
|
|
|
|
|
}
|
|
|
|
|
|
2010-12-13 13:11:51 -06:00
|
|
|
/********************************************************************/
|
|
|
|
|
|
2012-02-23 10:00:08 -06:00
|
|
|
/**
|
|
|
|
|
* nm_act_request_new:
|
|
|
|
|
*
|
|
|
|
|
* @connection: the connection to activate @device with
|
|
|
|
|
* @specific_object: the object path of the specific object (ie, WiFi access point,
|
|
|
|
|
* etc) that will be used to activate @connection and @device
|
2013-07-29 13:11:47 -05:00
|
|
|
* @subject: the #NMAuthSubject representing the requestor of the activation
|
2013-09-16 17:43:31 -05:00
|
|
|
* @device: the device/interface to configure according to @connection; or %NULL
|
|
|
|
|
* if the connection describes a software device which will be created during
|
|
|
|
|
* connection activation
|
2012-02-23 10:00:08 -06:00
|
|
|
*
|
2013-09-16 17:43:31 -05:00
|
|
|
* Creates a new device-based activation request.
|
2012-02-23 10:00:08 -06:00
|
|
|
*
|
|
|
|
|
* Returns: the new activation request on success, %NULL on error.
|
|
|
|
|
*/
|
2010-12-13 13:11:51 -06:00
|
|
|
NMActRequest *
|
|
|
|
|
nm_act_request_new (NMConnection *connection,
|
|
|
|
|
const char *specific_object,
|
2013-07-29 13:11:47 -05:00
|
|
|
NMAuthSubject *subject,
|
2013-07-29 16:26:09 -05:00
|
|
|
NMDevice *device)
|
2010-12-13 13:11:51 -06:00
|
|
|
{
|
|
|
|
|
g_return_val_if_fail (NM_IS_CONNECTION (connection), NULL);
|
2013-09-16 17:43:31 -05:00
|
|
|
g_return_val_if_fail (!device || NM_IS_DEVICE (device), NULL);
|
2013-07-29 13:11:47 -05:00
|
|
|
g_return_val_if_fail (NM_IS_AUTH_SUBJECT (subject), NULL);
|
|
|
|
|
|
|
|
|
|
return (NMActRequest *) g_object_new (NM_TYPE_ACT_REQUEST,
|
|
|
|
|
NM_ACTIVE_CONNECTION_INT_CONNECTION, connection,
|
|
|
|
|
NM_ACTIVE_CONNECTION_INT_DEVICE, device,
|
|
|
|
|
NM_ACTIVE_CONNECTION_SPECIFIC_OBJECT, specific_object,
|
|
|
|
|
NM_ACTIVE_CONNECTION_INT_SUBJECT, subject,
|
|
|
|
|
NULL);
|
2010-12-13 13:11:51 -06: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
|
|
|
}
|
|
|
|
|
|
2010-12-13 13:11:51 -06:00
|
|
|
static void
|
|
|
|
|
dispose (GObject *object)
|
|
|
|
|
{
|
|
|
|
|
NMActRequestPrivate *priv = NM_ACT_REQUEST_GET_PRIVATE (object);
|
2012-09-17 10:59:03 -05:00
|
|
|
NMConnection *connection;
|
2010-12-13 13:11:51 -06:00
|
|
|
GSList *iter;
|
|
|
|
|
|
|
|
|
|
/* Clear any share rules */
|
2012-08-22 09:38:01 -05:00
|
|
|
if (priv->share_rules) {
|
|
|
|
|
nm_act_request_set_shared (NM_ACT_REQUEST (object), FALSE);
|
|
|
|
|
clear_share_rules (NM_ACT_REQUEST (object));
|
|
|
|
|
}
|
2010-12-13 13:11:51 -06:00
|
|
|
|
2011-01-27 10:41:02 -06:00
|
|
|
/* Kill any in-progress secrets requests */
|
2012-09-17 10:59:03 -05:00
|
|
|
connection = nm_active_connection_get_connection (NM_ACTIVE_CONNECTION (object));
|
|
|
|
|
for (iter = priv->secrets_calls; connection && iter; iter = g_slist_next (iter)) {
|
2011-01-27 10:41:02 -06:00
|
|
|
GetSecretsInfo *info = iter->data;
|
|
|
|
|
|
2012-09-17 10:59:03 -05:00
|
|
|
nm_settings_connection_cancel_secrets (NM_SETTINGS_CONNECTION (connection), info->call_id);
|
2011-01-27 10:41:02 -06:00
|
|
|
g_free (info);
|
2010-12-13 13:11:51 -06:00
|
|
|
}
|
|
|
|
|
g_slist_free (priv->secrets_calls);
|
2012-08-22 09:38:01 -05:00
|
|
|
priv->secrets_calls = NULL;
|
2010-12-13 13:11:51 -06:00
|
|
|
|
|
|
|
|
G_OBJECT_CLASS (nm_act_request_parent_class)->dispose (object);
|
|
|
|
|
}
|
|
|
|
|
|
2013-12-18 08:46:43 -05:00
|
|
|
static void
|
|
|
|
|
get_property (GObject *object, guint prop_id,
|
|
|
|
|
GValue *value, GParamSpec *pspec)
|
|
|
|
|
{
|
|
|
|
|
NMDevice *device;
|
|
|
|
|
|
|
|
|
|
device = nm_active_connection_get_device (NM_ACTIVE_CONNECTION (object));
|
|
|
|
|
if (!device) {
|
|
|
|
|
g_value_set_boxed (value, "/");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
switch (prop_id) {
|
|
|
|
|
case PROP_IP4_CONFIG:
|
|
|
|
|
g_object_get_property (G_OBJECT (device), NM_DEVICE_IP4_CONFIG, value);
|
|
|
|
|
break;
|
|
|
|
|
case PROP_DHCP4_CONFIG:
|
|
|
|
|
g_object_get_property (G_OBJECT (device), NM_DEVICE_DHCP4_CONFIG, value);
|
|
|
|
|
break;
|
|
|
|
|
case PROP_IP6_CONFIG:
|
|
|
|
|
g_object_get_property (G_OBJECT (device), NM_DEVICE_IP6_CONFIG, value);
|
|
|
|
|
break;
|
|
|
|
|
case PROP_DHCP6_CONFIG:
|
|
|
|
|
g_object_get_property (G_OBJECT (device), NM_DEVICE_DHCP6_CONFIG, value);
|
|
|
|
|
break;
|
|
|
|
|
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);
|
2013-08-28 09:08:43 -05:00
|
|
|
NMActiveConnectionClass *active_class = NM_ACTIVE_CONNECTION_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 */
|
2007-09-14 19:43:28 +00:00
|
|
|
object_class->dispose = dispose;
|
2013-12-18 08:46:43 -05:00
|
|
|
object_class->get_property = get_property;
|
2013-08-28 09:08:43 -05:00
|
|
|
active_class->master_failed = master_failed;
|
2013-09-27 14:40:18 -05:00
|
|
|
active_class->device_state_changed = device_state_changed;
|
2013-12-18 08:46:43 -05:00
|
|
|
|
|
|
|
|
/* properties */
|
|
|
|
|
g_object_class_override_property (object_class, PROP_IP4_CONFIG,
|
|
|
|
|
NM_ACTIVE_CONNECTION_IP4_CONFIG);
|
|
|
|
|
g_object_class_override_property (object_class, PROP_DHCP4_CONFIG,
|
|
|
|
|
NM_ACTIVE_CONNECTION_DHCP4_CONFIG);
|
|
|
|
|
g_object_class_override_property (object_class, PROP_IP6_CONFIG,
|
|
|
|
|
NM_ACTIVE_CONNECTION_IP6_CONFIG);
|
|
|
|
|
g_object_class_override_property (object_class, PROP_DHCP6_CONFIG,
|
|
|
|
|
NM_ACTIVE_CONNECTION_DHCP6_CONFIG);
|
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
|
|
|
}
|
|
|
|
|
|