Commit 6fcc1dee authored by Dan Winship's avatar Dan Winship

core: add an NMExportedObject base class

Add NMExportedObject, make it the base class of all D-Bus-exported
types, and move the nm-properties-changed-signal logic into it. (Also,
make NMSettings use the same properties-changed code as everything
else, which it was not previously doing, presumably for historical
reasons).

(This is mostly just shuffling code around at this point, but
NMExportedObject will be more important in the gdbus port, since
gdbus-codegen doesn't do a very good job of supporting objects that
export multiple interfaces [as each NMDevice subclass does, for
example], so we will need more glue/helper code in NMExportedObject
then.)
parent f3d10b3e
......@@ -324,6 +324,8 @@ nm_sources = \
nm-dispatcher.h \
nm-enum-types.c \
nm-enum-types.h \
nm-exported-object.c \
nm-exported-object.h \
nm-firewall-manager.c \
nm-firewall-manager.h \
nm-ip4-config.c \
......@@ -344,8 +346,6 @@ nm_sources = \
nm-multi-index.h \
nm-policy.c \
nm-policy.h \
nm-properties-changed-signal.c \
nm-properties-changed-signal.h \
nm-rfkill-manager.c \
nm-rfkill-manager.h \
nm-session-monitor.h \
......@@ -505,6 +505,8 @@ libnm_iface_helper_la_SOURCES = \
nm-route-manager.c \
nm-route-manager.h \
\
nm-exported-object.c \
nm-exported-object.h \
nm-ip4-config.c \
nm-ip4-config.h \
nm-ip6-config.c \
......
......@@ -39,7 +39,6 @@
#include "NetworkManagerUtils.h"
#include "nm-logging.h"
#include "nm-enum-types.h"
#include "nm-dbus-manager.h"
#include "nm-platform.h"
#include "ppp-manager/nm-ppp-manager.h"
......@@ -615,7 +614,6 @@ nm_device_adsl_class_init (NMDeviceAdslClass *klass)
parent_class->act_stage3_ip4_config_start = act_stage3_ip4_config_start;
parent_class->deactivate = deactivate;
nm_dbus_manager_register_exported_type (nm_dbus_manager_get (),
G_TYPE_FROM_CLASS (klass),
nm_exported_object_class_add_interface (NM_EXPORTED_OBJECT_CLASS (klass),
&dbus_glib_nm_device_adsl_object_info);
}
......@@ -1196,7 +1196,6 @@ nm_device_bt_class_init (NMDeviceBtClass *klass)
G_TYPE_NONE, 2,
G_TYPE_UINT, G_TYPE_UINT);
nm_dbus_manager_register_exported_type (nm_dbus_manager_get (),
G_TYPE_FROM_CLASS (klass),
nm_exported_object_class_add_interface (NM_EXPORTED_OBJECT_CLASS (klass),
&dbus_glib_nm_device_bt_object_info);
}
......@@ -33,7 +33,6 @@
#include "nm-device-private.h"
#include "nm-platform.h"
#include "nm-dbus-glib-types.h"
#include "nm-dbus-manager.h"
#include "nm-enum-types.h"
#include "nm-device-factory.h"
#include "nm-core-internal.h"
......@@ -542,8 +541,7 @@ nm_device_bond_class_init (NMDeviceBondClass *klass)
G_PARAM_READABLE |
G_PARAM_STATIC_STRINGS));
nm_dbus_manager_register_exported_type (nm_dbus_manager_get (),
G_TYPE_FROM_CLASS (klass),
nm_exported_object_class_add_interface (NM_EXPORTED_OBJECT_CLASS (klass),
&dbus_glib_nm_device_bond_object_info);
}
......
......@@ -31,7 +31,6 @@
#include "NetworkManagerUtils.h"
#include "nm-device-private.h"
#include "nm-dbus-glib-types.h"
#include "nm-dbus-manager.h"
#include "nm-enum-types.h"
#include "nm-platform.h"
#include "nm-device-factory.h"
......@@ -466,8 +465,7 @@ nm_device_bridge_class_init (NMDeviceBridgeClass *klass)
G_PARAM_READABLE |
G_PARAM_STATIC_STRINGS));
nm_dbus_manager_register_exported_type (nm_dbus_manager_get (),
G_TYPE_FROM_CLASS (klass),
nm_exported_object_class_add_interface (NM_EXPORTED_OBJECT_CLASS (klass),
&dbus_glib_nm_device_bridge_object_info);
}
......
......@@ -41,7 +41,6 @@
#include "ppp-manager/nm-ppp-manager.h"
#include "nm-logging.h"
#include "nm-enum-types.h"
#include "nm-dbus-manager.h"
#include "nm-platform.h"
#include "nm-platform-utils.h"
#include "nm-dcb.h"
......@@ -1706,8 +1705,7 @@ nm_device_ethernet_class_init (NMDeviceEthernetClass *klass)
G_PARAM_READABLE |
G_PARAM_STATIC_STRINGS));
nm_dbus_manager_register_exported_type (nm_dbus_manager_get (),
G_TYPE_FROM_CLASS (klass),
nm_exported_object_class_add_interface (NM_EXPORTED_OBJECT_CLASS (klass),
&dbus_glib_nm_device_ethernet_object_info);
}
......
......@@ -24,7 +24,6 @@
#include "nm-device-private.h"
#include "nm-enum-types.h"
#include "nm-platform.h"
#include "nm-dbus-manager.h"
#include "nm-core-internal.h"
#include "nm-device-generic-glue.h"
......@@ -203,7 +202,6 @@ nm_device_generic_class_init (NMDeviceGenericClass *klass)
G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY |
G_PARAM_STATIC_STRINGS));
nm_dbus_manager_register_exported_type (nm_dbus_manager_get (),
G_TYPE_FROM_CLASS (klass),
nm_exported_object_class_add_interface (NM_EXPORTED_OBJECT_CLASS (klass),
&dbus_glib_nm_device_generic_object_info);
}
......@@ -25,7 +25,6 @@
#include "nm-device-gre.h"
#include "nm-device-private.h"
#include "nm-dbus-manager.h"
#include "nm-logging.h"
#include "nm-manager.h"
#include "nm-platform.h"
......@@ -256,8 +255,7 @@ nm_device_gre_class_init (NMDeviceGreClass *klass)
G_PARAM_READABLE |
G_PARAM_STATIC_STRINGS));
nm_dbus_manager_register_exported_type (nm_dbus_manager_get (),
G_TYPE_FROM_CLASS (klass),
nm_exported_object_class_add_interface (NM_EXPORTED_OBJECT_CLASS (klass),
&dbus_glib_nm_device_gre_object_info);
}
......
......@@ -30,7 +30,6 @@
#include "NetworkManagerUtils.h"
#include "nm-device-private.h"
#include "nm-enum-types.h"
#include "nm-dbus-manager.h"
#include "nm-activation-request.h"
#include "nm-ip4-config.h"
#include "nm-platform.h"
......@@ -295,8 +294,7 @@ nm_device_infiniband_class_init (NMDeviceInfinibandClass *klass)
G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY |
G_PARAM_STATIC_STRINGS));
nm_dbus_manager_register_exported_type (nm_dbus_manager_get (),
G_TYPE_FROM_CLASS (klass),
nm_exported_object_class_add_interface (NM_EXPORTED_OBJECT_CLASS (klass),
&dbus_glib_nm_device_infiniband_object_info);
}
......
......@@ -24,7 +24,6 @@
#include "nm-device-macvlan.h"
#include "nm-device-private.h"
#include "nm-dbus-manager.h"
#include "nm-logging.h"
#include "nm-manager.h"
#include "nm-platform.h"
......@@ -164,8 +163,7 @@ nm_device_macvlan_class_init (NMDeviceMacvlanClass *klass)
G_PARAM_READABLE |
G_PARAM_STATIC_STRINGS));
nm_dbus_manager_register_exported_type (nm_dbus_manager_get (),
G_TYPE_FROM_CLASS (klass),
nm_exported_object_class_add_interface (NM_EXPORTED_OBJECT_CLASS (klass),
&dbus_glib_nm_device_macvlan_object_info);
}
......
......@@ -25,7 +25,6 @@
#include "nm-device-tun.h"
#include "nm-device-private.h"
#include "nm-dbus-manager.h"
#include "nm-logging.h"
#include "nm-platform.h"
#include "nm-device-factory.h"
......@@ -258,8 +257,7 @@ nm_device_tun_class_init (NMDeviceTunClass *klass)
FALSE,
G_PARAM_READABLE | G_PARAM_STATIC_STRINGS));
nm_dbus_manager_register_exported_type (nm_dbus_manager_get (),
G_TYPE_FROM_CLASS (klass),
nm_exported_object_class_add_interface (NM_EXPORTED_OBJECT_CLASS (klass),
&dbus_glib_nm_device_tun_object_info);
}
......
......@@ -32,7 +32,6 @@
#include "nm-logging.h"
#include "nm-manager.h"
#include "nm-platform.h"
#include "nm-dbus-manager.h"
#include "nm-device-factory.h"
#include "nm-device-veth-glue.h"
......@@ -166,8 +165,7 @@ nm_device_veth_class_init (NMDeviceVethClass *klass)
G_PARAM_READABLE |
G_PARAM_STATIC_STRINGS));
nm_dbus_manager_register_exported_type (nm_dbus_manager_get (),
G_TYPE_FROM_CLASS (klass),
nm_exported_object_class_add_interface (NM_EXPORTED_OBJECT_CLASS (klass),
&dbus_glib_nm_device_veth_object_info);
}
......
......@@ -32,7 +32,6 @@
#include "NetworkManagerUtils.h"
#include "nm-device-private.h"
#include "nm-enum-types.h"
#include "nm-dbus-manager.h"
#include "nm-connection-provider.h"
#include "nm-activation-request.h"
#include "nm-ip4-config.h"
......@@ -606,8 +605,7 @@ nm_device_vlan_class_init (NMDeviceVlanClass *klass)
G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY |
G_PARAM_STATIC_STRINGS));
nm_dbus_manager_register_exported_type (nm_dbus_manager_get (),
G_TYPE_FROM_CLASS (klass),
nm_exported_object_class_add_interface (NM_EXPORTED_OBJECT_CLASS (klass),
&dbus_glib_nm_device_vlan_object_info);
}
......
......@@ -24,7 +24,6 @@
#include "nm-device-vxlan.h"
#include "nm-device-private.h"
#include "nm-dbus-manager.h"
#include "nm-logging.h"
#include "nm-manager.h"
#include "nm-platform.h"
......@@ -342,8 +341,7 @@ nm_device_vxlan_class_init (NMDeviceVxlanClass *klass)
G_PARAM_READABLE |
G_PARAM_STATIC_STRINGS));
nm_dbus_manager_register_exported_type (nm_dbus_manager_get (),
G_TYPE_FROM_CLASS (klass),
nm_exported_object_class_add_interface (NM_EXPORTED_OBJECT_CLASS (klass),
&dbus_glib_nm_device_vxlan_object_info);
}
......
......@@ -55,7 +55,6 @@
#include "nm-dhcp6-config.h"
#include "nm-rfkill-manager.h"
#include "nm-firewall-manager.h"
#include "nm-properties-changed-signal.h"
#include "nm-enum-types.h"
#include "nm-settings-connection.h"
#include "nm-connection-provider.h"
......@@ -79,7 +78,7 @@ static void ip_check_ping_watch_cb (GPid pid, gint status, gpointer user_data);
#include "nm-device-glue.h"
G_DEFINE_ABSTRACT_TYPE (NMDevice, nm_device, G_TYPE_OBJECT)
G_DEFINE_ABSTRACT_TYPE (NMDevice, nm_device, NM_TYPE_EXPORTED_OBJECT)
#define NM_DEVICE_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_DEVICE, NMDevicePrivate))
......@@ -526,6 +525,7 @@ nm_device_dbus_export (NMDevice *self)
priv->path = g_strdup_printf ("/org/freedesktop/NetworkManager/Devices/%d", devcount++);
_LOGD (LOGD_DEVICE, "exported as %s", priv->path);
nm_dbus_manager_register_object (nm_dbus_manager_get (), priv->path, self);
}
......@@ -9766,10 +9766,8 @@ nm_device_class_init (NMDeviceClass *klass)
0, NULL, NULL, NULL,
G_TYPE_NONE, 0);
nm_dbus_manager_register_exported_type (nm_dbus_manager_get (),
G_TYPE_FROM_CLASS (klass),
nm_exported_object_class_add_interface (NM_EXPORTED_OBJECT_CLASS (klass),
&dbus_glib_nm_device_object_info);
dbus_g_error_domain_register (NM_DEVICE_ERROR, NULL, NM_TYPE_DEVICE_ERROR);
}
......@@ -25,7 +25,7 @@
#include <dbus/dbus-glib.h>
#include <netinet/in.h>
#include "nm-glib.h"
#include "nm-exported-object.h"
#include "nm-dbus-interface.h"
#include "nm-types.h"
#include "nm-connection.h"
......@@ -104,7 +104,7 @@ typedef enum { /*< skip >*/
} NMDeviceCheckConAvailableFlags;
struct _NMDevice {
GObject parent;
NMExportedObject parent;
};
/* The flags have an relaxing meaning, that means, specifying more flags, can make
......@@ -118,7 +118,7 @@ typedef enum { /*< skip >*/
} NMDeviceCheckDevAvailableFlags;
typedef struct {
GObjectClass parent;
NMExportedObjectClass parent;
const char *connection_type;
......
......@@ -35,7 +35,6 @@
#include "nm-device-private.h"
#include "nm-platform.h"
#include "nm-dbus-glib-types.h"
#include "nm-dbus-manager.h"
#include "nm-enum-types.h"
#include "nm-team-enum-types.h"
#include "nm-core-internal.h"
......@@ -824,7 +823,7 @@ nm_device_team_class_init (NMDeviceTeamClass *klass)
G_PARAM_READABLE |
G_PARAM_STATIC_STRINGS));
nm_dbus_manager_register_exported_type (nm_dbus_manager_get (),
G_TYPE_FROM_CLASS (klass),
nm_exported_object_class_add_interface (NM_EXPORTED_OBJECT_CLASS (klass),
&dbus_glib_nm_device_team_object_info);
}
......@@ -50,7 +50,6 @@
#include "nm-setting-olpc-mesh.h"
#include "nm-manager.h"
#include "nm-enum-types.h"
#include "nm-dbus-manager.h"
#include "nm-platform.h"
#include "nm-wifi-enum-types.h"
......@@ -551,8 +550,7 @@ nm_device_olpc_mesh_class_init (NMDeviceOlpcMeshClass *klass)
G_PARAM_READABLE |
G_PARAM_STATIC_STRINGS));
nm_dbus_manager_register_exported_type (nm_dbus_manager_get (),
G_TYPE_FROM_CLASS (klass),
nm_exported_object_class_add_interface (NM_EXPORTED_OBJECT_CLASS (klass),
&dbus_glib_nm_device_olpc_mesh_object_info);
}
......@@ -29,7 +29,6 @@
#include <errno.h>
#include "nm-glib.h"
#include "nm-dbus-manager.h"
#include "nm-device.h"
#include "nm-device-wifi.h"
#include "nm-device-private.h"
......@@ -3062,8 +3061,7 @@ nm_device_wifi_class_init (NMDeviceWifiClass *klass)
scanning_allowed_accumulator, NULL, NULL,
G_TYPE_BOOLEAN, 0);
nm_dbus_manager_register_exported_type (nm_dbus_manager_get (),
G_TYPE_FROM_CLASS (klass),
nm_exported_object_class_add_interface (NM_EXPORTED_OBJECT_CLASS (klass),
&dbus_glib_nm_device_wifi_object_info);
}
......
......@@ -67,7 +67,7 @@ typedef struct
#define NM_AP_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_AP, NMAccessPointPrivate))
G_DEFINE_TYPE (NMAccessPoint, nm_ap, G_TYPE_OBJECT)
G_DEFINE_TYPE (NMAccessPoint, nm_ap, NM_TYPE_EXPORTED_OBJECT)
enum {
PROP_0,
......@@ -1074,8 +1074,7 @@ nm_ap_class_init (NMAccessPointClass *ap_class)
-1, G_MAXINT, -1,
G_PARAM_READABLE | G_PARAM_STATIC_STRINGS));
nm_dbus_manager_register_exported_type (nm_dbus_manager_get (),
G_TYPE_FROM_CLASS (ap_class),
nm_exported_object_class_add_interface (NM_EXPORTED_OBJECT_CLASS (ap_class),
&dbus_glib_nm_access_point_object_info);
}
......@@ -22,7 +22,7 @@
#ifndef __NETWORKMANAGER_ACCESS_POINT_H__
#define __NETWORKMANAGER_ACCESS_POINT_H__
#include "nm-glib.h"
#include "nm-exported-object.h"
#include "nm-dbus-interface.h"
#include "nm-connection.h"
......@@ -45,11 +45,11 @@
#define NM_AP_LAST_SEEN "last-seen"
typedef struct {
GObject parent;
NMExportedObject parent;
} NMAccessPoint;
typedef struct {
GObjectClass parent;
NMExportedObjectClass parent;
} NMAccessPointClass;
......
......@@ -28,7 +28,6 @@
#include "nm-device-private.h"
#include "nm-rfkill-manager.h"
#include "nm-logging.h"
#include "nm-dbus-manager.h"
#include "nm-settings-connection.h"
#include "nm-modem-broadband.h"
#include "NetworkManagerUtils.h"
......@@ -795,7 +794,6 @@ nm_device_modem_class_init (NMDeviceModemClass *mclass)
G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY |
G_PARAM_STATIC_STRINGS));
nm_dbus_manager_register_exported_type (nm_dbus_manager_get (),
G_TYPE_FROM_CLASS (mclass),
nm_exported_object_class_add_interface (NM_EXPORTED_OBJECT_CLASS (mclass),
&dbus_glib_nm_device_modem_object_info);
}
......@@ -26,7 +26,6 @@
#include "nm-platform.h"
#include "nm-dbus-manager.h"
#include "nm-setting-connection.h"
#include "nm-properties-changed-signal.h"
#include "nm-logging.h"
#include "NetworkManagerUtils.h"
#include "nm-device-private.h"
......
......@@ -9,6 +9,7 @@ AM_CPPFLAGS = \
-DNETWORKMANAGER_COMPILATION \
-DNM_VERSION_MAX_ALLOWED=NM_VERSION_NEXT_STABLE \
$(GLIB_CFLAGS) \
$(DBUS_CFLAGS) \
-DTESTDIR="\"$(abs_srcdir)\""
noinst_PROGRAMS = \
......
......@@ -37,7 +37,7 @@
#include "nm-active-connection-glue.h"
/* Base class for anything implementing the Connection.Active D-Bus interface */
G_DEFINE_ABSTRACT_TYPE (NMActiveConnection, nm_active_connection, G_TYPE_OBJECT)
G_DEFINE_ABSTRACT_TYPE (NMActiveConnection, nm_active_connection, NM_TYPE_EXPORTED_OBJECT)
#define NM_ACTIVE_CONNECTION_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), \
NM_TYPE_ACTIVE_CONNECTION, \
......@@ -1066,8 +1066,7 @@ nm_active_connection_class_init (NMActiveConnectionClass *ac_class)
NULL, NULL, NULL,
G_TYPE_NONE, 1, G_TYPE_UINT);
nm_dbus_manager_register_exported_type (nm_dbus_manager_get (),
G_TYPE_FROM_CLASS (ac_class),
nm_exported_object_class_add_interface (NM_EXPORTED_OBJECT_CLASS (ac_class),
&dbus_glib_nm_active_connection_object_info);
}
......@@ -21,8 +21,7 @@
#ifndef __NETWORKMANAGER_ACTIVE_CONNECTION_H__
#define __NETWORKMANAGER_ACTIVE_CONNECTION_H__
#include "nm-glib.h"
#include "nm-types.h"
#include "nm-exported-object.h"
#include "nm-connection.h"
#define NM_TYPE_ACTIVE_CONNECTION (nm_active_connection_get_type ())
......@@ -61,11 +60,11 @@
#define NM_ACTIVE_CONNECTION_DEVICE_METERED_CHANGED "device-metered-changed"
struct _NMActiveConnection {
GObject parent;
NMExportedObject parent;
};
typedef struct {
GObjectClass parent;
NMExportedObjectClass parent;
/* re-emits device state changes as a convenience for subclasses for
* device states >= DISCONNECTED.
......
......@@ -29,7 +29,6 @@
#include "nm-glib.h"
#include "nm-dbus-interface.h"
#include "nm-dbus-manager.h"
#include "nm-properties-changed-signal.h"
#include <dbus/dbus.h>
#include <dbus/dbus-glib.h>
......@@ -854,33 +853,6 @@ object_destroyed (NMDBusManager *self, gpointer object)
g_hash_table_remove (NM_DBUS_MANAGER_GET_PRIVATE (self)->exported, object);
}
void
nm_dbus_manager_register_exported_type (NMDBusManager *self,
GType object_type,
const DBusGObjectInfo *info)
{
const char *properties_info, *dbus_name, *gobject_name, *tmp_access;
dbus_g_object_type_install_info (object_type, info);
if (!info->exported_properties)
return;
properties_info = info->exported_properties;
while (*properties_info) {
/* The format is: "interface\0DBusPropertyName\0gobject_property_name\0access\0" */
dbus_name = strchr (properties_info, '\0') + 1;
gobject_name = strchr (dbus_name, '\0') + 1;
tmp_access = strchr (gobject_name, '\0') + 1;
properties_info = strchr (tmp_access, '\0') + 1;
/* Note that nm-properties-changed-signal takes advantage of the
* fact that @dbus_name and @gobject_name are static data that won't
* ever be freed.
*/
nm_properties_changed_signal_add_property (object_type, dbus_name, gobject_name);
}
}
void
nm_dbus_manager_register_object (NMDBusManager *self,
const char *path,
......
......@@ -104,10 +104,6 @@ gboolean nm_dbus_manager_get_caller_info_from_message (NMDBusManager *self,
gulong *out_uid,
gulong *out_pid);
void nm_dbus_manager_register_exported_type (NMDBusManager *self,
GType object_type,
const DBusGObjectInfo *info);
void nm_dbus_manager_register_object (NMDBusManager *self,
const char *path,
gpointer object);
......
......@@ -30,7 +30,7 @@
#include "nm-dbus-glib-types.h"
#include "nm-utils.h"
G_DEFINE_TYPE (NMDhcp4Config, nm_dhcp4_config, G_TYPE_OBJECT)
G_DEFINE_TYPE (NMDhcp4Config, nm_dhcp4_config, NM_TYPE_EXPORTED_OBJECT)
#define NM_DHCP4_CONFIG_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_DHCP4_CONFIG, NMDhcp4ConfigPrivate))
......@@ -185,7 +185,6 @@ nm_dhcp4_config_class_init (NMDhcp4ConfigClass *config_class)
G_PARAM_READABLE |
G_PARAM_STATIC_STRINGS));
nm_dbus_manager_register_exported_type (nm_dbus_manager_get (),
G_TYPE_FROM_CLASS (config_class),
nm_exported_object_class_add_interface (NM_EXPORTED_OBJECT_CLASS (config_class),
&dbus_glib_nm_dhcp4_config_object_info);
}
......@@ -21,9 +21,7 @@
#ifndef __NETWORKMANAGER_DHCP4_CONFIG_H__
#define __NETWORKMANAGER_DHCP4_CONFIG_H__
#include "nm-glib.h"
#include "nm-types.h"
#include "nm-exported-object.h"
#define NM_TYPE_DHCP4_CONFIG (nm_dhcp4_config_get_type ())
#define NM_DHCP4_CONFIG(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_DHCP4_CONFIG, NMDhcp4Config))
......@@ -33,11 +31,11 @@
#define NM_DHCP4_CONFIG_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NM_TYPE_DHCP4_CONFIG, NMDhcp4ConfigClass))
struct _NMDhcp4Config {
GObject parent;
NMExportedObject parent;
};
typedef struct {
GObjectClass parent;
NMExportedObjectClass parent;
} NMDhcp4ConfigClass;
......
......@@ -30,7 +30,7 @@
#include "nm-dbus-glib-types.h"
#include "nm-utils.h"
G_DEFINE_TYPE (NMDhcp6Config, nm_dhcp6_config, G_TYPE_OBJECT)
G_DEFINE_TYPE (NMDhcp6Config, nm_dhcp6_config, NM_TYPE_EXPORTED_OBJECT)
#define NM_DHCP6_CONFIG_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_DHCP6_CONFIG, NMDhcp6ConfigPrivate))
......@@ -185,7 +185,6 @@ nm_dhcp6_config_class_init (NMDhcp6ConfigClass *config_class)
G_PARAM_READABLE |
G_PARAM_STATIC_STRINGS));
nm_dbus_manager_register_exported_type (nm_dbus_manager_get (),
G_TYPE_FROM_CLASS (config_class),
nm_exported_object_class_add_interface (NM_EXPORTED_OBJECT_CLASS (config_class),
&dbus_glib_nm_dhcp6_config_object_info);
}
......@@ -21,9 +21,7 @@
#ifndef __NETWORKMANAGER_DHCP6_CONFIG_H__
#define __NETWORKMANAGER_DHCP6_CONFIG_H__
#include "nm-glib.h"
#include "nm-types.h"
#include "nm-exported-object.h"
#define NM_TYPE_DHCP6_CONFIG (nm_dhcp6_config_get_type ())
#define NM_DHCP6_CONFIG(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_DHCP6_CONFIG, NMDhcp6Config))
......@@ -33,11 +31,11 @@
#define NM_DHCP6_CONFIG_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NM_TYPE_DHCP6_CONFIG, NMDhcp6ConfigClass))
struct _NMDhcp6Config {
GObject parent;
NMExportedObject parent;
};
typedef struct {
GObjectClass parent;
NMExportedObjectClass parent;
} NMDhcp6ConfigClass;
......
......@@ -15,17 +15,39 @@
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Copyright (C) 2007 - 2008 Novell, Inc.
* Copyright (C) 2008 Red Hat, Inc.
* Copyright 2014 Red Hat, Inc.
*/
#ifndef _NM_PROPERTIES_CHANGED_SIGNAL_H_
#define _NM_PROPERTIES_CHANGED_SIGNAL_H_
#ifndef NM_EXPORTED_OBJECT_H
#define NM_EXPORTED_OBJECT_H
#include <dbus/dbus-glib.h>
#include "nm-glib.h"
#include "nm-types.h"
G_BEGIN_DECLS
#define NM_TYPE_EXPORTED_OBJECT (nm_exported_object_get_type ())
#define NM_EXPORTED_OBJECT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_EXPORTED_OBJECT, NMExportedObject))
#define NM_EXPORTED_OBJECT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NM_TYPE_EXPORTED_OBJECT, NMExportedObjectClass))
#define NM_IS_EXPORTED_OBJECT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NM_TYPE_EXPORTED_OBJECT))
#define NM_IS_EXPORTED_OBJECT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), NM_TYPE_EXPORTED_OBJECT))
#define NM_EXPORTED_OBJECT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NM_TYPE_EXPORTED_OBJECT, NMExportedObjectClass))
typedef struct {
GObject parent;
} NMExportedObject;
typedef struct {
GObjectClass parent;
} NMExportedObjectClass;
GType nm_exported_object_get_type (void);
void nm_exported_object_class_add_interface (NMExportedObjectClass *object_class,
const DBusGObjectInfo *info);
void nm_properties_changed_signal_add_property (GType type,
const char *dbus_property_name,
const char *gobject_property_name);
G_END_DECLS
#endif /* _NM_PROPERTIES_CHANGED_SIGNAL_H_ */
#endif /* NM_EXPORTED_OBJECT_H */
......@@ -37,7 +37,7 @@
#include "nm-core-internal.h"
#include "gsystem-local-alloc.h"
G_DEFINE_TYPE (NMIP4Config, nm_ip4_config, G_TYPE_OBJECT)
G_DEFINE_TYPE (NMIP4Config, nm_ip4_config, NM_TYPE_EXPORTED_OBJECT)
#define NM_IP4_CONFIG_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_IP4_CONFIG, NMIP4ConfigPrivate))
......@@ -2410,7 +2410,6 @@ nm_ip4_config_class_init (NMIP4ConfigClass *config_class)
g_object_class_install_properties (object_class, LAST_PROP, obj_properties);
nm_dbus_manager_register_exported_type (nm_dbus_manager_get (),
G_TYPE_FROM_CLASS (config_class),
nm_exported_object_class_add_interface (NM_EXPORTED_OBJECT_CLASS (config_class),
&dbus_glib_nm_ip4_config_object_info);
}
......@@ -21,9 +21,7 @@
#ifndef __NETWORKMANAGER_IP4_CONFIG_H__
#define __NETWORKMANAGER_IP4_CONFIG_H__
#include "nm-glib.h"
#include "nm-types.h"
#include "nm-exported-object.h"
#include "nm-setting-ip4-config.h"
#define NM_TYPE_IP4_CONFIG (nm_ip4_config_get_type ())
......@@ -34,11 +32,11 @@
#define NM_IP4_CONFIG_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NM_TYPE_IP4_CONFIG, NMIP4ConfigClass))
struct _NMIP4Config {
GObject parent;
NMExportedObject parent;
};
typedef struct {
GObjectClass parent;
NMExportedObjectClass parent;
} NMIP4ConfigClass;
/* internal */
......
......@@ -36,7 +36,7 @@
#include "nm-core-internal.h"
#include "NetworkManagerUtils.h"
G_DEFINE_TYPE (NMIP6Config, nm_ip6_config, G_TYPE_OBJECT)
G_DEFINE_TYPE (NMIP6Config, nm_ip6_config, NM_TYPE_EXPORTED_OBJECT)
#define NM_IP6_CONFIG_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_IP6_CONFIG, NMIP6ConfigPrivate))
......@@ -2215,7 +2215,6 @@ nm_ip6_config_class_init (NMIP6ConfigClass *config_class)
g_object_class_install_properties (object_class, LAST_PROP, obj_properties);
nm_dbus_manager_register_exported_type (nm_dbus_manager_get (),
G_TYPE_FROM_CLASS (config_class),
nm_exported_object_class_add_interface (NM_EXPORTED_OBJECT_CLASS (config_class),
&dbus_glib_nm_ip6_config_object_info);
}
......@@ -23,8 +23,7 @@
#include <netinet/in.h>
#include "nm-glib.h"
#include "nm-types.h"