2008-11-03 04:13:42 +00:00
|
|
|
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */
|
2005-12-31 08:21:24 +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-12-31 08:21:24 +00:00
|
|
|
*
|
2013-12-16 15:16:43 +01:00
|
|
|
* Copyright (C) 2005 - 2013 Red Hat, Inc.
|
2008-11-03 04:13:42 +00:00
|
|
|
* Copyright (C) 2006 - 2008 Novell, Inc.
|
2005-12-31 08:21:24 +00:00
|
|
|
*/
|
|
|
|
|
|
all: fix up multiple-include-guard defines
Previously, src/nm-ip4-config.h, libnm/nm-ip4-config.h, and
libnm-glib/nm-ip4-config.h all used "NM_IP4_CONFIG_H" as an include
guard, which meant that nm-test-utils.h could not tell which of them
was being included (and so, eg, if you tried to include
nm-ip4-config.h in a libnm test, it would fail to compile because
nm-test-utils.h was referring to symbols in src/nm-ip4-config.h).
Fix this by changing the include guards in the non-API-stable parts of
the tree:
- libnm-glib/nm-ip4-config.h remains NM_IP4_CONFIG_H
- libnm/nm-ip4-config.h now uses __NM_IP4_CONFIG_H__
- src/nm-ip4-config.h now uses __NETWORKMANAGER_IP4_CONFIG_H__
And likewise for all other headers.
The two non-"nm"-prefixed headers, libnm/NetworkManager.h and
src/NetworkManagerUtils.h are now __NETWORKMANAGER_H__ and
__NETWORKMANAGER_UTILS_H__ respectively, which, while not entirely
consistent with the general scheme, do still mostly make sense in
isolation.
2014-08-13 14:10:11 -04:00
|
|
|
#ifndef __NETWORKMANAGER_DEVICE_H__
|
|
|
|
|
#define __NETWORKMANAGER_DEVICE_H__
|
2005-12-31 08:21:24 +00:00
|
|
|
|
|
|
|
|
#include <netinet/in.h>
|
|
|
|
|
|
2015-04-13 13:31:42 -04:00
|
|
|
#include "nm-exported-object.h"
|
2014-07-05 16:23:30 -04:00
|
|
|
#include "nm-dbus-interface.h"
|
2015-07-17 14:38:54 +02:00
|
|
|
#include "nm-default.h"
|
2007-05-07 15:17:45 +00:00
|
|
|
#include "nm-connection.h"
|
2013-05-09 10:24:08 -04:00
|
|
|
#include "nm-rfkill-manager.h"
|
2014-04-10 15:29:45 -05:00
|
|
|
#include "NetworkManagerUtils.h"
|
2005-12-31 08:21:24 +00:00
|
|
|
|
2011-11-18 00:34:08 -06:00
|
|
|
/* Properties */
|
|
|
|
|
#define NM_DEVICE_UDI "udi"
|
|
|
|
|
#define NM_DEVICE_IFACE "interface"
|
|
|
|
|
#define NM_DEVICE_IP_IFACE "ip-interface"
|
|
|
|
|
#define NM_DEVICE_DRIVER "driver"
|
2012-06-01 16:48:57 +02:00
|
|
|
#define NM_DEVICE_DRIVER_VERSION "driver-version"
|
|
|
|
|
#define NM_DEVICE_FIRMWARE_VERSION "firmware-version"
|
2011-11-18 00:34:08 -06:00
|
|
|
#define NM_DEVICE_CAPABILITIES "capabilities"
|
2013-05-07 10:23:44 -04:00
|
|
|
#define NM_DEVICE_CARRIER "carrier"
|
2011-11-18 00:34:08 -06:00
|
|
|
#define NM_DEVICE_IP4_ADDRESS "ip4-address"
|
|
|
|
|
#define NM_DEVICE_IP4_CONFIG "ip4-config"
|
|
|
|
|
#define NM_DEVICE_DHCP4_CONFIG "dhcp4-config"
|
|
|
|
|
#define NM_DEVICE_IP6_CONFIG "ip6-config"
|
|
|
|
|
#define NM_DEVICE_DHCP6_CONFIG "dhcp6-config"
|
|
|
|
|
#define NM_DEVICE_STATE "state"
|
2012-01-29 22:40:37 +01:00
|
|
|
#define NM_DEVICE_STATE_REASON "state-reason"
|
2011-11-18 00:34:08 -06:00
|
|
|
#define NM_DEVICE_ACTIVE_CONNECTION "active-connection"
|
|
|
|
|
#define NM_DEVICE_DEVICE_TYPE "device-type" /* ugh */
|
2015-12-08 14:49:50 +01:00
|
|
|
#define NM_DEVICE_LINK_TYPE "link-type"
|
2011-11-18 00:34:08 -06:00
|
|
|
#define NM_DEVICE_MANAGED "managed"
|
2012-05-14 15:32:54 +02:00
|
|
|
#define NM_DEVICE_AUTOCONNECT "autoconnect"
|
2011-11-18 00:34:08 -06:00
|
|
|
#define NM_DEVICE_FIRMWARE_MISSING "firmware-missing"
|
2015-04-14 14:16:04 +02:00
|
|
|
#define NM_DEVICE_NM_PLUGIN_MISSING "nm-plugin-missing"
|
2013-05-01 09:28:16 -04:00
|
|
|
#define NM_DEVICE_AVAILABLE_CONNECTIONS "available-connections"
|
2013-10-11 14:59:26 -04:00
|
|
|
#define NM_DEVICE_PHYSICAL_PORT_ID "physical-port-id"
|
2013-12-16 15:16:43 +01:00
|
|
|
#define NM_DEVICE_MTU "mtu"
|
2014-07-14 17:59:45 -05:00
|
|
|
#define NM_DEVICE_HW_ADDRESS "hw-address"
|
2015-04-29 16:34:38 +02:00
|
|
|
#define NM_DEVICE_METERED "metered"
|
2015-10-07 11:48:38 +02:00
|
|
|
#define NM_DEVICE_LLDP_NEIGHBORS "lldp-neighbors"
|
2014-09-05 08:50:02 -05:00
|
|
|
#define NM_DEVICE_REAL "real"
|
2014-07-14 17:59:45 -05:00
|
|
|
|
2015-12-02 10:33:19 +01:00
|
|
|
/* the "slaves" property is internal in the parent class, but exposed
|
|
|
|
|
* by the derived classes NMDeviceBond, NMDeviceBridge and NMDeviceTeam.
|
|
|
|
|
* It is thus important that the property name matches. */
|
|
|
|
|
#define NM_DEVICE_SLAVES "slaves" /* partially internal */
|
|
|
|
|
|
2014-07-14 17:59:45 -05:00
|
|
|
#define NM_DEVICE_TYPE_DESC "type-desc" /* Internal only */
|
|
|
|
|
#define NM_DEVICE_RFKILL_TYPE "rfkill-type" /* Internal only */
|
|
|
|
|
#define NM_DEVICE_IFINDEX "ifindex" /* Internal only */
|
|
|
|
|
#define NM_DEVICE_IS_MASTER "is-master" /* Internal only */
|
|
|
|
|
#define NM_DEVICE_MASTER "master" /* Internal only */
|
2013-08-13 17:45:34 -04:00
|
|
|
#define NM_DEVICE_HAS_PENDING_ACTION "has-pending-action" /* Internal only */
|
2011-11-18 00:34:08 -06:00
|
|
|
|
2012-05-29 09:56:50 -05:00
|
|
|
/* Internal signals */
|
2014-02-24 18:10:18 -06:00
|
|
|
#define NM_DEVICE_AUTH_REQUEST "auth-request"
|
|
|
|
|
#define NM_DEVICE_IP4_CONFIG_CHANGED "ip4-config-changed"
|
|
|
|
|
#define NM_DEVICE_IP6_CONFIG_CHANGED "ip6-config-changed"
|
|
|
|
|
#define NM_DEVICE_REMOVED "removed"
|
|
|
|
|
#define NM_DEVICE_RECHECK_AUTO_ACTIVATE "recheck-auto-activate"
|
2014-05-28 10:18:34 -04:00
|
|
|
#define NM_DEVICE_RECHECK_ASSUME "recheck-assume"
|
2015-12-07 19:42:59 +01:00
|
|
|
#define NM_DEVICE_STATE_CHANGED "state-changed"
|
2015-09-03 16:51:39 +02:00
|
|
|
#define NM_DEVICE_LINK_INITIALIZED "link-initialized"
|
2011-11-18 00:34:08 -06:00
|
|
|
|
2005-12-31 08:21:24 +00:00
|
|
|
G_BEGIN_DECLS
|
|
|
|
|
|
|
|
|
|
#define NM_TYPE_DEVICE (nm_device_get_type ())
|
|
|
|
|
#define NM_DEVICE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_DEVICE, NMDevice))
|
|
|
|
|
#define NM_DEVICE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NM_TYPE_DEVICE, NMDeviceClass))
|
|
|
|
|
#define NM_IS_DEVICE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NM_TYPE_DEVICE))
|
|
|
|
|
#define NM_IS_DEVICE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), NM_TYPE_DEVICE))
|
|
|
|
|
#define NM_DEVICE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NM_TYPE_DEVICE, NMDeviceClass))
|
|
|
|
|
|
2011-11-17 22:39:34 -06:00
|
|
|
typedef enum NMActStageReturn NMActStageReturn;
|
|
|
|
|
|
2015-01-16 14:54:11 +01:00
|
|
|
/* These flags affect whether a connection is considered available on a device
|
|
|
|
|
* (check_connection_available()). The flags should have the meaning of relaxing
|
|
|
|
|
* a condition, so that adding a flag might make a connection available that would
|
|
|
|
|
* not be available otherwise. Adding a flag should never make a connection
|
|
|
|
|
* not available if it would be available otherwise. */
|
2015-02-24 18:01:22 +01:00
|
|
|
typedef enum { /*< skip >*/
|
2015-01-16 14:54:11 +01:00
|
|
|
NM_DEVICE_CHECK_CON_AVAILABLE_NONE = 0,
|
2015-01-20 21:06:31 +01:00
|
|
|
|
2014-12-08 12:50:10 +01:00
|
|
|
_NM_DEVICE_CHECK_CON_AVAILABLE_FOR_USER_REQUEST_WAITING_CARRIER = (1L << 0),
|
|
|
|
|
_NM_DEVICE_CHECK_CON_AVAILABLE_FOR_USER_REQUEST_IGNORE_AP = (1L << 1),
|
|
|
|
|
NM_DEVICE_CHECK_CON_AVAILABLE_FOR_USER_REQUEST = _NM_DEVICE_CHECK_CON_AVAILABLE_FOR_USER_REQUEST_WAITING_CARRIER
|
|
|
|
|
| _NM_DEVICE_CHECK_CON_AVAILABLE_FOR_USER_REQUEST_IGNORE_AP,
|
2015-01-16 14:54:11 +01:00
|
|
|
|
2015-12-09 12:02:16 +01:00
|
|
|
NM_DEVICE_CHECK_CON_AVAILABLE_ALL = (1L << 2) - 1,
|
2015-01-16 14:54:11 +01:00
|
|
|
} NMDeviceCheckConAvailableFlags;
|
|
|
|
|
|
2015-12-07 17:05:12 +01:00
|
|
|
struct _NMDevicePrivate;
|
|
|
|
|
|
2012-08-30 09:45:32 -05:00
|
|
|
struct _NMDevice {
|
2015-04-13 13:31:42 -04:00
|
|
|
NMExportedObject parent;
|
2015-12-07 17:05:12 +01:00
|
|
|
|
|
|
|
|
/* private */
|
|
|
|
|
struct _NMDevicePrivate *priv;
|
2012-08-30 09:45:32 -05:00
|
|
|
};
|
2005-12-31 08:21:24 +00:00
|
|
|
|
2015-01-20 20:25:25 +01:00
|
|
|
/* The flags have an relaxing meaning, that means, specifying more flags, can make
|
|
|
|
|
* a device appear more available. It can never make a device less available. */
|
2015-02-24 18:01:22 +01:00
|
|
|
typedef enum { /*< skip >*/
|
2015-01-20 20:25:25 +01:00
|
|
|
NM_DEVICE_CHECK_DEV_AVAILABLE_NONE = 0,
|
|
|
|
|
|
2015-12-09 12:08:40 +01:00
|
|
|
_NM_DEVICE_CHECK_DEV_AVAILABLE_IGNORE_CARRIER = (1L << 0),
|
|
|
|
|
NM_DEVICE_CHECK_DEV_AVAILABLE_FOR_USER_REQUEST = _NM_DEVICE_CHECK_DEV_AVAILABLE_IGNORE_CARRIER,
|
|
|
|
|
|
|
|
|
|
NM_DEVICE_CHECK_DEV_AVAILABLE_ALL = (1L << 1) - 1,
|
2015-01-20 20:25:25 +01:00
|
|
|
} NMDeviceCheckDevAvailableFlags;
|
|
|
|
|
|
2009-07-07 14:34:01 -04:00
|
|
|
typedef struct {
|
2015-04-13 13:31:42 -04:00
|
|
|
NMExportedObjectClass parent;
|
2005-12-31 08:21:24 +00:00
|
|
|
|
2013-06-27 14:39:13 +02:00
|
|
|
const char *connection_type;
|
2014-10-09 12:42:29 -05:00
|
|
|
const NMLinkType *link_types;
|
2013-06-27 14:39:13 +02:00
|
|
|
|
2011-11-18 00:09:37 -06:00
|
|
|
void (*state_changed) (NMDevice *device,
|
|
|
|
|
NMDeviceState new_state,
|
|
|
|
|
NMDeviceState old_state,
|
|
|
|
|
NMDeviceStateReason reason);
|
|
|
|
|
|
2013-07-27 10:41:44 +02:00
|
|
|
void (* link_changed) (NMDevice *self, NMPlatformLink *info);
|
|
|
|
|
|
2014-09-05 08:50:02 -05:00
|
|
|
/**
|
|
|
|
|
* create_and_realize():
|
|
|
|
|
* @self: the #NMDevice
|
|
|
|
|
* @connection: the #NMConnection being activated
|
|
|
|
|
* @parent: the parent #NMDevice, if any
|
2015-12-09 15:13:57 +01:00
|
|
|
* @out_plink: on success, a backing kernel network device if one exists.
|
|
|
|
|
* The returned pointer is owned by platform and only valid until the
|
|
|
|
|
* next platform operation.
|
2014-09-05 08:50:02 -05:00
|
|
|
* @error: location to store error, or %NULL
|
|
|
|
|
*
|
|
|
|
|
* Create any backing resources (kernel devices, etc) required for this
|
|
|
|
|
* device to activate @connection. If the device is backed by a kernel
|
|
|
|
|
* network device, that device should be returned in @out_plink after
|
|
|
|
|
* being created.
|
|
|
|
|
*
|
|
|
|
|
* Returns: %TRUE on success, %FALSE on error
|
|
|
|
|
*/
|
|
|
|
|
gboolean (*create_and_realize) (NMDevice *self,
|
|
|
|
|
NMConnection *connection,
|
|
|
|
|
NMDevice *parent,
|
2015-12-09 15:13:57 +01:00
|
|
|
const NMPlatformLink **out_plink,
|
2014-09-05 08:50:02 -05:00
|
|
|
GError **error);
|
|
|
|
|
|
|
|
|
|
/**
|
2016-01-08 17:24:24 +01:00
|
|
|
* realize_start_notify():
|
2014-09-05 08:50:02 -05:00
|
|
|
* @self: the #NMDevice
|
|
|
|
|
* @plink: the #NMPlatformLink if backed by a kernel netdevice
|
|
|
|
|
*
|
2016-01-08 17:24:24 +01:00
|
|
|
* Hook for derived classes to be notfied during realize_start_setup()
|
|
|
|
|
* and perform additional setup.
|
2014-09-05 08:50:02 -05:00
|
|
|
*/
|
2016-01-08 17:24:24 +01:00
|
|
|
void (*realize_start_notify) (NMDevice *self, const NMPlatformLink *plink);
|
2014-09-24 16:58:07 -05:00
|
|
|
|
2014-09-24 15:13:19 -05:00
|
|
|
/**
|
2016-01-10 15:18:31 +01:00
|
|
|
* unrealize_notify():
|
2014-09-24 15:13:19 -05:00
|
|
|
* @self: the #NMDevice
|
|
|
|
|
* @remove_resources: if %TRUE remove backing resources
|
|
|
|
|
* @error: location to store error, or %NULL
|
|
|
|
|
*
|
|
|
|
|
* Clears any properties that depend on backing resources (kernel devices,
|
|
|
|
|
* etc) and removes those resources if @remove_resources is %TRUE.
|
|
|
|
|
*/
|
2016-01-10 15:18:31 +01:00
|
|
|
void (*unrealize_notify) (NMDevice *self, gboolean remove_resources);
|
2014-09-24 15:13:19 -05:00
|
|
|
|
2013-05-07 10:23:44 -04:00
|
|
|
/* Hardware state (IFF_UP) */
|
2015-04-07 14:24:12 +02:00
|
|
|
gboolean (*can_unmanaged_external_down) (NMDevice *self);
|
|
|
|
|
gboolean (*is_up) (NMDevice *self);
|
|
|
|
|
gboolean (*bring_up) (NMDevice *self, gboolean *no_firmware);
|
|
|
|
|
gboolean (*take_down) (NMDevice *self);
|
2008-04-28 Dan Williams <dcbw@redhat.com>
Fix the device up/down ambiguities. Up/down state used to be a
conglomeration of hardware state (IFF_UP) and any device-specific things
(supplicant, periodic timers, etc) that the device used to indicate
readiness. Unfortunately, if the hardware was already IFF_UP for some
reason, then the device specific stuff wouldn't get run, and the device
would be stuck.
* src/nm-device.c
src/nm-device.h
- Create hw_is_up, hw_bring_up, and hw_take_down
- Rename bring_down -> take_down
- (real_hw_is_up): check interface flags for IFF_UP
- (nm_device_hw_is_up): let subclasses figure out their own HW state
- (nm_device_is_up): make static; only used locally
- (nm_device_hw_bring_up): update the hardware and IPv4 addresses even
if the device is already up; if the device isn't up, bring it up
- (nm_device_hw_take_down): just take down hardware
- (nm_device_bring_up): bring up HW first, then device specific stuff
- (nm_device_take_down): always deactivate device when called; always
try to take hardware down too
- (nm_device_state_changed): take device down when entering unmanaged
state from a higher state
* src/nm-device-802-11-wireless.c
- (real_hw_is_up, real_hw_bring_up, real_hw_take_down): implement; just
check IFF_UP really
- (real_take_down, supplicant_iface_state_cb_handler,
supplicant_iface_connection_state_cb_handler,
supplicant_mgr_state_cb_handler): fix some messages
* src/nm-device-802-3-ethernet.c
- (real_hw_is_up, real_hw_bring_up, real_hw_take_down): implement; just
check IFF_UP really
git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@3618 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2008-04-29 15:36:29 +00:00
|
|
|
|
2013-05-07 10:23:44 -04:00
|
|
|
/* Carrier state (IFF_LOWER_UP) */
|
|
|
|
|
void (*carrier_changed) (NMDevice *, gboolean carrier);
|
|
|
|
|
|
2014-04-10 15:29:45 -05:00
|
|
|
gboolean (* get_ip_iface_identifier) (NMDevice *self, NMUtilsIPv6IfaceId *out_iid);
|
|
|
|
|
|
2015-04-17 15:15:38 +02:00
|
|
|
NMDeviceCapabilities (* get_generic_capabilities) (NMDevice *self);
|
2005-12-31 08:21:24 +00:00
|
|
|
|
2015-01-20 20:25:25 +01:00
|
|
|
gboolean (* is_available) (NMDevice *self, NMDeviceCheckDevAvailableFlags flags);
|
2008-03-07 Dan Williams <dcbw@redhat.com>
First pass of multiple active device support. Expect bugs.
* src/nm-ip4-config.c
src/nm-ip4-config.h
- (nm_ip4_config_get_secondary, nm_ip4_config_set_secondary): remove;
there are better ways to do this in the named manager
* src/nm-device.c
src/nm-device.h
- (nm_device_can_activate): return whether the device can activate a
connection right now; taking into account things like carrier state
and rfkill state
- (nm_device_get_best_auto_connection): renamed from
nm_device_get_best_connection
- (real_act_stage4_get_ip4_config): MTU stuff is now handled in the
device subclasses themselves, so that each device can override the
MTU from it's NMSetting subclass if needed
- (nm_device_set_ip4_config): set MTU when setting up routes and stuff
in NetworkManagerSystem.c, not here
* src/named-manager/nm-named-manager.c
src/named-manager/nm-named-manager.h
- (nm_named_manager_name_owner_changed,
nm_named_manager_dbus_connection_changed): fix for changes to
rewrite_resolv_conf()
- (compute_nameservers): don't need the NMNamedManager at all, remove
from parameter list
- (merge_one_ip4_config): new function; merge ip4 configs together
- (rewrite_resolv_conf): write out resolv.conf from all the stored
ip4 configs; the VPN config takes precedence, then the best
device config, then the rest of the configs
- (get_domain_for_config): take the NMNamedManager as an argument
to check whether the config is the VPN config
- (add_ip4_config_to_named): fixups for removal of the 'secondary'
attribute from ip4 configs
- (add_all_ip4_configs_to_named): add all the configs in priority order
- (remove_ip4_config_from_named): fix for changes to
get_domain_for_config()
- (nm_named_manager_add_ip4_config): assign the config to the right slot
based on its type; callers must pass in the type now
- (get_last_default_domain): remove, unused
- (nm_named_manager_remove_ip4_config): handle config slots correctly
* src/nm-device-802-11-wireless.c
- (real_can_activate): new function
- (real_get_best_auto_connection): renamed from real_get_best_connection
- (real_act_stage4_get_ip4_config): handle MTU override
* src/nm-device-802-3-ethernet.c
- (real_can_activate): new function
- (real_get_best_auto_connection): renamed from real_get_best_connection
- (real_act_stage4_get_ip4_config): new function; handle MTU override
* src/vpn-manager/nm-vpn-connection.c
- (nm_vpn_connection_ip4_config_get): don't need to set the 'secondary'
attribute on the ip4 config
* src/NetworkManagerPolicy.c
- (nm_policy_auto_get_best_device): remove
- (nm_policy_device_change_check): remove
- (update_default_route): new function; set the default route via
the specified device
- (get_device_priority): new function; return the priority number of
a device type WRT which one should have the default route. Order is
(highest to lowest) wired, wireless, GSM, CDMA.
- (update_routing_and_dns): new function; determine which device should
have the default route, then update the routing table and DNS
- (maybe_auto_activate_device): new function; if a device is now
available for activation, find out what connection it would like to
activate and do it
- (schedule_activate_check): new function; if a device can be activated
now, schedule the activation. Each device may have only one
pending activation at a given time.
- (device_state_changed): if activation was canceled, try again,
possibly with another connection; if the device was activated,
update routing and DNS; if the device was deactivated, try again
with another connection
- (device_carrier_changed): if there is no carrier, deactivate the
device; otherwise schedule an activation check for the device
- (wireless_networks_changed): schedule an activation check for the
device
- (device_added): keep track of the signal handler IDs so they can
be removed when the device goes away
- (device_removed): remove any signal handlers that might be attached
to the device; update routing and DNS
- (schedule_activate_all): new function
- (connections_added, connection_added, connection_updated): when
connections change, schedule all devices for an activation check
- (connection_removed): when a device is deactivated because its
connection was removed, schedule another activation check for it
- (nm_policy_destroy): destroy pending activations and disconnect
all device signal handlers
* src/nm-manager.c
- (nm_manager_activate_device): if the device was already actived,
deactivate it
- (deactivate_old_device): remove
- (connection_added_default_handler, impl_manager_activate_device):
don't deactivate other devices when activating this one
* src/backends/NetworkManagerGentoo.c
src/backends/NetworkManagerFrugalware.c
src/backends/NetworkManagerPaldo.c
src/backends/NetworkManagerRedHat.c
src/backends/NetworkManagerSlackware.c
src/backends/NetworkManagerArch.c
src/backends/NetworkManagerSuSE.c
src/backends/NetworkManagerDebian.c
- (nm_system_get_mtu): remove; MTU should be provided through the
distro's system settings service plugin instead
- (nm_system_device_add_default_route_via_device): remove
- (nm_system_device_add_default_route_via_device_with_iface): remove
- (nm_system_device_replace_default_route): new function; call
generic implementation
* src/backends/NetworkManagerGeneric.c
src/backends/NetworkManagerGeneric.h
- (nm_generic_device_add_default_route_via_device,
nm_generic_device_add_default_route_via_device_with_iface): remove
- (nm_generic_device_replace_default_route): replace the default route
with the given route via some gateway
* src/NetworkManagerSystem.c
src/NetworkManagerSystem.h
- (nm_system_device_set_from_ip4_config): let the policy handle updates
to routing and DNS; but set the MTU here
- (nm_system_vpn_device_set_from_ip4_config): set the route with the
ip_iface of the active device; use the standard MTU setting function
- (nm_system_set_mtu): remove
- (nm_system_device_set_mtu): consolidate MTU setting code in one place
git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@3391 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2008-03-07 19:41:32 +00:00
|
|
|
|
2011-11-17 23:28:30 -06:00
|
|
|
gboolean (* get_enabled) (NMDevice *self);
|
|
|
|
|
|
2011-11-17 23:38:08 -06:00
|
|
|
void (* set_enabled) (NMDevice *self, gboolean enabled);
|
|
|
|
|
|
2013-03-06 16:16:54 -05:00
|
|
|
gboolean (* can_auto_connect) (NMDevice *self,
|
|
|
|
|
NMConnection *connection,
|
|
|
|
|
char **specific_object);
|
2007-09-09 17:58:44 +00:00
|
|
|
|
2012-08-01 11:16:48 -06:00
|
|
|
/* Checks whether the connection is compatible with the device using
|
|
|
|
|
* only the devices type and characteristics. Does not use any live
|
wimax: drop WiMAX support (bgo #747846)
Even Fedora is no longer shipping the WiMAX SDK, so it's likely we'll
eventually accidentally break some of the code in src/devices/wimax/
(if we haven't already). Discussion on the list showed a consensus for
dropping support for WiMAX.
So, remove the SDK checks from configure.ac, remove the WiMAX device
plugin and associated manager support, and deprecate all the APIs.
For compatibility reasons, it is still possible to create and save
WiMAX connections, to toggle the software WiMAX rfkill state, and to
change the "WIMAX" log level, although none of these have any effect,
since no NMDeviceWimax will ever be created.
nmcli was only compiling in support for most WiMAX operations when NM
as a whole was built with WiMAX support, so that code has been removed
now as well. (It is still possible to use nmcli to create and edit
WiMAX connections, but those connections will never be activatable.)
2015-04-13 17:07:00 -04:00
|
|
|
* network information like WiFi scan lists etc.
|
2012-08-01 11:16:48 -06:00
|
|
|
*/
|
2014-05-30 13:44:53 -05:00
|
|
|
gboolean (* check_connection_compatible) (NMDevice *self, NMConnection *connection);
|
2007-12-31 17:05:25 +00:00
|
|
|
|
2012-08-01 11:16:48 -06:00
|
|
|
/* Checks whether the connection is likely available to be activated,
|
2013-09-03 15:34:56 -05:00
|
|
|
* including any live network information like scan lists. The connection
|
|
|
|
|
* is checked against the object defined by @specific_object, if given.
|
|
|
|
|
* Returns TRUE if the connection is available; FALSE if not.
|
2014-12-08 12:39:45 +01:00
|
|
|
*
|
2015-01-16 14:54:11 +01:00
|
|
|
* The passed @flags affect whether a connection is considered
|
|
|
|
|
* available or not. Adding more flags, means the connection is
|
|
|
|
|
* *more* available.
|
|
|
|
|
*
|
|
|
|
|
* Specifying @specific_object can only reduce the availability of a connection.
|
2012-08-01 11:16:48 -06:00
|
|
|
*/
|
|
|
|
|
gboolean (* check_connection_available) (NMDevice *self,
|
2013-09-03 15:34:56 -05:00
|
|
|
NMConnection *connection,
|
2015-01-16 14:54:11 +01:00
|
|
|
NMDeviceCheckConAvailableFlags flags,
|
2013-09-03 15:34:56 -05:00
|
|
|
const char *specific_object);
|
2012-08-01 11:16:48 -06:00
|
|
|
|
2011-01-10 23:39:12 -06:00
|
|
|
gboolean (* complete_connection) (NMDevice *self,
|
|
|
|
|
NMConnection *connection,
|
|
|
|
|
const char *specific_object,
|
|
|
|
|
const GSList *existing_connections,
|
|
|
|
|
GError **error);
|
|
|
|
|
|
2008-07-11 10:28:53 +00:00
|
|
|
NMActStageReturn (* act_stage1_prepare) (NMDevice *self,
|
|
|
|
|
NMDeviceStateReason *reason);
|
|
|
|
|
NMActStageReturn (* act_stage2_config) (NMDevice *self,
|
|
|
|
|
NMDeviceStateReason *reason);
|
2009-07-29 12:12:41 -04:00
|
|
|
NMActStageReturn (* act_stage3_ip4_config_start) (NMDevice *self,
|
2011-10-09 22:50:04 -05:00
|
|
|
NMIP4Config **out_config,
|
2009-07-29 12:12:41 -04:00
|
|
|
NMDeviceStateReason *reason);
|
|
|
|
|
NMActStageReturn (* act_stage3_ip6_config_start) (NMDevice *self,
|
2011-10-09 22:50:04 -05:00
|
|
|
NMIP6Config **out_config,
|
2009-07-29 12:12:41 -04:00
|
|
|
NMDeviceStateReason *reason);
|
|
|
|
|
NMActStageReturn (* act_stage4_ip4_config_timeout) (NMDevice *self,
|
2008-07-11 10:28:53 +00:00
|
|
|
NMDeviceStateReason *reason);
|
2009-07-29 12:12:41 -04:00
|
|
|
NMActStageReturn (* act_stage4_ip6_config_timeout) (NMDevice *self,
|
|
|
|
|
NMDeviceStateReason *reason);
|
2011-10-09 22:50:04 -05:00
|
|
|
|
|
|
|
|
/* Called right before IP config is set; use for setting MTU etc */
|
|
|
|
|
void (* ip4_config_pre_commit) (NMDevice *self, NMIP4Config *config);
|
2014-08-13 14:24:45 -05:00
|
|
|
void (* ip6_config_pre_commit) (NMDevice *self, NMIP6Config *config);
|
2011-10-09 22:50:04 -05:00
|
|
|
|
2014-08-05 20:08:34 +02:00
|
|
|
/* Async deactivating (in the DEACTIVATING phase) */
|
|
|
|
|
void (* deactivate_async) (NMDevice *self,
|
|
|
|
|
GCancellable *cancellable,
|
|
|
|
|
GAsyncReadyCallback callback,
|
|
|
|
|
gpointer user_data);
|
|
|
|
|
gboolean (* deactivate_async_finish) (NMDevice *self,
|
|
|
|
|
GAsyncResult *res,
|
|
|
|
|
GError **error);
|
|
|
|
|
|
|
|
|
|
/* Sync deactivating (in the DISCONNECTED phase) */
|
2005-12-31 08:21:24 +00:00
|
|
|
void (* deactivate) (NMDevice *self);
|
2006-01-03 22:11:35 +00:00
|
|
|
|
2015-05-15 15:00:07 +02:00
|
|
|
const char *(*get_type_description) (NMDevice *self);
|
|
|
|
|
|
2015-01-23 17:02:16 +01:00
|
|
|
NMMatchSpecMatchType (* spec_match_list) (NMDevice *self, const GSList *specs);
|
2009-08-03 17:15:03 -04:00
|
|
|
|
2013-11-02 10:40:58 -05:00
|
|
|
/* Update the connection with currently configured L2 settings */
|
2013-06-27 14:39:13 +02:00
|
|
|
void (* update_connection) (NMDevice *device, NMConnection *connection);
|
2012-02-12 13:54:09 -06:00
|
|
|
|
2014-06-18 20:17:57 +02:00
|
|
|
gboolean (*master_update_slave_connection) (NMDevice *self,
|
|
|
|
|
NMDevice *slave,
|
|
|
|
|
NMConnection *connection,
|
|
|
|
|
GError **error);
|
|
|
|
|
|
2012-02-28 18:35:30 -06:00
|
|
|
gboolean (* enslave_slave) (NMDevice *self,
|
2012-11-04 17:51:34 -06:00
|
|
|
NMDevice *slave,
|
2013-11-07 01:08:02 -06:00
|
|
|
NMConnection *connection,
|
|
|
|
|
gboolean configure);
|
2012-02-28 18:35:30 -06:00
|
|
|
|
2015-12-02 09:56:17 +01:00
|
|
|
void (* release_slave) (NMDevice *self,
|
2014-02-25 16:44:01 -05:00
|
|
|
NMDevice *slave,
|
|
|
|
|
gboolean configure);
|
2013-01-25 11:59:05 -06:00
|
|
|
|
|
|
|
|
gboolean (* have_any_ready_slaves) (NMDevice *self,
|
|
|
|
|
const GSList *slaves);
|
2014-02-09 10:22:19 -06:00
|
|
|
|
2015-11-24 16:43:18 +01:00
|
|
|
void (* notify_new_device_added) (NMDevice *self, NMDevice *new_device);
|
|
|
|
|
|
2015-04-13 11:43:12 -05:00
|
|
|
/**
|
|
|
|
|
* component_added:
|
|
|
|
|
* @self: the #NMDevice
|
|
|
|
|
* @component: the component (device, modem, etc) which was added
|
|
|
|
|
*
|
|
|
|
|
* Notifies @self that a new component was added to the Manager. This
|
|
|
|
|
* may include any kind of %GObject subclass, and the device is expected
|
|
|
|
|
* to match only specific components they care about, like %NMModem objects
|
|
|
|
|
* or %NMDevice objects.
|
|
|
|
|
*
|
|
|
|
|
* Returns: %TRUE if the component was claimed exclusively and no further
|
|
|
|
|
* devices should be notified of the new component. %FALSE to indicate
|
|
|
|
|
* that the component was not exclusively claimed and other devices should
|
|
|
|
|
* be notified.
|
|
|
|
|
*/
|
2014-02-09 10:22:19 -06:00
|
|
|
gboolean (* component_added) (NMDevice *self, GObject *component);
|
|
|
|
|
|
|
|
|
|
gboolean (* owns_iface) (NMDevice *self, const char *iface);
|
2014-09-08 16:11:51 -05:00
|
|
|
|
|
|
|
|
NMConnection * (* new_default_connection) (NMDevice *self);
|
2009-07-07 14:34:01 -04:00
|
|
|
} NMDeviceClass;
|
2005-12-31 08:21:24 +00:00
|
|
|
|
2012-06-01 15:27:39 -05:00
|
|
|
typedef void (*NMDeviceAuthRequestFunc) (NMDevice *device,
|
2015-04-15 14:53:30 -04:00
|
|
|
GDBusMethodInvocation *context,
|
2015-07-14 10:19:19 +02:00
|
|
|
NMAuthSubject *subject,
|
2012-06-01 15:27:39 -05:00
|
|
|
GError *error,
|
|
|
|
|
gpointer user_data);
|
|
|
|
|
|
2005-12-31 08:21:24 +00:00
|
|
|
GType nm_device_get_type (void);
|
|
|
|
|
|
2014-12-05 13:12:55 +01:00
|
|
|
void nm_device_finish_init (NMDevice *device);
|
|
|
|
|
|
2005-12-31 08:21:24 +00:00
|
|
|
const char * nm_device_get_udi (NMDevice *dev);
|
|
|
|
|
const char * nm_device_get_iface (NMDevice *dev);
|
2010-04-21 14:58:25 -07:00
|
|
|
int nm_device_get_ifindex (NMDevice *dev);
|
2013-08-22 19:15:05 +02:00
|
|
|
gboolean nm_device_is_software (NMDevice *dev);
|
2014-09-05 08:50:02 -05:00
|
|
|
gboolean nm_device_is_real (NMDevice *dev);
|
2008-03-07 Dan Williams <dcbw@redhat.com>
First pass of multiple active device support. Expect bugs.
* src/nm-ip4-config.c
src/nm-ip4-config.h
- (nm_ip4_config_get_secondary, nm_ip4_config_set_secondary): remove;
there are better ways to do this in the named manager
* src/nm-device.c
src/nm-device.h
- (nm_device_can_activate): return whether the device can activate a
connection right now; taking into account things like carrier state
and rfkill state
- (nm_device_get_best_auto_connection): renamed from
nm_device_get_best_connection
- (real_act_stage4_get_ip4_config): MTU stuff is now handled in the
device subclasses themselves, so that each device can override the
MTU from it's NMSetting subclass if needed
- (nm_device_set_ip4_config): set MTU when setting up routes and stuff
in NetworkManagerSystem.c, not here
* src/named-manager/nm-named-manager.c
src/named-manager/nm-named-manager.h
- (nm_named_manager_name_owner_changed,
nm_named_manager_dbus_connection_changed): fix for changes to
rewrite_resolv_conf()
- (compute_nameservers): don't need the NMNamedManager at all, remove
from parameter list
- (merge_one_ip4_config): new function; merge ip4 configs together
- (rewrite_resolv_conf): write out resolv.conf from all the stored
ip4 configs; the VPN config takes precedence, then the best
device config, then the rest of the configs
- (get_domain_for_config): take the NMNamedManager as an argument
to check whether the config is the VPN config
- (add_ip4_config_to_named): fixups for removal of the 'secondary'
attribute from ip4 configs
- (add_all_ip4_configs_to_named): add all the configs in priority order
- (remove_ip4_config_from_named): fix for changes to
get_domain_for_config()
- (nm_named_manager_add_ip4_config): assign the config to the right slot
based on its type; callers must pass in the type now
- (get_last_default_domain): remove, unused
- (nm_named_manager_remove_ip4_config): handle config slots correctly
* src/nm-device-802-11-wireless.c
- (real_can_activate): new function
- (real_get_best_auto_connection): renamed from real_get_best_connection
- (real_act_stage4_get_ip4_config): handle MTU override
* src/nm-device-802-3-ethernet.c
- (real_can_activate): new function
- (real_get_best_auto_connection): renamed from real_get_best_connection
- (real_act_stage4_get_ip4_config): new function; handle MTU override
* src/vpn-manager/nm-vpn-connection.c
- (nm_vpn_connection_ip4_config_get): don't need to set the 'secondary'
attribute on the ip4 config
* src/NetworkManagerPolicy.c
- (nm_policy_auto_get_best_device): remove
- (nm_policy_device_change_check): remove
- (update_default_route): new function; set the default route via
the specified device
- (get_device_priority): new function; return the priority number of
a device type WRT which one should have the default route. Order is
(highest to lowest) wired, wireless, GSM, CDMA.
- (update_routing_and_dns): new function; determine which device should
have the default route, then update the routing table and DNS
- (maybe_auto_activate_device): new function; if a device is now
available for activation, find out what connection it would like to
activate and do it
- (schedule_activate_check): new function; if a device can be activated
now, schedule the activation. Each device may have only one
pending activation at a given time.
- (device_state_changed): if activation was canceled, try again,
possibly with another connection; if the device was activated,
update routing and DNS; if the device was deactivated, try again
with another connection
- (device_carrier_changed): if there is no carrier, deactivate the
device; otherwise schedule an activation check for the device
- (wireless_networks_changed): schedule an activation check for the
device
- (device_added): keep track of the signal handler IDs so they can
be removed when the device goes away
- (device_removed): remove any signal handlers that might be attached
to the device; update routing and DNS
- (schedule_activate_all): new function
- (connections_added, connection_added, connection_updated): when
connections change, schedule all devices for an activation check
- (connection_removed): when a device is deactivated because its
connection was removed, schedule another activation check for it
- (nm_policy_destroy): destroy pending activations and disconnect
all device signal handlers
* src/nm-manager.c
- (nm_manager_activate_device): if the device was already actived,
deactivate it
- (deactivate_old_device): remove
- (connection_added_default_handler, impl_manager_activate_device):
don't deactivate other devices when activating this one
* src/backends/NetworkManagerGentoo.c
src/backends/NetworkManagerFrugalware.c
src/backends/NetworkManagerPaldo.c
src/backends/NetworkManagerRedHat.c
src/backends/NetworkManagerSlackware.c
src/backends/NetworkManagerArch.c
src/backends/NetworkManagerSuSE.c
src/backends/NetworkManagerDebian.c
- (nm_system_get_mtu): remove; MTU should be provided through the
distro's system settings service plugin instead
- (nm_system_device_add_default_route_via_device): remove
- (nm_system_device_add_default_route_via_device_with_iface): remove
- (nm_system_device_replace_default_route): new function; call
generic implementation
* src/backends/NetworkManagerGeneric.c
src/backends/NetworkManagerGeneric.h
- (nm_generic_device_add_default_route_via_device,
nm_generic_device_add_default_route_via_device_with_iface): remove
- (nm_generic_device_replace_default_route): replace the default route
with the given route via some gateway
* src/NetworkManagerSystem.c
src/NetworkManagerSystem.h
- (nm_system_device_set_from_ip4_config): let the policy handle updates
to routing and DNS; but set the MTU here
- (nm_system_vpn_device_set_from_ip4_config): set the route with the
ip_iface of the active device; use the standard MTU setting function
- (nm_system_set_mtu): remove
- (nm_system_device_set_mtu): consolidate MTU setting code in one place
git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@3391 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2008-03-07 19:41:32 +00:00
|
|
|
const char * nm_device_get_ip_iface (NMDevice *dev);
|
2010-04-21 14:58:25 -07:00
|
|
|
int nm_device_get_ip_ifindex(NMDevice *dev);
|
2005-12-31 08:21:24 +00:00
|
|
|
const char * nm_device_get_driver (NMDevice *dev);
|
2012-06-01 16:48:57 +02:00
|
|
|
const char * nm_device_get_driver_version (NMDevice *dev);
|
2009-07-07 14:24:12 -04:00
|
|
|
const char * nm_device_get_type_desc (NMDevice *dev);
|
2015-05-15 15:00:07 +02:00
|
|
|
const char * nm_device_get_type_description (NMDevice *dev);
|
2005-12-31 08:21:24 +00:00
|
|
|
NMDeviceType nm_device_get_device_type (NMDevice *dev);
|
2015-12-08 14:49:50 +01:00
|
|
|
NMLinkType nm_device_get_link_type (NMDevice *dev);
|
2015-04-29 16:34:38 +02:00
|
|
|
NMMetered nm_device_get_metered (NMDevice *dev);
|
2005-12-31 08:21:24 +00:00
|
|
|
|
2008-09-30 15:04:10 +00:00
|
|
|
int nm_device_get_priority (NMDevice *dev);
|
2014-08-28 18:11:35 +02:00
|
|
|
guint32 nm_device_get_ip4_route_metric (NMDevice *dev);
|
|
|
|
|
guint32 nm_device_get_ip6_route_metric (NMDevice *dev);
|
2008-09-30 15:04:10 +00:00
|
|
|
|
2014-10-03 17:37:26 -05:00
|
|
|
const char * nm_device_get_hw_address (NMDevice *dev);
|
|
|
|
|
const char * nm_device_get_permanent_hw_address (NMDevice *dev);
|
|
|
|
|
const char * nm_device_get_initial_hw_address (NMDevice *dev);
|
2012-06-13 12:53:39 -05:00
|
|
|
|
libnm, core, cli, tui: fix the capitalization of various types
GLib/Gtk have mostly settled on the convention that two-letter
acronyms in type names remain all-caps (eg, "IO"), but longer acronyms
become initial-caps-only (eg, "Tcp").
NM was inconsistent, with most long acronyms using initial caps only
(Adsl, Cdma, Dcb, Gsm, Olpc, Vlan), but others using all caps (DHCP,
PPP, PPPOE, VPN). Fix libnm and src/ to use initial-caps only for all
three-or-more-letter-long acronyms (and update nmcli and nmtui for the
libnm changes).
2014-06-26 13:44:36 -04:00
|
|
|
NMDhcp4Config * nm_device_get_dhcp4_config (NMDevice *dev);
|
|
|
|
|
NMDhcp6Config * nm_device_get_dhcp6_config (NMDevice *dev);
|
2005-12-31 08:21:24 +00:00
|
|
|
|
|
|
|
|
NMIP4Config * nm_device_get_ip4_config (NMDevice *dev);
|
2015-08-19 23:07:13 +02:00
|
|
|
void nm_device_replace_vpn4_config (NMDevice *dev,
|
|
|
|
|
NMIP4Config *old,
|
|
|
|
|
NMIP4Config *config);
|
2013-08-01 10:59:42 -05:00
|
|
|
|
2009-07-29 12:12:41 -04:00
|
|
|
NMIP6Config * nm_device_get_ip6_config (NMDevice *dev);
|
2015-08-19 23:07:13 +02:00
|
|
|
void nm_device_replace_vpn6_config (NMDevice *dev,
|
|
|
|
|
NMIP6Config *old,
|
|
|
|
|
NMIP6Config *config);
|
2005-12-31 08:21:24 +00:00
|
|
|
|
2013-11-02 10:38:23 -05:00
|
|
|
void nm_device_capture_initial_config (NMDevice *dev);
|
|
|
|
|
|
2012-11-14 14:05:30 -06:00
|
|
|
/* Master */
|
2014-10-15 21:17:45 -05:00
|
|
|
gboolean nm_device_is_master (NMDevice *dev);
|
2012-11-14 14:05:30 -06:00
|
|
|
|
2014-01-02 14:46:02 -05:00
|
|
|
/* Slave */
|
|
|
|
|
NMDevice * nm_device_get_master (NMDevice *dev);
|
|
|
|
|
|
2015-07-14 16:53:24 +02:00
|
|
|
NMActRequest * nm_device_get_act_request (NMDevice *dev);
|
|
|
|
|
NMSettingsConnection * nm_device_get_settings_connection (NMDevice *dev);
|
|
|
|
|
NMConnection * nm_device_get_applied_connection (NMDevice *dev);
|
|
|
|
|
gboolean nm_device_has_unmodified_applied_connection (NMDevice *self,
|
|
|
|
|
NMSettingCompareFlags compare_flags);
|
2005-12-31 08:21:24 +00:00
|
|
|
|
2014-11-16 16:07:22 +01:00
|
|
|
void nm_device_removed (NMDevice *dev);
|
|
|
|
|
|
2015-01-20 20:25:25 +01:00
|
|
|
gboolean nm_device_is_available (NMDevice *dev, NMDeviceCheckDevAvailableFlags flags);
|
2013-05-07 10:23:44 -04:00
|
|
|
gboolean nm_device_has_carrier (NMDevice *dev);
|
2008-03-07 Dan Williams <dcbw@redhat.com>
First pass of multiple active device support. Expect bugs.
* src/nm-ip4-config.c
src/nm-ip4-config.h
- (nm_ip4_config_get_secondary, nm_ip4_config_set_secondary): remove;
there are better ways to do this in the named manager
* src/nm-device.c
src/nm-device.h
- (nm_device_can_activate): return whether the device can activate a
connection right now; taking into account things like carrier state
and rfkill state
- (nm_device_get_best_auto_connection): renamed from
nm_device_get_best_connection
- (real_act_stage4_get_ip4_config): MTU stuff is now handled in the
device subclasses themselves, so that each device can override the
MTU from it's NMSetting subclass if needed
- (nm_device_set_ip4_config): set MTU when setting up routes and stuff
in NetworkManagerSystem.c, not here
* src/named-manager/nm-named-manager.c
src/named-manager/nm-named-manager.h
- (nm_named_manager_name_owner_changed,
nm_named_manager_dbus_connection_changed): fix for changes to
rewrite_resolv_conf()
- (compute_nameservers): don't need the NMNamedManager at all, remove
from parameter list
- (merge_one_ip4_config): new function; merge ip4 configs together
- (rewrite_resolv_conf): write out resolv.conf from all the stored
ip4 configs; the VPN config takes precedence, then the best
device config, then the rest of the configs
- (get_domain_for_config): take the NMNamedManager as an argument
to check whether the config is the VPN config
- (add_ip4_config_to_named): fixups for removal of the 'secondary'
attribute from ip4 configs
- (add_all_ip4_configs_to_named): add all the configs in priority order
- (remove_ip4_config_from_named): fix for changes to
get_domain_for_config()
- (nm_named_manager_add_ip4_config): assign the config to the right slot
based on its type; callers must pass in the type now
- (get_last_default_domain): remove, unused
- (nm_named_manager_remove_ip4_config): handle config slots correctly
* src/nm-device-802-11-wireless.c
- (real_can_activate): new function
- (real_get_best_auto_connection): renamed from real_get_best_connection
- (real_act_stage4_get_ip4_config): handle MTU override
* src/nm-device-802-3-ethernet.c
- (real_can_activate): new function
- (real_get_best_auto_connection): renamed from real_get_best_connection
- (real_act_stage4_get_ip4_config): new function; handle MTU override
* src/vpn-manager/nm-vpn-connection.c
- (nm_vpn_connection_ip4_config_get): don't need to set the 'secondary'
attribute on the ip4 config
* src/NetworkManagerPolicy.c
- (nm_policy_auto_get_best_device): remove
- (nm_policy_device_change_check): remove
- (update_default_route): new function; set the default route via
the specified device
- (get_device_priority): new function; return the priority number of
a device type WRT which one should have the default route. Order is
(highest to lowest) wired, wireless, GSM, CDMA.
- (update_routing_and_dns): new function; determine which device should
have the default route, then update the routing table and DNS
- (maybe_auto_activate_device): new function; if a device is now
available for activation, find out what connection it would like to
activate and do it
- (schedule_activate_check): new function; if a device can be activated
now, schedule the activation. Each device may have only one
pending activation at a given time.
- (device_state_changed): if activation was canceled, try again,
possibly with another connection; if the device was activated,
update routing and DNS; if the device was deactivated, try again
with another connection
- (device_carrier_changed): if there is no carrier, deactivate the
device; otherwise schedule an activation check for the device
- (wireless_networks_changed): schedule an activation check for the
device
- (device_added): keep track of the signal handler IDs so they can
be removed when the device goes away
- (device_removed): remove any signal handlers that might be attached
to the device; update routing and DNS
- (schedule_activate_all): new function
- (connections_added, connection_added, connection_updated): when
connections change, schedule all devices for an activation check
- (connection_removed): when a device is deactivated because its
connection was removed, schedule another activation check for it
- (nm_policy_destroy): destroy pending activations and disconnect
all device signal handlers
* src/nm-manager.c
- (nm_manager_activate_device): if the device was already actived,
deactivate it
- (deactivate_old_device): remove
- (connection_added_default_handler, impl_manager_activate_device):
don't deactivate other devices when activating this one
* src/backends/NetworkManagerGentoo.c
src/backends/NetworkManagerFrugalware.c
src/backends/NetworkManagerPaldo.c
src/backends/NetworkManagerRedHat.c
src/backends/NetworkManagerSlackware.c
src/backends/NetworkManagerArch.c
src/backends/NetworkManagerSuSE.c
src/backends/NetworkManagerDebian.c
- (nm_system_get_mtu): remove; MTU should be provided through the
distro's system settings service plugin instead
- (nm_system_device_add_default_route_via_device): remove
- (nm_system_device_add_default_route_via_device_with_iface): remove
- (nm_system_device_replace_default_route): new function; call
generic implementation
* src/backends/NetworkManagerGeneric.c
src/backends/NetworkManagerGeneric.h
- (nm_generic_device_add_default_route_via_device,
nm_generic_device_add_default_route_via_device_with_iface): remove
- (nm_generic_device_replace_default_route): replace the default route
with the given route via some gateway
* src/NetworkManagerSystem.c
src/NetworkManagerSystem.h
- (nm_system_device_set_from_ip4_config): let the policy handle updates
to routing and DNS; but set the MTU here
- (nm_system_vpn_device_set_from_ip4_config): set the route with the
ip_iface of the active device; use the standard MTU setting function
- (nm_system_set_mtu): remove
- (nm_system_device_set_mtu): consolidate MTU setting code in one place
git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@3391 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2008-03-07 19:41:32 +00:00
|
|
|
|
2014-07-15 13:36:24 +02:00
|
|
|
NMConnection * nm_device_generate_connection (NMDevice *self, NMDevice *master);
|
2014-06-18 20:17:57 +02:00
|
|
|
|
|
|
|
|
gboolean nm_device_master_update_slave_connection (NMDevice *master,
|
|
|
|
|
NMDevice *slave,
|
|
|
|
|
NMConnection *connection,
|
|
|
|
|
GError **error);
|
2013-06-27 14:39:13 +02:00
|
|
|
|
2014-08-26 15:10:38 +02:00
|
|
|
gboolean nm_device_can_auto_connect (NMDevice *self,
|
|
|
|
|
NMConnection *connection,
|
|
|
|
|
char **specific_object);
|
|
|
|
|
|
2011-01-10 23:39:12 -06:00
|
|
|
gboolean nm_device_complete_connection (NMDevice *device,
|
|
|
|
|
NMConnection *connection,
|
|
|
|
|
const char *specific_object,
|
|
|
|
|
const GSList *existing_connection,
|
|
|
|
|
GError **error);
|
|
|
|
|
|
2014-05-30 13:44:53 -05:00
|
|
|
gboolean nm_device_check_connection_compatible (NMDevice *device, NMConnection *connection);
|
2014-10-15 21:17:45 -05:00
|
|
|
gboolean nm_device_check_slave_connection_compatible (NMDevice *device, NMConnection *connection);
|
2011-11-17 23:04:47 -06:00
|
|
|
|
2014-11-05 08:28:40 +01:00
|
|
|
gboolean nm_device_uses_assumed_connection (NMDevice *device);
|
|
|
|
|
|
core: don't do anything interesting in NMDevice dispose()
The NMDevice dispose() function contained some badly-duplicated logic
about when to deactivate a device on its last ref. This logic should
only run when the device is removed by the manager, since the manager
controls the device's life-cycle, and the manager knows best when to
clean up the device. But since it was tied to the device's refcount,
it could have run later than the manager wanted, or not at all.
It gets better. Dispose duplicated logic that was already done in
nm_device_cleanup(), and then *called* nm_device_cleanup() if the
device was still activated and managed. But the manager already
unmanages the device when removing it, which triggers a call to
nm_device_cleanup(), takes the device down, and resets the IPv6
sysctl properties, which dispose() duplicated too. So by the time
dispose() runs, the device should already be unmanaged if the
manager wants to deconfigure it, and most of the dispose() code
should be a no-op.
Clean all that up and remove duplicated functions. Now, the flow
should be like this:
1) manager decides to remove the device and calls remove_device()
2) if the device should be deconfigured, the manager unmanages
the device
3) the NMDevice state change handler tears down the active connection
via nm_device_cleanup() and resets IPv6 sysctl properties
4) when the device's last reference is finally released, only internal
data members are freed in dispose() because the device should
already have been cleaned up by the manager and be unmanaged
5) if the device should be left running because it has an assumable
connection, then the device is not unmanaged, and no cleanup
happens in the state change handler or in dispose()
2014-05-23 15:41:46 -05:00
|
|
|
gboolean nm_device_can_assume_active_connection (NMDevice *device);
|
2011-11-17 23:04:47 -06:00
|
|
|
|
2011-11-17 23:16:50 -06:00
|
|
|
gboolean nm_device_spec_match_list (NMDevice *device, const GSList *specs);
|
|
|
|
|
|
2005-12-31 08:21:24 +00:00
|
|
|
gboolean nm_device_is_activating (NMDevice *dev);
|
2009-07-15 17:22:10 -04:00
|
|
|
gboolean nm_device_autoconnect_allowed (NMDevice *self);
|
2006-01-22 22:40:14 +00:00
|
|
|
|
2007-02-05 12:14:09 +00:00
|
|
|
NMDeviceState nm_device_get_state (NMDevice *device);
|
|
|
|
|
|
2011-11-17 23:28:30 -06:00
|
|
|
gboolean nm_device_get_enabled (NMDevice *device);
|
|
|
|
|
|
2011-11-17 23:38:08 -06:00
|
|
|
void nm_device_set_enabled (NMDevice *device, gboolean enabled);
|
|
|
|
|
|
2011-11-18 12:02:58 -06:00
|
|
|
RfKillType nm_device_get_rfkill_type (NMDevice *device);
|
|
|
|
|
|
2014-03-31 21:45:54 -05:00
|
|
|
/**
|
|
|
|
|
* NMUnmanagedFlags:
|
|
|
|
|
* @NM_UNMANAGED_NONE: placeholder value
|
2014-04-01 14:45:00 -05:00
|
|
|
* @NM_UNMANAGED_INTERNAL: %TRUE when unmanaged by internal decision (ie,
|
|
|
|
|
* because NM is sleeping or not managed for some other reason)
|
2014-09-08 16:20:58 +02:00
|
|
|
* @NM_UNMANAGED_PARENT: %TRUE when unmanaged due to parent device being unmanaged
|
2015-10-02 20:24:30 +02:00
|
|
|
* @NM_UNMANAGED_LOOPBACK: %TRUE for unmanaging loopback device
|
2015-04-13 16:29:37 -05:00
|
|
|
* @NM_UNMANAGED_PLATFORM_INIT: %TRUE when unmanaged because platform link not
|
|
|
|
|
* yet initialized
|
2015-10-02 20:24:30 +02:00
|
|
|
* @NM_UNMANAGED_USER: %TRUE when unmanaged by user decision (via unmanaged-specs)
|
|
|
|
|
* @NM_UNMANAGED_DEFAULT: %TRUE when unmanaged by default (ie, Generic devices)
|
|
|
|
|
* @NM_UNMANAGED_EXTERNAL_DOWN: %TRUE when unmanaged because !IFF_UP and not created by NM
|
2014-03-31 21:45:54 -05:00
|
|
|
*/
|
2015-10-02 20:24:30 +02:00
|
|
|
typedef enum { /*< skip >*/
|
2015-06-02 15:54:50 +02:00
|
|
|
NM_UNMANAGED_NONE = 0,
|
2015-10-02 20:24:30 +02:00
|
|
|
|
|
|
|
|
NM_UNMANAGED_INTERNAL = (1LL << 0),
|
|
|
|
|
NM_UNMANAGED_PARENT = (1LL << 1),
|
|
|
|
|
NM_UNMANAGED_LOOPBACK = (1LL << 2),
|
|
|
|
|
NM_UNMANAGED_PLATFORM_INIT = (1LL << 3),
|
|
|
|
|
NM_UNMANAGED_USER = (1LL << 4),
|
|
|
|
|
|
|
|
|
|
NM_UNMANAGED_DEFAULT = (1LL << 8),
|
|
|
|
|
NM_UNMANAGED_EXTERNAL_DOWN = (1LL << 11),
|
2014-03-31 21:45:54 -05:00
|
|
|
|
|
|
|
|
/* Boundary value */
|
|
|
|
|
__NM_UNMANAGED_LAST,
|
2015-01-20 20:44:46 +01:00
|
|
|
NM_UNMANAGED_LAST = __NM_UNMANAGED_LAST - 1,
|
|
|
|
|
NM_UNMANAGED_ALL = ((NM_UNMANAGED_LAST << 1) - 1),
|
2014-03-31 21:45:54 -05:00
|
|
|
} NMUnmanagedFlags;
|
|
|
|
|
|
2008-04-07 Dan Williams <dcbw@redhat.com>
* include/NetworkManager.h
- Remove the DOWN and CANCELLED device states
- Add UNMANAGED and UNAVAILABLE device states
- Document the device states
* introspection/nm-device.xml
src/nm-device-interface.c
src/nm-device-interface.h
- Add the 'managed' property
* test/nm-tool.c
- (detail_device): print out device state
* src/NetworkManagerSystem.h
src/backends/NetworkManagerArch.c
src/backends/NetworkManagerDebian.c
src/backends/NetworkManagerFrugalware.c
src/backends/NetworkManagerGentoo.c
src/backends/NetworkManagerMandriva.c
src/backends/NetworkManagerPaldo.c
src/backends/NetworkManagerRedHat.c
src/backends/NetworkManagerSlackware.c
src/backends/NetworkManagerSuSE.c
- (nm_system_device_get_system_config, nm_system_device_get_disabled
nm_system_device_free_system_config): remove; they were unused and
their functionality should be re-implemented in each distro's
system settings service plugin
* src/nm-gsm-device.c
src/nm-gsm-device.h
src/nm-cdma-device.c
src/nm-cdma-device.h
- (*_new): take the 'managed' argument
* src/nm-device.c
- (nm_device_set_address): remove, fold into nm_device_bring_up()
- (nm_device_init): start in unmanaged state, not disconnected
- (constructor): don't start device until the system settings service
has had a chance to figure out if the device is managed or not
- (nm_device_deactivate, nm_device_bring_up, nm_device_bring_down):
don't set device state here, let callers handle that as appropriate
- (nm_device_dispose): don't touch the device if it's not managed
- (set_property, get_property, nm_device_class_init): implement the
'managed' property
- (nm_device_state_changed): bring the device up if its now managed,
and deactivate it if it used to be active
- (nm_device_get_managed, nm_device_set_managed): do the right thing
with the managed state
* src/nm-hal-manager.c
- (wired_device_creator, wireless_device_creator, modem_device_creator):
take initial managed state and pass it along to device constructors
- (create_device_and_add_to_list): get managed state and pass to
type creators
* src/nm-device-802-11-wireless.c
- (real_can_activate): fold in most of
nm_device_802_11_wireless_can_activate()
- (can_scan): can't scan in UNAVAILABLE or UNMANAGED
- (link_timeout_cb): instead of deactivating, change device state and
let the device state handler to it
- (real_update_hw_address): clean up
- (state_changed_cb): when entering UNAVAILABLE state, schedule an idle
handler to transition to DISCONNECTED if the device isn't rfkilled
* src/nm-device-802-3-ethernet.c
- (set_carrier): move above callers and get rid of prototype
- (device_state_changed): when entering UNAVAILABLE state, schedule an
idle handler to transition to DISCONNECTED if the device has a
carrier
- (real_update_hw_address): clean up
- (link_timeout_cb, ppp_state_changed): change state instead of calling
deactivation directly as deactivation doesn't change state anymore
* src/NetworkManagerPolicy.c
- (schedule_activate_check): yay, remove wireless_enabled hack since
the NMManager and wireless devices work that out themselves now
- (device_state_changed): change to a switch and update for new device
states
- (device_carrier_changed): remove; device handles this now through
state changes
- (device_added): don't care about carrier any more; the initial
activation check will happen when the device transitions to
DISCONNECTED
* src/nm-manager.c
- (dispose): clear unmanaged devices
- (handle_unmanaged_devices): update unmanaged device list and toggle
the managed property on each device when needed
- (system_settings_properties_changed_cb): handle signals from the
system settings service
- (system_settings_get_unmanaged_devices_cb): handle callback from
getting the unmanaged device list method call
- (query_unmanaged_devices): ask the system settings service for its
list of unmanaged devices
- (nm_manager_name_owner_changed, initial_get_connections): get unmanaged
devices
- (manager_set_wireless_enabled): push rfkill state down to wireless
devices directly and let them handle the necessary state transitions
- (manager_device_state_changed): update for new device states
- (nm_manager_add_device): set initial rfkill state on wireless devices
- (nm_manager_remove_device): don't touch the device if it's unmanaged
- (nm_manager_activate_connection): return error if the device is
unmanaged
- (nm_manager_sleep): handle new device states correctly; don't change
the state of unavailable/unmanaged devices
* libnm-glib/nm-device-802-11-wireless.c
- (state_changed_cb): update for new device states
git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@3540 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2008-04-08 02:58:02 +00:00
|
|
|
gboolean nm_device_get_managed (NMDevice *device);
|
2015-11-05 02:41:42 +01:00
|
|
|
NMUnmanagedFlags nm_device_get_unmanaged_flags (NMDevice *device, NMUnmanagedFlags flag);
|
2015-11-05 02:32:53 +01:00
|
|
|
void nm_device_set_unmanaged_flags (NMDevice *device,
|
|
|
|
|
NMUnmanagedFlags flag,
|
|
|
|
|
gboolean unmanaged,
|
|
|
|
|
NMDeviceStateReason reason);
|
|
|
|
|
void nm_device_set_unmanaged_flags_by_device_spec (NMDevice *self, const GSList *unmanaged_specs);
|
|
|
|
|
void nm_device_set_unmanaged_flags_initial (NMDevice *device,
|
|
|
|
|
NMUnmanagedFlags flag,
|
|
|
|
|
gboolean unmanaged);
|
2015-11-05 02:28:34 +01:00
|
|
|
void nm_device_set_unmanaged_quitting (NMDevice *device);
|
2008-04-07 Dan Williams <dcbw@redhat.com>
* include/NetworkManager.h
- Remove the DOWN and CANCELLED device states
- Add UNMANAGED and UNAVAILABLE device states
- Document the device states
* introspection/nm-device.xml
src/nm-device-interface.c
src/nm-device-interface.h
- Add the 'managed' property
* test/nm-tool.c
- (detail_device): print out device state
* src/NetworkManagerSystem.h
src/backends/NetworkManagerArch.c
src/backends/NetworkManagerDebian.c
src/backends/NetworkManagerFrugalware.c
src/backends/NetworkManagerGentoo.c
src/backends/NetworkManagerMandriva.c
src/backends/NetworkManagerPaldo.c
src/backends/NetworkManagerRedHat.c
src/backends/NetworkManagerSlackware.c
src/backends/NetworkManagerSuSE.c
- (nm_system_device_get_system_config, nm_system_device_get_disabled
nm_system_device_free_system_config): remove; they were unused and
their functionality should be re-implemented in each distro's
system settings service plugin
* src/nm-gsm-device.c
src/nm-gsm-device.h
src/nm-cdma-device.c
src/nm-cdma-device.h
- (*_new): take the 'managed' argument
* src/nm-device.c
- (nm_device_set_address): remove, fold into nm_device_bring_up()
- (nm_device_init): start in unmanaged state, not disconnected
- (constructor): don't start device until the system settings service
has had a chance to figure out if the device is managed or not
- (nm_device_deactivate, nm_device_bring_up, nm_device_bring_down):
don't set device state here, let callers handle that as appropriate
- (nm_device_dispose): don't touch the device if it's not managed
- (set_property, get_property, nm_device_class_init): implement the
'managed' property
- (nm_device_state_changed): bring the device up if its now managed,
and deactivate it if it used to be active
- (nm_device_get_managed, nm_device_set_managed): do the right thing
with the managed state
* src/nm-hal-manager.c
- (wired_device_creator, wireless_device_creator, modem_device_creator):
take initial managed state and pass it along to device constructors
- (create_device_and_add_to_list): get managed state and pass to
type creators
* src/nm-device-802-11-wireless.c
- (real_can_activate): fold in most of
nm_device_802_11_wireless_can_activate()
- (can_scan): can't scan in UNAVAILABLE or UNMANAGED
- (link_timeout_cb): instead of deactivating, change device state and
let the device state handler to it
- (real_update_hw_address): clean up
- (state_changed_cb): when entering UNAVAILABLE state, schedule an idle
handler to transition to DISCONNECTED if the device isn't rfkilled
* src/nm-device-802-3-ethernet.c
- (set_carrier): move above callers and get rid of prototype
- (device_state_changed): when entering UNAVAILABLE state, schedule an
idle handler to transition to DISCONNECTED if the device has a
carrier
- (real_update_hw_address): clean up
- (link_timeout_cb, ppp_state_changed): change state instead of calling
deactivation directly as deactivation doesn't change state anymore
* src/NetworkManagerPolicy.c
- (schedule_activate_check): yay, remove wireless_enabled hack since
the NMManager and wireless devices work that out themselves now
- (device_state_changed): change to a switch and update for new device
states
- (device_carrier_changed): remove; device handles this now through
state changes
- (device_added): don't care about carrier any more; the initial
activation check will happen when the device transitions to
DISCONNECTED
* src/nm-manager.c
- (dispose): clear unmanaged devices
- (handle_unmanaged_devices): update unmanaged device list and toggle
the managed property on each device when needed
- (system_settings_properties_changed_cb): handle signals from the
system settings service
- (system_settings_get_unmanaged_devices_cb): handle callback from
getting the unmanaged device list method call
- (query_unmanaged_devices): ask the system settings service for its
list of unmanaged devices
- (nm_manager_name_owner_changed, initial_get_connections): get unmanaged
devices
- (manager_set_wireless_enabled): push rfkill state down to wireless
devices directly and let them handle the necessary state transitions
- (manager_device_state_changed): update for new device states
- (nm_manager_add_device): set initial rfkill state on wireless devices
- (nm_manager_remove_device): don't touch the device if it's unmanaged
- (nm_manager_activate_connection): return error if the device is
unmanaged
- (nm_manager_sleep): handle new device states correctly; don't change
the state of unavailable/unmanaged devices
* libnm-glib/nm-device-802-11-wireless.c
- (state_changed_cb): update for new device states
git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@3540 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2008-04-08 02:58:02 +00:00
|
|
|
|
2013-08-05 10:03:41 +02:00
|
|
|
gboolean nm_device_get_is_nm_owned (NMDevice *device);
|
|
|
|
|
|
2015-04-17 15:19:48 +02:00
|
|
|
gboolean nm_device_has_capability (NMDevice *self, NMDeviceCapabilities caps);
|
|
|
|
|
|
2016-01-10 14:56:05 +01:00
|
|
|
gboolean nm_device_realize_start (NMDevice *device,
|
2016-01-10 15:13:20 +01:00
|
|
|
const NMPlatformLink *plink,
|
2014-10-09 12:42:29 -05:00
|
|
|
gboolean *out_compatible,
|
2014-09-05 08:50:02 -05:00
|
|
|
GError **error);
|
2016-01-10 14:56:05 +01:00
|
|
|
void nm_device_realize_finish (NMDevice *self,
|
|
|
|
|
const NMPlatformLink *plink);
|
2014-09-05 08:50:02 -05:00
|
|
|
gboolean nm_device_create_and_realize (NMDevice *self,
|
|
|
|
|
NMConnection *connection,
|
|
|
|
|
NMDevice *parent,
|
|
|
|
|
GError **error);
|
2014-09-24 15:13:19 -05:00
|
|
|
gboolean nm_device_unrealize (NMDevice *device,
|
|
|
|
|
gboolean remove_resources,
|
|
|
|
|
GError **error);
|
2014-09-05 08:50:02 -05:00
|
|
|
|
2012-05-14 15:32:54 +02:00
|
|
|
gboolean nm_device_get_autoconnect (NMDevice *device);
|
2015-11-05 07:52:51 +01:00
|
|
|
void nm_device_set_autoconnect (NMDevice *device, gboolean autoconnect);
|
2009-09-16 13:18:24 +02:00
|
|
|
|
2011-11-17 22:39:34 -06:00
|
|
|
void nm_device_state_changed (NMDevice *device,
|
|
|
|
|
NMDeviceState state,
|
|
|
|
|
NMDeviceStateReason reason);
|
|
|
|
|
|
2011-12-08 11:46:58 -06:00
|
|
|
void nm_device_queue_state (NMDevice *self,
|
|
|
|
|
NMDeviceState state,
|
|
|
|
|
NMDeviceStateReason reason);
|
|
|
|
|
|
2011-11-17 22:39:34 -06:00
|
|
|
gboolean nm_device_get_firmware_missing (NMDevice *self);
|
2015-04-14 14:16:04 +02:00
|
|
|
gboolean nm_device_get_nm_plugin_missing (NMDevice *self);
|
|
|
|
|
void nm_device_set_nm_plugin_missing (NMDevice *self,
|
|
|
|
|
gboolean missing);
|
2011-01-05 16:23:00 -06:00
|
|
|
|
2015-07-14 16:53:24 +02:00
|
|
|
void nm_device_steal_connection (NMDevice *device, NMSettingsConnection *connection);
|
2015-02-03 16:15:37 +01:00
|
|
|
|
core: queue re-activations to allow DEACTIVATING state
If a device is already activated, queue the new activation to allow
the transition through the DEACTIVATING state.
---
Also remove the "HACK" bits in nm_device_deactivate(). This hack was
added on 2007-09-25 in commit 9c2848d. At the time, with user settings
services, if a client created a connection and requested that NM
activate it, NM may not have read the connection from the client over
D-Bus yet. So NM created a "deferred" activation request which waited
until the connection was read from the client, and then began activation.
The Policy watched for device state changes and other events (like
it does now) and activated a new device if the old one was no longer
valid. It specifically checked for deferred activations and then
did nothing. However, when the client's connection was read, then
nm-device.c cleared the deferred activation bit, leading to a short
period of time where the device was in DISCONNECTED state but there
was no deferred activation, because the device only changes state to
PREPARE from the idle handler for stage1. If other events happened
during this time, the policy would tear down the device that was
about to be activated. This early state transition to PREPARE
worked around that.
We need to remove it now though, because (a) the reason for its
existence is no longer valid, and (b) _device_activate() may now
be called from inside nm_device_state_changed() and thus it cannot
change to a new state inside the function.
2014-02-17 17:16:08 -06:00
|
|
|
void nm_device_queue_activation (NMDevice *device, NMActRequest *req);
|
2011-11-17 23:50:13 -06:00
|
|
|
|
2012-09-19 10:56:30 -04:00
|
|
|
gboolean nm_device_supports_vlans (NMDevice *device);
|
|
|
|
|
|
2014-04-28 11:18:05 +02:00
|
|
|
gboolean nm_device_add_pending_action (NMDevice *device, const char *action, gboolean assert_not_yet_pending);
|
|
|
|
|
gboolean nm_device_remove_pending_action (NMDevice *device, const char *action, gboolean assert_is_pending);
|
2013-08-13 17:45:34 -04:00
|
|
|
gboolean nm_device_has_pending_action (NMDevice *device);
|
|
|
|
|
|
2013-09-03 15:34:56 -05:00
|
|
|
GPtrArray *nm_device_get_available_connections (NMDevice *device,
|
|
|
|
|
const char *specific_object);
|
|
|
|
|
|
2015-01-16 16:43:48 +01:00
|
|
|
gboolean nm_device_check_connection_available (NMDevice *device,
|
|
|
|
|
NMConnection *connection,
|
|
|
|
|
NMDeviceCheckConAvailableFlags flags,
|
|
|
|
|
const char *specific_object);
|
2013-11-04 19:51:28 -06:00
|
|
|
|
2015-11-24 16:43:18 +01:00
|
|
|
void nm_device_notify_new_device_added (NMDevice *self, NMDevice *new_device);
|
2014-02-09 10:22:19 -06:00
|
|
|
gboolean nm_device_notify_component_added (NMDevice *device, GObject *component);
|
|
|
|
|
|
|
|
|
|
gboolean nm_device_owns_iface (NMDevice *device, const char *iface);
|
|
|
|
|
|
2014-09-08 16:11:51 -05:00
|
|
|
NMConnection *nm_device_new_default_connection (NMDevice *self);
|
|
|
|
|
|
2014-11-11 12:29:46 +01:00
|
|
|
const NMPlatformIP4Route *nm_device_get_ip4_default_route (NMDevice *self, gboolean *out_is_assumed);
|
|
|
|
|
const NMPlatformIP6Route *nm_device_get_ip6_default_route (NMDevice *self, gboolean *out_is_assumed);
|
2014-08-29 00:03:47 +02:00
|
|
|
|
2014-10-29 09:12:18 -05:00
|
|
|
void nm_device_spawn_iface_helper (NMDevice *self);
|
2015-07-14 16:53:24 +02:00
|
|
|
|
|
|
|
|
void nm_device_reapply_settings_immediately (NMDevice *self);
|
|
|
|
|
|
|
|
|
|
void nm_device_update_firewall_zone (NMDevice *self);
|
2015-09-07 12:06:27 +02:00
|
|
|
void nm_device_update_metered (NMDevice *self);
|
2014-10-29 09:12:18 -05:00
|
|
|
|
2015-12-13 22:09:59 +01:00
|
|
|
void nm_device_update_hw_address (NMDevice *self);
|
|
|
|
|
void nm_device_update_initial_hw_address (NMDevice *self);
|
|
|
|
|
|
2005-12-31 08:21:24 +00:00
|
|
|
G_END_DECLS
|
|
|
|
|
|
|
|
|
|
#endif /* NM_DEVICE_H */
|