Commit 371de4c2 authored by Tambet Ingo's avatar Tambet Ingo Committed by Tambet Ingo

2007-02-08 Tambet Ingo <tambet@ximian.com>

	* src/NetworkManager.c:
		- Set up all the shiny new managers.

	* src/NetworkManagerPolicy.c:
		- Add the beginnings of new NMPolicy code. Instead of requireing all
		  classes to call into policy code, make the policy code kind of like
		  a supervisor that monitors what's going on and drives the whole NM.

	* src/nm-hal-manager.c: 
	* src/nm-hal-manager.h:
		- Collect all libhal code scattered around NM to this one class.
		- Listen libhal and NMManager events and add/remove devices to
		  NMManager.

	* src/nm-manager.c:
	* src/nm-manager.h:
		- Implment a replacement for NMData. NMData is now officially
		deprecated.



git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@2291 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
parent be529104
......@@ -42,6 +42,8 @@ NetworkManager_SOURCES = \
nm-dbus-net.h \
nm-dbus-nmi.c \
nm-dbus-nmi.h \
nm-hal-manager.c \
nm-hal-manager.h \
nm-ip4-config.c \
nm-ip4-config.h \
NetworkManager.c \
......@@ -54,6 +56,8 @@ NetworkManager_SOURCES = \
NetworkManagerSystem.h \
nm-logging.c \
nm-logging.h \
nm-manager.c \
nm-manager.h \
nm-netlink-monitor.c \
nm-netlink-monitor.h \
nm-activation-request.c \
......
This diff is collapsed.
......@@ -304,45 +304,17 @@ void nm_dbus_schedule_device_status_change_signal (NMData *data, NMDevice *dev,
}
/*
* nm_get_app_state_from_data
*
* Return the state of the network connection
*
*/
NMState nm_get_app_state_from_data (NMData *data)
{
NMDevice * act_dev = NULL;
g_return_val_if_fail (data != NULL, NM_STATE_DISCONNECTED);
if (data->asleep == TRUE)
return NM_STATE_ASLEEP;
act_dev = nm_get_active_device (data);
if (!act_dev && !data->modem_active)
return NM_STATE_DISCONNECTED;
if (nm_device_is_activating (act_dev))
return NM_STATE_CONNECTING;
else
return NM_STATE_CONNECTED;
}
/*
* nm_dbus_signal_state_change
*
* Signal a change in state
*
*/
void nm_dbus_signal_state_change (DBusConnection *connection, NMData *data)
void nm_dbus_signal_state_change (DBusConnection *connection, NMState state)
{
DBusMessage * message;
NMState state;
g_return_if_fail (connection != NULL);
g_return_if_fail (data != NULL);
if (!(message = dbus_message_new_signal (NM_DBUS_PATH, NM_DBUS_INTERFACE, NM_DBUS_SIGNAL_STATE_CHANGE)))
{
......@@ -350,7 +322,6 @@ void nm_dbus_signal_state_change (DBusConnection *connection, NMData *data)
return;
}
state = nm_get_app_state_from_data (data);
dbus_message_append_args (message, DBUS_TYPE_UINT32, &state, DBUS_TYPE_INVALID);
if (!dbus_connection_send (connection, message, NULL))
nm_warning ("nm_dbus_signal_state_change(): Could not raise the signal!");
......
......@@ -59,15 +59,13 @@ char * nm_dbus_get_object_path_for_network (NMDevice *dev, NMAccessPoint *ap);
void nm_dbus_schedule_device_status_change_signal (NMData *data, NMDevice *dev, NMAccessPoint *ap, DeviceStatus status);
void nm_dbus_signal_state_change (DBusConnection *connection, NMData *data);
void nm_dbus_signal_state_change (DBusConnection *connection, NMState state);
void nm_dbus_signal_wireless_network_change (NMDevice80211Wireless *dev, NMAccessPoint *ap, NMNetworkStatus status, gint strength);
void nm_dbus_signal_device_strength_change (NMDevice80211Wireless *dev, gint strength);
NMDevice * nm_dbus_get_device_from_escaped_object_path (NMData *data, const char *path);
NMState nm_get_app_state_from_data (NMData *data);
DBusMessage * nm_dbus_create_error_message (DBusMessage *message, const char *exception_namespace, const char *exception, const char *format, ...);
DBusMessage * nm_dbus_new_invalid_args_error (DBusMessage *replyto, const char *namespace);
......
......@@ -25,7 +25,6 @@
#include <glib.h>
#include <glib/gthread.h>
#include <dbus/dbus.h>
#include <libhal.h>
#include "NetworkManager.h"
#include "NetworkManagerAP.h"
#include "nm-netlink-monitor.h"
......@@ -34,18 +33,6 @@
#include "NetworkManagerDbusUtils.h"
typedef enum NMIntState
{
NM_INT_STATE_UNKNOWN = 0,
NM_INT_STATE_ASLEEP,
NM_INT_STATE_CONFIGURE_AP,
NM_INT_STATE_CONFIGURE_DEV,
NM_INT_STATE_CONFIGURE_IP,
NM_INT_STATE_CONNECTED,
NM_INT_STATE_DISCONNECTED
} NMIntState;
typedef struct NMActRequest NMActRequest;
typedef struct NMVPNActRequest NMVPNActRequest;
typedef struct NMVPNManager NMVPNManager;
......@@ -55,8 +42,6 @@ typedef struct NMData
GIOChannel * sigterm_iochannel;
int sigterm_pipe[2];
LibHalContext * hal_ctx;
NmNetlinkMonitor * netlink_monitor;
NMNamedManager * named_manager;
......@@ -85,15 +70,6 @@ typedef struct NMData
} NMData;
NMDevice * nm_get_active_device (NMData *data);
NMDevice * nm_create_device_and_add_to_list (NMData *data, const char *udi, const char *iface,
gboolean test_device, NMDeviceType test_device_type);
void nm_add_initial_devices (NMData *data);
void nm_remove_device (NMData *data, NMDevice *dev);
void nm_schedule_state_change_signal_broadcast (NMData *data);
int nm_get_sigterm_pipe (void);
......
......@@ -40,6 +40,20 @@
#include "nm-device-802-3-ethernet.h"
#include "nm-dbus-manager.h"
struct NMPolicy {
NMManager *manager;
guint device_state_changed_idle_id;
};
/* NMPolicy is supposed to be one of the highest classes of the
NM class hierarchy and the only public API it needs is:
NMPolicy *nm_policy_new (NMManager *manager);
void nm_policy_destroy (NMPolicy *policy);
Until this hasn't fixed, keep the global policy around.
*/
static NMPolicy *global_policy;
/*
* nm_policy_activation_finish
......@@ -286,15 +300,16 @@ nm_policy_device_change_check (gpointer user_data)
{
NMData * data = (NMData *) user_data;
NMAccessPoint * ap = NULL;
NMDevice * new_dev = NULL;
NMDevice * old_dev = NULL;
NMDevice * new_dev;
NMDevice * old_dev;
gboolean do_switch = FALSE;
g_return_val_if_fail (data != NULL, FALSE);
data->dev_change_check_idle_id = 0;
old_dev = nm_get_active_device (data);
g_assert (global_policy != NULL);
old_dev = nm_manager_get_active_device (global_policy->manager);
if (old_dev) {
guint32 caps = nm_device_get_capabilities (old_dev);
......@@ -455,16 +470,13 @@ static gboolean
nm_policy_device_activation (gpointer user_data)
{
NMActRequest * req = (NMActRequest *) user_data;
NMData * data;
NMDevice * new_dev = NULL;
NMDevice * old_dev = NULL;
NMDevice * new_dev;
NMDevice * old_dev;
g_return_val_if_fail (req != NULL, FALSE);
data = nm_act_request_get_data (req);
g_assert (data);
if ((old_dev = nm_get_active_device (data)))
g_assert (global_policy != NULL);
if ((old_dev = nm_manager_get_active_device (global_policy->manager)))
nm_device_deactivate (old_dev);
new_dev = nm_act_request_get_dev (req);
......@@ -634,3 +646,136 @@ nm_policy_schedule_device_ap_lists_update_from_allowed (NMData *app_data)
g_source_set_priority (source, G_PRIORITY_HIGH_IDLE);
}
}
/*****************************************************************************/
static void
device_change_check_done (gpointer user_data)
{
NMPolicy *policy = (NMPolicy *) user_data;
policy->device_state_changed_idle_id = 0;
}
static void
schedule_change_check (NMPolicy *policy)
{
if (policy->device_state_changed_idle_id > 0)
return;
/* FIXME: Uncomment this when nm_policy_schedule_device_change_check and
all it's callers have been removed. */
#if 0
policy->device_state_changed_idle_id = g_idle_add_full (G_PRIORITY_DEFAULT_IDLE,
nm_policy_device_change_check,
policy,
device_change_check_done);
#endif
}
static void
device_state_changed (NMDevice *device, NMDeviceState state, gpointer user_data)
{
NMPolicy *policy = (NMPolicy *) user_data;
if (state == NM_DEVICE_STATE_FAILED || state == NM_DEVICE_STATE_CANCELLED)
schedule_change_check (policy);
}
static void
device_carrier_changed (NMDevice *device, gboolean carrier_on, gpointer user_data)
{
NMPolicy *policy = (NMPolicy *) user_data;
schedule_change_check (policy);
}
static void
device_added (NMManager *manager, NMDevice *device, gpointer user_data)
{
NMPolicy *policy = (NMPolicy *) user_data;
g_signal_connect (device, "state-changed",
G_CALLBACK (device_state_changed),
policy);
g_signal_connect (device, "carrier-changed",
G_CALLBACK (device_carrier_changed),
policy);
/* FIXME: */
{
NMData *nm_data = nm_device_get_app_data (device);
nm_data->dev_list = g_slist_append (nm_data->dev_list, device);
}
/* FIXME: Uncomment once the patch to add these signals to wireless devices is committed */
#if 0
if (NM_IS_DEVICE_802_11_WIRELESS (device)) {
g_signal_connect (device, "network-added",
G_CALLBACK (wireless_networks_changed),
policy);
g_signal_connect (device, "network-removed",
G_CALLBACK (wireless_networks_changed),
policy);
}
#endif
schedule_change_check (policy);
}
static void
device_removed (NMManager *manager, NMDevice *device, gpointer user_data)
{
NMPolicy *policy = (NMPolicy *) user_data;
/* FIXME: */
{
NMData *nm_data = nm_device_get_app_data (device);
nm_data->dev_list = g_slist_remove (nm_data->dev_list, device);
}
schedule_change_check (policy);
}
static void
state_changed (NMManager *manager, NMState state, gpointer user_data)
{
/* FIXME: Do cool stuff here */
}
NMPolicy *
nm_policy_new (NMManager *manager)
{
NMPolicy *policy;
g_return_val_if_fail (NM_IS_MANAGER (manager), NULL);
g_assert (global_policy == NULL);
policy = g_slice_new (NMPolicy);
policy->manager = g_object_ref (manager);
g_signal_connect (manager, "device-added",
G_CALLBACK (device_added), policy);
g_signal_connect (manager, "device-removed",
G_CALLBACK (device_removed), policy);
g_signal_connect (manager, "state-change",
G_CALLBACK (state_changed), policy);
global_policy = policy;
return policy;
}
void
nm_policy_destroy (NMPolicy *policy)
{
if (policy) {
g_object_unref (policy->manager);
g_slice_free (NMPolicy, policy);
}
global_policy = NULL;
}
......@@ -23,10 +23,17 @@
#define NETWORK_MANAGER_POLICY_H
#include "NetworkManager.h"
#include "nm-manager.h"
#include "nm-device.h"
#include "NetworkManagerDbus.h"
#include "nm-activation-request.h"
typedef struct NMPolicy NMPolicy;
NMPolicy *nm_policy_new (NMManager *manager);
void nm_policy_destroy (NMPolicy *policy);
void nm_policy_schedule_device_change_check (NMData *data);
void nm_policy_schedule_device_activation (NMActRequest *req);
......
......@@ -419,7 +419,7 @@ out:
return reply;
}
#if 0
static DBusMessage *
nm_dbus_nm_create_test_device (DBusConnection *connection,
DBusMessage *message,
......@@ -521,6 +521,7 @@ out:
g_object_unref (G_OBJECT (dev));
return reply;
}
#endif
static DBusMessage *
nm_dbus_nm_set_wireless_enabled (DBusConnection *connection,
......@@ -606,7 +607,7 @@ nm_dbus_nm_sleep (DBusConnection *connection,
/* Not using nm_schedule_state_change_signal_broadcast() here
* because we want the signal to go out ASAP.
*/
nm_dbus_signal_state_change (connection, data);
nm_dbus_signal_state_change (connection, NM_STATE_ASLEEP);
/* Just deactivate and down all devices from the device list,
* we'll remove them in 'wake' for speed's sake.
......@@ -642,12 +643,15 @@ nm_dbus_nm_wake (DBusConnection *connection,
data->asleep = FALSE;
/* Remove all devices from the device list */
/* FIXME: Well, not really. This whole file will be gone soon. */
#if 0
while (g_slist_length (data->dev_list))
nm_remove_device (data, NM_DEVICE (data->dev_list->data));
g_slist_free (data->dev_list);
data->dev_list = NULL;
nm_add_initial_devices (data);
#endif
nm_schedule_state_change_signal_broadcast (data);
nm_policy_schedule_device_change_check (data);
......@@ -655,6 +659,8 @@ nm_dbus_nm_wake (DBusConnection *connection,
return NULL;
}
static DBusMessage *
nm_dbus_nm_get_state (DBusConnection *connection,
DBusMessage *message,
......@@ -673,7 +679,8 @@ nm_dbus_nm_get_state (DBusConnection *connection,
goto out;
}
state = nm_get_app_state_from_data (data);
/* FIXME: This function is deprecated and doesn't work anymore */
state = NM_STATE_UNKNOWN;
dbus_message_append_args (reply, DBUS_TYPE_UINT32, &state, DBUS_TYPE_INVALID);
out:
......@@ -706,8 +713,10 @@ NMDbusMethodList *nm_dbus_nm_methods_setup (NMData *data)
nm_dbus_method_list_add_method (list, "sleep", nm_dbus_nm_sleep);
nm_dbus_method_list_add_method (list, "wake", nm_dbus_nm_wake);
nm_dbus_method_list_add_method (list, "state", nm_dbus_nm_get_state);
#if 0
nm_dbus_method_list_add_method (list, "createTestDevice", nm_dbus_nm_create_test_device);
nm_dbus_method_list_add_method (list, "removeTestDevice", nm_dbus_nm_remove_test_device);
#endif
return list;
}
......@@ -42,6 +42,14 @@ G_BEGIN_DECLS
#define NM_IS_DEVICE_802_11_WIRELESS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), NM_TYPE_DEVICE_802_11_WIRELESS))
#define NM_DEVICE_802_11_WIRELESS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NM_TYPE_DEVICE_802_11_WIRELESS, NMDevice80211WirelessClass))
typedef enum NMWirelessScanInterval
{
NM_WIRELESS_SCAN_INTERVAL_INIT = 0,
NM_WIRELESS_SCAN_INTERVAL_ACTIVE,
NM_WIRELESS_SCAN_INTERVAL_INACTIVE
} NMWirelessScanInterval;
#ifndef NM_DEVICE_802_11_WIRELESS_DEFINED
#define NM_DEVICE_802_11_WIRELESS_DEFINED
typedef struct _NMDevice80211Wireless NMDevice80211Wireless;
......
......@@ -284,24 +284,11 @@ real_get_generic_capabilities (NMDevice *dev)
{
NMDevice8023Ethernet * self = NM_DEVICE_802_3_ETHERNET (dev);
guint32 caps = NM_DEVICE_CAP_NONE;
const char * udi = NULL;
char * usb_test = NULL;
NMData * app_data;
/* cipsec devices are also explicitly unsupported at this time */
if (strstr (nm_device_get_iface (dev), "cipsec"))
return NM_DEVICE_CAP_NONE;
/* Ignore Ethernet-over-USB devices too for the moment (Red Hat #135722) */
app_data = nm_device_get_app_data (dev);
udi = nm_device_get_udi (dev);
if ( libhal_device_property_exists (app_data->hal_ctx, udi, "usb.interface.class", NULL)
&& (usb_test = libhal_device_get_property_string (app_data->hal_ctx, udi, "usb.interface.class", NULL)))
{
libhal_free_string (usb_test);
return NM_DEVICE_CAP_NONE;
}
if (supports_ethtool_carrier_detect (self) || supports_mii_carrier_detect (self))
caps |= NM_DEVICE_CAP_CARRIER_DETECT;
......
......@@ -83,7 +83,7 @@ nm_device_interface_init (gpointer g_iface)
G_PARAM_READABLE));
/* Signals */
g_signal_new ("state_changed",
g_signal_new ("state-changed",
iface_type,
G_SIGNAL_RUN_FIRST,
G_STRUCT_OFFSET (NMDeviceInterface, state_changed),
......@@ -92,7 +92,7 @@ nm_device_interface_init (gpointer g_iface)
G_TYPE_NONE, 1,
G_TYPE_UINT);
g_signal_new ("carrier_changed",
g_signal_new ("carrier-changed",
iface_type,
G_SIGNAL_RUN_FIRST,
G_STRUCT_OFFSET (NMDeviceInterface, carrier_changed),
......
......@@ -6,7 +6,7 @@
#include "NetworkManager.h"
#define NM_TYPE_DEVICE_INTERFACE (nm_device_interface_get_type ())
#define NM_DEVICE_INTERFACE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_DEVICE_INTERFACE, NmDeviceInterface))
#define NM_DEVICE_INTERFACE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_DEVICE_INTERFACE, NMDeviceInterface))
#define NM_IS_DEVICE_INTERFACE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NM_TYPE_DEVICE_INTERFACE))
#define NM_DEVICE_INTERFACE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), NM_TYPE_DEVICE_INTERFACE, NMDeviceInterface))
......
......@@ -419,55 +419,15 @@ void
nm_device_set_active_link (NMDevice *self,
const gboolean link_active)
{
NMData * app_data;
NMActRequest * req;
g_return_if_fail (self != NULL);
g_return_if_fail (self->priv->app_data != NULL);
app_data = self->priv->app_data;
req = nm_device_get_act_request (self);
NMDevicePrivate *priv;
if (self->priv->link_active == link_active)
return;
g_return_if_fail (NM_IS_DEVICE (self));
self->priv->link_active = link_active;
/* Deactivate a currently active device */
if (!link_active && req) {
nm_policy_schedule_device_change_check (app_data);
} else if (link_active && !req) {
NMDevice * act_dev = nm_get_active_device (app_data);
NMActRequest * act_dev_req = act_dev ? nm_device_get_act_request (act_dev) : NULL;
/* Should we switch to this device now that it has a link?
*
* Only auto-switch for wired devices, AND...
*
* only switch to fully-supported devices, since ones that don't have carrier detection
* capability usually report the carrier as "always on" even if its not really on. User
* must manually choose semi-supported devices.
*
*/
if (NM_IS_DEVICE_802_3_ETHERNET (self) && (nm_device_get_capabilities (self) & NM_DEVICE_CAP_CARRIER_DETECT))
{
gboolean do_switch = act_dev ? FALSE : TRUE; /* If no currently active device, switch to this one */
NMActRequest * act_req;
/* If active device is wireless, switch to this one */
if (act_dev && NM_IS_DEVICE_802_11_WIRELESS (act_dev) && act_dev_req && !nm_act_request_get_user_requested (act_dev_req))
do_switch = TRUE;
if (do_switch && (act_req = nm_act_request_new (app_data, self, NULL, TRUE)))
{
nm_info ("Will activate wired connection '%s' because it now has a link.", nm_device_get_iface (self));
nm_policy_schedule_device_change_check (app_data);
}
}
priv = NM_DEVICE_GET_PRIVATE (self);
if (priv->link_active != link_active) {
priv->link_active = link_active;
g_signal_emit_by_name (self, "carrier-changed", link_active);
}
g_signal_emit_by_name (self, "carrier_changed", link_active);
nm_dbus_schedule_device_status_change_signal (app_data, self, NULL, link_active ? DEVICE_CARRIER_ON : DEVICE_CARRIER_OFF);
}
......@@ -1862,7 +1822,7 @@ nm_device_state_changed (NMDevice *device, NMDeviceState state)
break;
}
g_signal_emit_by_name (device, "state_changed", state);
g_signal_emit_by_name (device, "state-changed", state);
}
......
......@@ -42,13 +42,6 @@
# define nm_ioctl_info(fmt, args...) do { } while(0)
#endif
typedef enum NMWirelessScanInterval
{
NM_WIRELESS_SCAN_INTERVAL_INIT = 0,
NM_WIRELESS_SCAN_INTERVAL_ACTIVE,
NM_WIRELESS_SCAN_INTERVAL_INACTIVE
} NMWirelessScanInterval;
typedef enum NMActStageReturn
{
NM_ACT_STAGE_RETURN_FAILURE = 0,
......
This diff is collapsed.
#ifndef NM_HAL_MANAGER_H
#define NM_HAL_MANAGER_H
#include "nm-manager.h"
#include "NetworkManagerMain.h"
typedef struct _NMHalManager NMHalManager;
NMHalManager *nm_hal_manager_new (NMManager *nm_manager, NMData *nm_data);
void nm_hal_manager_destroy (NMHalManager *manager);
#endif /* NM_HAL_MANAGER_H */
#include <string.h>
#include "nm-manager.h"
#include "nm-utils.h"
#include "nm-dbus-manager.h"
#include "nm-device-802-11-wireless.h"
#include "NetworkManagerSystem.h"
// #include "NetworkManagerDbus.h"
static void manager_state_changed (NMManager *manager);
static void manager_set_wireless_enabled (NMManager *manager, gboolean enabled);
typedef struct {
GSList *devices;
gboolean wireless_enabled;
gboolean sleeping;
} NMManagerPrivate;
#define NM_MANAGER_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_MANAGER, NMManagerPrivate))
G_DEFINE_TYPE (NMManager, nm_manager, G_TYPE_OBJECT)
enum {
DEVICE_ADDED,
DEVICE_REMOVED,
STATE_CHANGE,
LAST_SIGNAL
};
static guint signals[LAST_SIGNAL] = { 0 };
enum {
PROP_0,
PROP_STATE,
PROP_WIRELESS_ENABLED,
LAST_PROP
};
static void
nm_manager_init (NMManager *msg)
{
}
static void
device_stop_and_free (gpointer data, gpointer user_data)
{
NMDevice *device = NM_DEVICE (data);
nm_device_set_removed (device, TRUE);
nm_device_deactivate (device);
g_object_unref (device);
}
static void
finalize (GObject *object)
{
NMManagerPrivate *priv = NM_MANAGER_GET_PRIVATE (object);
g_slist_foreach (priv->devices,
device_stop_and_free,
NULL);
g_slist_free (priv->devices);
G_OBJECT_CLASS (nm_manager_parent_class)->finalize (object);
}
static void
set_property (GObject *object, guint prop_id,
const GValue *value, GParamSpec *pspec)
{
switch (prop_id) {
case PROP_WIRELESS_ENABLED:
manager_set_wireless_enabled (NM_MANAGER (object), g_value_get_boolean (value));
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
}
}
static void
get_property (GObject *object, guint prop_id,
GValue *value, GParamSpec *pspec)
{
NMManagerPrivate *priv = NM_MANAGER_GET_PRIVATE (object);
switch (prop_id) {
case PROP_STATE:
g_value_set_uint (value, nm_manager_get_state (NM_MANAGER (object)));
break;
case PROP_WIRELESS_ENABLED:
g_value_set_boolean (value, priv->wireless_enabled);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
}
}
static void
nm_manager_class_init (NMManagerClass *manager_class)
{
GObjectClass *object_class = G_OBJECT_CLASS (manager_class);
g_type_class_add_private (manager_class, sizeof (NMManagerPrivate));
/* virtual methods */
object_class->set_property = set_property;
object_class->get_property = get_property;
object_class->finalize = finalize;
/* properties */
g_object_class_install_property
(object_class, PROP_STATE,
g_param_spec_uint (NM_MANAGER_STATE,
"State",
"Current state",
0, 5, 0, /* FIXME */
G_PARAM_READABLE));
g_object_class_install_property
(object_class, PROP_WIRELESS_ENABLED,
g_param_spec_boolean (NM_MANAGER_WIRELESS_ENABLED,
"WirelessEnabled",
"Is wireless enabled",
TRUE,
G_PARAM_READWRITE));
/* signals */
signals[DEVICE_ADDED] =
g_signal_new ("device-added",
G_OBJECT_CLASS_TYPE (object_class),
G_SIGNAL_RUN_FIRST,
G_STRUCT_OFFSET (NMManagerClass, device_added),
NULL, NULL,
g_cclosure_marshal_VOID__OBJECT,
G_TYPE_NONE, 1,
G_TYPE_OBJECT);
signals[DEVICE_REMOVED] =
g_signal_new ("device-removed",
G_OBJECT_CLASS_TYPE (object_class),
G_SIGNAL_RUN_FIRST,
G_STRUCT_OFFSET (NMManagerClass, device_removed),
NULL, NULL,
g_cclosure_marshal_VOID__OBJECT,
G_TYPE_NONE, 1,
G_TYPE_OBJECT);